[Digikam-devel] [Bug 147854] Put images into an emptied light-table
Arnd Baecker
arnd.baecker at web.de
Fri Sep 7 10:47:44 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=147854
------- Additional Comments From arnd.baecker web de 2007-09-07 11:47 -------
SVN commit 709349 by abaecker:
Always put images into an empty light-table on F6. With CTRL+F6 images
are added to the existing images in the light table.
CCBUGS: 147854
TODO:KDE4PORT
M +10 -6 digikam/albumiconview.cpp
M +2 -2 digikam/albumiconview.h
M +11 -2 digikam/digikamapp.cpp
M +1 -0 digikam/digikamui.rc
M +22 -3 digikam/digikamview.cpp
M +1 -0 digikam/digikamview.h
M +14 -4 utilities/lighttable/lighttablewindow.cpp
M +1 -1 utilities/lighttable/lighttablewindow.h
--- branches/extragear/kde3/graphics/digikam/digikam/albumiconview.cpp #709348:709349
@ -682,7 +682,8 @
case 19:
{
- insertSelectionToLightTable();
+ // add images to existing images in the light table
+ insertSelectionToLightTable(true);
break;
}
@ -1027,10 +1028,11 @
imview->setFocus();
}
-void AlbumIconView::insertSelectionToLightTable()
+void AlbumIconView::insertSelectionToLightTable(bool addTo)
{
// Run Light Table with all selected image files in the current Album.
-
+ // If addTo is false, the light table will be emptied before adding
+ // the images.
ImageInfoList imageInfoList;
for (IconItem *it = firstItem() ; it ; it = it->nextItem())
@ -1044,10 +1046,10 @
}
}
- insertToLightTable(imageInfoList, imageInfoList.first());
+ insertToLightTable(imageInfoList, imageInfoList.first(), addTo);
}
-void AlbumIconView::insertToLightTable(const ImageInfoList& list, ImageInfo* current)
+void AlbumIconView::insertToLightTable(const ImageInfoList& list, ImageInfo* current, bool addTo)
{
LightTableWindow *ltview = LightTableWindow::lightTableWindow();
@ -1064,7 +1066,9 @
ltview->raise();
ltview->setFocus();
- ltview->loadImageInfos(list, current);
+ // If addTo is false, the light table will be emptied before adding
+ // the images.
+ ltview->loadImageInfos(list, current, addTo);
if (list.count()>1)
ltview->setLeftRightItems(list);
}
--- branches/extragear/kde3/graphics/digikam/digikam/albumiconview.h #709348:709349
@ -117,8 +117,8 @
AlbumIconItem* nextItemToThumbnail() const;
PixmapManager* pixmapManager() const;
- void insertSelectionToLightTable();
- void insertToLightTable(const ImageInfoList& list, ImageInfo* current);
+ void insertSelectionToLightTable(bool addTo = false);
+ void insertToLightTable(const ImageInfoList& list, ImageInfo* current, bool addTo = false);
signals:
--- branches/extragear/kde3/graphics/digikam/digikam/digikamapp.cpp #709348:709349
@ -634,8 +634,17 @
SLOT(slotImageLightTable()),
actionCollection(),
"image_lighttable");
- d->imageLightTableAction->setWhatsThis(i18n("Insert the selected items into the light table thumbbar."));
+ d->imageLightTableAction->setWhatsThis(i18n("Put the selected items into the light table thumbbar."));
+ d->imageLightTableAction = new KAction(i18n("Add to Light Table"),
+ "idea",
+ CTRL+Key_F6,
+ d->view,
+ SLOT(slotImageAddToLightTable()),
+ actionCollection(),
+ "image_add_to_lighttable");
+ d->imageLightTableAction->setWhatsThis(i18n("Add selected items to the light table thumbbar."));
+
d->imageRenameAction = new KAction(i18n("Rename..."),
"pencil",
Key_F2,
@ -922,7 +931,7 @
advFindAction->setText(i18n("Advanced Search..."));
advFindAction->setShortcut("Ctrl+Alt+F");
- new KAction(i18n("Light Table"), "idea", CTRL+Key_F6,
+ new KAction(i18n("Light Table"), "idea", SHIFT+Key_F6,
d->view, SLOT(slotLightTable()), actionCollection(),
"light_table");
--- branches/extragear/kde3/graphics/digikam/digikam/digikamui.rc #709348:709349
@ -43,6 +43,7 @
<Action name="image_view" />
<Action name="image_edit" />
<Action name="image_lighttable" />
+ <Action name="image_add_to_lighttable" />
<Action name="image_set_exif_orientation"/>
<Separator />
<ActionList name="image_actions"/>
--- branches/extragear/kde3/graphics/digikam/digikam/digikamview.cpp #709348:709349
@ -994,24 +994,43 @
void DigikamView::slotLightTable()
{
ImageInfoList empty;
- d->iconView->insertToLightTable(empty, 0);
+ d->iconView->insertToLightTable(empty, 0, true);
}
void DigikamView::slotImageLightTable()
{
if (d->albumWidgetStack->previewMode() == AlbumWidgetStack::PreviewAlbumMode)
{
- d->iconView->insertSelectionToLightTable();
+ // put images into an emptied light table
+ d->iconView->insertSelectionToLightTable(false);
}
else
{
ImageInfoList list;
ImageInfo *info = d->albumWidgetStack->imagePreviewView()->getImageInfo();
list.append(info);
- d->iconView->insertToLightTable(list, info);
+ // put images into an emptied light table
+ d->iconView->insertToLightTable(list, info, false);
}
}
+void DigikamView::slotImageAddToLightTable()
+{
+ if (d->albumWidgetStack->previewMode() == AlbumWidgetStack::PreviewAlbumMode)
+ {
+ // add images to the existing images in the light table
+ d->iconView->insertSelectionToLightTable(true);
+ }
+ else
+ {
+ ImageInfoList list;
+ ImageInfo *info = d->albumWidgetStack->imagePreviewView()->getImageInfo();
+ list.append(info);
+ // add images to the existing images in the light table
+ d->iconView->insertToLightTable(list, info, true);
+ }
+}
+
void DigikamView::slotImageRename(AlbumIconItem *iconItem)
{
AlbumIconItem *item;
--- branches/extragear/kde3/graphics/digikam/digikam/digikamview.h #709348:709349
@ -113,6 +113,7 @
// Image action slots
void slotImageLightTable();
+ void slotImageAddToLightTable();
void slotImagePreview();
void slotImageEdit();
void slotImageExifOrientation(int orientation);
--- branches/extragear/kde3/graphics/digikam/utilities/lighttable/lighttablewindow.cpp #709348:709349
@ -500,7 +500,9 @
// Deal with items dropped onto the thumbbar (e.g. from the Album view)
void LightTableWindow::slotThumbbarDroppedItems(const ImageInfoList& list)
{
- loadImageInfos(list, 0);
+ // Setting the third parameter of loadImageInfos to true
+ // means that the images are added to the presently available images.
+ loadImageInfos(list, 0, true);
if (list.count()>1)
setLeftRightItems(list);
}
@ -513,8 +515,14 @
// c) albumiconview.cpp: AlbumIconView::insertToLightTable
// calls ltview->loadImageInfos(list, current);
// - via drag&drop, i.e. calls issued by the ...Dropped... routines
-void LightTableWindow::loadImageInfos(const ImageInfoList &list, ImageInfo *imageInfoCurrent)
+void LightTableWindow::loadImageInfos(const ImageInfoList &list, ImageInfo *imageInfoCurrent, bool addTo)
{
+ // Clear all items before adding new images to the light table.
+ if (!addTo)
+ {
+ slotClearItemsList();
+ }
+
ImageInfoList l = list;
if (!imageInfoCurrent)
@ -733,7 +741,8 @
void LightTableWindow::slotLeftDroppedItems(const ImageInfoList& list)
{
ImageInfo *info = *(list.begin());
- loadImageInfos(list, info);
+ // add the image to the existing images
+ loadImageInfos(list, info, true);
// We will check if first item from list is already stored in thumbbar
// Note that the thumbbar stores all ImageInfo reference
@ -757,7 +766,8 @
void LightTableWindow::slotRightDroppedItems(const ImageInfoList& list)
{
ImageInfo *info = *(list.begin());
- loadImageInfos(list, info);
+ // add the image to the existing images
+ loadImageInfos(list, info, true);
if (list.count()>1)
setLeftRightItems(list);
--- branches/extragear/kde3/graphics/digikam/utilities/lighttable/lighttablewindow.h #709348:709349
@ -57,7 +57,7 @
static LightTableWindow *lightTableWindow();
static bool lightTableWindowCreated();
- void loadImageInfos(const ImageInfoList &list, ImageInfo *imageInfoCurrent);
+ void loadImageInfos(const ImageInfoList &list, ImageInfo *imageInfoCurrent, bool addTo);
void setLeftRightItems(const ImageInfoList &list);
signals:
More information about the Digikam-devel
mailing list