From 3a5f83729065299a7456d49a2b1f044ee360fae1 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 12 Oct 2020 19:14:01 +0200 Subject: [PATCH] Rename dialog files --- apps/OpenSpace/ext/launcher/CMakeLists.txt | 78 +++++++++---------- .../ext/launcher/include/launcherwindow.h | 2 +- .../additionalscriptsdialog.h} | 4 +- .../{assets.h => profile/assetsdialog.h} | 4 +- .../include/{ => profile}/assettreeitem.h | 0 .../include/{ => profile}/assettreemodel.h | 0 .../{camera.h => profile/cameradialog.h} | 4 +- .../deltatimesdialog.h} | 4 +- .../keybindingsdialog.h} | 4 +- .../marknodesdialog.h} | 4 +- .../include/{meta.h => profile/metadialog.h} | 4 +- .../{modules.h => profile/modulesdialog.h} | 4 +- .../include/{ => profile}/profileedit.h | 40 +++++----- .../propertiesdialog.h} | 5 +- .../include/{ => profile}/timedialog.h | 4 +- .../ext/launcher/resources/qss/launcher.qss | 16 ++-- .../ext/launcher/src/launcherwindow.cpp | 1 - .../additionalscriptsdialog.cpp} | 11 +-- .../{assets.cpp => profile/assetsdialog.cpp} | 24 +++--- .../src/{ => profile}/assettreeitem.cpp | 2 +- .../src/{ => profile}/assettreemodel.cpp | 4 +- .../{camera.cpp => profile/cameradialog.cpp} | 22 +++--- .../deltatimesdialog.cpp} | 54 ++++++------- .../keybindingsdialog.cpp} | 55 +++++++------ .../marknodesdialog.cpp} | 30 ++++--- .../src/{meta.cpp => profile/metadialog.cpp} | 10 +-- .../modulesdialog.cpp} | 50 ++++++------ .../src/{ => profile}/profileedit.cpp | 25 +++--- .../propertiesdialog.cpp} | 59 ++++++++------ .../launcher/src/{ => profile}/timedialog.cpp | 16 ++-- 30 files changed, 290 insertions(+), 250 deletions(-) rename apps/OpenSpace/ext/launcher/include/{additionalscripts.h => profile/additionalscriptsdialog.h} (95%) rename apps/OpenSpace/ext/launcher/include/{assets.h => profile/assetsdialog.h} (96%) rename apps/OpenSpace/ext/launcher/include/{ => profile}/assettreeitem.h (100%) rename apps/OpenSpace/ext/launcher/include/{ => profile}/assettreemodel.h (100%) rename apps/OpenSpace/ext/launcher/include/{camera.h => profile/cameradialog.h} (97%) rename apps/OpenSpace/ext/launcher/include/{deltatimes.h => profile/deltatimesdialog.h} (97%) rename apps/OpenSpace/ext/launcher/include/{keybindings.h => profile/keybindingsdialog.h} (97%) rename apps/OpenSpace/ext/launcher/include/{marknodes.h => profile/marknodesdialog.h} (96%) rename apps/OpenSpace/ext/launcher/include/{meta.h => profile/metadialog.h} (96%) rename apps/OpenSpace/ext/launcher/include/{modules.h => profile/modulesdialog.h} (97%) rename apps/OpenSpace/ext/launcher/include/{ => profile}/profileedit.h (89%) rename apps/OpenSpace/ext/launcher/include/{properties.h => profile/propertiesdialog.h} (97%) rename apps/OpenSpace/ext/launcher/include/{ => profile}/timedialog.h (96%) rename apps/OpenSpace/ext/launcher/src/{additionalscripts.cpp => profile/additionalscriptsdialog.cpp} (91%) rename apps/OpenSpace/ext/launcher/src/{assets.cpp => profile/assetsdialog.cpp} (93%) rename apps/OpenSpace/ext/launcher/src/{ => profile}/assettreeitem.cpp (99%) rename apps/OpenSpace/ext/launcher/src/{ => profile}/assettreemodel.cpp (99%) rename apps/OpenSpace/ext/launcher/src/{camera.cpp => profile/cameradialog.cpp} (97%) rename apps/OpenSpace/ext/launcher/src/{deltatimes.cpp => profile/deltatimesdialog.cpp} (89%) rename apps/OpenSpace/ext/launcher/src/{keybindings.cpp => profile/keybindingsdialog.cpp} (92%) rename apps/OpenSpace/ext/launcher/src/{marknodes.cpp => profile/marknodesdialog.cpp} (87%) rename apps/OpenSpace/ext/launcher/src/{meta.cpp => profile/metadialog.cpp} (96%) rename apps/OpenSpace/ext/launcher/src/{modules.cpp => profile/modulesdialog.cpp} (91%) rename apps/OpenSpace/ext/launcher/src/{ => profile}/profileedit.cpp (97%) rename apps/OpenSpace/ext/launcher/src/{properties.cpp => profile/propertiesdialog.cpp} (88%) rename apps/OpenSpace/ext/launcher/src/{ => profile}/timedialog.cpp (95%) diff --git a/apps/OpenSpace/ext/launcher/CMakeLists.txt b/apps/OpenSpace/ext/launcher/CMakeLists.txt index 0bd8ef4f68..14ae92bd01 100644 --- a/apps/OpenSpace/ext/launcher/CMakeLists.txt +++ b/apps/OpenSpace/ext/launcher/CMakeLists.txt @@ -25,39 +25,39 @@ include(${OPENSPACE_CMAKE_EXT_DIR}/set_openspace_compile_settings.cmake) set(HEADER_FILES - include/additionalscripts.h - include/assets.h - include/assettreeitem.h - include/assettreemodel.h - include/camera.h - include/deltatimes.h include/filesystemaccess.h - include/keybindings.h include/launcherwindow.h - include/marknodes.h - include/meta.h - include/modules.h - include/timedialog.h - include/profileedit.h - include/properties.h + include/profile/additionalscriptsdialog.h + include/profile/assetsdialog.h + include/profile/assettreeitem.h + include/profile/assettreemodel.h + include/profile/cameradialog.h + include/profile/deltatimesdialog.h + include/profile/keybindingsdialog.h + include/profile/marknodesdialog.h + include/profile/metadialog.h + include/profile/modulesdialog.h + include/profile/timedialog.h + include/profile/profileedit.h + include/profile/propertiesdialog.h ) set(SOURCE_FILES - src/additionalscripts.cpp - src/assets.cpp - src/assettreeitem.cpp - src/assettreemodel.cpp - src/camera.cpp - src/deltatimes.cpp - src/filesystemaccess.cpp - src/keybindings.cpp src/launcherwindow.cpp - src/marknodes.cpp - src/meta.cpp - src/modules.cpp - src/timedialog.cpp - src/profileedit.cpp - src/properties.cpp + src/filesystemaccess.cpp + src/profile/additionalscriptsdialog.cpp + src/profile/assetsdialog.cpp + src/profile/assettreeitem.cpp + src/profile/assettreemodel.cpp + src/profile/cameradialog.cpp + src/profile/deltatimesdialog.cpp + src/profile/keybindingsdialog.cpp + src/profile/marknodesdialog.cpp + src/profile/metadialog.cpp + src/profile/modulesdialog.cpp + src/profile/timedialog.cpp + src/profile/profileedit.cpp + src/profile/propertiesdialog.cpp ) find_package(Qt5 COMPONENTS Widgets REQUIRED) @@ -65,19 +65,19 @@ find_package(Qt5 COMPONENTS Widgets REQUIRED) set(MOC_FILES "") qt5_wrap_cpp( MOC_FILES - include/additionalscripts.h - include/assets.h - include/assettreemodel.h - include/camera.h - include/deltatimes.h - include/keybindings.h include/launcherwindow.h - include/marknodes.h - include/meta.h - include/modules.h - include/timedialog.h - include/profileedit.h - include/properties.h + include/profile/additionalscriptsdialog.h + include/profile/assetsdialog.h + include/profile/assettreemodel.h + include/profile/cameradialog.h + include/profile/deltatimesdialog.h + include/profile/keybindingsdialog.h + include/profile/marknodesdialog.h + include/profile/metadialog.h + include/profile/modulesdialog.h + include/profile/timedialog.h + include/profile/profileedit.h + include/profile/propertiesdialog.h ) set(RESOURCE_FILES "") diff --git a/apps/OpenSpace/ext/launcher/include/launcherwindow.h b/apps/OpenSpace/ext/launcher/include/launcherwindow.h index 2a84a3d6db..4b69c611e2 100644 --- a/apps/OpenSpace/ext/launcher/include/launcherwindow.h +++ b/apps/OpenSpace/ext/launcher/include/launcherwindow.h @@ -28,7 +28,7 @@ #include #include -#include "profileedit.h" +#include "profile/profileedit.h" #include "filesystemaccess.h" #include #include diff --git a/apps/OpenSpace/ext/launcher/include/additionalscripts.h b/apps/OpenSpace/ext/launcher/include/profile/additionalscriptsdialog.h similarity index 95% rename from apps/OpenSpace/ext/launcher/include/additionalscripts.h rename to apps/OpenSpace/ext/launcher/include/profile/additionalscriptsdialog.h index 99ba7c2e72..b0c747f3e3 100644 --- a/apps/OpenSpace/ext/launcher/include/additionalscripts.h +++ b/apps/OpenSpace/ext/launcher/include/profile/additionalscriptsdialog.h @@ -31,7 +31,7 @@ namespace openspace { class Profile; } class QTextEdit; -class AdditionalScripts : public QDialog { +class AdditionalScriptsDialog : public QDialog { Q_OBJECT public: /** @@ -41,7 +41,7 @@ public: * new or imported profile. * \param parent Pointer to parent Qt widget */ - explicit AdditionalScripts(openspace::Profile* profile, QWidget* parent); + AdditionalScriptsDialog(openspace::Profile* profile, QWidget* parent); private slots: void parseScript(); diff --git a/apps/OpenSpace/ext/launcher/include/assets.h b/apps/OpenSpace/ext/launcher/include/profile/assetsdialog.h similarity index 96% rename from apps/OpenSpace/ext/launcher/include/assets.h rename to apps/OpenSpace/ext/launcher/include/profile/assetsdialog.h index bb598c78db..7082f6c8af 100644 --- a/apps/OpenSpace/ext/launcher/include/assets.h +++ b/apps/OpenSpace/ext/launcher/include/profile/assetsdialog.h @@ -35,7 +35,7 @@ namespace openspace { class Profile; } class QTextEdit; class QTreeView; -class Assets : public QDialog { +class AssetsDialog : public QDialog { Q_OBJECT public: /** @@ -48,7 +48,7 @@ public: * in class #assetTreeModel) * \param parent Pointer to parent Qt widget */ - explicit Assets(openspace::Profile* profile, const std::string reportAssets, + AssetsDialog(openspace::Profile* profile, const std::string reportAssets, QWidget* parent); /** diff --git a/apps/OpenSpace/ext/launcher/include/assettreeitem.h b/apps/OpenSpace/ext/launcher/include/profile/assettreeitem.h similarity index 100% rename from apps/OpenSpace/ext/launcher/include/assettreeitem.h rename to apps/OpenSpace/ext/launcher/include/profile/assettreeitem.h diff --git a/apps/OpenSpace/ext/launcher/include/assettreemodel.h b/apps/OpenSpace/ext/launcher/include/profile/assettreemodel.h similarity index 100% rename from apps/OpenSpace/ext/launcher/include/assettreemodel.h rename to apps/OpenSpace/ext/launcher/include/profile/assettreemodel.h diff --git a/apps/OpenSpace/ext/launcher/include/camera.h b/apps/OpenSpace/ext/launcher/include/profile/cameradialog.h similarity index 97% rename from apps/OpenSpace/ext/launcher/include/camera.h rename to apps/OpenSpace/ext/launcher/include/profile/cameradialog.h index 6ddc07e532..4b172e7e99 100644 --- a/apps/OpenSpace/ext/launcher/include/camera.h +++ b/apps/OpenSpace/ext/launcher/include/profile/cameradialog.h @@ -33,7 +33,7 @@ class QLabel; class QLineEdit; class QTabWidget; -class Camera : public QDialog { +class CameraDialog : public QDialog { Q_OBJECT public: /** @@ -43,7 +43,7 @@ public: * new or imported profile. * \param parent Pointer to parent Qt widget (optional) */ - explicit Camera(openspace::Profile* profile, QWidget* parent); + CameraDialog(openspace::Profile* profile, QWidget* parent); private slots: void approved(); diff --git a/apps/OpenSpace/ext/launcher/include/deltatimes.h b/apps/OpenSpace/ext/launcher/include/profile/deltatimesdialog.h similarity index 97% rename from apps/OpenSpace/ext/launcher/include/deltatimes.h rename to apps/OpenSpace/ext/launcher/include/profile/deltatimesdialog.h index 7a6fa5fb89..e61d4c1a9e 100644 --- a/apps/OpenSpace/ext/launcher/include/deltatimes.h +++ b/apps/OpenSpace/ext/launcher/include/profile/deltatimesdialog.h @@ -35,7 +35,7 @@ class QListWidget; class QLineEdit; class QPushButton; -class DeltaTimes : public QDialog { +class DeltaTimesDialog : public QDialog { Q_OBJECT public: /** @@ -45,7 +45,7 @@ public: * new or imported profile. * \param parent Pointer to parent Qt widget (optional) */ - DeltaTimes(openspace::Profile* profile, QWidget* parent); + DeltaTimesDialog(openspace::Profile* profile, QWidget* parent); /** * Returns a text summary of the delta time list for display purposes diff --git a/apps/OpenSpace/ext/launcher/include/keybindings.h b/apps/OpenSpace/ext/launcher/include/profile/keybindingsdialog.h similarity index 97% rename from apps/OpenSpace/ext/launcher/include/keybindings.h rename to apps/OpenSpace/ext/launcher/include/profile/keybindingsdialog.h index 952b7b8863..1c3ef4d960 100644 --- a/apps/OpenSpace/ext/launcher/include/keybindings.h +++ b/apps/OpenSpace/ext/launcher/include/profile/keybindingsdialog.h @@ -39,7 +39,7 @@ class QListWidget; class QLabel; class QPushButton; -class Keybindings : public QDialog { +class KeybindingsDialog : public QDialog { Q_OBJECT public: /** @@ -49,7 +49,7 @@ public: * new or imported profile. * \param parent Pointer to parent Qt widget (optional) */ - Keybindings(openspace::Profile* profile, QWidget* parent); + KeybindingsDialog(openspace::Profile* profile, QWidget* parent); /** * Handles keypress while the Qt dialog window is open diff --git a/apps/OpenSpace/ext/launcher/include/marknodes.h b/apps/OpenSpace/ext/launcher/include/profile/marknodesdialog.h similarity index 96% rename from apps/OpenSpace/ext/launcher/include/marknodes.h rename to apps/OpenSpace/ext/launcher/include/profile/marknodesdialog.h index e18dd7d4c9..39f62b0500 100644 --- a/apps/OpenSpace/ext/launcher/include/marknodes.h +++ b/apps/OpenSpace/ext/launcher/include/profile/marknodesdialog.h @@ -34,7 +34,7 @@ class QListWidget; class QListWidgetItem; class QPushButton; -class MarkNodes : public QDialog { +class MarkNodesDialog : public QDialog { Q_OBJECT public: /** @@ -44,7 +44,7 @@ public: * new or imported profile. * \param parent Pointer to parent Qt widget */ - MarkNodes(openspace::Profile* profile, QWidget* parent); + MarkNodesDialog(openspace::Profile* profile, QWidget* parent); /** * Handles keypress while the Qt dialog window is open diff --git a/apps/OpenSpace/ext/launcher/include/meta.h b/apps/OpenSpace/ext/launcher/include/profile/metadialog.h similarity index 96% rename from apps/OpenSpace/ext/launcher/include/meta.h rename to apps/OpenSpace/ext/launcher/include/profile/metadialog.h index b9c5630ce6..febe61d023 100644 --- a/apps/OpenSpace/ext/launcher/include/meta.h +++ b/apps/OpenSpace/ext/launcher/include/profile/metadialog.h @@ -32,7 +32,7 @@ namespace openspace { class Profile; } class QLineEdit; class QTextEdit; -class Meta : public QDialog { +class MetaDialog : public QDialog { Q_OBJECT public: @@ -43,7 +43,7 @@ public: * new or imported profile. * \param parent Pointer to parent Qt widget */ - explicit Meta(openspace::Profile* profile, QWidget* parent); + MetaDialog(openspace::Profile* profile, QWidget* parent); public slots: void save(); diff --git a/apps/OpenSpace/ext/launcher/include/modules.h b/apps/OpenSpace/ext/launcher/include/profile/modulesdialog.h similarity index 97% rename from apps/OpenSpace/ext/launcher/include/modules.h rename to apps/OpenSpace/ext/launcher/include/profile/modulesdialog.h index a462178683..0a40111cea 100644 --- a/apps/OpenSpace/ext/launcher/include/modules.h +++ b/apps/OpenSpace/ext/launcher/include/profile/modulesdialog.h @@ -35,7 +35,7 @@ class QLineEdit; class QListWidget; class QPushButton; -class Modules : public QDialog { +class ModulesDialog : public QDialog { Q_OBJECT public: /** @@ -45,7 +45,7 @@ public: * new or imported profile. * \param parent Pointer to parent Qt widget */ - Modules(openspace::Profile* profiles, QWidget* parent); + ModulesDialog(openspace::Profile* profiles, QWidget* parent); /** * Handles keypress while the Qt dialog window is open diff --git a/apps/OpenSpace/ext/launcher/include/profileedit.h b/apps/OpenSpace/ext/launcher/include/profile/profileedit.h similarity index 89% rename from apps/OpenSpace/ext/launcher/include/profileedit.h rename to apps/OpenSpace/ext/launcher/include/profile/profileedit.h index b207d1f6bb..3690d0a42f 100644 --- a/apps/OpenSpace/ext/launcher/include/profileedit.h +++ b/apps/OpenSpace/ext/launcher/include/profile/profileedit.h @@ -27,16 +27,16 @@ #include #include -#include "meta.h" -#include "properties.h" -#include "modules.h" -#include "keybindings.h" -#include "assets.h" -#include "timedialog.h" -#include "additionalscripts.h" -#include "deltatimes.h" -#include "camera.h" -#include "marknodes.h" +#include "profile/metadialog.h" +#include "profile/propertiesdialog.h" +#include "profile/modulesdialog.h" +#include "profile/keybindingsdialog.h" +#include "profile/assetsdialog.h" +#include "profile/timedialog.h" +#include "profile/additionalscriptsdialog.h" +#include "profile/deltatimesdialog.h" +#include "profile/cameradialog.h" +#include "profile/marknodesdialog.h" #include class ProfileEdit : public QDialog { @@ -116,16 +116,16 @@ private: bool isReadOnly(std::string profileToSave); QWidget* _parent; - Meta* _meta; - Properties* _properties; - Modules* _modules; - Keybindings* _keybindings; - Assets* _assets; - Time* _time; - AdditionalScripts* _addedScripts; - DeltaTimes* _deltaTimes; - Camera* _camera; - MarkNodes* _markNodes; + MetaDialog* _meta; + PropertiesDialog* _properties; + ModulesDialog* _modules; + KeybindingsDialog* _keybindings; + AssetsDialog* _assets; + TimeDialog* _time; + AdditionalScriptsDialog* _addedScripts; + DeltaTimesDialog* _deltaTimes; + CameraDialog* _camera; + MarkNodesDialog* _markNodes; openspace::Profile* _pData; const std::string _reportedAssets; bool _saveSelected = false; diff --git a/apps/OpenSpace/ext/launcher/include/properties.h b/apps/OpenSpace/ext/launcher/include/profile/propertiesdialog.h similarity index 97% rename from apps/OpenSpace/ext/launcher/include/properties.h rename to apps/OpenSpace/ext/launcher/include/profile/propertiesdialog.h index 05194fb974..4f71c815ee 100644 --- a/apps/OpenSpace/ext/launcher/include/properties.h +++ b/apps/OpenSpace/ext/launcher/include/profile/propertiesdialog.h @@ -36,9 +36,8 @@ class QLineEdit; class QListWidget; class QPushButton; -class Properties : public QDialog { +class PropertiesDialog : public QDialog { Q_OBJECT - public: /** * Constructor for properties class @@ -47,7 +46,7 @@ public: * new or imported profile. * \param parent Pointer to parent Qt widget (optional) */ - Properties(openspace::Profile* profile, QWidget* parent); + PropertiesDialog(openspace::Profile* profile, QWidget* parent); /** * Handles keypress while the Qt dialog window is open diff --git a/apps/OpenSpace/ext/launcher/include/timedialog.h b/apps/OpenSpace/ext/launcher/include/profile/timedialog.h similarity index 96% rename from apps/OpenSpace/ext/launcher/include/timedialog.h rename to apps/OpenSpace/ext/launcher/include/profile/timedialog.h index 08dc813909..e2447a3840 100644 --- a/apps/OpenSpace/ext/launcher/include/timedialog.h +++ b/apps/OpenSpace/ext/launcher/include/profile/timedialog.h @@ -34,7 +34,7 @@ class QDateTimeEdit; class QLabel; class QLineEdit; -class Time : public QDialog { +class TimeDialog : public QDialog { Q_OBJECT public: /** @@ -44,7 +44,7 @@ public: * new or imported profile. * \param parent Pointer to parent Qt widget (optional) */ - Time(openspace::Profile* profile, QWidget* parent); + TimeDialog(openspace::Profile* profile, QWidget* parent); public slots: void enableAccordingToType(int); diff --git a/apps/OpenSpace/ext/launcher/resources/qss/launcher.qss b/apps/OpenSpace/ext/launcher/resources/qss/launcher.qss index 20219123c7..b8dc05614c 100644 --- a/apps/OpenSpace/ext/launcher/resources/qss/launcher.qss +++ b/apps/OpenSpace/ext/launcher/resources/qss/launcher.qss @@ -65,44 +65,48 @@ LauncherWindow QPushButton#small { * ProfileEdit */ ProfileEdit QTextEdit { - min-width: 25em; + min-width: 30em; } ProfileEdit QLabel { font-size: 14px; } +ProfileEdit QLabel#profile { + font-weight: bold; +} + /* * Properties */ -Properties QListWidget { +PropertiesDialog QListWidget { min-width: 40em; } /* * Assets */ -Assets QTreeView { +AssetsDialog QTreeView { min-width: 40em; } /* * Keybindings */ -Keybindings QListWidget { +KeybindingsDialog QListWidget { min-width: 40em; } /* * DeltaTimes */ -DeltaTimes QListWidget { +DeltaTimesDialog QListWidget { min-width: 40em; } /* * Camera */ - Camera QLabel#error-message { + CameraDialog QLabel#error-message { min-width: 10em; } diff --git a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp index ba5e84ca0e..4175ad2418 100644 --- a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp +++ b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp @@ -24,7 +24,6 @@ #include #include "launcherwindow.h" -#include "profileedit.h" #include #include #include "filesystemaccess.h" diff --git a/apps/OpenSpace/ext/launcher/src/additionalscripts.cpp b/apps/OpenSpace/ext/launcher/src/profile/additionalscriptsdialog.cpp similarity index 91% rename from apps/OpenSpace/ext/launcher/src/additionalscripts.cpp rename to apps/OpenSpace/ext/launcher/src/profile/additionalscriptsdialog.cpp index 01b2cba0d5..fba6752037 100644 --- a/apps/OpenSpace/ext/launcher/src/additionalscripts.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/additionalscriptsdialog.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include "additionalscripts.h" +#include "profile/additionalscriptsdialog.h" #include #include @@ -31,7 +31,8 @@ #include #include -AdditionalScripts::AdditionalScripts(openspace::Profile* profile, QWidget *parent) +AdditionalScriptsDialog::AdditionalScriptsDialog(openspace::Profile* profile, + QWidget* parent) : QDialog(parent) , _profile(profile) { @@ -59,11 +60,11 @@ AdditionalScripts::AdditionalScripts(openspace::Profile* profile, QWidget *paren buttons->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Cancel); connect( buttons, &QDialogButtonBox::accepted, - this, &AdditionalScripts::parseScript + this, &AdditionalScriptsDialog::parseScript ); connect( buttons, &QDialogButtonBox::rejected, - this, &AdditionalScripts::reject + this, &AdditionalScriptsDialog::reject ); layout->addWidget(buttons); } @@ -77,7 +78,7 @@ AdditionalScripts::AdditionalScripts(openspace::Profile* profile, QWidget *paren _textScripts->moveCursor(QTextCursor::MoveOperation::End); } -void AdditionalScripts::parseScript() { +void AdditionalScriptsDialog::parseScript() { std::vector tmpMultilineStringToVector; std::istringstream iss(_textScripts->toPlainText().toUtf8().constData()); while (!iss.eof()) { diff --git a/apps/OpenSpace/ext/launcher/src/assets.cpp b/apps/OpenSpace/ext/launcher/src/profile/assetsdialog.cpp similarity index 93% rename from apps/OpenSpace/ext/launcher/src/assets.cpp rename to apps/OpenSpace/ext/launcher/src/profile/assetsdialog.cpp index fe0fd2aca6..03713c2e91 100644 --- a/apps/OpenSpace/ext/launcher/src/assets.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/assetsdialog.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include "assets.h" +#include "profile/assetsdialog.h" #include #include @@ -115,8 +115,8 @@ namespace { } } // namespace -Assets::Assets(openspace::Profile* profile, const std::string reportAssets, - QWidget* parent) +AssetsDialog::AssetsDialog(openspace::Profile* profile, const std::string reportAssets, + QWidget* parent) : QDialog(parent) , _profile(profile) { @@ -148,7 +148,7 @@ Assets::Assets(openspace::Profile* profile, const std::string reportAssets, _assetTree->setAnimated(true); _assetTree->setSortingEnabled(false); _assetTree->setSelectionMode(QAbstractItemView::SingleSelection); - connect(_assetTree, &QTreeView::clicked, this, &Assets::selected); + connect(_assetTree, &QTreeView::clicked, this, &AssetsDialog::selected); for (const std::string& a : _profile->assets()) { @@ -187,13 +187,19 @@ Assets::Assets(openspace::Profile* profile, const std::string reportAssets, { QDialogButtonBox* buttons = new QDialogButtonBox; buttons->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Cancel); - connect(buttons, &QDialogButtonBox::accepted, this, &Assets::parseSelections); - connect(buttons, &QDialogButtonBox::rejected, this, &Assets::reject); + connect( + buttons, &QDialogButtonBox::accepted, + this, &AssetsDialog::parseSelections + ); + connect( + buttons, &QDialogButtonBox::rejected, + this, &AssetsDialog::reject + ); layout->addWidget(buttons); } } -QString Assets::createTextSummary() { +QString AssetsDialog::createTextSummary() { std::vector summaryPaths; std::vector summaryItems; _assetTreeModel.getSelectedAssets(summaryPaths, summaryItems); @@ -213,7 +219,7 @@ QString Assets::createTextSummary() { return summary; } -void Assets::parseSelections() { +void AssetsDialog::parseSelections() { _profile->clearAssets(); std::vector summaryPaths; std::vector summaryItems; @@ -225,6 +231,6 @@ void Assets::parseSelections() { accept(); } -void Assets::selected(const QModelIndex& sel) { +void AssetsDialog::selected(const QModelIndex& sel) { _summary->setText(createTextSummary()); } diff --git a/apps/OpenSpace/ext/launcher/src/assettreeitem.cpp b/apps/OpenSpace/ext/launcher/src/profile/assettreeitem.cpp similarity index 99% rename from apps/OpenSpace/ext/launcher/src/assettreeitem.cpp rename to apps/OpenSpace/ext/launcher/src/profile/assettreeitem.cpp index 2bdc73bc11..f02b57ce3d 100644 --- a/apps/OpenSpace/ext/launcher/src/assettreeitem.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/assettreeitem.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include "assettreeitem.h" +#include "profile/assettreeitem.h" AssetTreeItem::AssetTreeItem(const std::vector& data, AssetTreeItem* parentItem) : _itemData(data) diff --git a/apps/OpenSpace/ext/launcher/src/assettreemodel.cpp b/apps/OpenSpace/ext/launcher/src/profile/assettreemodel.cpp similarity index 99% rename from apps/OpenSpace/ext/launcher/src/assettreemodel.cpp rename to apps/OpenSpace/ext/launcher/src/profile/assettreemodel.cpp index bbc4316f0d..fac56f4193 100644 --- a/apps/OpenSpace/ext/launcher/src/assettreemodel.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/assettreemodel.cpp @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include "assettreeitem.h" -#include "assettreemodel.h" +#include "profile/assettreeitem.h" +#include "profile/assettreemodel.h" #include #include diff --git a/apps/OpenSpace/ext/launcher/src/camera.cpp b/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp similarity index 97% rename from apps/OpenSpace/ext/launcher/src/camera.cpp rename to apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp index e971935564..98c59b7689 100644 --- a/apps/OpenSpace/ext/launcher/src/camera.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include "camera.h" +#include "profile/cameradialog.h" #include #include @@ -55,7 +55,7 @@ namespace { } } // namespace -Camera::Camera(openspace::Profile* profile, QWidget *parent) +CameraDialog::CameraDialog(openspace::Profile* profile, QWidget *parent) : QDialog(parent) , _profile(profile) { @@ -63,7 +63,7 @@ Camera::Camera(openspace::Profile* profile, QWidget *parent) QBoxLayout* layout = new QVBoxLayout(this); _tabWidget = new QTabWidget; - connect(_tabWidget, &QTabWidget::tabBarClicked, this, &Camera::tabSelect); + connect(_tabWidget, &QTabWidget::tabBarClicked, this, &CameraDialog::tabSelect); _tabWidget->addTab(createNavStateWidget(), "Navigation State"); _tabWidget->addTab(createGeoWidget(), "Geo State"); layout->addWidget(_tabWidget); @@ -85,8 +85,8 @@ Camera::Camera(openspace::Profile* profile, QWidget *parent) QDialogButtonBox* buttons = new QDialogButtonBox; buttons->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Cancel); - connect(buttons, &QDialogButtonBox::accepted, this, &Camera::approved); - connect(buttons, &QDialogButtonBox::rejected, this, &Camera::reject); + connect(buttons, &QDialogButtonBox::accepted, this, &CameraDialog::approved); + connect(buttons, &QDialogButtonBox::rejected, this, &CameraDialog::reject); footerLayout->addWidget(buttons); layout->addLayout(footerLayout); @@ -163,7 +163,7 @@ Camera::Camera(openspace::Profile* profile, QWidget *parent) } } -QWidget* Camera::createNavStateWidget() { +QWidget* CameraDialog::createNavStateWidget() { QWidget* box = new QWidget; QGridLayout* layout = new QGridLayout(box); @@ -250,7 +250,7 @@ QWidget* Camera::createNavStateWidget() { return box; } -QWidget* Camera::createGeoWidget() { +QWidget* CameraDialog::createGeoWidget() { QWidget* box = new QWidget; QGridLayout* layout = new QGridLayout(box); @@ -281,7 +281,7 @@ QWidget* Camera::createGeoWidget() { return box; } -bool Camera::areRequiredFormsFilledAndValid() { +bool CameraDialog::areRequiredFormsFilledAndValid() { bool allFormsOk = true; _errorMsg->clear(); @@ -346,7 +346,7 @@ bool Camera::areRequiredFormsFilledAndValid() { return allFormsOk; } -void Camera::addErrorMsg(QString errorDescription) { +void CameraDialog::addErrorMsg(QString errorDescription) { QString contents = _errorMsg->text(); if (contents.length() > 0) { contents += ", "; @@ -355,7 +355,7 @@ void Camera::addErrorMsg(QString errorDescription) { _errorMsg->setText(contents); } -void Camera::approved() { +void CameraDialog::approved() { if (!areRequiredFormsFilledAndValid()) { return; } @@ -410,7 +410,7 @@ void Camera::approved() { accept(); } -void Camera::tabSelect(int tabIndex) { +void CameraDialog::tabSelect(int tabIndex) { _errorMsg->clear(); if (tabIndex == 0) { diff --git a/apps/OpenSpace/ext/launcher/src/deltatimes.cpp b/apps/OpenSpace/ext/launcher/src/profile/deltatimesdialog.cpp similarity index 89% rename from apps/OpenSpace/ext/launcher/src/deltatimes.cpp rename to apps/OpenSpace/ext/launcher/src/profile/deltatimesdialog.cpp index f98512b488..61033bbe28 100644 --- a/apps/OpenSpace/ext/launcher/src/deltatimes.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/deltatimesdialog.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include "deltatimes.h" +#include "profile/deltatimesdialog.h" #include #include @@ -59,7 +59,7 @@ namespace { } // namespace -DeltaTimes::DeltaTimes(openspace::Profile* profile, QWidget *parent) +DeltaTimesDialog::DeltaTimesDialog(openspace::Profile* profile, QWidget *parent) : QDialog(parent) , _profile(profile) { @@ -69,7 +69,7 @@ DeltaTimes::DeltaTimes(openspace::Profile* profile, QWidget *parent) _listWidget = new QListWidget; connect( _listWidget, &QListWidget::itemSelectionChanged, - this, &DeltaTimes::listItemSelected + this, &DeltaTimesDialog::listItemSelected ); _listWidget->setAutoScroll(true); _listWidget->setLayoutMode(QListView::SinglePass); @@ -79,13 +79,16 @@ DeltaTimes::DeltaTimes(openspace::Profile* profile, QWidget *parent) { QBoxLayout* buttonLayout = new QHBoxLayout; _addButton = new QPushButton("Add Entry"); - connect(_addButton, &QPushButton::clicked, this, &DeltaTimes::addDeltaTimeValue); + connect( + _addButton, &QPushButton::clicked, + this, &DeltaTimesDialog::addDeltaTimeValue + ); buttonLayout->addWidget(_addButton); _removeButton = new QPushButton("Remove LastEntry"); connect( _removeButton, &QPushButton::clicked, - this, &DeltaTimes::removeDeltaTimeValue + this, &DeltaTimesDialog::removeDeltaTimeValue ); buttonLayout->addWidget(_removeButton); @@ -100,7 +103,7 @@ DeltaTimes::DeltaTimes(openspace::Profile* profile, QWidget *parent) QBoxLayout* box = new QHBoxLayout; _seconds = new QLineEdit; _seconds->setValidator(new QDoubleValidator); - connect(_seconds, &QLineEdit::textChanged, this, &DeltaTimes::valueChanged); + connect(_seconds, &QLineEdit::textChanged, this, &DeltaTimesDialog::valueChanged); box->addWidget(_seconds); _value = new QLabel; @@ -113,14 +116,14 @@ DeltaTimes::DeltaTimes(openspace::Profile* profile, QWidget *parent) _saveButton = new QPushButton("Save"); connect( _saveButton, &QPushButton::clicked, - this, &DeltaTimes::saveDeltaTimeValue + this, &DeltaTimesDialog::saveDeltaTimeValue ); box->addWidget(_saveButton); _discardButton = new QPushButton("Discard"); connect( _discardButton, &QPushButton::clicked, - this, &DeltaTimes::discardDeltaTimeValue + this, &DeltaTimesDialog::discardDeltaTimeValue ); box->addWidget(_discardButton); @@ -144,12 +147,9 @@ DeltaTimes::DeltaTimes(openspace::Profile* profile, QWidget *parent) _buttonBox->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Cancel); connect( _buttonBox, &QDialogButtonBox::accepted, - this, &DeltaTimes::parseSelections - ); - connect( - _buttonBox, &QDialogButtonBox::rejected, - this, &DeltaTimes::reject + this, &DeltaTimesDialog::parseSelections ); + connect(_buttonBox, &QDialogButtonBox::rejected, this, &DeltaTimesDialog::reject); footer->addWidget(_buttonBox); layout->addLayout(footer); } @@ -165,7 +165,7 @@ DeltaTimes::DeltaTimes(openspace::Profile* profile, QWidget *parent) transitionEditMode(_listWidget->count() - 1, false); } -std::string DeltaTimes::createSummaryForDeltaTime(size_t idx, bool forListView) { +std::string DeltaTimesDialog::createSummaryForDeltaTime(size_t idx, bool forListView) { int k = (idx%10 == 9) ? 0 : idx%10 + 1; k = (idx == 0) ? 1 : k; std::string key = std::to_string(k); @@ -192,7 +192,7 @@ std::string DeltaTimes::createSummaryForDeltaTime(size_t idx, bool forListView) return s; } -void DeltaTimes::listItemSelected() { +void DeltaTimesDialog::listItemSelected() { QListWidgetItem *item = _listWidget->currentItem(); int index = _listWidget->row(item); @@ -212,7 +212,7 @@ void DeltaTimes::listItemSelected() { transitionEditMode(index, true); } -void DeltaTimes::setLabelForKey(int index, bool editMode, std::string color) { +void DeltaTimesDialog::setLabelForKey(int index, bool editMode, std::string color) { std::string labelS = "Set Simulation Time Increment for key"; if (index >= _data.size()) { index = _data.size() - 1; @@ -227,7 +227,7 @@ void DeltaTimes::setLabelForKey(int index, bool editMode, std::string color) { )); } -QString DeltaTimes::timeDescription(int value) { +QString DeltaTimesDialog::timeDescription(int value) { if (value == 0) { return ""; } @@ -241,7 +241,7 @@ QString DeltaTimes::timeDescription(int value) { return checkForTimeDescription(i, value); } -void DeltaTimes::valueChanged(const QString& text) { +void DeltaTimesDialog::valueChanged(const QString& text) { if (_seconds->text() == "") { _errorMsg->setText(""); } @@ -255,14 +255,14 @@ void DeltaTimes::valueChanged(const QString& text) { } } -QString DeltaTimes::checkForTimeDescription(int intervalIndex, int value) { +QString DeltaTimesDialog::checkForTimeDescription(int intervalIndex, int value) { double amount = static_cast(value) / TimeIntervals[intervalIndex].secondsPerInterval; QString description = QString::number(amount, 'g', 2); return description += " " + TimeIntervals[intervalIndex].intervalName + "/sec"; } -bool DeltaTimes::isLineEmpty(int index) { +bool DeltaTimesDialog::isLineEmpty(int index) { bool isEmpty = true; if (!_listWidget->item(index)->text().isEmpty()) { isEmpty = false; @@ -273,7 +273,7 @@ bool DeltaTimes::isLineEmpty(int index) { return isEmpty; } -void DeltaTimes::addDeltaTimeValue() { +void DeltaTimesDialog::addDeltaTimeValue() { int currentListSize = _listWidget->count(); const QString messageAddValue = " (Enter integer value below & click 'Save')"; @@ -296,7 +296,7 @@ void DeltaTimes::addDeltaTimeValue() { _editModeNewItem = true; } -void DeltaTimes::saveDeltaTimeValue() { +void DeltaTimesDialog::saveDeltaTimeValue() { QListWidgetItem *item = _listWidget->currentItem(); if (item != nullptr) { int index = _listWidget->row(item); @@ -311,7 +311,7 @@ void DeltaTimes::saveDeltaTimeValue() { } } -void DeltaTimes::discardDeltaTimeValue(void) { +void DeltaTimesDialog::discardDeltaTimeValue(void) { listItemSelected(); transitionEditMode(_listWidget->count() - 1, false); if (_editModeNewItem && !_data.empty() && _data.back() == 0) { @@ -320,7 +320,7 @@ void DeltaTimes::discardDeltaTimeValue(void) { _editModeNewItem = false; } -void DeltaTimes::removeDeltaTimeValue() { +void DeltaTimesDialog::removeDeltaTimeValue() { if (_listWidget->count() > 0) { if (_listWidget->count() == 1) { _data.at(0) = 0; @@ -337,7 +337,7 @@ void DeltaTimes::removeDeltaTimeValue() { transitionEditMode(_listWidget->count() - 1, false); } -void DeltaTimes::transitionEditMode(int index, bool state) { +void DeltaTimesDialog::transitionEditMode(int index, bool state) { _listWidget->setEnabled(!state); _addButton->setEnabled(!state); _removeButton->setEnabled(!state); @@ -361,7 +361,7 @@ void DeltaTimes::transitionEditMode(int index, bool state) { _errorMsg->clear(); } -void DeltaTimes::parseSelections() { +void DeltaTimesDialog::parseSelections() { if ((_data.size() == 1) && (_data.at(0) == 0)) { _data.clear(); } @@ -379,7 +379,7 @@ void DeltaTimes::parseSelections() { accept(); } -void DeltaTimes::keyPressEvent(QKeyEvent* evt) { +void DeltaTimesDialog::keyPressEvent(QKeyEvent* evt) { if (evt->key() == Qt::Key_Enter || evt->key() == Qt::Key_Return) { if (_editModeNewItem) { saveDeltaTimeValue(); diff --git a/apps/OpenSpace/ext/launcher/src/keybindings.cpp b/apps/OpenSpace/ext/launcher/src/profile/keybindingsdialog.cpp similarity index 92% rename from apps/OpenSpace/ext/launcher/src/keybindings.cpp rename to apps/OpenSpace/ext/launcher/src/profile/keybindingsdialog.cpp index 48dc10802f..3222e28447 100644 --- a/apps/OpenSpace/ext/launcher/src/keybindings.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/keybindingsdialog.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include "keybindings.h" +#include "profile/keybindingsdialog.h" #include #include @@ -93,7 +93,7 @@ namespace { } // namespace -Keybindings::Keybindings(openspace::Profile* profile, QWidget *parent) +KeybindingsDialog::KeybindingsDialog(openspace::Profile* profile, QWidget *parent) : QDialog(parent) , _profile(profile) , _data(_profile->keybindings()) @@ -105,7 +105,7 @@ Keybindings::Keybindings(openspace::Profile* profile, QWidget *parent) _list = new QListWidget; connect( _list, &QListWidget::itemSelectionChanged, - this, &Keybindings::listItemSelected + this, &KeybindingsDialog::listItemSelected ); _list->setAlternatingRowColors(true); _list->setMovement(QListView::Free); @@ -121,11 +121,17 @@ Keybindings::Keybindings(openspace::Profile* profile, QWidget *parent) { QBoxLayout* box = new QHBoxLayout; _addButton = new QPushButton("Add new"); - connect(_addButton, &QPushButton::clicked, this, &Keybindings::listItemAdded); + connect( + _addButton, &QPushButton::clicked, + this, &KeybindingsDialog::listItemAdded + ); box->addWidget(_addButton); _removeButton = new QPushButton("Remove"); - connect(_removeButton, &QPushButton::clicked, this, &Keybindings::listItemRemove); + connect( + _removeButton, &QPushButton::clicked, + this, &KeybindingsDialog::listItemRemove + ); box->addWidget(_removeButton); box->addStretch(); layout->addLayout(box); @@ -216,13 +222,16 @@ Keybindings::Keybindings(openspace::Profile* profile, QWidget *parent) QBoxLayout* buttonBox = new QHBoxLayout; _saveButton = new QPushButton("Save"); - connect(_saveButton, &QPushButton::clicked, this, &Keybindings::listItemSave); + connect( + _saveButton, &QPushButton::clicked, + this, &KeybindingsDialog::listItemSave + ); buttonBox->addWidget(_saveButton); _cancelButton = new QPushButton("Cancel"); connect( _cancelButton, &QPushButton::clicked, - this, &Keybindings::listItemCancelSave + this, &KeybindingsDialog::listItemCancelSave ); buttonBox->addWidget(_cancelButton); buttonBox->addStretch(); @@ -247,11 +256,11 @@ Keybindings::Keybindings(openspace::Profile* profile, QWidget *parent) _buttonBox->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Cancel); QObject::connect( _buttonBox, &QDialogButtonBox::accepted, - this, &Keybindings::parseSelections + this, &KeybindingsDialog::parseSelections ); QObject::connect( _buttonBox, &QDialogButtonBox::rejected, - this, &Keybindings::reject + this, &KeybindingsDialog::reject ); footerLayout->addWidget(_buttonBox); layout->addLayout(footerLayout); @@ -260,7 +269,7 @@ Keybindings::Keybindings(openspace::Profile* profile, QWidget *parent) transitionFromEditMode(); } -void Keybindings::listItemSelected(void) { +void KeybindingsDialog::listItemSelected(void) { QListWidgetItem *item = _list->currentItem(); int index = _list->row(item); @@ -285,12 +294,12 @@ void Keybindings::listItemSelected(void) { transitionToEditMode(); } -int Keybindings::indexInKeyMapping(std::vector& mapVector, int keyInt) { +int KeybindingsDialog::indexInKeyMapping(std::vector& mapVector, int keyInt) { auto it = std::find(mapVector.begin(), mapVector.end(), keyInt); return std::distance(mapVector.begin(), it); } -bool Keybindings::isLineEmpty(int index) { +bool KeybindingsDialog::isLineEmpty(int index) { bool isEmpty = true; if (!_list->item(index)->text().isEmpty()) { isEmpty = false; @@ -301,7 +310,7 @@ bool Keybindings::isLineEmpty(int index) { return isEmpty; } -void Keybindings::listItemAdded(void) { +void KeybindingsDialog::listItemAdded(void) { int currentListSize = _list->count(); if ((currentListSize == 1) && (isLineEmpty(0))) { @@ -332,7 +341,7 @@ void Keybindings::listItemAdded(void) { _editModeNewItem = true; } -void Keybindings::listItemSave(void) { +void KeybindingsDialog::listItemSave(void) { if (!areRequiredFormsFilled()) { return; } @@ -357,7 +366,7 @@ void Keybindings::listItemSave(void) { transitionFromEditMode(); } -bool Keybindings::areRequiredFormsFilled() { +bool KeybindingsDialog::areRequiredFormsFilled() { bool requiredFormsFilled = true; std::string errors; if (_keyCombo->currentIndex() < 0) { @@ -382,7 +391,7 @@ bool Keybindings::areRequiredFormsFilled() { return requiredFormsFilled; } -void Keybindings::listItemCancelSave(void) { +void KeybindingsDialog::listItemCancelSave(void) { listItemSelected(); transitionFromEditMode(); if (_editModeNewItem && !_data.empty() && @@ -394,7 +403,7 @@ void Keybindings::listItemCancelSave(void) { _editModeNewItem = false; } -void Keybindings::listItemRemove(void) { +void KeybindingsDialog::listItemRemove(void) { if (_list->count() > 0) { if (_list->count() == 1) { // Special case where last remaining item is being removed (QListWidget does @@ -416,7 +425,7 @@ void Keybindings::listItemRemove(void) { transitionFromEditMode(); } -void Keybindings::transitionToEditMode() { +void KeybindingsDialog::transitionToEditMode() { _list->setDisabled(true); _addButton->setDisabled(true); _removeButton->setDisabled(true); @@ -434,7 +443,7 @@ void Keybindings::transitionToEditMode() { _errorMsg->setText(""); } -void Keybindings::transitionFromEditMode(void) { +void KeybindingsDialog::transitionFromEditMode(void) { _list->setDisabled(false); _addButton->setDisabled(false); _removeButton->setDisabled(false); @@ -452,7 +461,7 @@ void Keybindings::transitionFromEditMode(void) { _errorMsg->setText(""); } -void Keybindings::editBoxDisabled(bool disabled) { +void KeybindingsDialog::editBoxDisabled(bool disabled) { _keyLabel->setDisabled(disabled); _keyCombo->setDisabled(disabled); _keyModLabel->setDisabled(disabled); @@ -470,8 +479,8 @@ void Keybindings::editBoxDisabled(bool disabled) { _saveButton->setDisabled(disabled); } -void Keybindings::parseSelections() { - //Handle case with only one remaining but empty line +void KeybindingsDialog::parseSelections() { + // Handle case with only one remaining but empty line if ((_data.size() == 1) && (_data.at(0).name.empty())) { _data.clear(); } @@ -479,7 +488,7 @@ void Keybindings::parseSelections() { accept(); } -void Keybindings::keyPressEvent(QKeyEvent *evt) { +void KeybindingsDialog::keyPressEvent(QKeyEvent* evt) { if (evt->key() == Qt::Key_Enter || evt->key() == Qt::Key_Return) { return; } diff --git a/apps/OpenSpace/ext/launcher/src/marknodes.cpp b/apps/OpenSpace/ext/launcher/src/profile/marknodesdialog.cpp similarity index 87% rename from apps/OpenSpace/ext/launcher/src/marknodes.cpp rename to apps/OpenSpace/ext/launcher/src/profile/marknodesdialog.cpp index 1426511c41..15698c4f8e 100644 --- a/apps/OpenSpace/ext/launcher/src/marknodes.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/marknodesdialog.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include "marknodes.h" +#include "profile/marknodesdialog.h" #include #include @@ -34,7 +34,7 @@ #include #include -MarkNodes::MarkNodes(openspace::Profile* profile, QWidget* parent) +MarkNodesDialog::MarkNodesDialog(openspace::Profile* profile, QWidget* parent) : QDialog(parent) , _profile(profile) , _data(_profile->markNodes()) @@ -45,7 +45,7 @@ MarkNodes::MarkNodes(openspace::Profile* profile, QWidget* parent) _list = new QListWidget; connect( _list, &QListWidget::itemSelectionChanged, - this, &MarkNodes::listItemSelected + this, &MarkNodesDialog::listItemSelected ); _list->setAlternatingRowColors(true); _list->setMovement(QListView::Free); @@ -60,7 +60,7 @@ MarkNodes::MarkNodes(openspace::Profile* profile, QWidget* parent) layout->addWidget(_list); _removeButton = new QPushButton("Remove"); - connect(_removeButton, &QPushButton::clicked, this, &MarkNodes::listItemRemove); + connect(_removeButton, &QPushButton::clicked, this, &MarkNodesDialog::listItemRemove); layout->addWidget(_removeButton); { @@ -73,7 +73,10 @@ MarkNodes::MarkNodes(openspace::Profile* profile, QWidget* parent) box->addWidget(_newNode); QPushButton* addButton = new QPushButton("Add new"); - connect(addButton, &QPushButton::clicked, this, &MarkNodes::listItemAdded); + connect( + addButton, &QPushButton::clicked, + this, &MarkNodesDialog::listItemAdded + ); box->addWidget(addButton); layout->addLayout(box); } @@ -82,18 +85,21 @@ MarkNodes::MarkNodes(openspace::Profile* profile, QWidget* parent) buttons->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Cancel); QObject::connect( buttons, &QDialogButtonBox::accepted, - this, &MarkNodes::parseSelections + this, &MarkNodesDialog::parseSelections + ); + QObject::connect( + buttons, &QDialogButtonBox::rejected, + this, &MarkNodesDialog::reject ); - QObject::connect(buttons, &QDialogButtonBox::rejected, this, &MarkNodes::reject); layout->addWidget(buttons); } } -void MarkNodes::listItemSelected(void) { +void MarkNodesDialog::listItemSelected(void) { _removeButton->setEnabled(true); } -void MarkNodes::listItemAdded(void) { +void MarkNodesDialog::listItemAdded(void) { if (_newNode->text().isEmpty()) { return; } @@ -116,7 +122,7 @@ void MarkNodes::listItemAdded(void) { _newNode->clear(); } -void MarkNodes::listItemRemove() { +void MarkNodesDialog::listItemRemove() { QListWidgetItem* item = _list->currentItem(); int index = _list->row(item); @@ -129,12 +135,12 @@ void MarkNodes::listItemRemove() { _markedNodesListItems.erase(_markedNodesListItems.begin() + index); } -void MarkNodes::parseSelections() { +void MarkNodesDialog::parseSelections() { _profile->setMarkNodes(_data); accept(); } -void MarkNodes::keyPressEvent(QKeyEvent *evt) { +void MarkNodesDialog::keyPressEvent(QKeyEvent *evt) { if (evt->key() == Qt::Key_Enter || evt->key() == Qt::Key_Return) { if (_newNode->text().length() > 0 && _newNode->hasFocus()) { listItemAdded(); diff --git a/apps/OpenSpace/ext/launcher/src/meta.cpp b/apps/OpenSpace/ext/launcher/src/profile/metadialog.cpp similarity index 96% rename from apps/OpenSpace/ext/launcher/src/meta.cpp rename to apps/OpenSpace/ext/launcher/src/profile/metadialog.cpp index c7ab571323..e156ae9cad 100644 --- a/apps/OpenSpace/ext/launcher/src/meta.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/metadialog.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include "meta.h" +#include "profile/metadialog.h" #include #include @@ -33,7 +33,7 @@ #include #include -Meta::Meta(openspace::Profile* profile, QWidget *parent) +MetaDialog::MetaDialog(openspace::Profile* profile, QWidget *parent) : QDialog(parent) , _profile(profile) { @@ -67,8 +67,8 @@ Meta::Meta(openspace::Profile* profile, QWidget *parent) QDialogButtonBox* buttons = new QDialogButtonBox; buttons->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Cancel); - QObject::connect(buttons, &QDialogButtonBox::accepted, this, &Meta::save); - QObject::connect(buttons, &QDialogButtonBox::rejected, this, &Meta::reject); + QObject::connect(buttons, &QDialogButtonBox::accepted, this, &MetaDialog::save); + QObject::connect(buttons, &QDialogButtonBox::rejected, this, &MetaDialog::reject); layout->addWidget(buttons); @@ -95,7 +95,7 @@ Meta::Meta(openspace::Profile* profile, QWidget *parent) } } -void Meta::save() { +void MetaDialog::save() { const bool allEmpty = _nameEdit->text().isEmpty() && _versionEdit->text().isEmpty() && _descriptionEdit->toPlainText().isEmpty() && _authorEdit->text().isEmpty() && diff --git a/apps/OpenSpace/ext/launcher/src/modules.cpp b/apps/OpenSpace/ext/launcher/src/profile/modulesdialog.cpp similarity index 91% rename from apps/OpenSpace/ext/launcher/src/modules.cpp rename to apps/OpenSpace/ext/launcher/src/profile/modulesdialog.cpp index 38c7f3fb75..e1f422943a 100644 --- a/apps/OpenSpace/ext/launcher/src/modules.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/modulesdialog.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include "modules.h" +#include "profile/modulesdialog.h" #include #include @@ -33,7 +33,7 @@ #include #include -Modules::Modules(openspace::Profile* profile, QWidget *parent) +ModulesDialog::ModulesDialog(openspace::Profile* profile, QWidget *parent) : QDialog(parent) , _profile(profile) , _data(_profile->modules()) @@ -46,7 +46,7 @@ Modules::Modules(openspace::Profile* profile, QWidget *parent) _list = new QListWidget; connect( _list, &QListWidget::itemSelectionChanged, - this, &Modules::listItemSelected + this, &ModulesDialog::listItemSelected ); _list->setAlternatingRowColors(true); _list->setMovement(QListView::Free); @@ -60,11 +60,14 @@ Modules::Modules(openspace::Profile* profile, QWidget *parent) { QBoxLayout* box = new QHBoxLayout; _buttonAdd = new QPushButton("Add new"); - connect(_buttonAdd, &QPushButton::clicked, this, &Modules::listItemAdded); + connect(_buttonAdd, &QPushButton::clicked, this, &ModulesDialog::listItemAdded); box->addWidget(_buttonAdd); _buttonRemove = new QPushButton("Remove"); - connect(_buttonRemove, &QPushButton::clicked, this, &Modules::listItemRemove); + connect( + _buttonRemove, &QPushButton::clicked, + this, &ModulesDialog::listItemRemove + ); box->addWidget(_buttonRemove); box->addStretch(); @@ -99,12 +102,15 @@ Modules::Modules(openspace::Profile* profile, QWidget *parent) QBoxLayout* box = new QHBoxLayout; _buttonSave = new QPushButton("Save"); _buttonSave->setToolTip("Save module changes to the above list"); - connect(_buttonSave, &QPushButton::clicked, this, &Modules::listItemSave); + connect(_buttonSave, &QPushButton::clicked, this, &ModulesDialog::listItemSave); box->addWidget(_buttonSave); _buttonCancel = new QPushButton("Cancel"); _buttonCancel->setToolTip("Cancel adding this module to the above list"); - connect(_buttonCancel, &QPushButton::clicked, this, &Modules::listItemCancelSave); + connect( + _buttonCancel, &QPushButton::clicked, + this, &ModulesDialog::listItemCancelSave + ); box->addWidget(_buttonCancel); box->addStretch(); @@ -129,11 +135,11 @@ Modules::Modules(openspace::Profile* profile, QWidget *parent) _buttonBox->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Cancel); QObject::connect( _buttonBox, &QDialogButtonBox::accepted, - this, &Modules::parseSelections + this, &ModulesDialog::parseSelections ); QObject::connect( _buttonBox, &QDialogButtonBox::rejected, - this, &Modules::reject + this, &ModulesDialog::reject ); footerLayout->addWidget(_buttonBox); layout->addLayout(footerLayout); @@ -142,7 +148,7 @@ Modules::Modules(openspace::Profile* profile, QWidget *parent) transitionFromEditMode(); } -QString Modules::createOneLineSummary(openspace::Profile::Module m) { +QString ModulesDialog::createOneLineSummary(openspace::Profile::Module m) { QString summary = QString(m.name.c_str()); bool hasCommandForLoaded = (m.loadedInstruction->length() > 0); bool hasCommandForNotLoaded = (m.notLoadedInstruction->length() > 0); @@ -162,7 +168,7 @@ QString Modules::createOneLineSummary(openspace::Profile::Module m) { return summary; } -void Modules::listItemSelected() { +void ModulesDialog::listItemSelected() { QListWidgetItem *item = _list->currentItem(); int index = _list->row(item); @@ -185,7 +191,7 @@ void Modules::listItemSelected() { transitionToEditMode(); } -bool Modules::isLineEmpty(int index) { +bool ModulesDialog::isLineEmpty(int index) { bool isEmpty = true; if (!_list->item(index)->text().isEmpty()) { isEmpty = false; @@ -196,7 +202,7 @@ bool Modules::isLineEmpty(int index) { return isEmpty; } -void Modules::listItemAdded(void) { +void ModulesDialog::listItemAdded(void) { int currentListSize = _list->count(); if ((currentListSize == 1) && (isLineEmpty(0))) { @@ -236,7 +242,7 @@ void Modules::listItemAdded(void) { _editModeNewItem = true; } -void Modules::listItemSave(void) { +void ModulesDialog::listItemSave(void) { if (_moduleEdit->text().isEmpty()) { //ui->label_module->setText("Module"); _errorMsg->setText("Missing module name"); @@ -256,7 +262,7 @@ void Modules::listItemSave(void) { _editModeNewItem = false; } -void Modules::listItemCancelSave(void) { +void ModulesDialog::listItemCancelSave(void) { transitionFromEditMode(); if (_editModeNewItem) { if (_data.size() > 0) { @@ -268,7 +274,7 @@ void Modules::listItemCancelSave(void) { _editModeNewItem = false; } -void Modules::listItemRemove(void) { +void ModulesDialog::listItemRemove(void) { if (_list->count() > 0) { if (_list->currentRow() >= 0 && _list->currentRow() < _list->count()) { if (_list->count() == 1) { @@ -291,7 +297,7 @@ void Modules::listItemRemove(void) { transitionFromEditMode(); } -void Modules::transitionToEditMode(void) { +void ModulesDialog::transitionToEditMode(void) { _list->setDisabled(true); _buttonAdd->setDisabled(true); _buttonRemove->setDisabled(true); @@ -306,7 +312,7 @@ void Modules::transitionToEditMode(void) { _errorMsg->setText(""); } -void Modules::transitionFromEditMode(void) { +void ModulesDialog::transitionFromEditMode(void) { _list->setDisabled(false); _buttonAdd->setDisabled(false); _buttonRemove->setDisabled(false); @@ -321,7 +327,7 @@ void Modules::transitionFromEditMode(void) { _errorMsg->setText(""); } -void Modules::editBoxDisabled(bool disabled) { +void ModulesDialog::editBoxDisabled(bool disabled) { _moduleLabel->setDisabled(disabled); _moduleEdit->setDisabled(disabled); _loadedLabel->setDisabled(disabled); @@ -332,7 +338,7 @@ void Modules::editBoxDisabled(bool disabled) { _buttonSave->setDisabled(disabled); } -void Modules::parseSelections() { +void ModulesDialog::parseSelections() { // Handle case with only one remaining but empty line if ((_data.size() == 1) && (_data.at(0).name.empty())) { _data.clear(); @@ -341,14 +347,14 @@ void Modules::parseSelections() { accept(); } -void Modules::keyPressEvent(QKeyEvent* evt) { +void ModulesDialog::keyPressEvent(QKeyEvent* evt) { if (evt->key() == Qt::Key_Enter || evt->key() == Qt::Key_Return) { if (_editModeNewItem) { listItemSave(); } return; } - else if(evt->key() == Qt::Key_Escape) { + else if (evt->key() == Qt::Key_Escape) { if (_editModeNewItem) { listItemCancelSave(); return; diff --git a/apps/OpenSpace/ext/launcher/src/profileedit.cpp b/apps/OpenSpace/ext/launcher/src/profile/profileedit.cpp similarity index 97% rename from apps/OpenSpace/ext/launcher/src/profileedit.cpp rename to apps/OpenSpace/ext/launcher/src/profile/profileedit.cpp index 006f0346ff..ab32505082 100644 --- a/apps/OpenSpace/ext/launcher/src/profileedit.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/profileedit.cpp @@ -23,7 +23,7 @@ ****************************************************************************************/ #include -#include "profileedit.h" +#include "profile/profileedit.h" #include "filesystemaccess.h" #include #include @@ -53,6 +53,7 @@ ProfileEdit::ProfileEdit(openspace::Profile* profile, const std::string reported { QBoxLayout* container = new QHBoxLayout; QLabel* profileLabel = new QLabel("Profile Name:"); + profileLabel->setObjectName("profile"); container->addWidget(profileLabel); _profileEdit = new QLineEdit; @@ -309,7 +310,7 @@ ProfileEdit::ProfileEdit(openspace::Profile* profile, const std::string reported ); connect( buttons, &QDialogButtonBox::rejected, - this, &DeltaTimes::reject + this, &ProfileEdit::reject ); footer->addWidget(buttons); layout->addLayout(footer); @@ -367,7 +368,7 @@ void ProfileEdit::duplicateProfile() { void ProfileEdit::openMeta() { _errorMsg->setText(""); if (_pData) { - _meta = new Meta(_pData, this); + _meta = new MetaDialog(_pData, this); _meta->exec(); delete _meta; } @@ -376,7 +377,7 @@ void ProfileEdit::openMeta() { void ProfileEdit::openModules() { _errorMsg->setText(""); if (_pData) { - _modules = new Modules(_pData, this); + _modules = new ModulesDialog(_pData, this); _modules->exec(); labelText(_pData, _pData->modules().size(), "Modules", _modulesLabel); delete _modules; @@ -386,7 +387,7 @@ void ProfileEdit::openModules() { void ProfileEdit::openProperties() { _errorMsg->setText(""); if (_pData) { - _properties = new Properties(_pData, this); + _properties = new PropertiesDialog(_pData, this); _properties->exec(); labelText(_pData, _pData->properties().size(), "Properties", _propertiesLabel); _propertiesEdit->setText(summarizeText_properties()); @@ -397,7 +398,7 @@ void ProfileEdit::openProperties() { void ProfileEdit::openKeybindings() { _errorMsg->setText(""); if (_pData) { - _keybindings = new Keybindings(_pData, this); + _keybindings = new KeybindingsDialog(_pData, this); _keybindings->exec(); labelText(_pData, _pData->keybindings().size(), "Keybindings", _keybindingsLabel @@ -410,7 +411,7 @@ void ProfileEdit::openKeybindings() { void ProfileEdit::openAssets() { _errorMsg->setText(""); if (_pData) { - _assets = new Assets(_pData, _reportedAssets, this); + _assets = new AssetsDialog(_pData, _reportedAssets, this); _assets->exec(); labelText(_pData, _pData->assets().size(), "Assets", _assetsLabel); _assetsEdit->setText(_assets->createTextSummary()); @@ -422,7 +423,7 @@ void ProfileEdit::openAssets() { void ProfileEdit::openTime() { _errorMsg->setText(""); if (_pData) { - _time = new Time(_pData, this); + _time = new TimeDialog(_pData, this); _time->exec(); delete _time; } @@ -431,7 +432,7 @@ void ProfileEdit::openTime() { void ProfileEdit::openDeltaTimes() { _errorMsg->setText(""); if (_pData) { - _deltaTimes = new DeltaTimes(_pData, this); + _deltaTimes = new DeltaTimesDialog(_pData, this); _deltaTimes->exec(); labelText(_pData, _pData->deltaTimes().size(), "Simulation Time Increments", _deltaTimesLabel @@ -443,7 +444,7 @@ void ProfileEdit::openDeltaTimes() { void ProfileEdit::openAddedScripts() { _errorMsg->setText(""); if (_pData) { - _addedScripts = new AdditionalScripts(_pData, this); + _addedScripts = new AdditionalScriptsDialog(_pData, this); _addedScripts->exec(); delete _addedScripts; } @@ -452,7 +453,7 @@ void ProfileEdit::openAddedScripts() { void ProfileEdit::openCamera() { _errorMsg->setText(""); if (_pData) { - _camera = new Camera(_pData, this); + _camera = new CameraDialog(_pData, this); _camera->exec(); delete _camera; } @@ -461,7 +462,7 @@ void ProfileEdit::openCamera() { void ProfileEdit::openMarkNodes() { _errorMsg->setText(""); if (_pData) { - _markNodes = new MarkNodes(_pData, this); + _markNodes = new MarkNodesDialog(_pData, this); _markNodes->exec(); labelText(_pData, _pData->markNodes().size(), "Mark Interesting Nodes", _interestingNodesLabel diff --git a/apps/OpenSpace/ext/launcher/src/properties.cpp b/apps/OpenSpace/ext/launcher/src/profile/propertiesdialog.cpp similarity index 88% rename from apps/OpenSpace/ext/launcher/src/properties.cpp rename to apps/OpenSpace/ext/launcher/src/profile/propertiesdialog.cpp index e502e9a49a..4102953a80 100644 --- a/apps/OpenSpace/ext/launcher/src/properties.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/propertiesdialog.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include "properties.h" +#include "profile/propertiesdialog.h" #include #include @@ -43,7 +43,7 @@ namespace { }; } // namespace -Properties::Properties(openspace::Profile* profile, QWidget *parent) +PropertiesDialog::PropertiesDialog(openspace::Profile* profile, QWidget *parent) : QDialog(parent) , _profile(profile) , _data(_profile->properties()) @@ -55,7 +55,7 @@ Properties::Properties(openspace::Profile* profile, QWidget *parent) _list = new QListWidget; connect( _list, &QListWidget::itemSelectionChanged, - this, &Properties::listItemSelected + this, &PropertiesDialog::listItemSelected ); for (size_t i = 0; i < _data.size(); ++i) { _list->addItem(new QListWidgetItem(createOneLineSummary(_data[i]))); @@ -65,11 +65,17 @@ Properties::Properties(openspace::Profile* profile, QWidget *parent) { QBoxLayout* box = new QHBoxLayout; _addButton = new QPushButton("Add New"); - connect(_addButton, &QPushButton::clicked, this, &Properties::listItemAdded); + connect( + _addButton, &QPushButton::clicked, + this, &PropertiesDialog::listItemAdded + ); box->addWidget(_addButton); _removeButton = new QPushButton("Remove"); - connect(_removeButton, &QPushButton::clicked, this, &Properties::listItemRemove); + connect( + _removeButton, &QPushButton::clicked, + this, &PropertiesDialog::listItemRemove + ); box->addWidget(_removeButton); box->addStretch(); @@ -104,13 +110,16 @@ Properties::Properties(openspace::Profile* profile, QWidget *parent) { QBoxLayout* box = new QHBoxLayout; _saveButton = new QPushButton("Save"); - connect(_saveButton, &QPushButton::clicked, this, &Properties::listItemSave); + connect( + _saveButton, &QPushButton::clicked, + this, &PropertiesDialog::listItemSave + ); box->addWidget(_saveButton); _cancelButton = new QPushButton("Cancel"); connect( _cancelButton, &QPushButton::clicked, - this, &Properties::listItemCancelSave + this, &PropertiesDialog::listItemCancelSave ); box->addWidget(_cancelButton); @@ -132,11 +141,11 @@ Properties::Properties(openspace::Profile* profile, QWidget *parent) connect( _buttonBox, &QDialogButtonBox::accepted, - this, &Properties::parseSelections + this, &PropertiesDialog::parseSelections ); - QObject::connect( + connect( _buttonBox, &QDialogButtonBox::rejected, - this, &Properties::reject + this, &PropertiesDialog::reject ); footerLayout->addWidget(_buttonBox); layout->addLayout(footerLayout); @@ -145,7 +154,7 @@ Properties::Properties(openspace::Profile* profile, QWidget *parent) transitionFromEditMode(); } -QString Properties::createOneLineSummary(openspace::Profile::Property p) { +QString PropertiesDialog::createOneLineSummary(openspace::Profile::Property p) { QString summary = QString(p.name.c_str()); summary += " = "; summary += QString(p.value.c_str()); @@ -157,7 +166,7 @@ QString Properties::createOneLineSummary(openspace::Profile::Property p) { return summary; } -void Properties::listItemSelected() { +void PropertiesDialog::listItemSelected() { QListWidgetItem* item = _list->currentItem(); int index = _list->row(item); @@ -175,7 +184,7 @@ void Properties::listItemSelected() { transitionToEditMode(); } -bool Properties::isLineEmpty(int index) { +bool PropertiesDialog::isLineEmpty(int index) { bool isEmpty = true; if (!_list->item(index)->text().isEmpty()) { isEmpty = false; @@ -186,7 +195,7 @@ bool Properties::isLineEmpty(int index) { return isEmpty; } -void Properties::listItemAdded(void) { +void PropertiesDialog::listItemAdded(void) { int currentListSize = _list->count(); if ((currentListSize == 1) && (isLineEmpty(0))) { @@ -213,7 +222,7 @@ void Properties::listItemAdded(void) { _editModeNewItem = true; } -void Properties::listItemSave(void) { +void PropertiesDialog::listItemSave(void) { if (!areRequiredFormsFilled()) { return; } @@ -238,7 +247,7 @@ void Properties::listItemSave(void) { _editModeNewItem = false; } -bool Properties::areRequiredFormsFilled() { +bool PropertiesDialog::areRequiredFormsFilled() { bool requiredFormsFilled = true; QString errors; if (_propertyEdit->text().length() == 0) { @@ -256,7 +265,7 @@ bool Properties::areRequiredFormsFilled() { return requiredFormsFilled; } -void Properties::listItemCancelSave(void) { +void PropertiesDialog::listItemCancelSave(void) { listItemSelected(); transitionFromEditMode(); if (_editModeNewItem) { @@ -269,7 +278,7 @@ void Properties::listItemCancelSave(void) { _editModeNewItem = false; } -void Properties::listItemRemove(void) { +void PropertiesDialog::listItemRemove(void) { if (_list->count() > 0) { if (_list->currentRow() >= 0 && _list->currentRow() < _list->count()) { if (_list->count() == 1) { @@ -292,7 +301,7 @@ void Properties::listItemRemove(void) { transitionFromEditMode(); } -void Properties::transitionToEditMode(void) { +void PropertiesDialog::transitionToEditMode(void) { _list->setDisabled(true); _addButton->setDisabled(true); _removeButton->setDisabled(true); @@ -307,7 +316,7 @@ void Properties::transitionToEditMode(void) { _errorMsg->setText(""); } -void Properties::transitionFromEditMode(void) { +void PropertiesDialog::transitionFromEditMode(void) { _list->setDisabled(false); _addButton->setDisabled(false); _removeButton->setDisabled(false); @@ -322,7 +331,7 @@ void Properties::transitionFromEditMode(void) { _errorMsg->setText(""); } -void Properties::editBoxDisabled(bool disabled) { +void PropertiesDialog::editBoxDisabled(bool disabled) { _commandLabel->setDisabled(disabled); _commandCombo->setDisabled(disabled); _propertyLabel->setDisabled(disabled); @@ -333,7 +342,7 @@ void Properties::editBoxDisabled(bool disabled) { _cancelButton->setDisabled(disabled); } -void Properties::parseSelections() { +void PropertiesDialog::parseSelections() { // Handle case with only one remaining but empty line if ((_data.size() == 1) && (_data.at(0).name.compare("") == 0)) { _data.clear(); @@ -342,14 +351,14 @@ void Properties::parseSelections() { accept(); } -void Properties::keyPressEvent(QKeyEvent* evt) { - if(evt->key() == Qt::Key_Enter || evt->key() == Qt::Key_Return) { +void PropertiesDialog::keyPressEvent(QKeyEvent* evt) { + if (evt->key() == Qt::Key_Enter || evt->key() == Qt::Key_Return) { if (_editModeNewItem) { listItemSave(); } return; } - else if(evt->key() == Qt::Key_Escape) { + else if (evt->key() == Qt::Key_Escape) { if (_editModeNewItem) { listItemCancelSave(); return; diff --git a/apps/OpenSpace/ext/launcher/src/timedialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/timedialog.cpp similarity index 95% rename from apps/OpenSpace/ext/launcher/src/timedialog.cpp rename to apps/OpenSpace/ext/launcher/src/profile/timedialog.cpp index 053dce4cc8..00439e77ac 100644 --- a/apps/OpenSpace/ext/launcher/src/timedialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/timedialog.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include "timedialog.h" +#include "profile/timedialog.h" #include #include @@ -36,7 +36,7 @@ using namespace openspace; -Time::Time(openspace::Profile* profile, QWidget* parent) +TimeDialog::TimeDialog(openspace::Profile* profile, QWidget* parent) : QDialog(parent) , _profile(profile) { @@ -50,7 +50,7 @@ Time::Time(openspace::Profile* profile, QWidget* parent) _typeCombo->setToolTip("Types: Absolute defined time or Relative to actual time"); connect( _typeCombo, QOverload::of(&QComboBox::currentIndexChanged), - this, &Time::enableAccordingToType + this, &TimeDialog::enableAccordingToType ); layout->addWidget(_typeCombo); } @@ -81,8 +81,8 @@ Time::Time(openspace::Profile* profile, QWidget* parent) QDialogButtonBox* buttons = new QDialogButtonBox; buttons->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Cancel); - connect(buttons, &QDialogButtonBox::accepted, this, &Time::approved); - QObject::connect(buttons, &QDialogButtonBox::rejected, this, &Time::reject); + connect(buttons, &QDialogButtonBox::accepted, this, &TimeDialog::approved); + QObject::connect(buttons, &QDialogButtonBox::rejected, this, &TimeDialog::reject); layout->addWidget(buttons); } @@ -110,7 +110,7 @@ Time::Time(openspace::Profile* profile, QWidget* parent) enableAccordingToType(static_cast(_data.type)); } -void Time::enableAccordingToType(int idx) { +void TimeDialog::enableAccordingToType(int idx) { Profile::Time::Type comboIdx = static_cast(idx); bool setFormatForAbsolute = (comboIdx == Profile::Time::Type::Absolute); enableFormatForAbsolute(setFormatForAbsolute); @@ -137,14 +137,14 @@ void Time::enableAccordingToType(int idx) { } } -void Time::enableFormatForAbsolute(bool enableAbs) { +void TimeDialog::enableFormatForAbsolute(bool enableAbs) { _absoluteLabel->setEnabled(enableAbs); _absoluteEdit->setEnabled(enableAbs); _relativeLabel->setEnabled(!enableAbs); _relativeEdit->setEnabled(!enableAbs); } -void Time::approved() { +void TimeDialog::approved() { constexpr const int Relative = static_cast(Profile::Time::Type::Relative); if (_typeCombo->currentIndex() == Relative) { if (_relativeEdit->text().isEmpty()) {