Added main window menubar GUI. The logic of each action has not been implemented yet.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
master
Michele Calgaro 2 years ago
parent 14f7e49438
commit a80a494efe
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -70,6 +70,7 @@ set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined"
##### directories
add_subdirectory( icons )
add_subdirectory( src )

@ -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

@ -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
)

Before

Width:  |  Height:  |  Size: 237 B

After

Width:  |  Height:  |  Size: 237 B

Before

Width:  |  Height:  |  Size: 995 B

After

Width:  |  Height:  |  Size: 995 B

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 140 KiB

Before

Width:  |  Height:  |  Size: 631 B

After

Width:  |  Height:  |  Size: 631 B

Before

Width:  |  Height:  |  Size: 515 B

After

Width:  |  Height:  |  Size: 515 B

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 237 B

After

Width:  |  Height:  |  Size: 237 B

Before

Width:  |  Height:  |  Size: 257 B

After

Width:  |  Height:  |  Size: 257 B

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 545 B

Before

Width:  |  Height:  |  Size: 496 B

After

Width:  |  Height:  |  Size: 496 B

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 545 B

Before

Width:  |  Height:  |  Size: 420 B

After

Width:  |  Height:  |  Size: 420 B

Before

Width:  |  Height:  |  Size: 420 B

After

Width:  |  Height:  |  Size: 420 B

Before

Width:  |  Height:  |  Size: 446 B

After

Width:  |  Height:  |  Size: 446 B

Before

Width:  |  Height:  |  Size: 472 B

After

Width:  |  Height:  |  Size: 472 B

Before

Width:  |  Height:  |  Size: 465 B

After

Width:  |  Height:  |  Size: 465 B

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 984 B

After

Width:  |  Height:  |  Size: 984 B

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 474 B

After

Width:  |  Height:  |  Size: 474 B

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 825 B

After

Width:  |  Height:  |  Size: 825 B

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 821 B

After

Width:  |  Height:  |  Size: 821 B

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 852 B

After

Width:  |  Height:  |  Size: 852 B

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

@ -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"

@ -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

@ -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 <tntqwidget.h>
///-- #include <tntqlabel.h>
///-- #include <tntqstring.h>
///-- #include <tntqscrollbar.h>
#include <tqpixmap.h>
#include <tqaction.h>
#include <tqpopupmenu.h>
///-- #include <tqwidget.h>
///-- #include <tqlabel.h>
///-- #include <tqstring.h>
///-- #include <tqscrollbar.h>
///-- #include <tqtextcursor.h>
///-- #include <tntqfiledialog.h>
///-- #include <tntqtextstream.h>
///-- #include <tqfiledialog.h>
///-- #include <tqtextstream.h>
///-- #include <tqtextdocument.h>
///-- #include <tntqprinter.h>
///-- #include <tntqprintdialog.h>
///-- #include <tqprinter.h>
///-- #include <tqprintdialog.h>
///-- #include <tqcloseevent.h>
///-- #include <tqhelpevent.h>
///-- #include <tntqtooltip.h>
///-- #include <tntqtranslator.h>
///-- #include <tntqlocale.h>
///-- #include <tntqtextcodec.h>
///-- #include <tqtooltip.h>
///-- #include <tqtranslator.h>
///-- #include <tqlocale.h>
///-- #include <tqtextcodec.h>
///-- #include <tqdate.h>
///-- #include <tntqurl.h>
///-- #include <tntqmessagebox.h>
///-- #include <tqurl.h>
///-- #include <tqmessagebox.h>
///-- #include <tqtdebug.h>
///--
///-- #include <Qsci/qsciscintilla.h>
@ -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<TQAction*> actionList = _mainWindowForm->highlighterMenu->actions();
///-- TQList<TQAction*> 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<TQAction*> 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"

@ -20,7 +20,8 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <tqmainwindow.h>
#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;

@ -1,488 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<author>Thomas_-_S</author>
<class>MainWindowUi</class>
<widget class="TQMainWindow" name="MainWindowUi">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>949</width>
<height>633</height>
</rect>
</property>
<property name="windowTitle">
<string>UniversalIndentGUI</string>
</property>
<property name="windowIcon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/universalIndentGUI.svg</normaloff>:/mainWindow/universalIndentGUI.svg</iconset>
</property>
<widget class="TQWidget" name="centralwidget">
<layout class="TQHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="TQHBoxLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>2</number>
</property>
</layout>
</item>
</layout>
</widget>
<widget class="TQStatusBar" name="statusbar"/>
<widget class="TQMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>949</width>
<height>21</height>
</rect>
</property>
<widget class="TQMenu" name="menuIndenter">
<property name="title">
<string>Indenter</string>
</property>
</widget>
<widget class="TQMenu" name="menuFile">
<property name="title">
<string>File</string>
</property>
<widget class="TQMenu" name="menuExport">
<property name="title">
<string>Export</string>
</property>
<addaction name="actionExportPDF"/>
<addaction name="actionExportHTML"/>
</widget>
<widget class="TQMenu" name="menuRecently_Opened_Files">
<property name="title">
<string>Recently Opened Files</string>
</property>
<addaction name="separator"/>
<addaction name="actionClear_Recently_Opened_List"/>
</widget>
<widget class="TQMenu" name="encodingMenu">
<property name="title">
<string>Reopen File with other Encoding</string>
</property>
</widget>
<widget class="TQMenu" name="saveEncodedMenu">
<property name="title">
<string>Save Source File As with other Encoding</string>
</property>
</widget>
<addaction name="actionOpen_Source_File"/>
<addaction name="menuRecently_Opened_Files"/>
<addaction name="encodingMenu"/>
<addaction name="separator"/>
<addaction name="actionSave_Source_File"/>
<addaction name="actionSave_Source_File_As"/>
<addaction name="saveEncodedMenu"/>
<addaction name="separator"/>
<addaction name="menuExport"/>
<addaction name="actionExit"/>
</widget>
<widget class="TQMenu" name="menuSettings">
<property name="title">
<string>Settings</string>
</property>
<widget class="TQMenu" name="highlighterMenu">
<property name="title">
<string>Set Syntax Highlighter</string>
</property>
</widget>
<addaction name="actionLive_Indent_Preview"/>
<addaction name="enableSyntaxHighlightingAction"/>
<addaction name="whiteSpaceIsVisibleAction"/>
<addaction name="highlighterMenu"/>
<addaction name="indenterParameterTooltipsEnabledAction"/>
<addaction name="loadLastOpenedFileOnStartupAction"/>
<addaction name="actionShowSettings"/>
</widget>
<widget class="TQMenu" name="menuHelp">
<property name="title">
<string>Help</string>
</property>
<addaction name="actionCheck_for_update"/>
<addaction name="actionShowLog"/>
<addaction name="separator"/>
<addaction name="actionAbout_UniversalIndentGUI"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuIndenter"/>
<addaction name="menuSettings"/>
<addaction name="menuHelp"/>
</widget>
<widget class="TQDockWidget" name="dockWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="features">
<set>TQDockWidget::DockWidgetFloatable|TQDockWidget::DockWidgetMovable</set>
</property>
<property name="allowedAreas">
<set>TQt::LeftDockWidgetArea|TQt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Indenter Settings</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
<widget class="TQWidget" name="dockWidgetContents">
<layout class="TQHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="TQVBoxLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
</layout>
</item>
</layout>
</widget>
</widget>
<widget class="TQToolBar" name="toolBar">
<property name="contextMenuPolicy">
<enum>TQt::PreventContextMenu</enum>
</property>
<property name="windowTitle">
<string>Main Toolbar</string>
</property>
<property name="orientation">
<enum>TQt::Horizontal</enum>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>TQt::ToolButtonTextBesideIcon</enum>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<action name="actionOpen_Source_File">
<property name="icon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/document-open.png</normaloff>:/mainWindow/document-open.png</iconset>
</property>
<property name="text">
<string>Open Source File</string>
</property>
<property name="statusTip">
<string>Opens a dialog for selecting a source code file.</string>
</property>
<property name="shortcut">
<string>Ctrl+O</string>
</property>
</action>
<action name="actionSave_Source_File">
<property name="icon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/document-save.png</normaloff>:/mainWindow/document-save.png</iconset>
</property>
<property name="text">
<string>Save Source File</string>
</property>
<property name="statusTip">
<string>Saves the currently shown source code to the last opened or saved source file.</string>
</property>
<property name="shortcut">
<string>Ctrl+S</string>
</property>
</action>
<action name="actionSave_Source_File_As">
<property name="icon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/document-save-as.png</normaloff>:/mainWindow/document-save-as.png</iconset>
</property>
<property name="text">
<string>Save Source File As...</string>
</property>
<property name="iconText">
<string>Save Source File As...</string>
</property>
<property name="toolTip">
<string>Save Source File As...</string>
</property>
<property name="statusTip">
<string>Opens a file dialog to save the currently shown source code.</string>
</property>
<property name="shortcut">
<string>Ctrl+Shift+S</string>
</property>
</action>
<action name="actionAbout_UniversalIndentGUI">
<property name="icon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/info.png</normaloff>:/mainWindow/info.png</iconset>
</property>
<property name="text">
<string>About UniversalIndentGUI</string>
</property>
<property name="statusTip">
<string>Shows info about UniversalIndentGUI.</string>
</property>
</action>
<action name="actionExit">
<property name="icon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/system-log-out.png</normaloff>:/mainWindow/system-log-out.png</iconset>
</property>
<property name="text">
<string>Exit</string>
</property>
<property name="statusTip">
<string>Quits the UniversalIndentGUI.</string>
</property>
<property name="shortcut">
<string>Ctrl+Q</string>
</property>
</action>
<action name="actionExportPDF">
<property name="icon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/exportpdf.png</normaloff>:/mainWindow/exportpdf.png</iconset>
</property>
<property name="text">
<string>PDF</string>
</property>
<property name="statusTip">
<string>Export the currently visible source code as PDF document</string>
</property>
</action>
<action name="actionExportHTML">
<property name="icon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/exporthtml.png</normaloff>:/mainWindow/exporthtml.png</iconset>
</property>
<property name="text">
<string>HTML</string>
</property>
<property name="statusTip">
<string>Export the currently visible source code as HTML document</string>
</property>
</action>
<action name="indenterParameterTooltipsEnabledAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/tooltip.png</normaloff>:/mainWindow/tooltip.png</iconset>
</property>
<property name="text">
<string>Parameter Tooltips</string>
</property>
<property name="statusTip">
<string>If checked, tool tips will show up if the mouse cursor remains over an indenter parameter for a while.</string>
</property>
<property name="connectedSettingName" stdset="0">
<string>DONOTTRANSLATE:indenterParameterTooltipsEnabled</string>
</property>
</action>
<action name="actionLive_Indent_Preview">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/live-preview.png</normaloff>:/mainWindow/live-preview.png</iconset>
</property>
<property name="text">
<string>Live Indent Preview</string>
</property>
<property name="shortcut">
<string>Ctrl+L</string>
</property>
<property name="visible">
<bool>false</bool>
</property>
</action>
<action name="enableSyntaxHighlightingAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/syntax-highlight.png</normaloff>:/mainWindow/syntax-highlight.png</iconset>
</property>
<property name="text">
<string>Syntax Highlighting</string>
</property>
<property name="iconText">
<string>Syntax Highlighting</string>
</property>
<property name="toolTip">
<string>Enables or disables syntax highlighting for the source code.</string>
</property>
<property name="statusTip">
<string>By enabling special key words of the source code are highlighted.</string>
</property>
<property name="shortcut">
<string>Ctrl+H</string>
</property>
<property name="connectedSettingName" stdset="0">
<string>DONOTTRANSLATE:SyntaxHighlightingEnabled</string>
</property>
</action>
<action name="whiteSpaceIsVisibleAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>White Space Visible</string>
</property>
<property name="iconText">
<string>White Space Visible</string>
</property>
<property name="toolTip">
<string>Set white space visible</string>
</property>
<property name="statusTip">
<string>Enables or disables diplaying of white space characters in the editor.</string>
</property>
<property name="visible">
<bool>false</bool>
</property>
<property name="connectedSettingName" stdset="0">
<string>DONOTTRANSLATE:whiteSpaceIsVisible</string>
</property>
</action>
<action name="loadLastOpenedFileOnStartupAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>Auto Open Last File</string>
</property>
<property name="toolTip">
<string>Auto open last source file on startup</string>
</property>
<property name="statusTip">
<string>If selected opens last source code file on startup</string>
</property>
<property name="visible">
<bool>false</bool>
</property>
<property name="connectedSettingName" stdset="0">
<string>DONOTTRANSLATE:loadLastSourceCodeFileOnStartup</string>
</property>
</action>
<action name="actionShowSettings">
<property name="icon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/preferences-system.png</normaloff>:/mainWindow/preferences-system.png</iconset>
</property>
<property name="text">
<string>Settings</string>
</property>
<property name="iconText">
<string>Settings</string>
</property>
<property name="toolTip">
<string>Opens the settings dialog</string>
</property>
<property name="statusTip">
<string>Opens the settings dialog, to set language etc.</string>
</property>
</action>
<action name="actionCheck_for_update">
<property name="icon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/system-software-update.png</normaloff>:/mainWindow/system-software-update.png</iconset>
</property>
<property name="text">
<string>Check for update</string>
</property>
<property name="toolTip">
<string>Checks online whether a new version of UniversalIndentGUI is available.</string>
</property>
<property name="statusTip">
<string>Checks online whether a new version of UniversalIndentGUI is available.</string>
</property>
</action>
<action name="actionClear_Recently_Opened_List">
<property name="icon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/edit-clear.png</normaloff>:/mainWindow/edit-clear.png</iconset>
</property>
<property name="text">
<string>Clear Recently Opened List</string>
</property>
</action>
<action name="actionShowLog">
<property name="icon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/document-properties.png</normaloff>:/mainWindow/document-properties.png</iconset>
</property>
<property name="text">
<string>Show Log</string>
</property>
<property name="toolTip">
<string>Displays logging information.</string>
</property>
<property name="statusTip">
<string>Displays logging info about the currently running UiGUI application.</string>
</property>
</action>
</widget>
<resources>
<include location="../resources/Icons.qrc"/>
</resources>
<connections>
<connection>
<sender>actionExit</sender>
<signal>triggered()</signal>
<receiver>MainWindowUi</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>399</x>
<y>299</y>
</hint>
</hints>
</connection>
</connections>
</ui>

@ -0,0 +1,383 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<author>Thomas_-_S</author>
<class>MainWindowBase</class>
<widget class="TQMainWindow">
<property name="name">
<cstring>MainWindowBase</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>949</width>
<height>633</height>
</rect>
</property>
<property name="caption">
<string>UniversalIndentGUI (TQt)</string>
</property>
<hbox>
<property name="name">
<cstring>centralWidget</cstring>
</property>
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
</hbox>
</widget>
<menubar>
<property name="name">
<cstring>menuBar</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>949</width>
<height>21</height>
</rect>
</property>
<item text="&amp;File" name="menuFile">
<action name="actionOpenSourceFile"/>
<action name="actionMenuRecentlyOpenedFiles"/>
<item text="Recently Opened Files" name="popupMenuRecentlyOpenedFiles">
<separator/>
<action name="actionClearRecentlyOpenedList"/>
</item>
<action name="actionMenuEncoding"/>
<item text="Reopen File with other Encoding" name="popupMenuEncoding"/>
<separator/>
<action name="actionSaveSourceFile"/>
<action name="actionSaveSourceFileAs"/>
<action name="actionMenuSaveEncoded"/>
<item text="Save Source File As with other Encoding" name="popupMenuSaveEncoded"/>
<separator/>
<action name="actionMenuExport"/>
<item text="Export" name="popupMenuExport">
<action name="actionExportHTML"/>
<action name="actionExportPDF"/>
</item>
<action name="actionExit" />
</item>
<item text="&amp;Indenter" name="menuIndenter">
</item>
<item text="&amp;Settings" name="menuSettings">
<action name="actionLiveIndentPreview"/>
<action name="actionEnableSyntaxHighlighting"/>
<action name="actionWhiteSpaceIsVisible"/>
<action name="actionMenuHighlighter"/>
<item text="Set Syntax Highlighter" name="popupMenuHighlighter"/>
<action name="actionIndenterParameterTooltipsEnabled"/>
<action name="actionLoadLastOpenedFileOnStartup"/>
<action name="actionShowSettings"/>
</item>
<item text="&amp;Help" name="menuHelp">
<action name="actionShowLog"/>
<separator/>
<action name="actionAboutUniversalIndentGUITQt"/>
</item>
</menubar>
<actions>
<action>
<property name="name">
<cstring>actionOpenSourceFile</cstring>
</property>
<property name="text">
<string>Open Source File</string>
</property>
<property name="statusTip">
<string>Opens a dialog for selecting a source code file.</string>
</property>
<property name="accel">
<string>Ctrl+O</string>
</property>
</action>
<action>
<property name="name">
<cstring>actionMenuRecentlyOpenedFiles</cstring>
</property>
<property name="text">
<string>Recently Opened Files</string>
</property>
<property name="statusTip">
<string>Open a recently used file.</string>
</property>
</action>
<action>
<property name="name">
<cstring>actionClearRecentlyOpenedList</cstring>
</property>
<property name="text">
<string>Clear Recently Opened List</string>
</property>
<property name="statusTip">
<string>Clears the list of recently open files.</string>
</property>
</action>
<action>
<property name="name">
<cstring>actionMenuEncoding</cstring>
</property>
<property name="text">
<string>Reopen File with other Encoding</string>
</property>
<property name="statusTip">
<string>Reopen the current file using a specified encoding.</string>
</property>
</action>
<action>
<property name="name">
<cstring>actionSaveSourceFile</cstring>
</property>
<property name="text">
<string>Save Source File</string>
</property>
<property name="statusTip">
<string>Saves the currently shown source code to the last opened or saved source file.</string>
</property>
<property name="accel">
<string>Ctrl+S</string>
</property>
</action>
<action>
<property name="name">
<cstring>actionSaveSourceFileAs</cstring>
</property>
<property name="text">
<string>Save Source File As...</string>
</property>
<property name="statusTip">
<string>Opens a file dialog to save the currently shown source code.</string>
</property>
<property name="accel">
<string>Ctrl+Shift+S</string>
</property>
</action>
<action>
<property name="name">
<cstring>actionMenuSaveEncoded</cstring>
</property>
<property name="text">
<string>Save Source File As with other Encoding</string>
</property>
<property name="statusTip">
<string>Save the current source file using a specified encoding.</string>
</property>
</action>
<action>
<property name="name">
<cstring>actionMenuExport</cstring>
</property>
<property name="text">
<string>Export</string>
</property>
<property name="statusTip">
<string>Export the currently visible source</string>
</property>
</action>
<action>
<property name="name">
<cstring>actionExportHTML</cstring>
</property>
<property name="text">
<string>HTML</string>
</property>
<property name="statusTip">
<string>Export the currently visible source code as HTML document</string>
</property>
</action>
<action>
<property name="name">
<cstring>actionExportPDF</cstring>
</property>
<property name="text">
<string>PDF</string>
</property>
<property name="statusTip">
<string>Export the currently visible source code as PDF document</string>
</property>
</action>
<action>
<property name="name">
<cstring>actionExit</cstring>
</property>
<property name="text">
<string>Exit</string>
</property>
<property name="statusTip">
<string>Quits the UniversalIndentGUI.</string>
</property>
<property name="accel">
<string>Ctrl+Q</string>
</property>
</action>
<action>
<property name="name">
<cstring>actionLiveIndentPreview</cstring>
</property>
<property name="toggleAction">
<bool>true</bool>
</property>
<property name="text">
<string>Live Indent Preview</string>
</property>
<property name="accel">
<string>Ctrl+L</string>
</property>
<property name="visible">
<bool>false</bool>
</property>
</action>
<action>
<property name="name">
<cstring>actionEnableSyntaxHighlighting</cstring>
</property>
<property name="toggleAction">
<bool>true</bool>
</property>
<property name="on">
<bool>true</bool>
</property>
<property name="text">
<string>Syntax Highlighting</string>
</property>
<property name="statusTip">
<string>By enabling this, special keywords of the source code are highlighted.</string>
</property>
<property name="accel">
<string>Ctrl+H</string>
</property>
</action>
<action name="">
<property name="name">
<cstring>actionWhiteSpaceIsVisible</cstring>
</property>
<property name="toggleAction">
<bool>true</bool>
</property>
<property name="text">
<string>White Space Visible</string>
</property>
<property name="toolTip">
<string>Set white space visible</string>
</property>
<property name="statusTip">
<string>Enables or disables diplaying of white space characters in the editor.</string>
</property>
<property name="visible">
<bool>false</bool>
</property>
</action>
<action>
<property name="name">
<cstring>actionMenuHighlighter</cstring>
</property>
<property name="text">
<string>Set Syntax Highlighter</string>
</property>
<property name="statusTip">
<string>Set the syntax highlighter to use</string>
</property>
</action>
<action>
<property name="name">
<cstring>actionIndenterParameterTooltipsEnabled</cstring>
</property>
<property name="toggleAction">
<bool>true</bool>
</property>
<property name="on">
<bool>true</bool>
</property>
<property name="text">
<string>Parameter Tooltips</string>
</property>
<property name="statusTip">
<string>If checked, tooltips will show up if the mouse cursor remains over an indenter parameter for a while.</string>
</property>
</action>
<action>
<property name="name">
<cstring>actionLoadLastOpenedFileOnStartup</cstring>
</property>
<property name="toggleAction">
<bool>true</bool>
</property>
<property name="on">
<bool>true</bool>
</property>
<property name="text">
<string>Auto Open Last File</string>
</property>
<property name="toolTip">
<string>Auto open last source file on startup</string>
</property>
<property name="statusTip">
<string>If selected opens last source code file on startup</string>
</property>
<property name="visible">
<bool>false</bool>
</property>
</action>
<action>
<property name="name">
<cstring>actionShowSettings</cstring>
</property>
<property name="text">
<string>Settings</string>
</property>
<property name="toolTip">
<string>Opens the settings dialog</string>
</property>
<property name="statusTip">
<string>Opens the settings dialog, to set language etc.</string>
</property>
</action>
<action>
<property name="name">
<cstring>actionShowLog</cstring>
</property>
<property name="text">
<string>Show Log</string>
</property>
<property name="toolTip">
<string>Displays logging information.</string>
</property>
<property name="statusTip">
<string>Displays logging info about the currently running UiGUI application.</string>
</property>
</action>
<action>
<property name="name">
<cstring>actionAboutUniversalIndentGUITQt</cstring>
</property>
<property name="text">
<string>About UniversalIndentGUI TQt</string>
</property>
<property name="statusTip">
<string>Shows info about UniversalIndentGUI TQt.</string>
</property>
</action>
</actions>
<connections>
<connection>
<sender>actionExit</sender>
<signal>activated()</signal>
<receiver>MainWindowBase</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>399</x>
<y>299</y>
</hint>
</hints>
</connection>
</connections>
</UI>

@ -0,0 +1,157 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<author>Thomas_-_S</author>
<class>MainWindowUi</class>
<widget class="TQMainWindow">
<property name="name">
<cstring>MainWindowUi</cstring>
</property>
<widget class="TQWidget" name="centralwidget">
<layout class="TQHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="TQHBoxLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>2</number>
</property>
</layout>
</item>
</layout>
</widget>
<widget class="TQStatusBar" name="statusbar"/>
<widget class="TQDockWidget" name="dockWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="features">
<set>TQDockWidget::DockWidgetFloatable|TQDockWidget::DockWidgetMovable</set>
</property>
<property name="allowedAreas">
<set>TQt::LeftDockWidgetArea|TQt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Indenter Settings</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
<widget class="TQWidget" name="dockWidgetContents">
<layout class="TQHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="TQVBoxLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
</layout>
</item>
</layout>
</widget>
</widget>
<widget class="TQToolBar" name="toolBar">
<property name="contextMenuPolicy">
<enum>TQt::PreventContextMenu</enum>
</property>
<property name="windowTitle">
<string>Main Toolbar</string>
</property>
<property name="orientation">
<enum>TQt::Horizontal</enum>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>TQt::ToolButtonTextBesideIcon</enum>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<action name="actionSave_Source_File">
</action>
<action name="actionSave_Source_File_As">
<property name="icon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/document-save-as.png</normaloff>:/mainWindow/document-save-as.png</iconset>
</property>
<property name="text">
<string>Save Source File As...</string>
</property>
<property name="iconText">
<string>Save Source File As...</string>
</property>
<property name="toolTip">
<string>Save Source File As...</string>
</property>
<property name="statusTip">
<string>Opens a file dialog to save the currently shown source code.</string>
</property>
<property name="shortcut">
<string>Ctrl+Shift+S</string>
</property>
</action>
<action name="actionCheck_for_update">
<property name="icon">
<iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/system-software-update.png</normaloff>:/mainWindow/system-software-update.png</iconset>
</property>
<property name="text">
<string>Check for update</string>
</property>
<property name="toolTip">
<string>Checks online whether a new version of UniversalIndentGUI is available.</string>
</property>
<property name="statusTip">
<string>Checks online whether a new version of UniversalIndentGUI is available.</string>
</property>
</action>
<action name="actionClear_Recently_Opened_List">
</action>
</widget>
<resources>
<include location="../resources/Icons.qrc"/>
</resources>
<connections>
<connection>
<sender>actionExit</sender>
<signal>triggered()</signal>
<receiver>MainWindowUi</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>399</x>
<y>299</y>
</hint>
</hints>
</connection>
</connections>
</UI>

@ -20,7 +20,7 @@
#ifndef UIGUIINDENTSERVER_H
#define UIGUIINDENTSERVER_H
#include <tntqobject.h>
#include <tqobject.h>
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

@ -21,16 +21,16 @@
#include "SettingsPaths.h"
#include <tntqsettings.h>
#include <tntqpoint.h>
#include <tntqsize.h>
#include <tntqdir.h>
#include <tqsettings.h>
#include <tqpoint.h>
#include <tqsize.h>
#include <tqdir.h>
#include <tqdate.h>
#include <tntqstringlist.h>
#include <tqstringlist.h>
#include <tqcoreapplication.h>
#include <tqmetamethod.h>
#include <tqmetaproperty.h>
#include <tntqwidget.h>
#include <tqwidget.h>
//! \defgroup grp_Settings All concerning the settings.
@ -628,21 +628,21 @@ void UiGuiSettings::setValueByName(const TQString &settingName, const TQVariant
}
}
#include <tntqbitarray.h>
#include <tntqbitmap.h>
#include <tntqbrush.h>
#include <tntqcursor.h>
#include <tntqdatetime.h>
#include <tntqfont.h>
#include <tqbitarray.h>
#include <tqbitmap.h>
#include <tqbrush.h>
#include <tqcursor.h>
#include <tqdatetime.h>
#include <tqfont.h>
#include <tqicon.h>
#include <tntqkeysequence.h>
#include <tntqlocale.h>
#include <tntqpalette.h>
#include <tntqpen.h>
#include <tntqsizepolicy.h>
#include <tqkeysequence.h>
#include <tqlocale.h>
#include <tqpalette.h>
#include <tqpen.h>
#include <tqsizepolicy.h>
#include <tqtextformat.h>
#include <tqtextlength.h>
#include <tntqurl.h>
#include <tqurl.h>
#if TQT_VERSION >= 0x040600
#include <tqmatrix4x4.h>
#include <tqvector2d.h>

@ -20,10 +20,9 @@
#ifndef UIGUISETTINGS_H
#define UIGUISETTINGS_H
#include <tntqobject.h>
#include <tntqstringlist.h>
#include <tqmultimap.h>
#include <tqsharedpointer.h>
#include <tqobject.h>
#include <tqstringlist.h>
/////#include <tqmultimap.h>
class TQSettings;
@ -35,10 +34,10 @@ class UiGuiSettings : public TQObject
private:
UiGuiSettings();
static TQWeakPointer<UiGuiSettings> _instance;
static UiGuiSettings *_instance;
public:
static TQSharedPointer<UiGuiSettings> getInstance();
static UiGuiSettings* getInstance();
~UiGuiSettings();
Loading…
Cancel
Save