summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-04-18 20:47:44 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-04-18 20:47:44 +0900
commit425e16ad894fd23d7c5b061acffba6cd04a1b1db (patch)
treee1f794e07812bcd59a4b518747bf9dc5c2a5a163
parent11451cea9db07b2a257297de57d76a8dbb7e3a5e (diff)
downloaduniversal-indent-gui-tqt-425e16ad894fd23d7c5b061acffba6cd04a1b1db.tar.gz
universal-indent-gui-tqt-425e16ad894fd23d7c5b061acffba6cd04a1b1db.zip
Added code to load last open file or an example or an untitled file.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r--CMakeLists.txt1
-rw-r--r--indenters/CMakeLists.txt5
-rwxr-xr-xindenters/__TODO/JsDecoder.js (renamed from indenters/JsDecoder.js)0
-rwxr-xr-xindenters/__TODO/example.cbl (renamed from indenters/example.cbl)0
-rwxr-xr-xindenters/__TODO/example.css (renamed from indenters/example.css)0
-rwxr-xr-xindenters/__TODO/example.f90 (renamed from indenters/example.f90)0
-rwxr-xr-xindenters/__TODO/example.html (renamed from indenters/example.html)0
-rwxr-xr-xindenters/__TODO/example.js (renamed from indenters/example.js)0
-rwxr-xr-xindenters/__TODO/example.php (renamed from indenters/example.php)0
-rwxr-xr-xindenters/__TODO/example.pl (renamed from indenters/example.pl)0
-rwxr-xr-xindenters/__TODO/example.py (renamed from indenters/example.py)0
-rwxr-xr-xindenters/__TODO/example.rb (renamed from indenters/example.rb)0
-rwxr-xr-xindenters/__TODO/example.sh (renamed from indenters/example.sh)0
-rwxr-xr-xindenters/__TODO/example.sql (renamed from indenters/example.sql)0
-rwxr-xr-xindenters/__TODO/example.vb (renamed from indenters/example.vb)0
-rwxr-xr-xindenters/__TODO/example.xml (renamed from indenters/example.xml)0
-rwxr-xr-xindenters/__TODO/hindent (renamed from indenters/hindent)0
-rwxr-xr-xindenters/__TODO/hindent.html (renamed from indenters/hindent.html)0
-rwxr-xr-xindenters/__TODO/perltidy (renamed from indenters/perltidy)0
-rwxr-xr-xindenters/__TODO/phpStylist.php (renamed from indenters/phpStylist.php)0
-rwxr-xr-xindenters/__TODO/phpStylist.txt (renamed from indenters/phpStylist.txt)0
-rwxr-xr-xindenters/__TODO/pindent.py (renamed from indenters/pindent.py)0
-rwxr-xr-xindenters/__TODO/pindent.txt (renamed from indenters/pindent.txt)0
-rwxr-xr-xindenters/__TODO/rbeautify.rb (renamed from indenters/rbeautify.rb)0
-rwxr-xr-xindenters/__TODO/ruby_formatter.rb (renamed from indenters/ruby_formatter.rb)0
-rwxr-xr-xindenters/__TODO/shellindent.awk (renamed from indenters/shellindent.awk)0
-rwxr-xr-xindenters/__TODO/uigui_CblBeau.ini (renamed from indenters/uigui_CblBeau.ini)0
-rwxr-xr-xindenters/__TODO/uigui_astyle.ini (renamed from indenters/uigui_astyle.ini)0
-rwxr-xr-xindenters/__TODO/uigui_bcpp.ini (renamed from indenters/uigui_bcpp.ini)0
-rwxr-xr-xindenters/__TODO/uigui_csstidy.ini (renamed from indenters/uigui_csstidy.ini)0
-rwxr-xr-xindenters/__TODO/uigui_f90ppr.ini (renamed from indenters/uigui_f90ppr.ini)0
-rwxr-xr-xindenters/__TODO/uigui_gnuindent.ini (renamed from indenters/uigui_gnuindent.ini)0
-rwxr-xr-xindenters/__TODO/uigui_greatcode.ini (renamed from indenters/uigui_greatcode.ini)0
-rwxr-xr-xindenters/__TODO/uigui_hindent.ini (renamed from indenters/uigui_hindent.ini)0
-rwxr-xr-xindenters/__TODO/uigui_htb.ini (renamed from indenters/uigui_htb.ini)0
-rwxr-xr-xindenters/__TODO/uigui_jsdecoder.ini (renamed from indenters/uigui_jsdecoder.ini)0
-rwxr-xr-xindenters/__TODO/uigui_jsppp.ini (renamed from indenters/uigui_jsppp.ini)0
-rwxr-xr-xindenters/__TODO/uigui_perltidy.ini (renamed from indenters/uigui_perltidy.ini)0
-rwxr-xr-xindenters/__TODO/uigui_phpCB.ini (renamed from indenters/uigui_phpCB.ini)0
-rwxr-xr-xindenters/__TODO/uigui_phpStylist.ini (renamed from indenters/uigui_phpStylist.ini)0
-rwxr-xr-xindenters/__TODO/uigui_php_Beautifier.ini (renamed from indenters/uigui_php_Beautifier.ini)0
-rwxr-xr-xindenters/__TODO/uigui_pindent.ini (renamed from indenters/uigui_pindent.ini)0
-rwxr-xr-xindenters/__TODO/uigui_psti.ini (renamed from indenters/uigui_psti.ini)0
-rwxr-xr-xindenters/__TODO/uigui_rbeautify.ini (renamed from indenters/uigui_rbeautify.ini)0
-rwxr-xr-xindenters/__TODO/uigui_rubyformatter.ini (renamed from indenters/uigui_rubyformatter.ini)0
-rwxr-xr-xindenters/__TODO/uigui_shellindent.ini (renamed from indenters/uigui_shellindent.ini)0
-rwxr-xr-xindenters/__TODO/uigui_tidy.ini (renamed from indenters/uigui_tidy.ini)0
-rwxr-xr-xindenters/__TODO/uigui_uncrustify.ini (renamed from indenters/uigui_uncrustify.ini)0
-rwxr-xr-xindenters/__TODO/uigui_vbsbeaut.ini (renamed from indenters/uigui_vbsbeaut.ini)0
-rwxr-xr-xindenters/__TODO/uigui_xmlindent.ini (renamed from indenters/uigui_xmlindent.ini)0
-rw-r--r--src/MainWindow.cpp393
-rw-r--r--src/MainWindow.h57
-rwxr-xr-xsrc/MainWindowBase.ui3
53 files changed, 233 insertions, 226 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2f8fac1..d4000d9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,6 +72,7 @@ set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined"
add_subdirectory( config )
add_subdirectory( icons )
+add_subdirectory( indenters )
add_subdirectory( src )
diff --git a/indenters/CMakeLists.txt b/indenters/CMakeLists.txt
new file mode 100644
index 0000000..c0ae4b6
--- /dev/null
+++ b/indenters/CMakeLists.txt
@@ -0,0 +1,5 @@
+install(
+ FILES
+ example.cpp
+ DESTINATION ${SHARE_INSTALL_PREFIX}/universal-indent-gui-tqt/indenters
+)
diff --git a/indenters/JsDecoder.js b/indenters/__TODO/JsDecoder.js
index ec9f3ca..ec9f3ca 100755
--- a/indenters/JsDecoder.js
+++ b/indenters/__TODO/JsDecoder.js
diff --git a/indenters/example.cbl b/indenters/__TODO/example.cbl
index 8b12b04..8b12b04 100755
--- a/indenters/example.cbl
+++ b/indenters/__TODO/example.cbl
diff --git a/indenters/example.css b/indenters/__TODO/example.css
index 438f8ab..438f8ab 100755
--- a/indenters/example.css
+++ b/indenters/__TODO/example.css
diff --git a/indenters/example.f90 b/indenters/__TODO/example.f90
index 8131b8b..8131b8b 100755
--- a/indenters/example.f90
+++ b/indenters/__TODO/example.f90
diff --git a/indenters/example.html b/indenters/__TODO/example.html
index 4998e31..4998e31 100755
--- a/indenters/example.html
+++ b/indenters/__TODO/example.html
diff --git a/indenters/example.js b/indenters/__TODO/example.js
index a807cae..a807cae 100755
--- a/indenters/example.js
+++ b/indenters/__TODO/example.js
diff --git a/indenters/example.php b/indenters/__TODO/example.php
index 5817e49..5817e49 100755
--- a/indenters/example.php
+++ b/indenters/__TODO/example.php
diff --git a/indenters/example.pl b/indenters/__TODO/example.pl
index 1323bfc..1323bfc 100755
--- a/indenters/example.pl
+++ b/indenters/__TODO/example.pl
diff --git a/indenters/example.py b/indenters/__TODO/example.py
index a975cb2..a975cb2 100755
--- a/indenters/example.py
+++ b/indenters/__TODO/example.py
diff --git a/indenters/example.rb b/indenters/__TODO/example.rb
index 6117e5a..6117e5a 100755
--- a/indenters/example.rb
+++ b/indenters/__TODO/example.rb
diff --git a/indenters/example.sh b/indenters/__TODO/example.sh
index c2ac3f1..c2ac3f1 100755
--- a/indenters/example.sh
+++ b/indenters/__TODO/example.sh
diff --git a/indenters/example.sql b/indenters/__TODO/example.sql
index 077eeb8..077eeb8 100755
--- a/indenters/example.sql
+++ b/indenters/__TODO/example.sql
diff --git a/indenters/example.vb b/indenters/__TODO/example.vb
index 94adf39..94adf39 100755
--- a/indenters/example.vb
+++ b/indenters/__TODO/example.vb
diff --git a/indenters/example.xml b/indenters/__TODO/example.xml
index 1be9bed..1be9bed 100755
--- a/indenters/example.xml
+++ b/indenters/__TODO/example.xml
diff --git a/indenters/hindent b/indenters/__TODO/hindent
index dc71264..dc71264 100755
--- a/indenters/hindent
+++ b/indenters/__TODO/hindent
diff --git a/indenters/hindent.html b/indenters/__TODO/hindent.html
index e1a8012..e1a8012 100755
--- a/indenters/hindent.html
+++ b/indenters/__TODO/hindent.html
diff --git a/indenters/perltidy b/indenters/__TODO/perltidy
index 49ebe37..49ebe37 100755
--- a/indenters/perltidy
+++ b/indenters/__TODO/perltidy
diff --git a/indenters/phpStylist.php b/indenters/__TODO/phpStylist.php
index 4c8cbaf..4c8cbaf 100755
--- a/indenters/phpStylist.php
+++ b/indenters/__TODO/phpStylist.php
diff --git a/indenters/phpStylist.txt b/indenters/__TODO/phpStylist.txt
index 55b3cc5..55b3cc5 100755
--- a/indenters/phpStylist.txt
+++ b/indenters/__TODO/phpStylist.txt
diff --git a/indenters/pindent.py b/indenters/__TODO/pindent.py
index 1a627fc..1a627fc 100755
--- a/indenters/pindent.py
+++ b/indenters/__TODO/pindent.py
diff --git a/indenters/pindent.txt b/indenters/__TODO/pindent.txt
index 55ddefb..55ddefb 100755
--- a/indenters/pindent.txt
+++ b/indenters/__TODO/pindent.txt
diff --git a/indenters/rbeautify.rb b/indenters/__TODO/rbeautify.rb
index c4dbd67..c4dbd67 100755
--- a/indenters/rbeautify.rb
+++ b/indenters/__TODO/rbeautify.rb
diff --git a/indenters/ruby_formatter.rb b/indenters/__TODO/ruby_formatter.rb
index acd3150..acd3150 100755
--- a/indenters/ruby_formatter.rb
+++ b/indenters/__TODO/ruby_formatter.rb
diff --git a/indenters/shellindent.awk b/indenters/__TODO/shellindent.awk
index c02af04..c02af04 100755
--- a/indenters/shellindent.awk
+++ b/indenters/__TODO/shellindent.awk
diff --git a/indenters/uigui_CblBeau.ini b/indenters/__TODO/uigui_CblBeau.ini
index 069f429..069f429 100755
--- a/indenters/uigui_CblBeau.ini
+++ b/indenters/__TODO/uigui_CblBeau.ini
diff --git a/indenters/uigui_astyle.ini b/indenters/__TODO/uigui_astyle.ini
index 7d312b8..7d312b8 100755
--- a/indenters/uigui_astyle.ini
+++ b/indenters/__TODO/uigui_astyle.ini
diff --git a/indenters/uigui_bcpp.ini b/indenters/__TODO/uigui_bcpp.ini
index c094f97..c094f97 100755
--- a/indenters/uigui_bcpp.ini
+++ b/indenters/__TODO/uigui_bcpp.ini
diff --git a/indenters/uigui_csstidy.ini b/indenters/__TODO/uigui_csstidy.ini
index 2cca15a..2cca15a 100755
--- a/indenters/uigui_csstidy.ini
+++ b/indenters/__TODO/uigui_csstidy.ini
diff --git a/indenters/uigui_f90ppr.ini b/indenters/__TODO/uigui_f90ppr.ini
index 9d3dc3c..9d3dc3c 100755
--- a/indenters/uigui_f90ppr.ini
+++ b/indenters/__TODO/uigui_f90ppr.ini
diff --git a/indenters/uigui_gnuindent.ini b/indenters/__TODO/uigui_gnuindent.ini
index 53ac520..53ac520 100755
--- a/indenters/uigui_gnuindent.ini
+++ b/indenters/__TODO/uigui_gnuindent.ini
diff --git a/indenters/uigui_greatcode.ini b/indenters/__TODO/uigui_greatcode.ini
index 24c7a58..24c7a58 100755
--- a/indenters/uigui_greatcode.ini
+++ b/indenters/__TODO/uigui_greatcode.ini
diff --git a/indenters/uigui_hindent.ini b/indenters/__TODO/uigui_hindent.ini
index d9767b2..d9767b2 100755
--- a/indenters/uigui_hindent.ini
+++ b/indenters/__TODO/uigui_hindent.ini
diff --git a/indenters/uigui_htb.ini b/indenters/__TODO/uigui_htb.ini
index c6227c0..c6227c0 100755
--- a/indenters/uigui_htb.ini
+++ b/indenters/__TODO/uigui_htb.ini
diff --git a/indenters/uigui_jsdecoder.ini b/indenters/__TODO/uigui_jsdecoder.ini
index f22ea7b..f22ea7b 100755
--- a/indenters/uigui_jsdecoder.ini
+++ b/indenters/__TODO/uigui_jsdecoder.ini
diff --git a/indenters/uigui_jsppp.ini b/indenters/__TODO/uigui_jsppp.ini
index 53c886c..53c886c 100755
--- a/indenters/uigui_jsppp.ini
+++ b/indenters/__TODO/uigui_jsppp.ini
diff --git a/indenters/uigui_perltidy.ini b/indenters/__TODO/uigui_perltidy.ini
index bf2587b..bf2587b 100755
--- a/indenters/uigui_perltidy.ini
+++ b/indenters/__TODO/uigui_perltidy.ini
diff --git a/indenters/uigui_phpCB.ini b/indenters/__TODO/uigui_phpCB.ini
index 00dbfc3..00dbfc3 100755
--- a/indenters/uigui_phpCB.ini
+++ b/indenters/__TODO/uigui_phpCB.ini
diff --git a/indenters/uigui_phpStylist.ini b/indenters/__TODO/uigui_phpStylist.ini
index 6374906..6374906 100755
--- a/indenters/uigui_phpStylist.ini
+++ b/indenters/__TODO/uigui_phpStylist.ini
diff --git a/indenters/uigui_php_Beautifier.ini b/indenters/__TODO/uigui_php_Beautifier.ini
index ab5364d..ab5364d 100755
--- a/indenters/uigui_php_Beautifier.ini
+++ b/indenters/__TODO/uigui_php_Beautifier.ini
diff --git a/indenters/uigui_pindent.ini b/indenters/__TODO/uigui_pindent.ini
index ae17620..ae17620 100755
--- a/indenters/uigui_pindent.ini
+++ b/indenters/__TODO/uigui_pindent.ini
diff --git a/indenters/uigui_psti.ini b/indenters/__TODO/uigui_psti.ini
index 9a1acb7..9a1acb7 100755
--- a/indenters/uigui_psti.ini
+++ b/indenters/__TODO/uigui_psti.ini
diff --git a/indenters/uigui_rbeautify.ini b/indenters/__TODO/uigui_rbeautify.ini
index 38babe1..38babe1 100755
--- a/indenters/uigui_rbeautify.ini
+++ b/indenters/__TODO/uigui_rbeautify.ini
diff --git a/indenters/uigui_rubyformatter.ini b/indenters/__TODO/uigui_rubyformatter.ini
index 1afba10..1afba10 100755
--- a/indenters/uigui_rubyformatter.ini
+++ b/indenters/__TODO/uigui_rubyformatter.ini
diff --git a/indenters/uigui_shellindent.ini b/indenters/__TODO/uigui_shellindent.ini
index 2c36958..2c36958 100755
--- a/indenters/uigui_shellindent.ini
+++ b/indenters/__TODO/uigui_shellindent.ini
diff --git a/indenters/uigui_tidy.ini b/indenters/__TODO/uigui_tidy.ini
index 1341d45..1341d45 100755
--- a/indenters/uigui_tidy.ini
+++ b/indenters/__TODO/uigui_tidy.ini
diff --git a/indenters/uigui_uncrustify.ini b/indenters/__TODO/uigui_uncrustify.ini
index e16e560..e16e560 100755
--- a/indenters/uigui_uncrustify.ini
+++ b/indenters/__TODO/uigui_uncrustify.ini
diff --git a/indenters/uigui_vbsbeaut.ini b/indenters/__TODO/uigui_vbsbeaut.ini
index 0168a92..0168a92 100755
--- a/indenters/uigui_vbsbeaut.ini
+++ b/indenters/__TODO/uigui_vbsbeaut.ini
diff --git a/indenters/uigui_xmlindent.ini b/indenters/__TODO/uigui_xmlindent.ini
index 3717510..3717510 100755
--- a/indenters/uigui_xmlindent.ini
+++ b/indenters/__TODO/uigui_xmlindent.ini
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index a3480c7..ab3040d 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -37,6 +37,9 @@
#include <tqaction.h>
#include <tqapplication.h>
#include <tqcheckbox.h>
+#include <tqcursor.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
#include <tqlabel.h>
#include <tqlocale.h>
#include <tqmessagebox.h>
@@ -44,6 +47,7 @@
#include <tqpopupmenu.h>
#include <tqpushbutton.h>
#include <tqstatusbar.h>
+#include <tqtextcodec.h>
#include <tqtranslator.h>
///-- #include <tqwidget.h>
///-- #include <tqstring.h>
@@ -57,7 +61,6 @@
///-- #include <tqcloseevent.h>
///-- #include <tqhelpevent.h>
///-- #include <tqtooltip.h>
-///-- #include <tqtextcodec.h>
///-- #include <tqdate.h>
///-- #include <tqurl.h>
///-- #include <tqtdebug.h>
@@ -87,7 +90,8 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) :
MainWindowBase(parent), m_aboutDialog(nullptr), m_qSciSourceCodeEditor(nullptr),
m_qTranslator(nullptr), m_uiGuiTranslator(nullptr), m_textEditLineColumnInfoLabel(nullptr),
m_oldLinesNumber(0), m_encodingsList(), m_encodingActionGroup(nullptr),
- m_saveEncodedActionGroup(nullptr), m_highlighterActionGroup(nullptr)
+ m_saveEncodedActionGroup(nullptr), m_highlighterActionGroup(nullptr),
+ m_documentModified(false)
///- _mainWindowForm(nullptr), _settings(nullptr)
///- m_highlighter(nullptr), _aboutDialogGraphicsView(nullptr), _settingsDialog(nullptr)
///- m_textEditVScrollBar(nullptr), _toolBarWidget(nullptr), _indentHandler(nullptr)
@@ -131,21 +135,20 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) :
///-- _settingsDialog = new UiGuiSettingsDialog(this, _settings);
///-- 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
-///-- // it
-///-- if (TQFile::exists(file2OpenOnStart))
-///-- {
-///-- openSourceFileDialog(file2OpenOnStart);
-///-- }
-///-- // Otherwise load the last opened file, if this is enabled in the settings.
-///-- else
-///-- {
-///-- loadLastOpenedFile();
-///-- }
-///--
-///-- updateSourceView();
-///--
+
+ if (TQFile::exists(file2OpenOnStart))
+ {
+ // If a file that should be opened on start exists, load it
+ openSourceFileDialog(file2OpenOnStart);
+ }
+ else
+ {
+ // Otherwise load the last opened file, if this is enabled in the settings.
+ loadLastOpenedFile();
+ }
+
+ updateSourceView();
+
///-- // Enable accept dropping of files.
///-- setAcceptDrops(true);
}
@@ -249,6 +252,8 @@ void MainWindow::initMainWindow()
///-- //connect( _settings, SIGNAL(recentlyOpenedListSize(int)), this, SLOT(updateRecentlyOpenedList())
///-- // );
///-- _settings->registerObjectSlot(this, "updateRecentlyOpenedList()", "recentlyOpenedListSize");
+
+ updateWindowTitle();
}
/*
@@ -455,7 +460,7 @@ void MainWindow::initIndenter()
///--
///-- // Set this true, so the indenter is called at first program start
///-- _indentSettingsChanged = true;
-///-- _previewToggled = true;
+///-- m_previewToggled = true;
///--
///-- // Handle if indenter parameter tool tips are enabled
///-- _settings->registerObjectProperty(actionIndenterParameterTooltipsEnabled,
@@ -465,37 +470,37 @@ void MainWindow::initIndenter()
///-- _mainWindowForm->menuIndenter->addActions(_indentHandler->getIndenterMenuActions());
}
-///-- /*
-///-- \brief Tries to load the by \a filePath defined file and returns its content as TQString.
-///--
-///-- If the file could not be loaded a error dialog will be shown.
-///-- */
-///-- TQString MainWindow::loadFile(TQString filePath)
-///-- {
-///-- TQFile inSrcFile(filePath);
-///-- TQString fileContent = "";
-///--
-///-- if (!inSrcFile.open(TQFile::ReadOnly | TQFile::Text))
-///-- {
-///-- TQMessageBox::warning(NULL, tr("Error opening file"), tr(
-///-- "Cannot read the file ") + "\"" + filePath + "\".");
-///-- }
-///-- else
-///-- {
-///-- TQTextStream inSrcStrm(&inSrcFile);
-///-- TQApplication::setOverrideCursor(TQt::WaitCursor);
-///-- inSrcStrm.setCodec(TQTextCodec::codecForName(m_currentEncoding.toAscii()));
-///-- fileContent = inSrcStrm.readAll();
-///-- TQApplication::restoreOverrideCursor();
-///-- inSrcFile.close();
-///--
-///-- TQFileInfo fileInfo(filePath);
-///-- _currentSourceFileExtension = fileInfo.suffix();
-///-- int indexOfHighlighter = _highlighter->setLexerForExtension(_currentSourceFileExtension);
+/*
+ \brief Tries to load the by \a filePath defined file and returns its content as TQString.
+
+ If the file could not be loaded a error dialog will be shown.
+ */
+TQString MainWindow::loadFile(const TQString &filePath)
+{
+ TQFile inSrcFile(filePath);
+ TQString fileContent = "";
+
+ if (!inSrcFile.open(IO_ReadOnly | IO_Translate))
+ {
+ TQMessageBox::warning(nullptr, tr("Error opening file"),
+ tr("Cannot read the file ") + "\"" + filePath + "\".");
+ }
+ else
+ {
+ TQTextStream inSrcStream(&inSrcFile);
+ TQApplication::setOverrideCursor(TQt::WaitCursor);
+ inSrcStream.setCodec(TQTextCodec::codecForName(m_currentEncoding.ascii()));
+ fileContent = inSrcStream.read();
+ TQApplication::restoreOverrideCursor();
+ inSrcFile.close();
+
+ TQFileInfo fileInfo(filePath);
+ m_currentSourceFileExtension = fileInfo.extension(false);
+///-- int indexOfHighlighter = _highlighter->setLexerForExtension(m_currentSourceFileExtension);
///-- m_highlighterActionGroup->actions().at(indexOfHighlighter)->setChecked(true);
-///-- }
-///-- return fileContent;
-///-- }
+ }
+ return fileContent;
+}
/*
\brief Calls the source file open dialog to load a source file for the formatting preview.
@@ -518,32 +523,32 @@ void MainWindow::openSourceFileDialog(TQString fileName)
///-- if (fileName.isEmpty())
///-- {
///-- fileName = TQFileDialog::getOpenFileName(this, tr(
-///-- "Choose source code file"), _currentSourceFile, fileExtensions);
+///-- "Choose source code file"), m_currentSourceFile, fileExtensions);
///-- }
///--
///-- if (fileName != "")
///-- {
-///-- _currentSourceFile = fileName;
+///-- m_currentSourceFile = fileName;
///-- TQFileInfo fileInfo(fileName);
-///-- _currentSourceFileExtension = fileInfo.suffix();
+///-- m_currentSourceFileExtension = fileInfo.suffix();
///--
///-- openedSourceFileContent = loadFile(fileName);
-///-- _sourceFileContent = openedSourceFileContent;
+///-- m_sourceFileContent = openedSourceFileContent;
///-- if (m_toolBarWidget->cbLivePreview->isChecked())
///-- {
///-- callIndenter();
///-- }
///-- m_sourceCodeChanged = true;
-///-- _previewToggled = true;
+///-- m_previewToggled = true;
///-- updateSourceView();
///-- updateWindowTitle();
///-- updateRecentlyOpenedList();
///-- _textEditLastScrollPos = 0;
///-- m_textEditVScrollBar->setValue(_textEditLastScrollPos);
///--
-///-- _savedSourceContent = openedSourceFileContent;
+///-- m_savedSourceContent = openedSourceFileContent;
///-- m_qSciSourceCodeEditor->setModified(false);
-///-- setWindowModified(false);
+///-- m_documentModified = false;
///-- }
}
@@ -560,7 +565,7 @@ bool MainWindow::saveasSourceFileDialog(TQAction *chosenEncodingAction)
///-- //TQString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./",
///-- // fileExtensions );
///-- TQString fileName = TQFileDialog::getSaveFileName(this, tr(
-///-- "Save source code file"), _currentSourceFile, fileExtensions);
+///-- "Save source code file"), m_currentSourceFile, fileExtensions);
///--
///-- // Saving has been canceled if the filename is empty
///-- if (fileName.isEmpty())
@@ -568,9 +573,9 @@ bool MainWindow::saveasSourceFileDialog(TQAction *chosenEncodingAction)
///-- return false;
///-- }
///--
-///-- _savedSourceContent = m_qSciSourceCodeEditor->text();
+///-- m_savedSourceContent = m_qSciSourceCodeEditor->text();
///--
-///-- _currentSourceFile = fileName;
+///-- m_currentSourceFile = fileName;
///-- TQFile::remove(fileName);
///-- TQFile outSrcFile(fileName);
///-- outSrcFile.open(TQFile::ReadWrite | TQFile::Text);
@@ -586,16 +591,16 @@ bool MainWindow::saveasSourceFileDialog(TQAction *chosenEncodingAction)
///-- }
///-- TQTextStream outSrcStrm(&outSrcFile);
///-- outSrcStrm.setCodec(TQTextCodec::codecForName(encoding.toAscii()));
-///-- outSrcStrm << _savedSourceContent;
+///-- outSrcStrm << m_savedSourceContent;
///-- outSrcFile.close();
///--
///-- TQFileInfo fileInfo(fileName);
-///-- _currentSourceFileExtension = fileInfo.suffix();
+///-- m_currentSourceFileExtension = fileInfo.suffix();
///--
///-- m_qSciSourceCodeEditor->setModified(false);
-///-- setWindowModified(false);
+///-- m_documentModified = false;
///--
-///-- updateWindowTitle();
+ updateWindowTitle();
return true;
}
@@ -606,26 +611,26 @@ bool MainWindow::saveasSourceFileDialog(TQAction *chosenEncodingAction)
*/
bool MainWindow::saveSourceFile()
{
-///-- if (_currentSourceFile.isEmpty())
+///-- if (m_currentSourceFile.isEmpty())
///-- {
///-- return saveasSourceFileDialog();
///-- }
///-- else
///-- {
-///-- TQFile::remove(_currentSourceFile);
-///-- TQFile outSrcFile(_currentSourceFile);
-///-- _savedSourceContent = m_qSciSourceCodeEditor->text();
+///-- TQFile::remove(m_currentSourceFile);
+///-- TQFile outSrcFile(m_currentSourceFile);
+///-- m_savedSourceContent = m_qSciSourceCodeEditor->text();
///-- outSrcFile.open(TQFile::ReadWrite | TQFile::Text);
///--
///-- // Get current encoding.
///-- TQString m_currentEncoding = m_encodingActionGroup->checkedAction()->text();
///-- TQTextStream outSrcStrm(&outSrcFile);
///-- outSrcStrm.setCodec(TQTextCodec::codecForName(m_currentEncoding.toAscii()));
-///-- outSrcStrm << _savedSourceContent;
+///-- outSrcStrm << m_savedSourceContent;
///-- outSrcFile.close();
///--
///-- m_qSciSourceCodeEditor->setModified(false);
-///-- setWindowModified(false);
+///-- m_documentModified = false;
///-- }
return true;
}
@@ -650,42 +655,40 @@ bool MainWindow::saveSourceFile()
///--
///-- return fileContent;
///-- }
-///--
-///-- /*
-///-- \brief Updates the displaying of the source code.
-///--
-///-- Updates the text edit field, which is showing the loaded, and if preview is enabled formatted, source code.
-///-- Reassigns the line numbers and in case of switch between preview and none preview keeps the text field
-///-- at the same line number.
-///-- */
-///-- void MainWindow::updateSourceView()
-///-- {
+
+/*
+ \brief Updates the displaying of the source code.
+
+ Updates the text edit field, which is showing the loaded, and if preview is enabled formatted, source code.
+ Reassigns the line numbers and in case of switch between preview and none preview keeps the text field
+ at the same line number.
+ */
+void MainWindow::updateSourceView()
+{
///-- _textEditLastScrollPos = m_textEditVScrollBar->value();
-///--
-///-- if (m_toolBarWidget->cbLivePreview->isChecked())
-///-- {
-///-- _sourceViewContent = _sourceFormattedContent;
-///-- }
-///-- else
-///-- {
-///-- _sourceViewContent = _sourceFileContent;
-///-- }
-///--
-///-- if (_previewToggled)
-///-- {
-///-- disconnect(m_qSciSourceCodeEditor, SIGNAL(textChanged()), this,
-///-- SLOT(sourceCodeChangedHelperSlot()));
-///-- bool textIsModified = isWindowModified();
-///-- m_qSciSourceCodeEditor->setText(_sourceViewContent);
-///-- setWindowModified(textIsModified);
-///-- _previewToggled = false;
-///-- connect(m_qSciSourceCodeEditor, SIGNAL(textChanged()), this,
-///-- SLOT(sourceCodeChangedHelperSlot()));
-///-- }
-///--
+
+ if (m_toolBarWidget->cbLivePreview->isOn())
+ {
+ m_sourceViewContent = m_sourceFormattedContent;
+ }
+ else
+ {
+ m_sourceViewContent = m_sourceFileContent;
+ }
+
+ if (m_previewToggled)
+ {
+ disconnect(m_qSciSourceCodeEditor, SIGNAL(textChanged()),
+ this, SLOT(sourceCodeChangedHelperSlot()));
+ m_qSciSourceCodeEditor->setText(m_sourceViewContent);
+ m_previewToggled = false;
+ connect(m_qSciSourceCodeEditor, SIGNAL(textChanged()),
+ this, SLOT(sourceCodeChangedHelperSlot()));
+ }
+
///-- m_textEditVScrollBar->setValue(_textEditLastScrollPos);
-///-- }
-///--
+}
+
///-- /*
///-- \brief Calls the selected indenter with the currently loaded source code to retrieve the formatted source code.
///--
@@ -694,8 +697,8 @@ bool MainWindow::saveSourceFile()
///-- void MainWindow::callIndenter()
///-- {
///-- TQApplication::setOverrideCursor(TQCursor(TQt::WaitCursor));
-///-- _sourceFormattedContent = _indentHandler->callIndenter(_sourceFileContent,
-///-- _currentSourceFileExtension);
+///-- m_sourceFormattedContent = _indentHandler->callIndenter(m_sourceFileContent,
+///-- m_currentSourceFileExtension);
///-- //updateSourceView();
///-- TQApplication::restoreOverrideCursor();
///-- }
@@ -713,7 +716,7 @@ void MainWindow::turnHighlightOnOff(bool turnOn)
///-- {
///-- _highlighter->turnHighlightOff();
///-- }
-///-- _previewToggled = true;
+///-- m_previewToggled = true;
///-- updateSourceView();
}
@@ -738,17 +741,17 @@ void MainWindow::sourceCodeChangedSlot()
///-- m_sourceCodeChanged = true;
///--
///-- // Get the content text of the text editor.
-///-- _sourceFileContent = m_qSciSourceCodeEditor->text();
+///-- m_sourceFileContent = m_qSciSourceCodeEditor->text();
///--
///-- // Get the position of the cursor in the unindented text.
-///-- if (_sourceFileContent.isEmpty())
+///-- if (m_sourceFileContent.isEmpty())
///-- {
///-- // Add this line feed, because AStyle has problems with a totally emtpy file.
-///-- _sourceFileContent += "\n";
+///-- m_sourceFileContent += "\n";
///-- cursorPosAbsolut = 0;
///-- cursorPos = 0;
///-- cursorLine = 0;
-///-- enteredCharacter = _sourceFileContent.at(cursorPosAbsolut);
+///-- enteredCharacter = m_sourceFileContent.at(cursorPosAbsolut);
///-- }
///-- else
///-- {
@@ -763,14 +766,14 @@ void MainWindow::sourceCodeChangedSlot()
///-- {
///-- cursorPos--;
///-- }
-///-- enteredCharacter = _sourceFileContent.at(cursorPosAbsolut);
+///-- enteredCharacter = m_sourceFileContent.at(cursorPosAbsolut);
///-- }
///--
///-- // Call the indenter to reformat the text.
///-- if (m_toolBarWidget->cbLivePreview->isChecked())
///-- {
///-- callIndenter();
-///-- _previewToggled = true;
+///-- m_previewToggled = true;
///-- }
///--
///-- // Update the text editor.
@@ -859,15 +862,15 @@ void MainWindow::sourceCodeChangedSlot()
///-- m_sourceCodeChanged = false;
///-- }
///--
-///-- if (_savedSourceContent == m_qSciSourceCodeEditor->text())
+///-- if (m_savedSourceContent == m_qSciSourceCodeEditor->text())
///-- {
///-- m_qSciSourceCodeEditor->setModified(false);
-///-- setWindowModified(false);
+///-- m_documentModified = false;
///-- }
///-- else
///-- {
///-- m_qSciSourceCodeEditor->setModified(true); // Has no effect according to TQScintilla docs.
-///-- setWindowModified(true);
+///-- m_documentModified = true;
///-- }
///--
///-- // Could set cursor this way and use normal linear search in text instead of columns and rows.
@@ -891,7 +894,7 @@ void MainWindow::sourceCodeChangedSlot()
///-- if (m_toolBarWidget->cbLivePreview->isChecked())
///-- {
///-- callIndenter();
-///-- _previewToggled = true;
+///-- m_previewToggled = true;
///--
///-- updateSourceView();
///-- if (m_sourceCodeChanged)
@@ -912,15 +915,15 @@ void MainWindow::sourceCodeChangedSlot()
///-- updateSourceView();
///-- }
///--
-///-- if (_savedSourceContent == m_qSciSourceCodeEditor->text())
+///-- if (m_savedSourceContent == m_qSciSourceCodeEditor->text())
///-- {
///-- m_qSciSourceCodeEditor->setModified(false);
-///-- setWindowModified(false);
+///-- m_documentModified = false;
///-- }
///-- else
///-- {
///-- m_qSciSourceCodeEditor->setModified(true); // Has no effect according to TQScintilla docs.
-///-- setWindowModified(true);
+///-- m_documentModified = true;
///-- }
///-- }
@@ -932,7 +935,7 @@ void MainWindow::sourceCodeChangedSlot()
*/
void MainWindow::previewTurnedOnOff(bool turnOn)
{
-///-- _previewToggled = true;
+///-- m_previewToggled = true;
///--
///-- int cursorLine, cursorPos;
///-- m_qSciSourceCodeEditor->getCursorPosition(&cursorLine, &cursorPos);
@@ -955,26 +958,26 @@ void MainWindow::previewTurnedOnOff(bool turnOn)
///-- }
///-- _indentSettingsChanged = false;
///--
-///-- if (_savedSourceContent == m_qSciSourceCodeEditor->text())
+///-- if (m_savedSourceContent == m_qSciSourceCodeEditor->text())
///-- {
///-- m_qSciSourceCodeEditor->setModified(false);
-///-- setWindowModified(false);
+///-- m_documentModified = false;
///-- }
///-- else
///-- {
///-- m_qSciSourceCodeEditor->setModified(true);
-///-- setWindowModified(true);
+///-- m_documentModified = true;
///-- }
-///-- }
-///--
-///-- /*
-///-- \brief This slot updates the main window title to show the currently opened
-///-- source code filename.
-///-- */
-///-- void MainWindow::updateWindowTitle()
-///-- {
-///-- this->setWindowTitle("UniversalIndentGUI " + TQString(
-///-- PROGRAM_VERSION_STRING) + " [*]" + _currentSourceFile);
+}
+
+/*
+ \brief This slot updates the main window title to show the currently opened
+ source code filename.
+ */
+void MainWindow::updateWindowTitle()
+{
+ setCaption("UniversalIndentGUI (TQt) " + TQString(PROGRAM_VERSION_STRING) +
+ " [*] " + m_currentSourceFile);
}
/*
@@ -984,7 +987,7 @@ void MainWindow::exportToPDF()
{
///-- TQString fileExtensions = tr("PDF Document") + " (*.pdf)";
///--
-///-- TQString fileName = _currentSourceFile;
+///-- TQString fileName = m_currentSourceFile;
///-- TQFileInfo fileInfo(fileName);
///-- TQString fileExtension = fileInfo.suffix();
///--
@@ -1008,7 +1011,7 @@ void MainWindow::exportToHTML()
{
///-- TQString fileExtensions = tr("HTML Document") + " (*.html)";
///--
-///-- TQString fileName = _currentSourceFile;
+///-- TQString fileName = m_currentSourceFile;
///-- TQFileInfo fileInfo(fileName);
///-- TQString fileExtension = fileInfo.suffix();
///--
@@ -1034,60 +1037,60 @@ void MainWindow::exportToHTML()
///-- }
}
-///-- /*
-///-- \brief Loads the last opened file if this option is enabled in the _settings.
-///--
-///-- If the file does not exist, the default example file is tried to be loaded. If even that
-///-- fails a very small code example is shown.
-///-- If the setting for opening the last file is disabled, the editor is empty on startup.
-///-- */
-///-- void MainWindow::loadLastOpenedFile()
-///-- {
-///-- // Get setting for last opened source code file.
-///-- _loadLastSourceCodeFileOnStartup =
-///-- _settings->getValueByName("loadLastSourceCodeFileOnStartup").toBool();
-///--
-///-- // Only load last source code file if set to do so
-///-- if (_loadLastSourceCodeFileOnStartup)
-///-- {
-///-- // From the list of last opened files get the first one.
-///-- _currentSourceFile =
-///-- _settings->getValueByName("lastSourceCodeFile").toString().split("|").first();
-///--
-///-- // If source file exist load it.
-///-- if (TQFile::exists(_currentSourceFile))
-///-- {
-///-- TQFileInfo fileInfo(_currentSourceFile);
-///-- _currentSourceFile = fileInfo.absoluteFilePath();
-///-- _sourceFileContent = loadFile(_currentSourceFile);
-///-- }
-///-- // If the last opened source code file does not exist, try to load the default example.cpp file.
-///-- else if (TQFile::exists(SettingsPaths::getIndenterPath() + "/example.cpp"))
-///-- {
-///-- TQFileInfo fileInfo(SettingsPaths::getIndenterPath() + "/example.cpp");
-///-- _currentSourceFile = fileInfo.absoluteFilePath();
-///-- _sourceFileContent = loadFile(_currentSourceFile);
-///-- }
-///-- // If neither the example source code file exists show some small code example.
-///-- else
-///-- {
-///-- _currentSourceFile = "untitled.cpp";
-///-- _currentSourceFileExtension = "cpp";
-///-- _sourceFileContent = "if(x==\"y\"){x=z;}";
-///-- }
-///-- }
-///-- // if last opened source file should not be loaded make some default _settings.
-///-- else
-///-- {
-///-- _currentSourceFile = "untitled.cpp";
-///-- _currentSourceFileExtension = "cpp";
-///-- _sourceFileContent = "";
-///-- }
-///-- _savedSourceContent = _sourceFileContent;
-///--
-///-- // Update the mainwindow title to show the name of the loaded source code file.
-///-- updateWindowTitle();
-///-- }
+/*
+ \brief Loads the last opened file if this option is enabled in the settings.
+
+ If the file does not exist, the default example file is tried to be loaded.
+ If even that fails, a very small code example is shown.
+ If the setting for opening the last file is disabled, the editor is empty on startup.
+*/
+void MainWindow::loadLastOpenedFile()
+{
+ // Get setting for last opened source code file.
+ m_loadLastSourceCodeFileOnStartup =
+ m_settings->getValueByName("LoadLastOpenedFileOnStartup").toBool();
+
+ // Only load last source code file if set to do so
+ if (m_loadLastSourceCodeFileOnStartup)
+ {
+ // From the list of last opened files get the first one.
+ TQString sourceFiles = m_settings->getValueByName("LastOpenedFiles").toString();
+ m_currentSourceFile = TQStringList::split("|", sourceFiles).first();
+
+ if (TQFile::exists(m_currentSourceFile))
+ {
+ // If source file exist load it.
+ TQFileInfo fileInfo(m_currentSourceFile);
+ m_currentSourceFile = fileInfo.absFilePath();
+ m_sourceFileContent = loadFile(m_currentSourceFile);
+ }
+ else if (TQFile::exists(SettingsPaths::getIndenterPath() + "/example.cpp"))
+ {
+ // If the last opened source code file does not exist, try to load the default example.cpp file.
+ TQFileInfo fileInfo(SettingsPaths::getIndenterPath() + "/example.cpp");
+ m_currentSourceFile = fileInfo.absFilePath();
+ m_sourceFileContent = loadFile(m_currentSourceFile);
+ }
+ else
+ {
+ // If neither the example source code file exists show some small code example.
+ m_currentSourceFile = "untitled.cpp";
+ m_currentSourceFileExtension = "cpp";
+ m_sourceFileContent = "if(x==\"y\"){x=z;}";
+ }
+ }
+ else
+ {
+ // if last opened source file should not be loaded make some default settings.
+ m_currentSourceFile = "untitled.cpp";
+ m_currentSourceFileExtension = "cpp";
+ m_sourceFileContent = "";
+ }
+ m_savedSourceContent = m_sourceFileContent;
+
+ // Update the mainwindow title to show the name of the loaded source code file.
+ updateWindowTitle();
+}
/*
\brief Saves the m_settings for the main application to the file "UniversalIndentGUI.ini".
@@ -1290,13 +1293,13 @@ void MainWindow::encodingChanged(TQAction *encodingAction)
{
///-- if (maybeSave())
///-- {
-///-- TQFile inSrcFile(_currentSourceFile);
+///-- TQFile inSrcFile(m_currentSourceFile);
///-- TQString fileContent = "";
///--
///-- if (!inSrcFile.open(TQFile::ReadOnly | TQFile::Text))
///-- {
///-- TQMessageBox::warning(NULL, tr("Error opening file"), tr(
-///-- "Cannot read the file ") + "\"" + _currentSourceFile + "\".");
+///-- "Cannot read the file ") + "\"" + m_currentSourceFile + "\".");
///-- }
///-- else
///-- {
@@ -1449,7 +1452,7 @@ void MainWindow::updateRecentlyOpenedList()
///-- _mainWindowForm->menuRecently_Opened_Files->actions();
///--
///-- // Check if the currently open file is in the list of recently opened.
-///-- int indexOfCurrentFile = recentlyOpenedList.indexOf(_currentSourceFile);
+///-- int indexOfCurrentFile = recentlyOpenedList.indexOf(m_currentSourceFile);
///--
///-- // If it is in the list of recently opened files and not at the first position, move it to the
///-- // first pos.
@@ -1459,12 +1462,12 @@ void MainWindow::updateRecentlyOpenedList()
///-- recentlyOpenedActionList.move(indexOfCurrentFile, 0);
///-- }
///-- // Put the current file at the first position if it not already is and is not empty.
-///-- else if (indexOfCurrentFile == -1 && !_currentSourceFile.isEmpty())
+///-- else if (indexOfCurrentFile == -1 && !m_currentSourceFile.isEmpty())
///-- {
-///-- recentlyOpenedList.insert(0, _currentSourceFile);
+///-- recentlyOpenedList.insert(0, m_currentSourceFile);
///-- TQAction *recentlyOpenedAction = new TQAction(TQFileInfo(
-///-- _currentSourceFile).fileName(), _mainWindowForm->menuRecently_Opened_Files);
-///-- recentlyOpenedAction->setStatusTip(_currentSourceFile);
+///-- m_currentSourceFile).fileName(), _mainWindowForm->menuRecently_Opened_Files);
+///-- recentlyOpenedAction->setStatusTip(m_currentSourceFile);
///-- recentlyOpenedActionList.insert(0, recentlyOpenedAction);
///-- }
///--
diff --git a/src/MainWindow.h b/src/MainWindow.h
index d00e141..773c1ec 100644
--- a/src/MainWindow.h
+++ b/src/MainWindow.h
@@ -58,7 +58,7 @@ class MainWindow : public MainWindowBase
bool saveasSourceFileDialog(TQAction *chosenEncodingAction = NULL);
void saveAsOtherEncoding(TQAction *chosenEncodingAction);
///-- void callIndenter();
-///-- void updateSourceView();
+ void updateSourceView();
void turnHighlightOnOff(bool turnOn);
void setWhiteSpaceVisibility(bool visible);
void sourceCodeChangedHelperSlot();
@@ -75,12 +75,12 @@ class MainWindow : public MainWindowBase
void clearRecentlyOpenedList();
void showAboutDialog();
void setStatusBarCursorPosInfo(int line, int column);
-///--
+
private:
-///-- TQString loadFile(TQString filePath);
+ TQString loadFile(const TQString &filePath);
///-- TQString openFileDialog(TQString dialogHeaderStr, TQString startPath, TQString fileMaskStr);
-///-- void updateWindowTitle();
-///-- void loadLastOpenedFile();
+ void updateWindowTitle();
+ void loadLastOpenedFile();
void saveSettings();
bool maybeSave();
void createEncodingMenu();
@@ -94,41 +94,42 @@ class MainWindow : public MainWindowBase
///-- void changeEvent(TQEvent *event);
///-- void dragEnterEvent(TQDragEnterEvent *event);
///-- void dropEvent(TQDropEvent *event);
-///--
+
TQextScintilla *m_qSciSourceCodeEditor;
UiGuiSettings *m_settings;
-///--
- TQString m_currentEncoding;
-///-- TQString _sourceFileContent;
-///-- TQString _sourceFormattedContent;
-///-- TQString _sourceViewContent;
+
+ TQString m_currentEncoding;
+ TQString m_sourceFileContent;
+ TQString m_sourceFormattedContent;
+ TQString m_sourceViewContent;
///-- UiGuiHighlighter *m_highlighter;
///-- TQScrollBar *m_textEditVScrollBar;
- AboutDialog *m_aboutDialog;
+ AboutDialog *m_aboutDialog;
///-- AboutDialogGraphicsView *_aboutDialogGraphicsView;
///-- UiGuiSettingsDialog *_settingsDialog;
int m_actionClearRecentlyOpenedListId;
///-- int _textEditLastScrollPos;
///-- int _currentIndenterID;
- int m_oldLinesNumber;
-///-- bool _loadLastSourceCodeFileOnStartup;
-///-- TQString _currentSourceFile;
-///-- TQString _currentSourceFileExtension;
-///-- TQString _savedSourceContent;
- TQActionGroup *m_encodingActionGroup;
- TQActionGroup *m_saveEncodedActionGroup;
- TQActionGroup *m_highlighterActionGroup;
- TQTranslator *m_uiGuiTranslator;
- TQTranslator *m_qTranslator;
-///--
- bool m_sourceCodeChanged;
+ int m_oldLinesNumber;
+ bool m_loadLastSourceCodeFileOnStartup;
+ TQString m_currentSourceFile;
+ TQString m_currentSourceFileExtension;
+ TQString m_savedSourceContent;
+ TQActionGroup *m_encodingActionGroup;
+ TQActionGroup *m_saveEncodedActionGroup;
+ TQActionGroup *m_highlighterActionGroup;
+ TQTranslator *m_uiGuiTranslator;
+ TQTranslator *m_qTranslator;
+
+ bool m_sourceCodeChanged;
///-- bool _indentSettingsChanged;
-///-- bool _previewToggled;
- TQStringList m_encodingsList;
+ bool m_previewToggled;
+ bool m_documentModified;
+ TQStringList m_encodingsList;
- ToolBarWidget *m_toolBarWidget;
+ ToolBarWidget *m_toolBarWidget;
///-- IndentHandler *_indentHandler;
- TQLabel *m_textEditLineColumnInfoLabel;
+ TQLabel *m_textEditLineColumnInfoLabel;
};
#endif // MAINWINDOW_H
diff --git a/src/MainWindowBase.ui b/src/MainWindowBase.ui
index 676b6f1..6b55170 100755
--- a/src/MainWindowBase.ui
+++ b/src/MainWindowBase.ui
@@ -13,9 +13,6 @@
<height>633</height>
</rect>
</property>
- <property name="caption">
- <string>UniversalIndentGUI (TQt)</string>
- </property>
<hbox>
<property name="name">
<cstring>centralWidget</cstring>