[Digikam-devel] extragear/graphics/digikam

Gilles Caulier caulier.gilles at free.fr
Thu Jan 26 07:28:18 GMT 2006


SVN commit 502480 by cgilles:

digikam from trunk : Showfoto/IE common GUI implementation : 

- new setupStandardAccelerators() to set common keys accelerators.
- new common plugActionAccel() and unplugActionAccel() methods.

Nota : Now IE asnd showfoto are a large common accelerator collection. I'm so supprise to see a big differences betwwen Showfoto and IE in original implementations about accelerators (just one keys is set to IE, and many others to showfoto). Nobody have reported any problems before. Certainly none digikam users used Key accelerators in IE (Achim, Mikolaj, if you read this message ... (:=)))...

CCMAIL: digikam-devel at kde.org

 M  +1 -29     showfoto/showfoto.cpp  
 M  +64 -0     utilities/imageeditor/editor/editorwindow.cpp  
 M  +10 -1     utilities/imageeditor/editor/editorwindow.h  
 M  +2 -26     utilities/imageeditor/editor/imagewindow.cpp  
 M  +0 -4      utilities/imageeditor/editor/imagewindow.h  


--- trunk/extragear/graphics/digikam/showfoto/showfoto.cpp #502479:502480
@@ -333,35 +333,7 @@
 
     createGUI("showfotoui.rc", false);
 
-    KAccel *accel = new KAccel(this);
-    accel->insert("Exit fullscreen", i18n("Exit Fullscreen"),
-                  i18n("Exit out of the fullscreen mode"),
-                  Key_Escape, this, SLOT(slotEscapePressed()),
-                  false, true);
-    accel->insert("Next Image Key_Space", i18n("Next Image"),
-                  i18n("Load Next Image"),
-                  Key_Space, this, SLOT(slotForward()),
-                  false, true);
-    accel->insert("Previous Image Key_Backspace", i18n("Previous Image"),
-                  i18n("Load Previous Image"),
-                  Key_Backspace, this, SLOT(slotBackward()),
-                  false, true);
-    accel->insert("Next Image Key_Next", i18n("Next Image"),
-                  i18n("Load Next Image"),
-                  Key_Next, this, SLOT(slotForward()),
-                  false, true);
-    accel->insert("Previous Image Key_Prior", i18n("Previous Image"),
-                  i18n("Load Previous Image"),
-                  Key_Prior, this, SLOT(slotBackward()),
-                  false, true);
-    accel->insert("Zoom Plus Key_Plus", i18n("Zoom In"),
-                  i18n("Zoom into Image"),
-                  Key_Plus, m_canvas, SLOT(slotIncreaseZoom()),
-                  false, true);
-    accel->insert("Zoom Plus Key_Minus", i18n("Zoom Out"),
-                  i18n("Zoom out of Image"),
-                  Key_Minus, m_canvas, SLOT(slotDecreaseZoom()),
-                  false, true);
+    setupStandardAccelerators();
 }
 
 void ShowFoto::applySettings()
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindow.cpp #502479:502480
@@ -110,6 +110,11 @@
     m_rotate180Action        = 0;
     m_rotate270Action        = 0;    
     m_rotateAction           = 0;
+    m_flipHorzAction         = 0;
+    m_flipVertAction         = 0;
+    m_undoAction             = 0;
+    m_redoAction             = 0;
+    m_accel                  = 0;
     m_fullScreen             = false;
     m_isReadOnly             = false;
 
@@ -319,6 +324,46 @@
                                            actionCollection(), "editorwindow_imagepluginshelp");
 }
 
+void EditorWindow::setupStandardAccelerators()
+{
+    m_accel = new KAccel(this);
+    
+    m_accel->insert("Exit fullscreen", i18n("Exit Fullscreen"),
+                    i18n("Exit out of the fullscreen mode"),
+                    Key_Escape, this, SLOT(slotEscapePressed()),
+                    false, true);
+
+    m_accel->insert("Next Image Key_Space", i18n("Next Image"),
+                    i18n("Load Next Image"),
+                    Key_Space, this, SLOT(slotForward()),
+                    false, true);
+
+    m_accel->insert("Previous Image Key_Backspace", i18n("Previous Image"),
+                    i18n("Load Previous Image"),
+                    Key_Backspace, this, SLOT(slotBackward()),
+                    false, true);
+
+    m_accel->insert("Next Image Key_Next", i18n("Next Image"),
+                    i18n("Load Next Image"),
+                    Key_Next, this, SLOT(slotForward()),
+                    false, true);
+
+    m_accel->insert("Previous Image Key_Prior", i18n("Previous Image"),
+                    i18n("Load Previous Image"),
+                    Key_Prior, this, SLOT(slotBackward()),
+                    false, true);
+
+    m_accel->insert("Zoom Plus Key_Plus", i18n("Zoom In"),
+                    i18n("Zoom into Image"),
+                    Key_Plus, m_canvas, SLOT(slotIncreaseZoom()),
+                    false, true);
+    
+    m_accel->insert("Zoom Plus Key_Minus", i18n("Zoom Out"),
+                    i18n("Zoom out of Image"),
+                    Key_Minus, m_canvas, SLOT(slotDecreaseZoom()),
+                    false, true);
+}
+    
 void EditorWindow::setupStatusBar()
 {
     m_nameLabel = new IOFileProgressBar(statusBar());
@@ -478,6 +523,25 @@
         m_fullScreenAction->activate();
 }
 
+void EditorWindow::plugActionAccel(KAction* action)
+{
+    if (!action)
+        return;
+
+    m_accel->insert(action->text(),
+                    action->text(),
+                    action->whatsThis(),
+                    action->shortcut(),
+                    action,
+                    SLOT(activate()));
+}
+
+void EditorWindow::unplugActionAccel(KAction* action)
+{
+    m_accel->remove(action->text());
+}
+
+
 }  // namespace Digikam
 
 #include "editorwindow.moc"
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindow.h #502479:502480
@@ -33,6 +33,7 @@
 class QSplitter;
 class QLabel;
 
+class KAccel;
 class KToolBarPopupAction;
 class KToggleAction;
 class KAction;
@@ -99,6 +100,8 @@
     KActionMenu             *m_flipAction;
     KActionMenu             *m_rotateAction;
 
+    KAccel                  *m_accel;
+    
     KSelectAction           *m_viewHistogramAction;
 
     KToggleAction           *m_zoomFitAction;
@@ -142,11 +145,17 @@
     
 protected:
 
+    void closeEvent(QCloseEvent* e);
+
     void setupStandardActions();    
+    void setupStandardAccelerators();
     void setupStatusBar();
+
     void printImage(KURL url);
-    void closeEvent(QCloseEvent* e);
 
+    void plugActionAccel(KAction* action);
+    void unplugActionAccel(KAction* action);
+    
     virtual void setupActions()=0;
     virtual bool promptUserSave()=0;
     virtual void saveSettings()=0;
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/imagewindow.cpp #502479:502480
@@ -122,14 +122,6 @@
 
     m_contextMenu = dynamic_cast<QPopupMenu*>(factory()->container("RMBMenu", this));
     
-    // -- Some Accels not available from actions -------------
-
-    m_accel = new KAccel(this);
-    m_accel->insert("Exit fullscreen", i18n("Exit Fullscreen"),
-                    i18n("Exit out of the fullscreen mode"),
-                    Key_Escape, this, SLOT(slotEscapePressed()),
-                    false, true);
-
     // -- setup connections ---------------------------
            
     connect(m_canvas, SIGNAL(signalRightButtonClicked()),
@@ -232,6 +224,8 @@
     
     createGUI("digikamimagewindowui.rc", false);
 
+    setupStandardAccelerators();
+    
     // -- if rotating/flipping set the rotatedflipped flag to true ---------------------
 
     connect(m_rotate90Action, SIGNAL(activated()),
@@ -1166,24 +1160,6 @@
     return true;
 }
 
-void ImageWindow::plugActionAccel(KAction* action)
-{
-    if (!action)
-        return;
-
-    m_accel->insert(action->text(),
-                    action->text(),
-                    action->whatsThis(),
-                    action->shortcut(),
-                    action,
-                    SLOT(activate()));
-}
-
-void ImageWindow::unplugActionAccel(KAction* action)
-{
-    m_accel->remove(action->text());
-}
-
 void ImageWindow::slotAssignTag(int tagID)
 {
     IconItem* item = m_view->findItem(m_urlCurrent.url());
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/imagewindow.h #502479:502480
@@ -90,8 +90,6 @@
     KURL::List              m_urlList;
     KURL                    m_urlCurrent;
     
-    KAccel                 *m_accel;
-    
     // Allow to use Image properties and
     // Comments/Tags dialogs from main window.
     AlbumIconView            *m_view;
@@ -109,8 +107,6 @@
     void setupActions();
 
     void readSettings();
-    void plugActionAccel(KAction* action);
-    void unplugActionAccel(KAction* action);
     bool save();
     bool saveAs();
     void finishSaving(bool success);



More information about the Digikam-devel mailing list