[Digikam-devel] [Bug 145237] small wishes for the light-table

Gilles Caulier caulier.gilles at gmail.com
Fri May 11 14:22:35 BST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=145237         




------- Additional Comments From caulier.gilles gmail com  2007-05-11 15:22 -------
SVN commit 663493 by cgilles:

digikam from trunk : Light Table : added new options to navigate between thumbbar items (first, previous, next, last). Shortcuts are the same than Album Gui and Image Editor
CCBUGS: 145237

 M  +1 -1      lighttablebar.cpp  
 M  +1 -1      lighttablebar.h  
 M  +72 -3     lighttablewindow.cpp  
 M  +5 -0      lighttablewindow.h  
 M  +14 -1     lighttablewindowui.rc  


--- trunk/extragear/graphics/digikam/utilities/lighttable/lighttablebar.cpp #663492:663493
 @ -284,7 +284,7  @
     return list;
 }
 
-void LightTableBar::setSelected(LightTableBarItem* ltItem)
+void LightTableBar::setSelectedItem(LightTableBarItem* ltItem)
 {
     ThumbBarItem *item = static_cast<ThumbBarItem*>(ltItem);
     if (item) ThumbBarView::setSelected(item);
--- trunk/extragear/graphics/digikam/utilities/lighttable/lighttablebar.h #663492:663493
 @ -59,7 +59,7  @
     ImageInfo*    currentItemImageInfo() const;
     ImageInfoList itemsImageInfoList();
 
-    void setSelected(LightTableBarItem* ltItem);
+    void setSelectedItem(LightTableBarItem* ltItem);
 
     LightTableBarItem* findItemByInfo(const ImageInfo* info) const;
     LightTableBarItem* findItemByPos(const QPoint& pos) const;
--- trunk/extragear/graphics/digikam/utilities/lighttable/lighttablewindow.cpp #663492:663493
 @ -109,6 +109,10  @
         statusProgressBar      = 0;
         leftZoomBar            = 0;  
         rightZoomBar           = 0;  
+        forwardAction          = 0;
+        backwardAction         = 0;
+        firstAction            = 0;
+        lastAction             = 0;
     }
 
     bool                      fullScreenHideToolBar;
 @ -127,6 +131,11  @
     KAction                  *star4;
     KAction                  *star5;
 
+    KAction                  *forwardAction;
+    KAction                  *backwardAction;
+    KAction                  *firstAction;
+    KAction                  *lastAction;
+
     KAction                  *setItemLeftAction;
     KAction                  *setItemRightAction;
     KAction                  *clearListAction;
 @ -378,6 +387,22  @
 {
     // -- Standard 'File' menu actions ---------------------------------------------
 
+    d->backwardAction = KStdAction::back(this, SLOT(slotBackward()),
+                                    actionCollection(), "lighttable_backward");
+
+    d->forwardAction = KStdAction::forward(this, SLOT(slotForward()),
+                                   actionCollection(), "lighttable_forward");
+
+    d->firstAction = new KAction(i18n("&First"), "start",
+                                 KStdAccel::shortcut( KStdAccel::Home),
+                                 this, SLOT(slotFirst()),
+                                 actionCollection(), "lighttable_first");
+
+    d->lastAction = new KAction(i18n("&Last"), "finish",
+                                KStdAccel::shortcut( KStdAccel::End),
+                                this, SLOT(slotLast()),
+                                actionCollection(), "lighttable_last");
+
     d->setItemLeftAction = new KAction(i18n("Show item on left panel"), "previous",
                                        CTRL+Key_L, this, SLOT(slotSetItemLeft()),
                                        actionCollection(), "lighttable_setitemleft");
 @ -510,6 +535,26  @
                     Key_Escape, this, SLOT(slotEscapePressed()),
                     false, true);
 
+    d->accelerators->insert("Next Image Key_Space", i18n("Next Image"),
+                    i18n("Load Next Image"),
+                    Key_Space, this, SLOT(slotForward()),
+                    false, true);
+
+    d->accelerators->insert("Previous Image Key_Backspace", i18n("Previous Image"),
+                    i18n("Load Previous Image"),
+                    Key_Backspace, this, SLOT(slotBackward()),
+                    false, true);
+
+    d->accelerators->insert("Next Image Key_Next", i18n("Next Image"),
+                    i18n("Load Next Image"),
+                    Key_Next, this, SLOT(slotForward()),
+                    false, true);
+
+    d->accelerators->insert("Previous Image Key_Prior", i18n("Previous Image"),
+                    i18n("Load Previous Image"),
+                    Key_Prior, this, SLOT(slotBackward()),
+                    false, true);
+
     d->accelerators->insert("Zoom Plus Key_Plus", i18n("Zoom in"),
                     i18n("Zoom in on image"),
                     Key_Plus, d->previewView, SLOT(slotIncreaseZoom()),
 @ -530,7 +575,7  @
             LightTableBarItem *item = new LightTableBarItem(d->barView, *it);
             if (*it == imageInfoCurrent)
             {
-                d->barView->setSelected(item);
+                d->barView->setSelectedItem(item);
             }
         }
     }   
 @ -580,12 +625,12  @
 
 void LightTableWindow::slotLeftPanelLeftButtonClicked()
 {
-    d->barView->setSelected(d->barView->findItemByInfo(d->previewView->leftImageInfo()));
+    d->barView->setSelectedItem(d->barView->findItemByInfo(d->previewView->leftImageInfo()));
 }
 
 void LightTableWindow::slotRightPanelLeftButtonClicked()
 {
-    d->barView->setSelected(d->barView->findItemByInfo(d->previewView->rightImageInfo()));
+    d->barView->setSelectedItem(d->barView->findItemByInfo(d->previewView->rightImageInfo()));
 }
 
 void LightTableWindow::slotLeftPreviewLoaded(bool b)
 @ -1165,5 +1210,29  @
     }
 }
 
+void LightTableWindow::slotBackward()
+{
+    ThumbBarItem* curr = d->barView->currentItem();
+    if (curr && curr->prev())
+        d->barView->setSelected(curr->prev());
+}
+
+void LightTableWindow::slotForward()
+{
+    ThumbBarItem* curr = d->barView->currentItem();
+    if (curr && curr->next())
+        d->barView->setSelected(curr->next());
+}
+
+void LightTableWindow::slotFirst()
+{
+    d->barView->setSelected( d->barView->firstItem() );
+}
+
+void LightTableWindow::slotLast()
+{
+    d->barView->setSelected( d->barView->lastItem() );
+}
+
 }  // namespace Digikam
 
--- trunk/extragear/graphics/digikam/utilities/lighttable/lighttablewindow.h #663492:663493
 @ -85,6 +85,11  @
 
 private slots:
 
+    void slotBackward();
+    void slotForward();
+    void slotFirst();
+    void slotLast();
+
     void slotSetItemLeft();
     void slotSetItemRight();
     void slotSetItemOnLeftPanel(ImageInfo*);
--- trunk/extragear/graphics/digikam/utilities/lighttable/lighttablewindowui.rc #663492:663493
 @ -1,9 +1,14  @
 <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<gui version="12" name="lighttablewindow" >
+<gui version="13" name="lighttablewindow" >
 
 <MenuBar>
 
     <Menu name="File" ><text>&File</text>
+        <Action name="lighttable_first" />
+        <Action name="lighttable_backward" />
+        <Action name="lighttable_forward" />
+        <Action name="lighttable_last" />
+        <Separator/>
         <Action name="lighttable_setitemleft" />
         <Action name="lighttable_setitemright" />
         <Action name="lighttable_edititem" />
 @ -49,6 +54,14  @
 </MenuBar>
 
 <ToolBar name="ToolBar" ><text>Main Toolbar</text>
+     <Action name="lighttable_first" />
+     <Action name="lighttable_backward" />
+     <Action name="lighttable_forward" />
+     <Action name="lighttable_last" />
+     <Separator/>     
+     <Action name="lighttable_setitemleft" />
+     <Action name="lighttable_setitemright" />
+     <Separator/>     
      <Action name="lighttable_syncpreview" /> 
      <Action name="lighttable_zoomplus" /> 
      <Action name="lighttable_zoomminus" />



More information about the Digikam-devel mailing list