From 0b981d0bac2dccd6c54b0feb84683ae465fcb251 Mon Sep 17 00:00:00 2001 From: abn Date: Tue, 28 Oct 2014 12:36:59 +0100 Subject: [PATCH] Connecting restore default signal in settings dialog. --- src/PVGUI/PVGUI_Module.cxx | 2 +- src/PVGUI/PVGUI_ParaViewSettingsPane.cxx | 8 +++++++- src/PVGUI/PVGUI_ParaViewSettingsPane.h | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/PVGUI/PVGUI_Module.cxx b/src/PVGUI/PVGUI_Module.cxx index 9f8165a3..b94515ef 100644 --- a/src/PVGUI/PVGUI_Module.cxx +++ b/src/PVGUI/PVGUI_Module.cxx @@ -999,7 +999,7 @@ void PVGUI_Module::createPreferences() setPreferenceProperty(aParaViewSettingsTab, "stretch", false ); int aPanel = addPreference(QString(), aParaViewSettingsTab, LightApp_Preferences::UserDefined, PARAVIS_MODULE_NAME, ""); - setPreferenceProperty(aPanel, "content", (qint64)(new PVGUI_ParaViewSettingsPane())); + setPreferenceProperty(aPanel, "content", (qint64)(new PVGUI_ParaViewSettingsPane(0, getApp()))); // Paravis settings tab int aParaVisSettingsTab = addPreference( tr( "TIT_PVISSETTINGS" ) ); diff --git a/src/PVGUI/PVGUI_ParaViewSettingsPane.cxx b/src/PVGUI/PVGUI_ParaViewSettingsPane.cxx index ac9e5431..ea616e43 100644 --- a/src/PVGUI/PVGUI_ParaViewSettingsPane.cxx +++ b/src/PVGUI/PVGUI_ParaViewSettingsPane.cxx @@ -25,6 +25,8 @@ #include "PVGUI_ParaViewSettingsPane.h" #include "ui_pqCustomSettingsWidget.h" +#include + #include #include @@ -70,7 +72,7 @@ public: bool PVGUI_ParaViewSettingsPane::ShowRestartRequired = false; //---------------------------------------------------------------------------- -PVGUI_ParaViewSettingsPane::PVGUI_ParaViewSettingsPane(QWidget *widgetParent) +PVGUI_ParaViewSettingsPane::PVGUI_ParaViewSettingsPane(QWidget *widgetParent, LightApp_Application * app) : QtxUserDefinedContent(widgetParent), Internals (new PVGUI_ParaViewSettingsPane::pqInternals()) { @@ -156,6 +158,10 @@ PVGUI_ParaViewSettingsPane::PVGUI_ParaViewSettingsPane(QWidget *widgetParent) // this->connect(ui.buttonBox->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked()), // SLOT(onRestoreDefaults())); // this->connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton*)), SLOT(clicked(QAbstractButton*))); + + // [ABN] connect to reset to default emitted by Light_App: + this->connect(app, SIGNAL(preferenceResetToDefaults()), this, SLOT(onRestoreDefaults())); + this->connect(this, SIGNAL(accepted()), SLOT(onAccepted())); this->connect(this, SIGNAL(rejected()), SLOT(onRejected())); this->connect(ui.tabBar, SIGNAL(currentChanged(int)), this, SLOT(onTabIndexChanged(int))); diff --git a/src/PVGUI/PVGUI_ParaViewSettingsPane.h b/src/PVGUI/PVGUI_ParaViewSettingsPane.h index 31729139..a8e9467c 100644 --- a/src/PVGUI/PVGUI_ParaViewSettingsPane.h +++ b/src/PVGUI/PVGUI_ParaViewSettingsPane.h @@ -32,6 +32,7 @@ class QAbstractButton; class vtkSMProperty; class QShowEvent; class QHideEvent; +class LightApp_Application; /**! * Almost identical copy/paste of what is found in @@ -45,7 +46,7 @@ class PVGUI_ParaViewSettingsPane : public QtxUserDefinedContent Q_OBJECT public: - PVGUI_ParaViewSettingsPane(QWidget *parent=0); + PVGUI_ParaViewSettingsPane(QWidget *parent, LightApp_Application * app); virtual ~PVGUI_ParaViewSettingsPane(); /// Implementation of QtxUserDefinedContent interface -- 2.39.2