|
|
|
@ -114,11 +114,11 @@ MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) :
|
|
|
|
|
//m_aboutDialog = new AboutDialog(this, WStyle_Splash);
|
|
|
|
|
m_aboutDialog = new AboutDialog(this);
|
|
|
|
|
///-- _aboutDialogGraphicsView = new AboutDialogGraphicsView(m_aboutDialog, this);
|
|
|
|
|
connect(actionAboutUniversalIndentGUITQt, SIGNAL(activated()), this, SLOT(showAboutDialog()));
|
|
|
|
|
connect(actionAboutUniversalIndentGUITQt, TQ_SIGNAL(activated()), this, TQ_SLOT(showAboutDialog()));
|
|
|
|
|
|
|
|
|
|
// Generate settings dialog box
|
|
|
|
|
m_settingsDialog = new UiGuiSettingsDialog(this, m_settings);
|
|
|
|
|
connect(actionShowSettings, SIGNAL(activated()), m_settingsDialog, SLOT(showDialog()));
|
|
|
|
|
connect(actionShowSettings, TQ_SIGNAL(activated()), m_settingsDialog, TQ_SLOT(showDialog()));
|
|
|
|
|
|
|
|
|
|
if (TQFile::exists(file2OpenOnStart))
|
|
|
|
|
{
|
|
|
|
@ -205,60 +205,60 @@ void MainWindow::initMainWindow()
|
|
|
|
|
m_currentEncoding = m_settings->getValueByName("FileEncoding").toString();
|
|
|
|
|
|
|
|
|
|
// Register the syntax highlighting setting in the menu to the settings object.
|
|
|
|
|
connect(actionEnableSyntaxHighlighting, SIGNAL(toggled(bool)),
|
|
|
|
|
m_settings, SLOT(handleValueChangeFromExtern(bool)));
|
|
|
|
|
connect(m_settings, SIGNAL(syntaxHighlightingEnabled(bool)),
|
|
|
|
|
actionEnableSyntaxHighlighting, SLOT(setOn(bool)));
|
|
|
|
|
connect(actionEnableSyntaxHighlighting, TQ_SIGNAL(toggled(bool)),
|
|
|
|
|
m_settings, TQ_SLOT(handleValueChangeFromExtern(bool)));
|
|
|
|
|
connect(m_settings, TQ_SIGNAL(syntaxHighlightingEnabled(bool)),
|
|
|
|
|
actionEnableSyntaxHighlighting, TQ_SLOT(setOn(bool)));
|
|
|
|
|
actionEnableSyntaxHighlighting->setOn(
|
|
|
|
|
m_settings->getValueByName("SyntaxHighlightingEnabled").toBool());
|
|
|
|
|
// Tell the highlighter if it has to be enabled or disabled.
|
|
|
|
|
connect(m_settings, SIGNAL(syntaxHighlightingEnabled(bool)), this, SLOT(turnHighlightOnOff(bool)));
|
|
|
|
|
connect(m_settings, TQ_SIGNAL(syntaxHighlightingEnabled(bool)), this, TQ_SLOT(turnHighlightOnOff(bool)));
|
|
|
|
|
|
|
|
|
|
// Register the load last file setting in the menu to the settings object
|
|
|
|
|
connect(actionLoadLastOpenedFileOnStartup, SIGNAL(toggled(bool)),
|
|
|
|
|
m_settings, SLOT(handleValueChangeFromExtern(bool)));
|
|
|
|
|
connect(m_settings, SIGNAL(loadLastOpenedFileOnStartup(bool)),
|
|
|
|
|
actionLoadLastOpenedFileOnStartup, SLOT(setOn(bool)));
|
|
|
|
|
connect(actionLoadLastOpenedFileOnStartup, TQ_SIGNAL(toggled(bool)),
|
|
|
|
|
m_settings, TQ_SLOT(handleValueChangeFromExtern(bool)));
|
|
|
|
|
connect(m_settings, TQ_SIGNAL(loadLastOpenedFileOnStartup(bool)),
|
|
|
|
|
actionLoadLastOpenedFileOnStartup, TQ_SLOT(setOn(bool)));
|
|
|
|
|
actionLoadLastOpenedFileOnStartup->setOn(
|
|
|
|
|
m_settings->getValueByName("LoadLastOpenedFileOnStartup").toBool());
|
|
|
|
|
|
|
|
|
|
// Register the white space setting in the menu to the settings object.
|
|
|
|
|
connect(actionWhiteSpaceIsVisible, SIGNAL(toggled(bool)),
|
|
|
|
|
m_settings, SLOT(handleValueChangeFromExtern(bool)));
|
|
|
|
|
connect(m_settings, SIGNAL(whiteSpaceIsVisible(bool)),
|
|
|
|
|
actionWhiteSpaceIsVisible, SLOT(setOn(bool)));
|
|
|
|
|
connect(actionWhiteSpaceIsVisible, TQ_SIGNAL(toggled(bool)),
|
|
|
|
|
m_settings, TQ_SLOT(handleValueChangeFromExtern(bool)));
|
|
|
|
|
connect(m_settings, TQ_SIGNAL(whiteSpaceIsVisible(bool)),
|
|
|
|
|
actionWhiteSpaceIsVisible, TQ_SLOT(setOn(bool)));
|
|
|
|
|
actionWhiteSpaceIsVisible->setOn(m_settings->getValueByName("WhiteSpaceIsVisible").toBool());
|
|
|
|
|
// Tell the TQScintilla editor if it has to show white space.
|
|
|
|
|
connect(m_settings, SIGNAL(whiteSpaceIsVisible(bool)), this, SLOT(setWhiteSpaceVisibility(bool)));
|
|
|
|
|
connect(m_settings, TQ_SIGNAL(whiteSpaceIsVisible(bool)), this, TQ_SLOT(setWhiteSpaceVisibility(bool)));
|
|
|
|
|
|
|
|
|
|
// Register the indenter parameter tooltip setting in the menu to the settings object
|
|
|
|
|
connect(actionIndenterParameterTooltipsEnabled, SIGNAL(toggled(bool)),
|
|
|
|
|
m_settings, SLOT(handleValueChangeFromExtern(bool)));
|
|
|
|
|
connect(m_settings, SIGNAL(indenterParameterTooltipsEnabled(bool)),
|
|
|
|
|
actionIndenterParameterTooltipsEnabled, SLOT(setOn(bool)));
|
|
|
|
|
connect(actionIndenterParameterTooltipsEnabled, TQ_SIGNAL(toggled(bool)),
|
|
|
|
|
m_settings, TQ_SLOT(handleValueChangeFromExtern(bool)));
|
|
|
|
|
connect(m_settings, TQ_SIGNAL(indenterParameterTooltipsEnabled(bool)),
|
|
|
|
|
actionIndenterParameterTooltipsEnabled, TQ_SLOT(setOn(bool)));
|
|
|
|
|
actionIndenterParameterTooltipsEnabled->setOn(
|
|
|
|
|
m_settings->getValueByName("IndenterParameterTooltipsEnabled").toBool());
|
|
|
|
|
|
|
|
|
|
// Connect the remaining menu items.
|
|
|
|
|
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(m_settings, SIGNAL(indenterParameterTooltipsEnabled(bool)),
|
|
|
|
|
this, SLOT(setIndenterParameterTooltips(bool)));
|
|
|
|
|
connect(actionOpenSourceFile, TQ_SIGNAL(activated()), this, TQ_SLOT(openSourceFileDialog()));
|
|
|
|
|
connect(actionSaveSourceFile, TQ_SIGNAL(activated()), this, TQ_SLOT(saveSourceFile()));
|
|
|
|
|
connect(actionSaveSourceFileAs, TQ_SIGNAL(activated()), this, TQ_SLOT(saveasSourceFileDialog()));
|
|
|
|
|
connect(actionExportPDF, TQ_SIGNAL(activated()), this, TQ_SLOT(exportToPDF()));
|
|
|
|
|
connect(actionExportHTML, TQ_SIGNAL(activated()), this, TQ_SLOT(exportToHTML()));
|
|
|
|
|
connect(m_settings, TQ_SIGNAL(indenterParameterTooltipsEnabled(bool)),
|
|
|
|
|
this, TQ_SLOT(setIndenterParameterTooltips(bool)));
|
|
|
|
|
|
|
|
|
|
///-- connect(actionShowLog, SIGNAL(activated()),
|
|
|
|
|
///-- debugging::TSLogger::getInstance(), SLOT(show()));
|
|
|
|
|
///-- connect(actionShowLog, TQ_SIGNAL(activated()),
|
|
|
|
|
///-- debugging::TSLogger::getInstance(), TQ_SLOT(show()));
|
|
|
|
|
|
|
|
|
|
// Init the menu for selecting one of the recently opened files.
|
|
|
|
|
initRecentlyOpenedList();
|
|
|
|
|
updateRecentlyOpenedList();
|
|
|
|
|
connect(popupMenuRecentlyOpenedFiles, SIGNAL(highlighted(int)),
|
|
|
|
|
this, SLOT(recentlyOpenedFileHighlighted(int)));
|
|
|
|
|
connect(popupMenuRecentlyOpenedFiles, SIGNAL(activated(int)),
|
|
|
|
|
this, SLOT(openFileFromRecentlyOpenedList(int)));
|
|
|
|
|
connect(m_settings, SIGNAL(recentlyOpenedListSize(int)), this, SLOT(updateRecentlyOpenedList()));
|
|
|
|
|
connect(popupMenuRecentlyOpenedFiles, TQ_SIGNAL(highlighted(int)),
|
|
|
|
|
this, TQ_SLOT(recentlyOpenedFileHighlighted(int)));
|
|
|
|
|
connect(popupMenuRecentlyOpenedFiles, TQ_SIGNAL(activated(int)),
|
|
|
|
|
this, TQ_SLOT(openFileFromRecentlyOpenedList(int)));
|
|
|
|
|
connect(m_settings, TQ_SIGNAL(recentlyOpenedListSize(int)), this, TQ_SLOT(updateRecentlyOpenedList()));
|
|
|
|
|
|
|
|
|
|
updateWindowTitle();
|
|
|
|
|
}
|
|
|
|
@ -278,19 +278,19 @@ void MainWindow::initToolBar()
|
|
|
|
|
m_toolBarWidget->cbEnableSyntaxHL->hide();
|
|
|
|
|
|
|
|
|
|
m_toolBarWidget->pbOpenSourceFile->setIconSet(TQPixmap(ICONS_PATH + "document-open.png"));
|
|
|
|
|
connect(m_toolBarWidget->pbOpenSourceFile, SIGNAL(clicked()), this, SLOT(openSourceFileDialog()));
|
|
|
|
|
connect(m_toolBarWidget->pbOpenSourceFile, TQ_SIGNAL(clicked()), this, TQ_SLOT(openSourceFileDialog()));
|
|
|
|
|
|
|
|
|
|
m_toolBarWidget->pbAbout->setIconSet(TQPixmap(ICONS_PATH + "info.png"));
|
|
|
|
|
connect(m_toolBarWidget->pbAbout, SIGNAL(clicked()), this, SLOT(showAboutDialog()));
|
|
|
|
|
connect(m_toolBarWidget->pbAbout, TQ_SIGNAL(clicked()), this, TQ_SLOT(showAboutDialog()));
|
|
|
|
|
|
|
|
|
|
m_toolBarWidget->pbExit->setIconSet(TQPixmap(ICONS_PATH + "system-log-out.png"));
|
|
|
|
|
connect(m_toolBarWidget->pbExit, SIGNAL(clicked()), this, SLOT(close()));
|
|
|
|
|
connect(m_toolBarWidget->pbExit, TQ_SIGNAL(clicked()), this, TQ_SLOT(close()));
|
|
|
|
|
|
|
|
|
|
// Settings a pixmap hides the text in TQt3
|
|
|
|
|
//m_toolBarWidget->cbLivePreview->setPixmap(TQPixmap(ICONS_PATH + "live-preview.png"));
|
|
|
|
|
connect(m_toolBarWidget->cbLivePreview, SIGNAL(toggled(bool)), this, SLOT(previewTurnedOnOff(bool)));
|
|
|
|
|
connect(m_toolBarWidget->cbLivePreview, SIGNAL(toggled(bool)),
|
|
|
|
|
actionLiveIndentPreview, SLOT(setOn(bool)));
|
|
|
|
|
connect(m_toolBarWidget->cbLivePreview, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(previewTurnedOnOff(bool)));
|
|
|
|
|
connect(m_toolBarWidget->cbLivePreview, TQ_SIGNAL(toggled(bool)),
|
|
|
|
|
actionLiveIndentPreview, TQ_SLOT(setOn(bool)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -329,7 +329,7 @@ void MainWindow::initTextEditor()
|
|
|
|
|
// Handle the width of tabs in spaces
|
|
|
|
|
int tabWidth = m_settings->getValueByName("TabWidth").toInt();
|
|
|
|
|
m_qSciSourceCodeEditor->setTabWidth(tabWidth);
|
|
|
|
|
connect(m_settings, SIGNAL(tabWidth(int)), m_qSciSourceCodeEditor, SLOT(setTabWidth(int)));
|
|
|
|
|
connect(m_settings, TQ_SIGNAL(tabWidth(int)), m_qSciSourceCodeEditor, TQ_SLOT(setTabWidth(int)));
|
|
|
|
|
|
|
|
|
|
// TODO not available in TQScintilla 1.71
|
|
|
|
|
// Remember a pointer to the scrollbar of the TQScintilla widget used to keep
|
|
|
|
@ -339,15 +339,15 @@ void MainWindow::initTextEditor()
|
|
|
|
|
// Add a column row indicator to the status bar.
|
|
|
|
|
m_textEditLineColumnInfoLabel = new TQLabel(tr("Line %1, Column %2").arg(1).arg(1), this);
|
|
|
|
|
statusBar()->addWidget(m_textEditLineColumnInfoLabel, 0, true);
|
|
|
|
|
connect(m_qSciSourceCodeEditor, SIGNAL(cursorPositionChanged(int,int)),
|
|
|
|
|
this, SLOT(setStatusBarCursorPosInfo(int, int)));
|
|
|
|
|
connect(m_qSciSourceCodeEditor, TQ_SIGNAL(cursorPositionChanged(int,int)),
|
|
|
|
|
this, TQ_SLOT(setStatusBarCursorPosInfo(int, int)));
|
|
|
|
|
|
|
|
|
|
// Connect the text editor to dependent functions.
|
|
|
|
|
connect(m_qSciSourceCodeEditor, SIGNAL(textChanged()), this, SLOT(sourceCodeChangedHelperSlot()));
|
|
|
|
|
connect(m_qSciSourceCodeEditor, TQ_SIGNAL(textChanged()), this, TQ_SLOT(sourceCodeChangedHelperSlot()));
|
|
|
|
|
// TODO signal 'linesChanged' is not available in TQScintilla 1.71.
|
|
|
|
|
// Use textChanged for now and check for line number changes in the slot
|
|
|
|
|
//connect(m_qSciSourceCodeEditor, SIGNAL(linesChanged()), this, SLOT(numberOfLinesChanged()));
|
|
|
|
|
connect(m_qSciSourceCodeEditor, SIGNAL(textChanged()), this, SLOT(numberOfLinesChanged()));
|
|
|
|
|
//connect(m_qSciSourceCodeEditor, TQ_SIGNAL(linesChanged()), this, TQ_SLOT(numberOfLinesChanged()));
|
|
|
|
|
connect(m_qSciSourceCodeEditor, TQ_SIGNAL(textChanged()), this, TQ_SLOT(numberOfLinesChanged()));
|
|
|
|
|
numberOfLinesChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -423,7 +423,7 @@ bool MainWindow::initApplicationLanguage()
|
|
|
|
|
tqApp->installTranslator(m_uiGuiTranslator);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
connect(m_settings, SIGNAL(language(int)), this, SLOT(languageChanged(int)) );
|
|
|
|
|
connect(m_settings, TQ_SIGNAL(language(int)), this, TQ_SLOT(languageChanged(int)) );
|
|
|
|
|
|
|
|
|
|
return translationFileLoaded;
|
|
|
|
|
}
|
|
|
|
@ -441,8 +441,8 @@ void MainWindow::initIndenter()
|
|
|
|
|
m_centralSplitter->moveToFirst(m_indentHandler);
|
|
|
|
|
|
|
|
|
|
// If settings for the indenter have changed, let the main window know aboud it.
|
|
|
|
|
connect(m_indentHandler, SIGNAL(indenterSettingsChanged()), this,
|
|
|
|
|
SLOT(indentSettingsChangedSlot()));
|
|
|
|
|
connect(m_indentHandler, TQ_SIGNAL(indenterSettingsChanged()), this,
|
|
|
|
|
TQ_SLOT(indentSettingsChangedSlot()));
|
|
|
|
|
|
|
|
|
|
// Set this true, so the indenter is called at first program start
|
|
|
|
|
m_indentSettingsChanged = true;
|
|
|
|
@ -644,12 +644,12 @@ void MainWindow::updateSourceView()
|
|
|
|
|
|
|
|
|
|
if (m_previewToggled)
|
|
|
|
|
{
|
|
|
|
|
disconnect(m_qSciSourceCodeEditor, SIGNAL(textChanged()),
|
|
|
|
|
this, SLOT(sourceCodeChangedHelperSlot()));
|
|
|
|
|
disconnect(m_qSciSourceCodeEditor, TQ_SIGNAL(textChanged()),
|
|
|
|
|
this, TQ_SLOT(sourceCodeChangedHelperSlot()));
|
|
|
|
|
m_qSciSourceCodeEditor->setText(m_sourceViewContent);
|
|
|
|
|
m_previewToggled = false;
|
|
|
|
|
connect(m_qSciSourceCodeEditor, SIGNAL(textChanged()),
|
|
|
|
|
this, SLOT(sourceCodeChangedHelperSlot()));
|
|
|
|
|
connect(m_qSciSourceCodeEditor, TQ_SIGNAL(textChanged()),
|
|
|
|
|
this, TQ_SLOT(sourceCodeChangedHelperSlot()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///-- m_textEditVScrollBar->setValue(_textEditLastScrollPos);
|
|
|
|
@ -691,7 +691,7 @@ void MainWindow::turnHighlightOnOff(bool turnOn)
|
|
|
|
|
*/
|
|
|
|
|
void MainWindow::sourceCodeChangedHelperSlot()
|
|
|
|
|
{
|
|
|
|
|
TQTimer::singleShot(0, this, SLOT(sourceCodeChangedSlot()));
|
|
|
|
|
TQTimer::singleShot(0, this, TQ_SLOT(sourceCodeChangedSlot()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -1172,12 +1172,12 @@ void MainWindow::createEncodingMenu()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_encodingActionGroup->addTo(popupMenuEncoding);
|
|
|
|
|
connect(m_encodingActionGroup, SIGNAL(selected(TQAction*)),
|
|
|
|
|
this, SLOT(encodingChanged(TQAction*)));
|
|
|
|
|
connect(m_encodingActionGroup, TQ_SIGNAL(selected(TQAction*)),
|
|
|
|
|
this, TQ_SLOT(encodingChanged(TQAction*)));
|
|
|
|
|
|
|
|
|
|
m_saveEncodedActionGroup->addTo(popupMenuSaveEncoded);
|
|
|
|
|
connect(m_saveEncodedActionGroup, SIGNAL(selected(TQAction*)),
|
|
|
|
|
this, SLOT(saveAsOtherEncoding(TQAction*)));
|
|
|
|
|
connect(m_saveEncodedActionGroup, TQ_SIGNAL(selected(TQAction*)),
|
|
|
|
|
this, TQ_SLOT(saveAsOtherEncoding(TQAction*)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -1254,8 +1254,8 @@ void MainWindow::createHighlighterMenu()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_highlighterActionGroup->addTo(popupMenuHighlighter);
|
|
|
|
|
connect(m_highlighterActionGroup , SIGNAL(selected(TQAction*)),
|
|
|
|
|
m_highlighter, SLOT(setHighlighterByAction(TQAction*)));
|
|
|
|
|
connect(m_highlighterActionGroup , TQ_SIGNAL(selected(TQAction*)),
|
|
|
|
|
m_highlighter, TQ_SLOT(setHighlighterByAction(TQAction*)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|