From b530d99bf1c35b35a024e119cef746f74475d2b9 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Mon, 9 Feb 2015 17:54:27 +0100 Subject: [PATCH] Renamed the studio startup settings dialog to avoid name conflict with the core plugin's settings dialog. --HG-- branch : hotfix --- code/studio/src/CMakeLists.txt | 4 +- code/studio/src/main.cpp | 4 +- .../studio/src/plugins/core/settings_dialog.h | 2 +- ...gs_dialog.cpp => startup_settings_dlg.cpp} | 42 +++++++++---------- ...ttings_dialog.h => startup_settings_dlg.h} | 12 +++--- ...ings_dialog.ui => startup_settings_dlg.ui} | 4 +- 6 files changed, 34 insertions(+), 34 deletions(-) rename code/studio/src/{settings_dialog.cpp => startup_settings_dlg.cpp} (84%) rename code/studio/src/{settings_dialog.h => startup_settings_dlg.h} (84%) rename code/studio/src/{settings_dialog.ui => startup_settings_dlg.ui} (95%) diff --git a/code/studio/src/CMakeLists.txt b/code/studio/src/CMakeLists.txt index 9bc071bf2..510f0f93b 100644 --- a/code/studio/src/CMakeLists.txt +++ b/code/studio/src/CMakeLists.txt @@ -11,7 +11,7 @@ FILE(GLOB STUDIO_SRC extension_system/*.h SET(STUDIO_HDR extension_system/iplugin_manager.h extension_system/plugin_manager.h - settings_dialog.h + startup_settings_dlg.h splash_screen.h pm_watcher.h ) @@ -22,7 +22,7 @@ SET(STUDIO_TS translations/object_viewer_qt_en.ts translations/object_viewer_qt_de.ts translations/object_viewer_qt_ru.ts) -SET(STUDIO_PLUGIN_UIS settings_dialog.ui ) +SET(STUDIO_PLUGIN_UIS startup_settings_dlg.ui ) SET(QT_USE_QTGUI TRUE) SET(QT_USE_QTOPENGL TRUE) diff --git a/code/studio/src/main.cpp b/code/studio/src/main.cpp index e758037c0..dc1e7efb6 100644 --- a/code/studio/src/main.cpp +++ b/code/studio/src/main.cpp @@ -41,7 +41,7 @@ #include #include -#include "settings_dialog.h" +#include "startup_settings_dlg.h" #include "splash_screen.h" #include "pm_watcher.h" @@ -160,7 +160,7 @@ int main(int argc, char **argv) { settings->setValue( "FirstRun", false ); - SettingsDialog sd; + StartupSettingsDlg sd; sd.setSettings( settings ); sd.load(); sd.exec(); diff --git a/code/studio/src/plugins/core/settings_dialog.h b/code/studio/src/plugins/core/settings_dialog.h index a90f88b18..9e1c86444 100644 --- a/code/studio/src/plugins/core/settings_dialog.h +++ b/code/studio/src/plugins/core/settings_dialog.h @@ -19,7 +19,7 @@ #ifndef SETTINGS_DIALOG_H #define SETTINGS_DIALOG_H -#include "../core/ui_settings_dialog.h" +#include "ui_settings_dialog.h" // Qt includes #include diff --git a/code/studio/src/settings_dialog.cpp b/code/studio/src/startup_settings_dlg.cpp similarity index 84% rename from code/studio/src/settings_dialog.cpp rename to code/studio/src/startup_settings_dlg.cpp index df2718b9b..645df7040 100644 --- a/code/studio/src/settings_dialog.cpp +++ b/code/studio/src/startup_settings_dlg.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see . -#include "settings_dialog.h" +#include "startup_settings_dlg.h" #include #include #include @@ -32,7 +32,7 @@ int findListItem( QListWidget *l, const QString &s ) return -1; } -SettingsDialog::SettingsDialog( QDialog *parent ) : +StartupSettingsDlg::StartupSettingsDlg( QDialog *parent ) : QDialog( parent ) { setupUi( this ); @@ -40,11 +40,11 @@ QDialog( parent ) settings = NULL; } -SettingsDialog::~SettingsDialog() +StartupSettingsDlg::~StartupSettingsDlg() { } -void SettingsDialog::load() +void StartupSettingsDlg::load() { pluginsLE->setText( settings->value( "PluginPath" ).toString() ); @@ -82,7 +82,7 @@ void SettingsDialog::load() settings->endGroup(); } -void SettingsDialog::saveSearchPaths() +void StartupSettingsDlg::saveSearchPaths() { QStringList l; for( int i = 0; i < searchLW->count(); i++ ) @@ -93,7 +93,7 @@ void SettingsDialog::saveSearchPaths() settings->setValue( "SearchPaths", l ); } -void SettingsDialog::saveRecursivePaths() +void StartupSettingsDlg::saveRecursivePaths() { QStringList l; for( int i = 0; i < recursiveLW->count(); i++ ) @@ -104,7 +104,7 @@ void SettingsDialog::saveRecursivePaths() settings->setValue( "RecursiveSearchPathes", l ); } -void SettingsDialog::save() +void StartupSettingsDlg::save() { settings->setValue( "PluginPath", pluginsLE->text() ); @@ -123,59 +123,59 @@ void SettingsDialog::save() settings->sync(); } -void SettingsDialog::accept() +void StartupSettingsDlg::accept() { save(); QDialog::accept(); } -void SettingsDialog::reject() +void StartupSettingsDlg::reject() { QDialog::reject(); } -void SettingsDialog::onOKClicked() +void StartupSettingsDlg::onOKClicked() { accept(); } -void SettingsDialog::onCancelClicked() +void StartupSettingsDlg::onCancelClicked() { reject(); } -void SettingsDialog::onPluginBClicked() +void StartupSettingsDlg::onPluginBClicked() { QString p = QFileDialog::getExistingDirectory( this, tr( "Plugins directory" ), "" ); pluginsLE->setText( p ); } -void SettingsDialog::onSheetsBClicked() +void StartupSettingsDlg::onSheetsBClicked() { QString p = QFileDialog::getExistingDirectory( this, tr( "Sheets directory" ), "" ); sheetsLE->setText( p ); } -void SettingsDialog::onAssetsBClicked() +void StartupSettingsDlg::onAssetsBClicked() { QString p = QFileDialog::getExistingDirectory( this, tr( "Assets directory" ), "" ); assetsLE->setText( p ); } -void SettingsDialog::onPrimitivesBClicked() +void StartupSettingsDlg::onPrimitivesBClicked() { QString p = QFileDialog::getExistingDirectory( this, tr( "Primitives directory" ), "" ); primitivesLE->setText( p ); } -void SettingsDialog::onLigoBClicked() +void StartupSettingsDlg::onLigoBClicked() { QString p; p = QFileDialog::getOpenFileName( this, tr( "LIGO config file" ), "" ); ligoLE->setText( p ); } -void SettingsDialog::onPathAddClicked() +void StartupSettingsDlg::onPathAddClicked() { QString p = QFileDialog::getExistingDirectory( this, tr( "Search path" ), "" ); if( p.isEmpty() ) @@ -187,7 +187,7 @@ void SettingsDialog::onPathAddClicked() searchLW->addItem( p ); } -void SettingsDialog::onPathRemoveClicked() +void StartupSettingsDlg::onPathRemoveClicked() { QListWidgetItem *i = searchLW->currentItem(); if( i == NULL ) @@ -196,7 +196,7 @@ void SettingsDialog::onPathRemoveClicked() delete i; } -void SettingsDialog::onRecursiveAddClicked() +void StartupSettingsDlg::onRecursiveAddClicked() { QString p = QFileDialog::getExistingDirectory( this, tr( "Recursive search path" ), "" ); if( p.isEmpty() ) @@ -208,7 +208,7 @@ void SettingsDialog::onRecursiveAddClicked() recursiveLW->addItem( p ); } -void SettingsDialog::onRecursiveRemoveClicked() +void StartupSettingsDlg::onRecursiveRemoveClicked() { QListWidgetItem *i = recursiveLW->currentItem(); if( i == NULL ) @@ -218,7 +218,7 @@ void SettingsDialog::onRecursiveRemoveClicked() } -void SettingsDialog::setupConnections() +void StartupSettingsDlg::setupConnections() { connect( bb, SIGNAL( accepted() ), this, SLOT( onOKClicked() ) ); connect( bb, SIGNAL( rejected() ), this, SLOT( onCancelClicked() ) ); diff --git a/code/studio/src/settings_dialog.h b/code/studio/src/startup_settings_dlg.h similarity index 84% rename from code/studio/src/settings_dialog.h rename to code/studio/src/startup_settings_dlg.h index 173ba37d4..49dd01ef7 100644 --- a/code/studio/src/settings_dialog.h +++ b/code/studio/src/startup_settings_dlg.h @@ -14,19 +14,19 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#ifndef SETTINGS_DIALOG_H -#define SETTINGS_DIALOG_H +#ifndef STARTUP_SETTINGS_DIALOG_H +#define STARTUP_SETTINGS_DIALOG_H -#include "ui_settings_dialog.h" +#include "ui_startup_settings_dlg.h" class QSettings; -class SettingsDialog : public QDialog, public Ui::SettingsDialog +class StartupSettingsDlg : public QDialog, public Ui::StartupSettingsDlg { Q_OBJECT public: - SettingsDialog( QDialog *parent = NULL ); - ~SettingsDialog(); + StartupSettingsDlg( QDialog *parent = NULL ); + ~StartupSettingsDlg(); void setSettings( QSettings *s ){ settings = s; } diff --git a/code/studio/src/settings_dialog.ui b/code/studio/src/startup_settings_dlg.ui similarity index 95% rename from code/studio/src/settings_dialog.ui rename to code/studio/src/startup_settings_dlg.ui index 2fb6151d3..5f125ed14 100644 --- a/code/studio/src/settings_dialog.ui +++ b/code/studio/src/startup_settings_dlg.ui @@ -1,7 +1,7 @@ - SettingsDialog - + StartupSettingsDlg + Qt::ApplicationModal