[Digikam-devel] extragear/graphics/digikam/showfoto

Gilles Caulier caulier.gilles at free.fr
Mon Oct 31 12:12:14 GMT 2005


SVN commit 476057 by cgilles:

Showfoto::slideshow : disable any unecessary actions during slide (file open, file save, image plugins, etc.)

CCMAIL: digikam-devel at kde.org

 M  +19 -5     showfoto.cpp  
 M  +2 -1      showfoto.h  


--- trunk/extragear/graphics/digikam/showfoto/showfoto.cpp #476056:476057
@@ -248,8 +248,8 @@
 
 void ShowFoto::setupActions()
 {
-    KStdAction::open(this, SLOT(slotOpenFile()),
-                     actionCollection(), "open_file");
+    m_fileOpenAction = KStdAction::open(this, SLOT(slotOpenFile()),
+                       actionCollection(), "open_file");
     KStdAction::quit(this, SLOT(close()),
                      actionCollection());
 
@@ -1123,7 +1123,7 @@
     }
 }
 
-void ShowFoto::toggleActions(bool val)
+void ShowFoto::toggleActions(bool val, bool slideShow)
 {
     m_zoomFitAction->setEnabled(val);
     m_saveAsAction->setEnabled(val);
@@ -1134,7 +1134,18 @@
     m_filePrintAction->setEnabled(val);
     m_resizeAction->setEnabled(val);
     m_fileDeleteAction->setEnabled(val);
-    m_slideShowAction->setEnabled(val);
+    
+    if (!slideShow)
+    {
+       // if no slideshow mode then toggle it.
+       m_slideShowAction->setEnabled(val);
+    }
+    else
+    {
+       // if slideshow mode then toogle file open actions.
+       m_slideShowAction->setEnabled(val);
+       m_fileOpenAction->setEnabled(val);
+    }
 
     if (m_BCGAction)
         m_BCGAction->setEnabled(val);
@@ -1144,7 +1155,8 @@
     for (Digikam::ImagePlugin* plugin = pluginList.first();
          plugin; plugin = pluginList.next())
     {
-        if (plugin) {
+        if (plugin) 
+        {
             plugin->setEnabledActions(val);
         }
     }
@@ -1431,11 +1443,13 @@
             m_fullScreenAction->activate();
         }
 
+        toggleActions(false, true);
         m_slideShow->start();
     }
     else
     {
         m_slideShow->stop();
+        toggleActions(true, true);
 
         if (m_fullScreenAction->isChecked() && m_slideShowInFullScreen)
         {
--- trunk/extragear/graphics/digikam/showfoto/showfoto.h #476056:476057
@@ -115,7 +115,7 @@
     void saveSettings();
     bool promptUserSave();
     bool save();
-    void toggleActions(bool val);
+    void toggleActions(bool val, bool slideShow=false);
     void toggleNavigation(int index);
     void loadPlugins();
     void unLoadPlugins();
@@ -157,6 +157,7 @@
     KAction               *m_propertiesAction;
     KAction               *m_filePrintAction;    
     KAction               *m_fileDeleteAction;
+    KAction               *m_fileOpenAction;
     
     KAction               *m_forwardAction;
     KAction               *m_backAction;



More information about the Digikam-devel mailing list