diff --git a/CMakeLists.txt b/CMakeLists.txt index 75375e2..ab6768f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,7 @@ set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" ##### directories +add_subdirectory( icons ) add_subdirectory( src ) diff --git a/config.h.cmake b/config.h.cmake index 33d4bd8..4154741 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -1,5 +1,8 @@ #define VERSION "@VERSION@" +// application icons location +#define APP_ICONS_PATH "@SHARE_INSTALL_PREFIX@/universal-indent-gui-tqt/icons/" + // Defined if you have fvisibility and fvisibility-inlines-hidden support. #cmakedefine __KDE_HAVE_GCC_VISIBILITY 1 diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt new file mode 100644 index 0000000..7d86613 --- /dev/null +++ b/icons/CMakeLists.txt @@ -0,0 +1,22 @@ +install( + FILES + document-open.png + document-properties.png + document-save.png + document-save-as.png + edit-clear.png + exporthtml.png + exportpdf.png + info.png + live-preview.png + preferences-system.png + syntax-highlight.png + system-log-out.png + tooltip.png + universalIndentGUI.ico + universalIndentGUI.svg + universalIndentGUI_32x32.xpm + universalIndentGUI_64x64.png + universalIndentGUI_512x512.png + DESTINATION ${SHARE_INSTALL_PREFIX}/universal-indent-gui-tqt/icons +) diff --git a/resources/Icon1.png b/icons/__TODO/Icon1.png similarity index 100% rename from resources/Icon1.png rename to icons/__TODO/Icon1.png diff --git a/resources/Icons.qrc b/icons/__TODO/Icons.qrc similarity index 100% rename from resources/Icons.qrc rename to icons/__TODO/Icons.qrc diff --git a/resources/accessories-text-editor.png b/icons/__TODO/accessories-text-editor.png similarity index 100% rename from resources/accessories-text-editor.png rename to icons/__TODO/accessories-text-editor.png diff --git a/resources/applications-system.png b/icons/__TODO/applications-system.png similarity index 100% rename from resources/applications-system.png rename to icons/__TODO/applications-system.png diff --git a/resources/banner.png b/icons/__TODO/banner.png similarity index 100% rename from resources/banner.png rename to icons/__TODO/banner.png diff --git a/resources/edit-select-all.png b/icons/__TODO/edit-select-all.png similarity index 100% rename from resources/edit-select-all.png rename to icons/__TODO/edit-select-all.png diff --git a/resources/format-justify-left.png b/icons/__TODO/format-justify-left.png similarity index 100% rename from resources/format-justify-left.png rename to icons/__TODO/format-justify-left.png diff --git a/resources/help.png b/icons/__TODO/help.png similarity index 100% rename from resources/help.png rename to icons/__TODO/help.png diff --git a/resources/icon2.ico b/icons/__TODO/icon2.ico similarity index 100% rename from resources/icon2.ico rename to icons/__TODO/icon2.ico diff --git a/resources/icon2.png b/icons/__TODO/icon2.png similarity index 100% rename from resources/icon2.png rename to icons/__TODO/icon2.png diff --git a/resources/icon3.png b/icons/__TODO/icon3.png similarity index 100% rename from resources/icon3.png rename to icons/__TODO/icon3.png diff --git a/resources/language-de.png b/icons/__TODO/language-de.png similarity index 100% rename from resources/language-de.png rename to icons/__TODO/language-de.png diff --git a/resources/language-en.png b/icons/__TODO/language-en.png similarity index 100% rename from resources/language-en.png rename to icons/__TODO/language-en.png diff --git a/resources/language-fr.png b/icons/__TODO/language-fr.png similarity index 100% rename from resources/language-fr.png rename to icons/__TODO/language-fr.png diff --git a/resources/language-ja.png b/icons/__TODO/language-ja.png similarity index 100% rename from resources/language-ja.png rename to icons/__TODO/language-ja.png diff --git a/resources/language-ru.png b/icons/__TODO/language-ru.png similarity index 100% rename from resources/language-ru.png rename to icons/__TODO/language-ru.png diff --git a/resources/language-uk.png b/icons/__TODO/language-uk.png similarity index 100% rename from resources/language-uk.png rename to icons/__TODO/language-uk.png diff --git a/resources/language-zh_CN.png b/icons/__TODO/language-zh_CN.png similarity index 100% rename from resources/language-zh_CN.png rename to icons/__TODO/language-zh_CN.png diff --git a/resources/language-zh_TW.png b/icons/__TODO/language-zh_TW.png similarity index 100% rename from resources/language-zh_TW.png rename to icons/__TODO/language-zh_TW.png diff --git a/resources/load_indent_cfg.png b/icons/__TODO/load_indent_cfg.png similarity index 100% rename from resources/load_indent_cfg.png rename to icons/__TODO/load_indent_cfg.png diff --git a/resources/qt_logo.png b/icons/__TODO/qt_logo.png similarity index 100% rename from resources/qt_logo.png rename to icons/__TODO/qt_logo.png diff --git a/resources/save_indent_cfg.png b/icons/__TODO/save_indent_cfg.png similarity index 100% rename from resources/save_indent_cfg.png rename to icons/__TODO/save_indent_cfg.png diff --git a/resources/shell.png b/icons/__TODO/shell.png similarity index 100% rename from resources/shell.png rename to icons/__TODO/shell.png diff --git a/resources/system-software-update.png b/icons/__TODO/system-software-update.png similarity index 100% rename from resources/system-software-update.png rename to icons/__TODO/system-software-update.png diff --git a/resources/view-refresh.png b/icons/__TODO/view-refresh.png similarity index 100% rename from resources/view-refresh.png rename to icons/__TODO/view-refresh.png diff --git a/resources/document-open.png b/icons/document-open.png similarity index 100% rename from resources/document-open.png rename to icons/document-open.png diff --git a/resources/document-properties.png b/icons/document-properties.png similarity index 100% rename from resources/document-properties.png rename to icons/document-properties.png diff --git a/resources/document-save-as.png b/icons/document-save-as.png similarity index 100% rename from resources/document-save-as.png rename to icons/document-save-as.png diff --git a/resources/document-save.png b/icons/document-save.png similarity index 100% rename from resources/document-save.png rename to icons/document-save.png diff --git a/resources/edit-clear.png b/icons/edit-clear.png similarity index 100% rename from resources/edit-clear.png rename to icons/edit-clear.png diff --git a/resources/exporthtml.png b/icons/exporthtml.png similarity index 100% rename from resources/exporthtml.png rename to icons/exporthtml.png diff --git a/resources/exportpdf.png b/icons/exportpdf.png similarity index 100% rename from resources/exportpdf.png rename to icons/exportpdf.png diff --git a/resources/info.png b/icons/info.png similarity index 100% rename from resources/info.png rename to icons/info.png diff --git a/resources/live-preview.png b/icons/live-preview.png similarity index 100% rename from resources/live-preview.png rename to icons/live-preview.png diff --git a/resources/preferences-system.png b/icons/preferences-system.png similarity index 100% rename from resources/preferences-system.png rename to icons/preferences-system.png diff --git a/resources/syntax-highlight.png b/icons/syntax-highlight.png similarity index 100% rename from resources/syntax-highlight.png rename to icons/syntax-highlight.png diff --git a/resources/system-log-out.png b/icons/system-log-out.png similarity index 100% rename from resources/system-log-out.png rename to icons/system-log-out.png diff --git a/resources/tooltip.png b/icons/tooltip.png similarity index 100% rename from resources/tooltip.png rename to icons/tooltip.png diff --git a/resources/universalIndentGUI.ico b/icons/universalIndentGUI.ico similarity index 100% rename from resources/universalIndentGUI.ico rename to icons/universalIndentGUI.ico diff --git a/resources/universalIndentGUI.svg b/icons/universalIndentGUI.svg similarity index 100% rename from resources/universalIndentGUI.svg rename to icons/universalIndentGUI.svg diff --git a/resources/universalIndentGUI_32x32.xpm b/icons/universalIndentGUI_32x32.xpm similarity index 100% rename from resources/universalIndentGUI_32x32.xpm rename to icons/universalIndentGUI_32x32.xpm diff --git a/resources/universalIndentGUI_512x512.png b/icons/universalIndentGUI_512x512.png similarity index 100% rename from resources/universalIndentGUI_512x512.png rename to icons/universalIndentGUI_512x512.png diff --git a/resources/universalIndentGUI_64x64.png b/icons/universalIndentGUI_64x64.png similarity index 100% rename from resources/universalIndentGUI_64x64.png rename to icons/universalIndentGUI_64x64.png diff --git a/resources/UniversalIndentGUI.icns b/resources/UniversalIndentGUI.icns deleted file mode 100755 index c7f0294..0000000 Binary files a/resources/UniversalIndentGUI.icns and /dev/null differ diff --git a/resources/programicon.rc b/resources/programicon.rc deleted file mode 100755 index 03b1e8e..0000000 --- a/resources/programicon.rc +++ /dev/null @@ -1,108 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2012 by Thomas Schweitzer * - * thomas-schweitzer(at)arcor.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License version 2.0 as * - * published by the Free Software Foundation. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program in the file LICENSE.GPL; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "..\src\UiGuiVersion.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "windows.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Deutsch (Deutschland) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) -#ifdef _WIN32 -LANGUAGE LANG_GERMAN, SUBLANG_GERMAN -#pragma code_page(1252) -#endif //_WIN32 - - -#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS - #define PROGRAM_TITLE "UniversalIndentGUI Notepad++ Plugin" - #define INTERNALNAME "UiGUI NPP Plugin" - #define ORIGINALFILENAME "UniversalIndentGUI_NPP.dll" -#else - #define PROGRAM_TITLE "UniversalIndentGUI" - #define INTERNALNAME "UiGUI" - #define ORIGINALFILENAME "UniversalIndentGUI.exe" -#endif - - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION RESOURCE_VERSION - PRODUCTVERSION RESOURCE_VERSION - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040704b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "Thomas Schweitzer\0" - VALUE "FileDescription", PROGRAM_TITLE "\0" - VALUE "FileVersion", RESOURCE_VERSION_STRING - VALUE "InternalName", INTERNALNAME "\0" - VALUE "LegalCopyright", "Copyright © Thomas Schweitzer 2012\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", ORIGINALFILENAME "\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", PROGRAM_TITLE "\0" - VALUE "ProductVersion", RESOURCE_VERSION_STRING - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x407, 1200 - END -END - -#endif // !_MAC - -#endif // #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ICON1 ICON DISCARDABLE "universalIndentGUI.ico" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 253a779..a911d9c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -26,9 +26,8 @@ link_directories( set( target universal-indent-gui-tqt ) set( ${target}_SRCS - main.cpp + MainWindowBase.ui MainWindow.cpp main.cpp UiGuiVersion.cpp - MainWindow.cpp ) tde_add_executable( ${target} AUTOMOC diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 1aa68a3..242797d 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -17,10 +17,10 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include "config.h" #include "MainWindow.h" -///-- #include "ui_MainWindow.h" -///-- -///-- #include "UiGuiVersion.h" +#include "UiGuiVersion.h" + ///-- #include "debugging/TSLogger.h" ///-- #include "SettingsPaths.h" ///-- @@ -33,25 +33,28 @@ ///-- #include "IndentHandler.h" ///-- #include "UpdateCheckDialog.h" ///-- -///-- #include -///-- #include -///-- #include -///-- #include +#include +#include +#include +///-- #include +///-- #include +///-- #include +///-- #include ///-- #include -///-- #include -///-- #include +///-- #include +///-- #include ///-- #include -///-- #include -///-- #include +///-- #include +///-- #include ///-- #include ///-- #include -///-- #include -///-- #include -///-- #include -///-- #include +///-- #include +///-- #include +///-- #include +///-- #include ///-- #include -///-- #include -///-- #include +///-- #include +///-- #include ///-- #include ///-- ///-- #include @@ -75,7 +78,7 @@ \brief Constructs the main window. */ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : - TQMainWindow(parent) + MainWindowBase(parent) ///- , _mainWindowForm(NULL), _qSciSourceCodeEditor(NULL), _settings(NULL), ///- _highlighter(NULL), _textEditVScrollBar(NULL), _aboutDialog(NULL), _aboutDialogGraphicsView( ///- NULL), _settingsDialog(NULL), _encodingActionGroup(NULL), _saveEncodedActionGroup(NULL), @@ -93,7 +96,7 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- initApplicationLanguage(); ///-- ///-- // Creates the main window and initializes it. -///-- initMainWindow(); + initMainWindow(); ///-- ///-- // Create toolbar and insert it into the main window. ///-- initToolBar(); @@ -116,12 +119,11 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- _aboutDialog = new AboutDialog(this, TQt::SplashScreen); ///-- _aboutDialogGraphicsView = new AboutDialogGraphicsView(_aboutDialog, this); ///-- connect(_toolBarWidget->pbAbout, SIGNAL(clicked()), this, SLOT(showAboutDialog())); -///-- connect(_mainWindowForm->actionAbout_UniversalIndentGUI, SIGNAL(triggered()), this, -///-- SLOT(showAboutDialog())); + connect(actionAboutUniversalIndentGUITQt, SIGNAL(activated()), this, SLOT(showAboutDialog())); ///-- ///-- // Generate settings dialog box ///-- _settingsDialog = new UiGuiSettingsDialog(this, _settings); -///-- connect(_mainWindowForm->actionShowSettings, SIGNAL(triggered()), _settingsDialog, +///-- connect(actionShowSettings, SIGNAL(activated()), _settingsDialog, ///-- SLOT(showDialog())); ///-- ///-- // If a file that should be opened on start has been handed over to the constructor exists, load @@ -153,12 +155,37 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- /*! ///-- \brief Initializes the main window by creating the main gui and make some _settings. ///-- */ -///-- void MainWindow::initMainWindow() -///-- { -///-- // Generate gui as it is build in the file "mainwindow.ui" -///-- _mainWindowForm = new Ui::MainWindowUi(); -///-- _mainWindowForm->setupUi(this); -///-- +void MainWindow::initMainWindow() +{ + // Setup icons + TQString ICONS_PATH(APP_ICONS_PATH); + // Application icon + setIcon(TQPixmap(ICONS_PATH + "universalIndentGUI_64x64.png")); + // Menu icons + // - File menu + actionOpenSourceFile->setIconSet(TQPixmap(ICONS_PATH + "document-open.png")); + actionMenuRecentlyOpenedFiles->setIconSet(TQPixmap(ICONS_PATH + "document-open.png")); + actionClearRecentlyOpenedList->setIconSet(TQPixmap(ICONS_PATH + "edit-clear.png")); + actionMenuEncoding->setIconSet(TQPixmap(ICONS_PATH + "document-open.png")); + actionSaveSourceFile->setIconSet(TQPixmap(ICONS_PATH + "document-save.png")); + actionSaveSourceFileAs->setIconSet(TQPixmap(ICONS_PATH + "document-save-as.png")); + actionMenuSaveEncoded->setIconSet(TQPixmap(ICONS_PATH + "document-save-as.png")); + actionMenuExport->setIconSet(TQPixmap(ICONS_PATH + "exporthtml.png")); + actionExportPDF->setIconSet(TQPixmap(ICONS_PATH + "exportpdf.png")); + actionExportHTML->setIconSet(TQPixmap(ICONS_PATH + "exporthtml.png")); + actionExit->setIconSet(TQPixmap(ICONS_PATH + "system-log-out.png")); + // - Setting menu + actionLiveIndentPreview->setIconSet(TQPixmap(ICONS_PATH + "live-preview.png")); + actionEnableSyntaxHighlighting->setIconSet(TQPixmap(ICONS_PATH + "syntax-highlight.png")); + actionIndenterParameterTooltipsEnabled->setIconSet(TQPixmap(ICONS_PATH + "tooltip.png")); + actionShowSettings->setIconSet(TQPixmap(ICONS_PATH + "preferences-system.png")); + // - Help menu + actionShowLog->setIconSet(TQPixmap(ICONS_PATH + "document-properties.png")); + actionAboutUniversalIndentGUITQt->setIconSet(TQPixmap(ICONS_PATH + "info.png")); + // Menu ids + _actionClearRecentlyOpenedListId = popupMenuRecentlyOpenedFiles->idAt( + popupMenuRecentlyOpenedFiles->count() - 1); + ///-- // Handle last opened window size ///-- // ------------------------------ ///-- bool maximized = _settings->getValueByName("maximized").toBool(); @@ -194,39 +221,36 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- _updateCheckDialog = new UpdateCheckDialog(_settings, this); ///-- ///-- // Register the load last file setting in the menu to the _settings object. -///-- _settings->registerObjectProperty(_mainWindowForm->loadLastOpenedFileOnStartupAction, "checked", +///-- _settings->registerObjectProperty(actionLoadLastOpenedFileOnStartup, "checked", ///-- "loadLastSourceCodeFileOnStartup"); ///-- ///-- // Tell the TQScintilla editor if it has to show white space. -///-- connect(_mainWindowForm->whiteSpaceIsVisibleAction, SIGNAL(toggled(bool)), this, +///-- connect(_mainWindowForm->actionWhiteSpaceIsVisible, SIGNAL(acivated(bool)), this, ///-- SLOT(setWhiteSpaceVisibility(bool))); ///-- // Register the white space setting in the menu to the _settings object. -///-- _settings->registerObjectProperty(_mainWindowForm->whiteSpaceIsVisibleAction, "checked", +///-- _settings->registerObjectProperty(actionWhiteSpaceIsVisible, "checked", ///-- "whiteSpaceIsVisible"); ///-- ///-- // Connect the remaining menu items. -///-- connect(_mainWindowForm->actionOpen_Source_File, SIGNAL(triggered()), this, -///-- SLOT(openSourceFileDialog())); -///-- connect(_mainWindowForm->actionSave_Source_File_As, SIGNAL(triggered()), this, -///-- SLOT(saveasSourceFileDialog())); -///-- connect(_mainWindowForm->actionSave_Source_File, SIGNAL(triggered()), this, -///-- SLOT(saveSourceFile())); -///-- connect(_mainWindowForm->actionExportPDF, SIGNAL(triggered()), this, SLOT(exportToPDF())); -///-- connect(_mainWindowForm->actionExportHTML, SIGNAL(triggered()), this, SLOT(exportToHTML())); + connect(actionOpenSourceFile, SIGNAL(activated()), this, SLOT(openSourceFileDialog())); + connect(actionSaveSourceFile, SIGNAL(activated()), this, SLOT(saveSourceFile())); + connect(actionSaveSourceFileAs, SIGNAL(activated()), this, SLOT(saveasSourceFileDialog())); + connect(actionExportPDF, SIGNAL(activated()), this, SLOT(exportToPDF())); + connect(actionExportHTML, SIGNAL(activated()), this, SLOT(exportToHTML())); ///-- connect(_mainWindowForm->actionCheck_for_update, SIGNAL(triggered()), _updateCheckDialog, ///-- SLOT(checkForUpdateAndShowDialog())); -///-- connect(_mainWindowForm->actionShowLog, SIGNAL(triggered()), +///-- connect(actionShowLog, SIGNAL(activated()), ///-- debugging::TSLogger::getInstance(), SLOT(show())); ///-- -///-- // Init the menu for selecting one of the recently opened files. -///-- updateRecentlyOpenedList(); -///-- connect(_mainWindowForm->menuRecently_Opened_Files, SIGNAL(triggered(TQAction*)), this, -///-- SLOT(openFileFromRecentlyOpenedList(TQAction*))); + // Init the menu for selecting one of the recently opened files. + updateRecentlyOpenedList(); + connect(popupMenuRecentlyOpenedFiles, SIGNAL(activated(int)), + this, SLOT(openFileFromRecentlyOpenedList(int))); ///-- //connect( _settings, SIGNAL(recentlyOpenedListSize(int)), this, SLOT(updateRecentlyOpenedList()) ///-- // ); ///-- _settings->registerObjectSlot(this, "updateRecentlyOpenedList()", "recentlyOpenedListSize"); -///-- } -///-- +} + ///-- /*! ///-- \brief Creates and inits the tool bar. It is added to the main window. ///-- */ @@ -249,8 +273,8 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- connect(_toolBarWidget->cbLivePreview, SIGNAL(toggled(bool)), this, ///-- SLOT(previewTurnedOnOff(bool))); ///-- connect(_toolBarWidget->cbLivePreview, SIGNAL(toggled( -///-- bool)), _mainWindowForm->actionLive_Indent_Preview, SLOT(setChecked(bool))); -///-- connect(_mainWindowForm->actionLive_Indent_Preview, SIGNAL(toggled( +///-- bool)), actionLiveIndentPreview, SLOT(setChecked(bool))); +///-- connect(actionLiveIndentPreview, SIGNAL(toggled( ///-- bool)), _toolBarWidget->cbLivePreview, SLOT(setChecked(bool))); ///-- } ///-- @@ -323,11 +347,11 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- _highlighter = new UiGuiHighlighter(_qSciSourceCodeEditor); ///-- ///-- // Connect the syntax highlighting setting in the menu to the turnHighlightOnOff function. -///-- connect(_mainWindowForm->enableSyntaxHighlightingAction, SIGNAL(toggled(bool)), this, +///-- connect(actionEnableSyntaxHighlighting, SIGNAL(activated(bool)), this, ///-- SLOT(turnHighlightOnOff(bool))); ///-- ///-- // Register the syntax highlighting setting in the menu to the _settings object. -///-- _settings->registerObjectProperty(_mainWindowForm->enableSyntaxHighlightingAction, "checked", +///-- _settings->registerObjectProperty(actionEnableSyntaxHighlighting, "checked", ///-- "SyntaxHighlightingEnabled"); ///-- } ///-- @@ -421,7 +445,7 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- _previewToggled = true; ///-- ///-- // Handle if indenter parameter tool tips are enabled -///-- _settings->registerObjectProperty(_mainWindowForm->indenterParameterTooltipsEnabledAction, +///-- _settings->registerObjectProperty(actionIndenterParameterTooltipsEnabled, ///-- "checked", "indenterParameterTooltipsEnabled"); ///-- ///-- // Add the indenters context menu to the mainwindows menu. @@ -459,14 +483,13 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- } ///-- return fileContent; ///-- } -///-- -///-- /*! -///-- \brief Calls the source file open dialog to load a source file for the formatting preview. -///-- -///-- If the file was successfully loaded the indenter will be called to generate the formatted source code. -///-- */ -///-- void MainWindow::openSourceFileDialog(TQString fileName) -///-- { + +/*! + \brief Calls the source file open dialog to load a source file for the formatting preview. + If the file was successfully loaded the indenter will be called to generate the formatted source code. + */ +void MainWindow::openSourceFileDialog(TQString fileName) +{ ///-- // If the source code file is changed and the shown dialog for saving the file ///-- // is canceled, also stop opening another source file. ///-- if (!maybeSave()) @@ -509,15 +532,14 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- _qSciSourceCodeEditor->setModified(false); ///-- setWindowModified(false); ///-- } -///-- } -///-- -///-- /*! -///-- \brief Calls the source file save as dialog to save a source file under a chosen name. -///-- -///-- If the file already exists and it should be overwritten, a warning is shown before. -///-- */ -///-- bool MainWindow::saveasSourceFileDialog(TQAction *chosenEncodingAction) -///-- { +} + +/*! + \brief Calls the source file save as dialog to save a source file under a chosen name. + If the file already exists and it should be overwritten, a warning is shown before. + */ +bool MainWindow::saveasSourceFileDialog(TQAction *chosenEncodingAction) +{ ///-- TQString encoding; ///-- TQString fileExtensions = tr("Supported by indenter") + " (" + ///-- _indentHandler->getPossibleIndenterFileExtensions() + ");;" + tr("All files") + " (*.*)"; @@ -561,17 +583,16 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- setWindowModified(false); ///-- ///-- updateWindowTitle(); -///-- return true; -///-- } -///-- -///-- /*! -///-- \brief Saves the currently shown source code to the last save or opened source file. -///-- -///-- If no source file has been opened, because only the static example has been loaded, -///-- the save as file dialog will be shown. -///-- */ -///-- bool MainWindow::saveSourceFile() -///-- { + return true; +} + +/*! + \brief Saves the currently shown source code to the last save or opened source file. + If no source file has been opened, because only the static example has been loaded, + the save as file dialog will be shown. + */ +bool MainWindow::saveSourceFile() +{ ///-- if (_currentSourceFile.isEmpty()) ///-- { ///-- return saveasSourceFileDialog(); @@ -593,9 +614,9 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- _qSciSourceCodeEditor->setModified(false); ///-- setWindowModified(false); ///-- } -///-- return true; -///-- } -///-- + return true; +} + ///-- /*! ///-- \brief Shows a file open dialog. ///-- @@ -946,12 +967,12 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- this->setWindowTitle("UniversalIndentGUI " + TQString( ///-- PROGRAM_VERSION_STRING) + " [*]" + _currentSourceFile); ///-- } -///-- -///-- /*! -///-- \brief Opens a dialog to save the current source code as a PDF document. -///-- */ -///-- void MainWindow::exportToPDF() -///-- { + +/*! + \brief Opens a dialog to save the current source code as a PDF document. + */ +void MainWindow::exportToPDF() +{ ///-- TQString fileExtensions = tr("PDF Document") + " (*.pdf)"; ///-- ///-- TQString fileName = _currentSourceFile; @@ -969,13 +990,13 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- printer.setOutputFileName(fileName); ///-- printer.printRange(_qSciSourceCodeEditor); ///-- } -///-- } -///-- -///-- /*! -///-- \brief Opens a dialog to save the current source code as a HTML document. -///-- */ -///-- void MainWindow::exportToHTML() -///-- { +} + +/*! + \brief Opens a dialog to save the current source code as a HTML document. + */ +void MainWindow::exportToHTML() +{ ///-- TQString fileExtensions = tr("HTML Document") + " (*.html)"; ///-- ///-- TQString fileName = _currentSourceFile; @@ -1002,8 +1023,8 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- outSrcFile.write(sourceCodeAsHTML.toAscii()); ///-- outSrcFile.close(); ///-- } -///-- } -///-- +} + ///-- /*! ///-- \brief Loads the last opened file if this option is enabled in the _settings. ///-- @@ -1107,7 +1128,7 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- { ///-- if (event->type() == TQEvent::ToolTip) ///-- { -///-- if (_mainWindowForm->indenterParameterTooltipsEnabledAction->isChecked()) +///-- if (actionIndenterParameterTooltipsEnabled->isOn()) ///-- { ///-- return TQMainWindow::eventFilter(obj, event); ///-- } @@ -1220,11 +1241,11 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- encodingName); ///-- } ///-- -///-- _mainWindowForm->encodingMenu->addActions(_encodingActionGroup->actions()); +///-- _mainWindowForm->popupMenuEncoding->addActions(_encodingActionGroup->actions()); ///-- connect(_encodingActionGroup, SIGNAL(triggered(TQAction*)), this, ///-- SLOT(encodingChanged(TQAction*))); ///-- -///-- _mainWindowForm->saveEncodedMenu->addActions(_saveEncodedActionGroup->actions()); +///-- _mainWindowForm->popupMenuSaveEncoded->addActions(_saveEncodedActionGroup->actions()); ///-- connect(_saveEncodedActionGroup, SIGNAL(triggered(TQAction*)), this, ///-- SLOT(saveAsOtherEncoding(TQAction*))); ///-- } @@ -1301,9 +1322,9 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- highlighterAction->setStatusTip(tr("Set the syntax highlightning to ") + highlighterName); ///-- highlighterAction->setCheckable(true); ///-- } -///-- _mainWindowForm->highlighterMenu->addActions(_highlighterActionGroup->actions()); -///-- _mainWindowForm->menuSettings->insertMenu(_mainWindowForm->indenterParameterTooltipsEnabledAction, -///-- _mainWindowForm->highlighterMenu); +///-- _mainWindowForm->popupMenuHighlighter->addActions(_highlighterActionGroup->actions()); +///-- _mainWindowForm->menuSettings->insertMenu(actionIndenterParameterTooltipsEnabled, +///-- _mainWindowForm->popupMenuHighlighter); ///-- ///-- connect(_highlighterActionGroup, SIGNAL(triggered(TQAction*)), _highlighter, ///-- SLOT(setHighlighterByAction(TQAction*))); @@ -1378,7 +1399,7 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- } ///-- ///-- // Translate the _highlighter menu. -///-- TQList actionList = _mainWindowForm->highlighterMenu->actions(); +///-- TQList actionList = _mainWindowForm->popupMenuHighlighter->actions(); ///-- i = 0; ///-- foreach(TQString highlighterName, _highlighter->getAvailableHighlighters()) ///-- { @@ -1397,17 +1418,16 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- TQWidget::changeEvent(event); ///-- } ///-- } -///-- -///-- /*! -///-- \brief Updates the list of recently opened files. -///-- -///-- Therefore the currently open file is set at the lists first position -///-- regarding the in the _settings set maximum list length. Overheads of the -///-- list will be cut off. The new list will be updated to the _settings and -///-- the recently opened menu will be updated too. -///-- */ -///-- void MainWindow::updateRecentlyOpenedList() -///-- { + +/*! + \brief Updates the list of recently opened files. + Therefore the currently open file is set at the lists first position + regarding the in the _settings set maximum list length. Overheads of the + list will be cut off. The new list will be updated to the _settings and + the recently opened menu will be updated too. + */ +void MainWindow::updateRecentlyOpenedList() +{ ///-- TQString fileName; ///-- TQString filePath; ///-- TQStringList recentlyOpenedList = @@ -1484,22 +1504,22 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- // Write the new recently opened list to the _settings. ///-- _settings->setValueByName("lastSourceCodeFile", recentlyOpenedList.join("|")); ///-- -///-- // Enable or disable "actionClear_Recently_Opened_List" if list is [not] emtpy +///-- // Enable or disable "actionClearRecentlyOpenedList" if list is [not] emtpy ///-- if (recentlyOpenedList.isEmpty()) ///-- { -///-- _mainWindowForm->actionClear_Recently_Opened_List->setEnabled(false); +///-- _mainWindowForm->actionClearRecentlyOpenedList->setEnabled(false); ///-- } ///-- else ///-- { -///-- _mainWindowForm->actionClear_Recently_Opened_List->setEnabled(true); +///-- _mainWindowForm->actionClearRecentlyOpenedList->setEnabled(true); ///-- } -///-- } -///-- -///-- /*! -///-- \brief This slot empties the list of recently opened files. -///-- */ -///-- void MainWindow::clearRecentlyOpenedList() -///-- { +} + +/*! + \brief This slot empties the list of recently opened files. + */ +void MainWindow::clearRecentlyOpenedList() +{ ///-- TQStringList recentlyOpenedList = ///-- _settings->getValueByName("lastSourceCodeFile").toString().split("|"); ///-- TQList recentlyOpenedActionList = @@ -1515,24 +1535,24 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- // Write the new recently opened list to the _settings. ///-- _settings->setValueByName("lastSourceCodeFile", recentlyOpenedList.join("|")); ///-- -///-- // Disable "actionClear_Recently_Opened_List" -///-- _mainWindowForm->actionClear_Recently_Opened_List->setEnabled(false); -///-- } -///-- -///-- /*! -///-- \brief This slot is called if an entry from the list of recently opened files is -///-- being selected. -///-- */ -///-- void MainWindow::openFileFromRecentlyOpenedList(TQAction *recentlyOpenedAction) -///-- { -///-- // If the selected action from the recently opened list menu is the clear action -///-- // call the slot to clear the list and then leave. -///-- if (recentlyOpenedAction == _mainWindowForm->actionClear_Recently_Opened_List) -///-- { -///-- clearRecentlyOpenedList(); -///-- return; -///-- } -///-- +///-- // Disable "actionClearRecentlyOpenedList" +///-- _mainWindowForm->actionClearRecentlyOpenedList->setEnabled(false); +} + +/*! + \brief This slot is called if an entry from the list of recently opened files is + being selected. + */ +void MainWindow::openFileFromRecentlyOpenedList(int recentlyOpenedActionId) +{ + // If the selected action from the recently opened list menu is the clear action + // call the slot to clear the list and then leave. + if (recentlyOpenedActionId == _actionClearRecentlyOpenedListId) + { + clearRecentlyOpenedList(); + return; + } + ///-- TQString fileName = recentlyOpenedAction->text(); ///-- int indexOfSelectedFile = _mainWindowForm->menuRecently_Opened_Files->actions().indexOf( ///-- recentlyOpenedAction); @@ -1558,8 +1578,8 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- // any of these actions in updateRecentlyOpenedList() causes an error. ///-- TQTimer::singleShot(0, this, SLOT(updateRecentlyOpenedList())); ///-- } -///-- } -///-- +} + ///-- /*! ///-- \brief If the dragged in object contains urls/paths to a file, accept the drag. ///-- */ @@ -1584,19 +1604,19 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- ///-- event->acceptProposedAction(); ///-- } -///-- -///-- /*! -///-- \brief If the dropped in object contains urls/paths to a file, open that file. -///-- */ -///-- void MainWindow::showAboutDialog() -///-- { + +/*! + \brief Show the About dialog. +*/ +void MainWindow::showAboutDialog() +{ ///-- //TQPixmap originalPixmap = TQPixmap::grabWindow(TQApplication::desktop()->screen()->winId()); ///-- //tqDebug("in main pixmap width %d, numScreens = %d", originalPixmap.size().width(), ///-- // TQApplication::desktop()->availableGeometry().width()); ///-- //_aboutDialogGraphicsView->setScreenshotPixmap( originalPixmap ); ///-- _aboutDialogGraphicsView->show(); -///-- } -///-- +} + ///-- /*! ///-- \brief Sets the label in the status bar to show the \a line and \a column number. ///-- */ @@ -1604,3 +1624,5 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : ///-- { ///-- _textEditLineColumnInfoLabel->setText(tr("Line %1, Column %2").arg(line + 1).arg(column + 1)); ///-- } + +#include "MainWindow.moc" diff --git a/src/MainWindow.h b/src/MainWindow.h index acb399a..e0d9320 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -20,7 +20,8 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include +#include "MainWindowBase.h" +#include "ntqobjectdefs.h" /// #include "UiGuiSettings.h" /// @@ -33,7 +34,6 @@ /// namespace Ui /// { /// class ToolBarWidget; -/// class MainWindowUi; /// } /// /// class TQLabel; @@ -44,9 +44,9 @@ /// class QsciScintilla; -class MainWindow : public TQMainWindow +class MainWindow : public MainWindowBase { -///--Q_OBJECT + TQ_OBJECT public: //! Constructor @@ -61,11 +61,11 @@ class MainWindow : public TQMainWindow ///-- void closeEvent(TQCloseEvent *event); ///-- bool eventFilter(TQObject *obj, TQEvent *event); ///-- -///-- private slots: -///-- void openSourceFileDialog(TQString fileName = ""); -///-- bool saveasSourceFileDialog(TQAction *chosenEncodingAction = NULL); + private slots: + void openSourceFileDialog(TQString fileName = ""); + bool saveSourceFile(); + bool saveasSourceFileDialog(TQAction *chosenEncodingAction = NULL); ///-- void saveAsOtherEncoding(TQAction *chosenEncodingAction); -///-- bool saveSourceFile(); ///-- void callIndenter(); ///-- void updateSourceView(); ///-- void turnHighlightOnOff(bool turnOn); @@ -74,20 +74,18 @@ class MainWindow : public TQMainWindow ///-- void sourceCodeChangedSlot(); ///-- void indentSettingsChangedSlot(); ///-- void previewTurnedOnOff(bool turnOn); -///-- void exportToPDF(); -///-- void exportToHTML(); + void exportToPDF(); + void exportToHTML(); ///-- void languageChanged(int languageIndex); ///-- void encodingChanged(TQAction *encodingAction); ///-- void numberOfLinesChanged(); -///-- void updateRecentlyOpenedList(); -///-- void openFileFromRecentlyOpenedList(TQAction *recentlyOpenedAction); -///-- void clearRecentlyOpenedList(); -///-- void showAboutDialog(); + void updateRecentlyOpenedList(); + void openFileFromRecentlyOpenedList(int recentlyOpenedActionId); + void clearRecentlyOpenedList(); + void showAboutDialog(); ///-- void setStatusBarCursorPosInfo(int line, int column); ///-- -///-- private: -///-- Ui::MainWindowUi *_mainWindowForm; -///-- + private: ///-- TQString loadFile(TQString filePath); ///-- TQString openFileDialog(TQString dialogHeaderStr, TQString startPath, TQString fileMaskStr); ///-- void updateWindowTitle(); @@ -97,7 +95,7 @@ class MainWindow : public TQMainWindow ///-- void createEncodingMenu(); ///-- void createHighlighterMenu(); ///-- bool initApplicationLanguage(); -///-- void initMainWindow(); + void initMainWindow(); ///-- void initToolBar(); ///-- void initTextEditor(); ///-- void initSyntaxHighlighter(); @@ -118,6 +116,7 @@ class MainWindow : public TQMainWindow ///-- AboutDialog *_aboutDialog; ///-- AboutDialogGraphicsView *_aboutDialogGraphicsView; ///-- UiGuiSettingsDialog *_settingsDialog; + int _actionClearRecentlyOpenedListId; ///-- int _textEditLastScrollPos; ///-- int _currentIndenterID; ///-- bool _loadLastSourceCodeFileOnStartup; diff --git a/src/MainWindow.ui b/src/MainWindow.ui deleted file mode 100755 index cc73e47..0000000 --- a/src/MainWindow.ui +++ /dev/null @@ -1,488 +0,0 @@ - - - Thomas_-_S - MainWindowUi - - - - 0 - 0 - 949 - 633 - - - - UniversalIndentGUI - - - - :/mainWindow/universalIndentGUI.svg:/mainWindow/universalIndentGUI.svg - - - - - 6 - - - 0 - - - - - 0 - - - 2 - - - - - - - - - - 0 - 0 - 949 - 21 - - - - - Indenter - - - - - File - - - - Export - - - - - - - Recently Opened Files - - - - - - - Reopen File with other Encoding - - - - - Save Source File As with other Encoding - - - - - - - - - - - - - - - - Settings - - - - Set Syntax Highlighter - - - - - - - - - - - - - Help - - - - - - - - - - - - - - - 0 - 0 - - - - TQDockWidget::DockWidgetFloatable|TQDockWidget::DockWidgetMovable - - - TQt::LeftDockWidgetArea|TQt::RightDockWidgetArea - - - Indenter Settings - - - 1 - - - - - 6 - - - 0 - - - - - 0 - - - 0 - - - - - - - - - TQt::PreventContextMenu - - - Main Toolbar - - - TQt::Horizontal - - - - 16 - 16 - - - - TQt::ToolButtonTextBesideIcon - - - TopToolBarArea - - - false - - - - - - :/mainWindow/document-open.png:/mainWindow/document-open.png - - - Open Source File - - - Opens a dialog for selecting a source code file. - - - Ctrl+O - - - - - - :/mainWindow/document-save.png:/mainWindow/document-save.png - - - Save Source File - - - Saves the currently shown source code to the last opened or saved source file. - - - Ctrl+S - - - - - - :/mainWindow/document-save-as.png:/mainWindow/document-save-as.png - - - Save Source File As... - - - Save Source File As... - - - Save Source File As... - - - Opens a file dialog to save the currently shown source code. - - - Ctrl+Shift+S - - - - - - :/mainWindow/info.png:/mainWindow/info.png - - - About UniversalIndentGUI - - - Shows info about UniversalIndentGUI. - - - - - - :/mainWindow/system-log-out.png:/mainWindow/system-log-out.png - - - Exit - - - Quits the UniversalIndentGUI. - - - Ctrl+Q - - - - - - :/mainWindow/exportpdf.png:/mainWindow/exportpdf.png - - - PDF - - - Export the currently visible source code as PDF document - - - - - - :/mainWindow/exporthtml.png:/mainWindow/exporthtml.png - - - HTML - - - Export the currently visible source code as HTML document - - - - - true - - - true - - - - :/mainWindow/tooltip.png:/mainWindow/tooltip.png - - - Parameter Tooltips - - - If checked, tool tips will show up if the mouse cursor remains over an indenter parameter for a while. - - - DONOTTRANSLATE:indenterParameterTooltipsEnabled - - - - - true - - - - :/mainWindow/live-preview.png:/mainWindow/live-preview.png - - - Live Indent Preview - - - Ctrl+L - - - false - - - - - true - - - true - - - - :/mainWindow/syntax-highlight.png:/mainWindow/syntax-highlight.png - - - Syntax Highlighting - - - Syntax Highlighting - - - Enables or disables syntax highlighting for the source code. - - - By enabling special key words of the source code are highlighted. - - - Ctrl+H - - - DONOTTRANSLATE:SyntaxHighlightingEnabled - - - - - true - - - White Space Visible - - - White Space Visible - - - Set white space visible - - - Enables or disables diplaying of white space characters in the editor. - - - false - - - DONOTTRANSLATE:whiteSpaceIsVisible - - - - - true - - - true - - - Auto Open Last File - - - Auto open last source file on startup - - - If selected opens last source code file on startup - - - false - - - DONOTTRANSLATE:loadLastSourceCodeFileOnStartup - - - - - - :/mainWindow/preferences-system.png:/mainWindow/preferences-system.png - - - Settings - - - Settings - - - Opens the settings dialog - - - Opens the settings dialog, to set language etc. - - - - - - :/mainWindow/system-software-update.png:/mainWindow/system-software-update.png - - - Check for update - - - Checks online whether a new version of UniversalIndentGUI is available. - - - Checks online whether a new version of UniversalIndentGUI is available. - - - - - - :/mainWindow/edit-clear.png:/mainWindow/edit-clear.png - - - Clear Recently Opened List - - - - - - :/mainWindow/document-properties.png:/mainWindow/document-properties.png - - - Show Log - - - Displays logging information. - - - Displays logging info about the currently running UiGUI application. - - - - - - - - - actionExit - triggered() - MainWindowUi - close() - - - -1 - -1 - - - 399 - 299 - - - - - diff --git a/src/MainWindowBase.ui b/src/MainWindowBase.ui new file mode 100755 index 0000000..56256f0 --- /dev/null +++ b/src/MainWindowBase.ui @@ -0,0 +1,383 @@ + + Thomas_-_S + MainWindowBase + + + MainWindowBase + + + + 0 + 0 + 949 + 633 + + + + UniversalIndentGUI (TQt) + + + + centralWidget + + + 6 + + + 0 + + + + + + menuBar + + + + 0 + 0 + 949 + 21 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + actionOpenSourceFile + + + Open Source File + + + Opens a dialog for selecting a source code file. + + + Ctrl+O + + + + + actionMenuRecentlyOpenedFiles + + + Recently Opened Files + + + Open a recently used file. + + + + + actionClearRecentlyOpenedList + + + Clear Recently Opened List + + + Clears the list of recently open files. + + + + + actionMenuEncoding + + + Reopen File with other Encoding + + + Reopen the current file using a specified encoding. + + + + + actionSaveSourceFile + + + Save Source File + + + Saves the currently shown source code to the last opened or saved source file. + + + Ctrl+S + + + + + actionSaveSourceFileAs + + + Save Source File As... + + + Opens a file dialog to save the currently shown source code. + + + Ctrl+Shift+S + + + + + actionMenuSaveEncoded + + + Save Source File As with other Encoding + + + Save the current source file using a specified encoding. + + + + + actionMenuExport + + + Export + + + Export the currently visible source + + + + + actionExportHTML + + + HTML + + + Export the currently visible source code as HTML document + + + + + actionExportPDF + + + PDF + + + Export the currently visible source code as PDF document + + + + + actionExit + + + Exit + + + Quits the UniversalIndentGUI. + + + Ctrl+Q + + + + + actionLiveIndentPreview + + + true + + + Live Indent Preview + + + Ctrl+L + + + false + + + + + actionEnableSyntaxHighlighting + + + true + + + true + + + Syntax Highlighting + + + By enabling this, special keywords of the source code are highlighted. + + + Ctrl+H + + + + + actionWhiteSpaceIsVisible + + + true + + + White Space Visible + + + Set white space visible + + + Enables or disables diplaying of white space characters in the editor. + + + false + + + + + actionMenuHighlighter + + + Set Syntax Highlighter + + + Set the syntax highlighter to use + + + + + actionIndenterParameterTooltipsEnabled + + + true + + + true + + + Parameter Tooltips + + + If checked, tooltips will show up if the mouse cursor remains over an indenter parameter for a while. + + + + + actionLoadLastOpenedFileOnStartup + + + true + + + true + + + Auto Open Last File + + + Auto open last source file on startup + + + If selected opens last source code file on startup + + + false + + + + + actionShowSettings + + + Settings + + + Opens the settings dialog + + + Opens the settings dialog, to set language etc. + + + + + actionShowLog + + + Show Log + + + Displays logging information. + + + Displays logging info about the currently running UiGUI application. + + + + + actionAboutUniversalIndentGUITQt + + + About UniversalIndentGUI TQt + + + Shows info about UniversalIndentGUI TQt. + + + + + + actionExit + activated() + MainWindowBase + close() + + + -1 + -1 + + + 399 + 299 + + + + + diff --git a/src/AboutDialog.cpp b/src/__TODO/AboutDialog.cpp similarity index 100% rename from src/AboutDialog.cpp rename to src/__TODO/AboutDialog.cpp diff --git a/src/AboutDialog.h b/src/__TODO/AboutDialog.h similarity index 100% rename from src/AboutDialog.h rename to src/__TODO/AboutDialog.h diff --git a/src/AboutDialog.ui b/src/__TODO/AboutDialog.ui similarity index 100% rename from src/AboutDialog.ui rename to src/__TODO/AboutDialog.ui diff --git a/src/AboutDialogGraphicsView.cpp b/src/__TODO/AboutDialogGraphicsView.cpp similarity index 100% rename from src/AboutDialogGraphicsView.cpp rename to src/__TODO/AboutDialogGraphicsView.cpp diff --git a/src/AboutDialogGraphicsView.h b/src/__TODO/AboutDialogGraphicsView.h similarity index 100% rename from src/AboutDialogGraphicsView.h rename to src/__TODO/AboutDialogGraphicsView.h diff --git a/src/FindDialog.ui b/src/__TODO/FindDialog.ui similarity index 100% rename from src/FindDialog.ui rename to src/__TODO/FindDialog.ui diff --git a/src/IndentHandler.cpp b/src/__TODO/IndentHandler.cpp similarity index 100% rename from src/IndentHandler.cpp rename to src/__TODO/IndentHandler.cpp diff --git a/src/IndentHandler.h b/src/__TODO/IndentHandler.h similarity index 100% rename from src/IndentHandler.h rename to src/__TODO/IndentHandler.h diff --git a/src/__TODO/MainWindow.ui b/src/__TODO/MainWindow.ui new file mode 100755 index 0000000..6377823 --- /dev/null +++ b/src/__TODO/MainWindow.ui @@ -0,0 +1,157 @@ + + Thomas_-_S + MainWindowUi + + + MainWindowUi + + + + + 6 + + + 0 + + + + + 0 + + + 2 + + + + + + + + + + 0 + 0 + + + + TQDockWidget::DockWidgetFloatable|TQDockWidget::DockWidgetMovable + + + TQt::LeftDockWidgetArea|TQt::RightDockWidgetArea + + + Indenter Settings + + + 1 + + + + + 6 + + + 0 + + + + + 0 + + + 0 + + + + + + + + + TQt::PreventContextMenu + + + Main Toolbar + + + TQt::Horizontal + + + + 16 + 16 + + + + TQt::ToolButtonTextBesideIcon + + + TopToolBarArea + + + false + + + + + + + + :/mainWindow/document-save-as.png:/mainWindow/document-save-as.png + + + Save Source File As... + + + Save Source File As... + + + Save Source File As... + + + Opens a file dialog to save the currently shown source code. + + + Ctrl+Shift+S + + + + + + :/mainWindow/system-software-update.png:/mainWindow/system-software-update.png + + + Check for update + + + Checks online whether a new version of UniversalIndentGUI is available. + + + Checks online whether a new version of UniversalIndentGUI is available. + + + + + + + + + + + actionExit + triggered() + MainWindowUi + close() + + + -1 + -1 + + + 399 + 299 + + + + + diff --git a/src/SettingsPaths.cpp b/src/__TODO/SettingsPaths.cpp similarity index 100% rename from src/SettingsPaths.cpp rename to src/__TODO/SettingsPaths.cpp diff --git a/src/SettingsPaths.h b/src/__TODO/SettingsPaths.h similarity index 100% rename from src/SettingsPaths.h rename to src/__TODO/SettingsPaths.h diff --git a/src/TemplateBatchScript.cpp b/src/__TODO/TemplateBatchScript.cpp similarity index 100% rename from src/TemplateBatchScript.cpp rename to src/__TODO/TemplateBatchScript.cpp diff --git a/src/TemplateBatchScript.h b/src/__TODO/TemplateBatchScript.h similarity index 100% rename from src/TemplateBatchScript.h rename to src/__TODO/TemplateBatchScript.h diff --git a/src/ToolBarWidget.ui b/src/__TODO/ToolBarWidget.ui similarity index 100% rename from src/ToolBarWidget.ui rename to src/__TODO/ToolBarWidget.ui diff --git a/src/UiGuiErrorMessage.cpp b/src/__TODO/UiGuiErrorMessage.cpp similarity index 100% rename from src/UiGuiErrorMessage.cpp rename to src/__TODO/UiGuiErrorMessage.cpp diff --git a/src/UiGuiErrorMessage.h b/src/__TODO/UiGuiErrorMessage.h similarity index 100% rename from src/UiGuiErrorMessage.h rename to src/__TODO/UiGuiErrorMessage.h diff --git a/src/UiGuiHighlighter.cpp b/src/__TODO/UiGuiHighlighter.cpp similarity index 100% rename from src/UiGuiHighlighter.cpp rename to src/__TODO/UiGuiHighlighter.cpp diff --git a/src/UiGuiHighlighter.h b/src/__TODO/UiGuiHighlighter.h similarity index 100% rename from src/UiGuiHighlighter.h rename to src/__TODO/UiGuiHighlighter.h diff --git a/src/UiGuiIndentServer.cpp b/src/__TODO/UiGuiIndentServer.cpp similarity index 100% rename from src/UiGuiIndentServer.cpp rename to src/__TODO/UiGuiIndentServer.cpp diff --git a/src/UiGuiIndentServer.h b/src/__TODO/UiGuiIndentServer.h similarity index 97% rename from src/UiGuiIndentServer.h rename to src/__TODO/UiGuiIndentServer.h index 0a8f069..3f8c996 100644 --- a/src/UiGuiIndentServer.h +++ b/src/__TODO/UiGuiIndentServer.h @@ -20,7 +20,7 @@ #ifndef UIGUIINDENTSERVER_H #define UIGUIINDENTSERVER_H -#include +#include class TQTcpServer; class TQTcpSocket; @@ -49,7 +49,7 @@ class UiGuiIndentServer : public TQObject TQByteArray _dataToSend; bool _readyForHandleRequest; TQTcpSocket *_currentClientConnection; - tquint32 _blockSize; + TQ_UINT32 _blockSize; }; #endif // UIGUIINDENTSERVER_H diff --git a/src/UiGuiIniFileParser.cpp b/src/__TODO/UiGuiIniFileParser.cpp similarity index 100% rename from src/UiGuiIniFileParser.cpp rename to src/__TODO/UiGuiIniFileParser.cpp diff --git a/src/UiGuiIniFileParser.h b/src/__TODO/UiGuiIniFileParser.h similarity index 100% rename from src/UiGuiIniFileParser.h rename to src/__TODO/UiGuiIniFileParser.h diff --git a/src/UiGuiSettings.cpp b/src/__TODO/UiGuiSettings.cpp similarity index 98% rename from src/UiGuiSettings.cpp rename to src/__TODO/UiGuiSettings.cpp index 11cc4c2..ebac977 100644 --- a/src/UiGuiSettings.cpp +++ b/src/__TODO/UiGuiSettings.cpp @@ -21,16 +21,16 @@ #include "SettingsPaths.h" -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include #include #include -#include +#include //! \defgroup grp_Settings All concerning the settings. @@ -628,21 +628,21 @@ void UiGuiSettings::setValueByName(const TQString &settingName, const TQVariant } } -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include -#include +#include #if TQT_VERSION >= 0x040600 #include #include diff --git a/src/UiGuiSettings.h b/src/__TODO/UiGuiSettings.h similarity index 94% rename from src/UiGuiSettings.h rename to src/__TODO/UiGuiSettings.h index 14376ad..5068d52 100644 --- a/src/UiGuiSettings.h +++ b/src/__TODO/UiGuiSettings.h @@ -20,10 +20,9 @@ #ifndef UIGUISETTINGS_H #define UIGUISETTINGS_H -#include -#include -#include -#include +#include +#include +/////#include class TQSettings; @@ -35,10 +34,10 @@ class UiGuiSettings : public TQObject private: UiGuiSettings(); - static TQWeakPointer _instance; + static UiGuiSettings *_instance; public: - static TQSharedPointer getInstance(); + static UiGuiSettings* getInstance(); ~UiGuiSettings(); diff --git a/src/UiGuiSettingsDialog.cpp b/src/__TODO/UiGuiSettingsDialog.cpp similarity index 100% rename from src/UiGuiSettingsDialog.cpp rename to src/__TODO/UiGuiSettingsDialog.cpp diff --git a/src/UiGuiSettingsDialog.h b/src/__TODO/UiGuiSettingsDialog.h similarity index 100% rename from src/UiGuiSettingsDialog.h rename to src/__TODO/UiGuiSettingsDialog.h diff --git a/src/UiGuiSettingsDialog.ui b/src/__TODO/UiGuiSettingsDialog.ui similarity index 100% rename from src/UiGuiSettingsDialog.ui rename to src/__TODO/UiGuiSettingsDialog.ui diff --git a/src/UiGuiSystemInfo.cpp b/src/__TODO/UiGuiSystemInfo.cpp similarity index 100% rename from src/UiGuiSystemInfo.cpp rename to src/__TODO/UiGuiSystemInfo.cpp diff --git a/src/UiGuiSystemInfo.h b/src/__TODO/UiGuiSystemInfo.h similarity index 100% rename from src/UiGuiSystemInfo.h rename to src/__TODO/UiGuiSystemInfo.h diff --git a/src/UpdateCheckDialog.cpp b/src/__TODO/UpdateCheckDialog.cpp similarity index 100% rename from src/UpdateCheckDialog.cpp rename to src/__TODO/UpdateCheckDialog.cpp diff --git a/src/UpdateCheckDialog.h b/src/__TODO/UpdateCheckDialog.h similarity index 100% rename from src/UpdateCheckDialog.h rename to src/__TODO/UpdateCheckDialog.h diff --git a/src/UpdateCheckDialog.ui b/src/__TODO/UpdateCheckDialog.ui similarity index 100% rename from src/UpdateCheckDialog.ui rename to src/__TODO/UpdateCheckDialog.ui