diff --git a/GUI/View/Job/JobPropertiesWidget.cpp b/GUI/View/Job/JobPropertiesWidget.cpp index 44268070e0b898b09a721865d7bedb70dda6086f..941993344ff8f04d571835dd38e281b60cd21768 100644 --- a/GUI/View/Job/JobPropertiesWidget.cpp +++ b/GUI/View/Job/JobPropertiesWidget.cpp @@ -69,12 +69,14 @@ JobPropertiesWidget::JobPropertiesWidget(QWidget* parent, Qt::WindowFlags f) setMinimumWidth(10); setMinimumHeight(190); + applySettings(); } JobPropertiesWidget::~JobPropertiesWidget() { if (m_jobItem) disconnect(m_jobItem, nullptr, this, nullptr); + saveSettings(); } void JobPropertiesWidget::setJobItem(JobItem* jobItem) @@ -110,6 +112,25 @@ void JobPropertiesWidget::notifyJobPropertyChange() }); } +void JobPropertiesWidget::applySettings() +{ + QSettings settings; + if (settings.childGroups().contains(GUI::Constants::S_JOB_PROPERTIES_WIDGET)) { + settings.beginGroup(GUI::Constants::S_JOB_PROPERTIES_WIDGET); + m_tabWidget->setCurrentIndex(settings.value(GUI::Constants::S_JOB_PROPERTIES_WIDGET_CURRENT_TAB).toInt()); + settings.endGroup(); + } +} + +void JobPropertiesWidget::saveSettings() +{ + QSettings settings; + settings.beginGroup(GUI::Constants::S_JOB_PROPERTIES_WIDGET); + settings.setValue(GUI::Constants::S_JOB_PROPERTIES_WIDGET_CURRENT_TAB, m_tabWidget->currentIndex()); + settings.endGroup(); + settings.sync(); +} + //-------------------------------------------------------------------------------------------------- // private slots //-------------------------------------------------------------------------------------------------- diff --git a/GUI/View/Job/JobPropertiesWidget.h b/GUI/View/Job/JobPropertiesWidget.h index a1feb343df15e6a06ebd595feb8334806545cd70..f4f63653bea53e6c8102a8421e0c7974e9c76b9a 100644 --- a/GUI/View/Job/JobPropertiesWidget.h +++ b/GUI/View/Job/JobPropertiesWidget.h @@ -35,6 +35,8 @@ public: private: void notifyJobPropertyChange(); + void applySettings(); + void saveSettings(); private slots: void onCommentsEdited(); diff --git a/GUI/View/Tool/mainwindow_constants.h b/GUI/View/Tool/mainwindow_constants.h index 7355efd4f27cad3ba3d36f36d11cc88745732806..ee956e51da4b7dfa5c5ea7975b671e3eff50dffb 100644 --- a/GUI/View/Tool/mainwindow_constants.h +++ b/GUI/View/Tool/mainwindow_constants.h @@ -26,6 +26,7 @@ const char S_JOB_SELECTOR_PANEL[] = "JobSelectorPanel"; const char S_FIT_ACTIVITY_PANEL[] = "FitActivityPanel"; const char S_SESSION_MODEL_VIEW[] = "SessionModelView"; const char S_FIT_SESSION_WIDGET[] = "FitSessionWidget"; +const char S_JOB_PROPERTIES_WIDGET[] = "JobPropertiesWidget"; // Settings keys const char S_WINDOW_SIZE[] = "size"; @@ -37,6 +38,7 @@ const char S_JOB_SELECTOR_PANEL_WIDTH[] = "width"; const char S_JOB_SELECTOR_SPLITTER_SIZES[] = "splitter_sizes"; const char S_FIT_ACTIVITY_PANEL_SIZE[] = "size"; const char S_FIT_SESSION_WIDGET_CURRENT_TAB[] = "current_tab"; +const char S_JOB_PROPERTIES_WIDGET_CURRENT_TAB[] = "current_tab"; const int MAX_RECENT_PROJECTS = 10;