Salome HOME
Copyright update 2022
[modules/paravis.git] / src / PVGUI / PVGUI_ParaViewSettingsPane.cxx
index fb095ece4472858f947ac8e2b38f916c4fa92c58..79d22048f83ba101009bbae444f1cac05c2d176e 100644 (file)
@@ -1,6 +1,6 @@
 // PARAVIS : ParaView wrapper SALOME module
 //
-// Copyright (C) 2010-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2010-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -25,6 +25,8 @@
 #include "PVGUI_ParaViewSettingsPane.h"
 #include "ui_pqCustomSettingsWidget.h"
 
+#include <LightApp_Application.h>
+
 #include <QtxDialog.h>
 
 #include <QString>
 #include <QShowEvent>
 #include <QHideEvent>
 
-// This class is revisited to hack on the SALOME's Preferences "Default" button
-// to ParaView's "Default" behavior.
 class PVGUI_ParaViewSettingsPane::pqInternals
 {
 public:
-  pqInternals()
-  {
-    // Get the containing preference tab to identify when it has focus
-
-  }
-  ~pqInternals();
-
   Ui::CustomSettingsWidget Ui;
 
   // Map from tab indices to stack widget indices. This is needed because there
@@ -79,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())
 {
@@ -165,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)));
@@ -220,7 +217,7 @@ void PVGUI_ParaViewSettingsPane::hideEvent(QHideEvent * ev)
 }
 
 //-----------------------------------------------------------------------------
-void PVGUI_ParaViewSettingsPane::clicked(QAbstractButton *button)
+void PVGUI_ParaViewSettingsPane::clicked(QAbstractButton * /*button*/)
 {
 //  Ui::CustomSettingsWidget &ui = this->Internals->Ui;
 //  QDialogButtonBox::ButtonRole role = ui.buttonBox->buttonRole(button);