[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: extragear/graphics/digikam/digikam
From: Gilles Caulier <caulier.gilles () gmail ! com>
Date: 2007-08-31 20:14:55
Message-ID: 1188591295.280819.24370.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 707035 by cgilles:
digiKam from trunk (KDE4) : backport patch from Arnd (KDE3, commits #706991)
CCMAIL: arnd.baecker@web.de
M +33 -10 digikamapp.cpp
M +2 -1 digikamapp.h
M +8 -5 digikamview.cpp
M +2 -3 digikamview.h
--- trunk/extragear/graphics/digikam/digikam/digikamapp.cpp #707034:707035
@@ -40,7 +40,6 @@
#include <klocale.h>
#include <kglobalsettings.h>
#include <kstandarddirs.h>
-#include <kurl.h>
#include <kstandardaction.h>
#include <kstandardshortcut.h>
#include <kshortcutsdialog.h>
@@ -358,8 +357,8 @@
connect(d->view, SIGNAL(signalTagSelected(bool)),
this, SLOT(slotTagSelected(bool)));
- connect(d->view, SIGNAL(signalImageSelected(const ImageInfoList&, bool, bool)),
- this, SLOT(slotImageSelected(const ImageInfoList&, bool, bool)));
+ connect(d->view, SIGNAL(signalImageSelected(const ImageInfoList&, bool, bool, const KUrl::List&)),
+ this, SLOT(slotImageSelected(const ImageInfoList&, bool, bool, const KUrl::List&)));
}
void DigikamApp::setupStatusBar()
@@ -1134,10 +1133,17 @@
}
}
-void DigikamApp::slotImageSelected(const ImageInfoList& list, bool hasPrev, bool hasNext)
+void DigikamApp::slotImageSelected(const ImageInfoList& list, bool hasPrev, bool hasNext,
+ const KUrl::List& listAll)
{
ImageInfoList selection = list;
- bool val = selection.isEmpty() ? false : true;
+
+ KUrl::List all = listAll;
+ int num_images = listAll.count();
+ bool val = selection.isEmpty() ? false : true;
+ int index = 1;
+ QString text;
+
d->imageViewAction->setEnabled(val);
d->imagePreviewAction->setEnabled(val);
d->imageLightTableAction->setEnabled(val);
@@ -1150,13 +1156,30 @@
{
case 0:
d->statusProgressBar->setText(i18n("No item selected"));
- break;
+ break;
case 1:
- d->statusProgressBar->setText(selection.first().fileUrl().fileName());
- break;
+ {
+ KUrl first = selection.first().fileUrl();
+
+ for (KUrl::List::iterator it = all.begin();
+ it != all.end(); ++it)
+ {
+ if ((*it) == first)
+ break;
+
+ index++;
+ }
+
+ text = selection.first().fileUrl().fileName()
+ + i18n(" (%1 of %2)", QString::number(index),
+ QString::number(num_images));
+ d->statusProgressBar->setText(text);
+ break;
+ }
default:
- d->statusProgressBar->setText(i18n("%1 items selected",selection.count()));
- break;
+ d->statusProgressBar->setText(i18n("%1/%2 items selected", selection.count(),
+ QString::number(num_images)));
+ break;
}
d->statusNavigateBar->setNavigateBarState(hasPrev, hasNext);
--- trunk/extragear/graphics/digikam/digikam/digikamapp.h #707034:707035
@@ -34,6 +34,7 @@
// KDE includes.
+#include <kurl.h>
#include <kxmlguiwindow.h>
#include <kio/global.h>
#include <kio/netaccess.h>
@@ -110,7 +111,7 @@
void slotAlbumAddImages();
void slotAlbumSelected(bool val);
void slotTagSelected(bool val);
- void slotImageSelected(const ImageInfoList&, bool, bool);
+ void slotImageSelected(const ImageInfoList&, bool, bool, const KUrl::List&);
void slotExit();
void slotShowTip();
void slotShowKipiHelp();
--- trunk/extragear/graphics/digikam/digikam/digikamview.cpp #707034:707035
@@ -36,7 +36,6 @@
// KDE includes.
-#include <kurl.h>
#include <kpushbutton.h>
#include <klocale.h>
#include <kapplication.h>
@@ -44,12 +43,12 @@
#include <krun.h>
#include <kiconloader.h>
#include <kstandarddirs.h>
+#include <kglobal.h>
+#include <kvbox.h>
// LibKDcraw includes.
#include <libkdcraw/rawfiles.h>
-#include <kglobal.h>
-#include <kvbox.h>
// Local includes.
@@ -690,11 +689,15 @@
{
// the list of copies of ImageInfos of currently selected items, currentItem first
ImageInfoList list = d->iconView->selectedImageInfos();
+
+ // no copy needed for this one, as this list is just used for counting
+ // the total number of images
+ KUrl::List listAll = d->iconView->allItems();
if (list.isEmpty())
{
d->albumWidgetStack->setPreviewItem();
- emit signalImageSelected(list, false, false);
+ emit signalImageSelected(list, false, false, listAll);
emit signalNoCurrentItem();
}
else
@@ -711,7 +714,7 @@
if (!d->albumWidgetStack->previewMode() == AlbumWidgetStack::PreviewAlbumMode)
d->albumWidgetStack->setPreviewItem(list.first(), previousInfo, nextInfo);
- emit signalImageSelected(list, !previousInfo.isNull(), !nextInfo.isNull());
+ emit signalImageSelected(list, !previousInfo.isNull(), !nextInfo.isNull(), listAll);
}
d->needDispatchSelection = false;
--- trunk/extragear/graphics/digikam/digikam/digikamview.h #707034:707035
@@ -34,13 +34,12 @@
// KDE includes.
#include <khbox.h>
+#include <kurl.h>
// Local includes.
#include "imageinfo.h"
-class KUrl;
-
namespace Digikam
{
class AlbumIconItem;
@@ -69,7 +68,7 @@
void signalAlbumSelected(bool val);
void signalTagSelected(bool val);
- void signalImageSelected(const ImageInfoList& list, bool, bool);
+ void signalImageSelected(const ImageInfoList&, bool, bool, const KUrl::List&);
void signalNoCurrentItem();
void signalProgressBarMode(int, const QString&);
void signalProgressValue(int);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic