[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/systemsettings
From:       Ben Cooksley <sourtooth () gmail ! com>
Date:       2009-08-11 9:01:27
Message-ID: 1249981287.634623.15485.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1009931 by bcooksley:

Enhance support for view specific configurations with automatic load and save slots

 M  +3 -0      app/SettingsBase.cpp  
 M  +8 -0      core/BaseMode.cpp  
 M  +12 -0     core/BaseMode.h  


--- trunk/KDE/kdebase/workspace/systemsettings/app/SettingsBase.cpp #1009930:1009931
@@ -203,6 +203,7 @@
     const int currentIndex = configWidget.CbPlugins->currentIndex();
     BaseConfig::setActiveView( possibleViews.keys().at(currentIndex) );
     BaseConfig::setShowToolTips( configWidget.ChTooltips->isChecked() );
+    activeView->saveConfiguration();
     changePlugin();
 }
 
@@ -216,6 +217,8 @@
         return; // It shouldn't be triggering anyway, since the action is disabled
     }
 
+    activeView->loadConfiguration();
+
     const QStringList pluginList = possibleViews.keys();
     const int configIndex = pluginList.indexOf( BaseConfig::activeView() );
     if( configIndex == -1 ) {
--- trunk/KDE/kdebase/workspace/systemsettings/core/BaseMode.cpp #1009930:1009931
@@ -112,6 +112,14 @@
     Q_UNUSED( config );
 }
 
+void BaseMode::loadConfiguration()
+{
+}
+
+void BaseMode::saveConfiguration()
+{
+}
+
 MenuItem * BaseMode::rootItem() const
 {
     return d->rootItem;
--- trunk/KDE/kdebase/workspace/systemsettings/core/BaseMode.h #1009930:1009931
@@ -171,6 +171,18 @@
      */
     virtual void addConfiguration( KConfigDialog * config );
 
+    /**
+     * Allows views to load their configuration before the configuration dialog is shown
+     * Views should revert any changes that have not been saved
+     */
+    virtual void loadConfiguration();
+
+    /**
+     * Should be implmented to ensure that views settings are saved when the user confirms their changes
+     * Views should also apply the configuration at the same time
+     */
+    virtual void saveConfiguration();
+
 Q_SIGNALS:
     /**
      * Triggers a reload of the views actions by the host application.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic