Browse Source

ctkSettingsPanel - Remove "acceptSettings()" and set "applySettings()' as virtual

Jean-Christophe Fillion-Robin 14 years ago
parent
commit
ef721b55a4

+ 1 - 12
Libs/Widgets/ctkSettingsDialog.cpp

@@ -215,7 +215,7 @@ ctkSettingsPanel* ctkSettingsDialog::panel(const QString& label)const
 // --------------------------------------------------------------------------
 // --------------------------------------------------------------------------
 void ctkSettingsDialog::accept()
 void ctkSettingsDialog::accept()
 {
 {
-  this->acceptSettings();
+  this->applySettings();
   this->Superclass::accept();
   this->Superclass::accept();
 }
 }
 
 
@@ -227,17 +227,6 @@ void ctkSettingsDialog::reject()
 }
 }
 
 
 // --------------------------------------------------------------------------
 // --------------------------------------------------------------------------
-void ctkSettingsDialog::acceptSettings()
-{
-  Q_D(ctkSettingsDialog);
-  foreach(ctkSettingsPanel* panel, d->Panels.values())
-    {
-    panel->acceptSettings();
-    }
-  d->SettingsButtonBox->button(QDialogButtonBox::Reset)->setEnabled(false);
-}
-
-// --------------------------------------------------------------------------
 void ctkSettingsDialog::applySettings()
 void ctkSettingsDialog::applySettings()
 {
 {
   Q_D(ctkSettingsDialog);
   Q_D(ctkSettingsDialog);

+ 0 - 1
Libs/Widgets/ctkSettingsDialog.h

@@ -62,7 +62,6 @@ public slots:
   void setCurrentPanel(ctkSettingsPanel* panel);
   void setCurrentPanel(ctkSettingsPanel* panel);
   void setCurrentPanel(const QString& label);
   void setCurrentPanel(const QString& label);
 
 
-  void acceptSettings();
   void applySettings();
   void applySettings();
   void resetSettings();
   void resetSettings();
   void restoreDefaultSettings();
   void restoreDefaultSettings();

+ 0 - 6
Libs/Widgets/ctkSettingsPanel.cpp

@@ -227,12 +227,6 @@ void ctkSettingsPanel::registerProperty(const QString& key,
 }
 }
 
 
 // --------------------------------------------------------------------------
 // --------------------------------------------------------------------------
-void ctkSettingsPanel::acceptSettings()
-{
-  this->applySettings();
-}
-
-// --------------------------------------------------------------------------
 void ctkSettingsPanel::applySettings()
 void ctkSettingsPanel::applySettings()
 {
 {
   Q_D(ctkSettingsPanel);
   Q_D(ctkSettingsPanel);

+ 1 - 4
Libs/Widgets/ctkSettingsPanel.h

@@ -65,13 +65,10 @@ public:
 
 
 public slots:
 public slots:
 
 
-  /// By default, it calls applySettings()
-  virtual void acceptSettings();
-
   /// Forget the old property values so next time resetSettings is called it
   /// Forget the old property values so next time resetSettings is called it
   /// will set the properties with the same values when applySettings() is
   /// will set the properties with the same values when applySettings() is
   /// called.
   /// called.
-  void applySettings();
+  virtual void applySettings();
 
 
   /// Restore all the properties with their values when applySettings() was
   /// Restore all the properties with their values when applySettings() was
   /// called last (or their original values if applySettings was never called).
   /// called last (or their original values if applySettings was never called).