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

List:       kde-commits
Subject:    KDE/kdepim/mobile
From:       Tobias Koenig <tokoe () kde ! org>
Date:       2010-11-03 15:50:13
Message-ID: 20101103155013.8B067AC89B () svn ! kde ! org
[Download RAW message or body]

SVN commit 1192634 by tokoe:

Introduce GuiStateManager::ConfigScreenState and make
the visibility of all ConfigDialog.qml depending on it


 M  +3 -2      calendar/ConfigDialog.qml  
 M  +1 -2      calendar/korganizer-mobile.qml  
 M  +3 -2      contacts/ConfigDialog.qml  
 M  +1 -2      contacts/kaddressbook-mobile.qml  
 M  +5 -0      lib/guistatemanager.cpp  
 M  +11 -0     lib/guistatemanager.h  
 M  +3 -2      mail/ConfigDialog.qml  
 M  +11 -13    mail/kmail-mobile.qml  
 M  +3 -2      tasks/ConfigDialog.qml  
 M  +1 -2      tasks/tasks.qml  


--- trunk/KDE/kdepim/mobile/calendar/ConfigDialog.qml #1192633:1192634
@@ -27,6 +27,7 @@
   anchors.fill: parent
   z: 10
   color: "white"
+  visible: guiStateManager.inConfigScreenState
 
   QML.Flickable {
     id: configWidgetBox
@@ -59,7 +60,7 @@
     buttonText: KDE.i18n( "Ok" )
     onClicked: {
       configWidget.save();
-      configDialog.visible = false
+      guiStateManager.popState()
     }
   }
 
@@ -70,7 +71,7 @@
     width: 150
     buttonText: KDE.i18n( "Cancel" )
     onClicked: {
-      configDialog.visible = false
+      guiStateManager.popState()
     }
   }
 }
--- trunk/KDE/kdepim/mobile/calendar/korganizer-mobile.qml #1192633:1192634
@@ -516,7 +516,7 @@
               name : "configure"
               script : {
                 actionPanel.collapse();
-                configDialog.visible = true;
+                guiStateManager.pushState( KPIM.GuiStateManager.ConfigScreenState );
               }
             },
             KPIM.ScriptAction {
@@ -732,7 +732,6 @@
 
   ConfigDialog {
     id: configDialog
-    visible: false
   }
 
   SearchDialog {
--- trunk/KDE/kdepim/mobile/contacts/ConfigDialog.qml #1192633:1192634
@@ -27,6 +27,7 @@
   anchors.fill: parent
   z: 10
   color: "white"
+  visible: guiStateManager.inConfigScreenState
 
   QML.Flickable {
     id: configWidgetBox
@@ -59,7 +60,7 @@
     buttonText: KDE.i18n( "Ok" )
     onClicked: {
       configWidget.save();
-      configDialog.visible = false
+      guiStateManager.popState()
     }
   }
 
@@ -70,7 +71,7 @@
     width: 150
     buttonText: KDE.i18n( "Cancel" )
     onClicked: {
-      configDialog.visible = false
+      guiStateManager.popState()
     }
   }
 }
--- trunk/KDE/kdepim/mobile/contacts/kaddressbook-mobile.qml #1192633:1192634
@@ -325,7 +325,7 @@
               name : "configure"
               script : {
                 actionPanel.collapse();
-                configDialog.visible = true;
+                guiStateManager.pushState( KPIM.GuiStateManager.ConfigScreenState );
               }
             },
             KPIM.ScriptAction {
@@ -461,7 +461,6 @@
 
   ConfigDialog {
     id: configDialog
-    visible: false
   }
 
   SearchDialog {
--- trunk/KDE/kdepim/mobile/lib/guistatemanager.cpp #1192633:1192634
@@ -144,6 +144,11 @@
   return (currentState() == SearchResultScreenState);
 }
 
+bool GuiStateManager::inConfigScreenState() const
+{
+  return (currentState() == ConfigScreenState);
+}
+
 void GuiStateManager::emitChangedSignal()
 {
   emit guiStateChanged();
--- trunk/KDE/kdepim/mobile/lib/guistatemanager.h #1192633:1192634
@@ -43,6 +43,7 @@
   Q_PROPERTY( bool inViewSingleItemState READ inViewSingleItemState NOTIFY guiStateChanged )
   Q_PROPERTY( bool inSearchScreenState READ inSearchScreenState NOTIFY guiStateChanged )
   Q_PROPERTY( bool inSearchResultScreenState READ inSearchResultScreenState NOTIFY guiStateChanged )
+  Q_PROPERTY( bool inConfigScreenState READ inConfigScreenState NOTIFY guiStateChanged )
 
   Q_ENUMS( GuiState )
 
@@ -103,6 +104,11 @@
       SearchResultScreenState,
 
       /**
+       * The state when the main configuration dialog is shown.
+       */
+      ConfigScreenState,
+
+      /**
        * Point of extension.
        */
       UserState
@@ -199,6 +205,11 @@
      */
     bool inSearchResultScreenState() const;
 
+    /**
+     * Returns whether the current state is the config screen state.
+     */
+    bool inConfigScreenState() const;
+
   Q_SIGNALS:
     void guiStateChanged();
 
--- trunk/KDE/kdepim/mobile/mail/ConfigDialog.qml #1192633:1192634
@@ -27,6 +27,7 @@
   anchors.fill: parent
   z: 10
   color: "white"
+  visible: guiStateManager.inConfigScreenState
 
   QML.Flickable {
     id: configWidgetBox
@@ -59,7 +60,7 @@
     buttonText: KDE.i18n( "Ok" )
     onClicked: {
       configWidget.save();
-      configDialog.visible = false
+      guiStateManager.popState()
     }
   }
 
@@ -70,7 +71,7 @@
     width: 150
     buttonText: KDE.i18n( "Cancel" )
     onClicked: {
-      configDialog.visible = false
+      guiStateManager.popState()
     }
   }
 }
--- trunk/KDE/kdepim/mobile/mail/kmail-mobile.qml #1192633:1192634
@@ -522,7 +522,7 @@
                 name : "configure"
                 script : {
                   actionPanel.collapse();
-                  configDialog.visible = true;
+                  guiStateManager.pushState( KPIM.GuiStateManager.ConfigScreenState );
                 }
               },
               KPIM.ScriptAction {
@@ -694,18 +694,6 @@
     }
   }
 
-
-  ConfigDialog {
-    id: configDialog
-    visible: false
-  }
-
-  FilterConfigDialog {
-    id: filterConfigDialog
-    visible: false
-    filterModel: _filterModel
-  }
-
   QML.Connections {
     target: startPage
     onAccountSelected : {
@@ -731,7 +719,17 @@
     source: backgroundImage.source
   }
 
+  ConfigDialog {
+    id: configDialog
+  }
+
   SearchDialog {
     id : searchDialog
   }
+
+  FilterConfigDialog {
+    id: filterConfigDialog
+    visible: false
+    filterModel: _filterModel
 }
+}
--- trunk/KDE/kdepim/mobile/tasks/ConfigDialog.qml #1192633:1192634
@@ -27,6 +27,7 @@
   anchors.fill: parent
   z: 10
   color: "white"
+  visible: guiStateManager.inConfigScreenState
 
   QML.Flickable {
     id: configWidgetBox
@@ -59,7 +60,7 @@
     buttonText: KDE.i18n( "Ok" )
     onClicked: {
       configWidget.save();
-      configDialog.visible = false
+      guiStateManager.popState()
     }
   }
 
@@ -70,7 +71,7 @@
     width: 150
     buttonText: KDE.i18n( "Cancel" )
     onClicked: {
-      configDialog.visible = false
+      guiStateManager.popState()
     }
   }
 }
--- trunk/KDE/kdepim/mobile/tasks/tasks.qml #1192633:1192634
@@ -274,7 +274,7 @@
               name : "configure"
               script : {
                 actionPanel.collapse();
-                configDialog.visible = true;
+                guiStateManager.pushState( KPIM.GuiStateManager.ConfigScreenState );
               }
             },
             KPIM.ScriptAction {
@@ -431,7 +431,6 @@
 
   ConfigDialog {
     id: configDialog
-    visible: false
   }
 
   SearchDialog {
[prev in list] [next in list] [prev in thread] [next in thread] 

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