diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-04-05 23:18:18 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-04-10 17:36:57 +0900 |
commit | ec3911b99cb9095c9f25d3f31535fb8713bd8509 (patch) | |
tree | 3c64524cc548e6e5b15c18ee55380cd1cd2b887f /src/UiGuiInfoDialog.cpp | |
parent | 4f7c336af2beeba0d370d2677801351fa94c5885 (diff) | |
download | universal-indent-gui-tqt-r14.1.4.tar.gz universal-indent-gui-tqt-r14.1.4.zip |
Add dialog to display information about files and paths.r14.1.4
This resolves issue #6.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 0550152e172efec0828bb227f9433fd74a532b04)
Diffstat (limited to 'src/UiGuiInfoDialog.cpp')
-rw-r--r-- | src/UiGuiInfoDialog.cpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/UiGuiInfoDialog.cpp b/src/UiGuiInfoDialog.cpp new file mode 100644 index 0000000..4c05d7a --- /dev/null +++ b/src/UiGuiInfoDialog.cpp @@ -0,0 +1,67 @@ +/*************************************************************************** +* 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 "config.h" + +#include "UiGuiInfoDialog.h" +#include "IndentHandler.h" +#include "MainWindow.h" +#include "SettingsPaths.h" + +#include <tqlineedit.h> +#include <tqpixmap.h> +#include <tqtabwidget.h> + +/* + \class UiGuiInfoDialog + \brief Displays a dialog window with information about the current file + and about the paths used by the application +*/ + +UiGuiInfoDialog::UiGuiInfoDialog(TQWidget *parent, const IndentHandler *indenter) : + UiGuiInfoDialogBase(parent), m_mainWindow((const MainWindow*)parent), + m_indentHandler(indenter) +{ + // For icon setup + const TQString ICONS_PATH(APP_ICONS_PATH); + // Application icon + setIcon(TQPixmap(ICONS_PATH + "info.png")); + + tabWidget->setTabIconSet(tabFile, TQPixmap(ICONS_PATH + "accessories-text-editor.png")); + tabWidget->setTabIconSet(tabPaths, TQPixmap(ICONS_PATH + "syntax-highlight.png")); +} + +/* + \brief Displays the dialog by calling the dialogs exec function. + */ +void UiGuiInfoDialog::showDialog() +{ + // Populate all dialog objects + leFilename->setText(m_mainWindow->m_currentSourceFile); + leConfigFilename->setText(m_indentHandler->m_indenterConfigFilename); + leIndenter->setText(m_indentHandler->m_indenterName); + + leApplicationPath->setText(SettingsPaths::getApplicationBinaryPath()); + leSettingsPath->setText(SettingsPaths::getSettingsPath()); + leGlobalFilesPath->setText(SettingsPaths::getGlobalFilesPath()); + leIndentersPath->setText(SettingsPaths::getIndenterPath()); + leTempPath->setText(SettingsPaths::getTempPath()); + + // Execute the dialog. + exec(); +} + +#include "UiGuiInfoDialog.moc" |