[Digikam-devel] [Bug 115157] digikam usability: Image comments/tags dialog: hard to find/see all already selected tags (and to 'de'select them)
Gilles Caulier
caulier.gilles at kdemail.net
Tue Dec 19 12:49:33 GMT 2006
------- 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=115157
caulier.gilles kdemail net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From caulier.gilles kdemail net 2006-12-19 13:49 -------
SVN commit 614902 by cgilles:
digikam from trunk : Comments & Tags Sidebar tab : add a new small push button to only display the currently assigned tags of the image.
BUG: 115157
M +75 -9 imagedescedittab.cpp
M +1 -0 imagedescedittab.h
--- trunk/extragear/graphics/digikam/libs/imageproperties/imagedescedittab.cpp #614901:614902
@ -30,6 +30,7 @
#include <qvgroupbox.h>
#include <qheader.h>
#include <qtoolbutton.h>
+#include <qpushbutton.h>
#include <qiconset.h>
#include <qwhatsthis.h>
#include <qtooltip.h>
@ -98,6 +99,7 @
navigateBar = 0;
ABCMenu = 0;
tab = 0;
+ assignedTagsBtn = 0;
}
bool modified;
@ -108,6 +110,8 @
QPopupMenu *ABCMenu;
+ QPushButton *assignedTagsBtn;
+
KTextEdit *commentsEdit;
KLineEdit *tagsSearchEdit;
@ -179,11 +183,19 @
d->tagsSearchEdit = new KLineEdit(tagsSearch);
d->tagsSearchEdit->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
+ d->assignedTagsBtn = new QPushButton(tagsSearch);
+ QToolTip::add(d->assignedTagsBtn, i18n("Already Assigned Tags"));
+ d->assignedTagsBtn->setIconSet(kapp->iconLoader()->loadIcon("tag-assigned",
+ KIcon::NoGroup, KIcon::SizeSmall,
+ KIcon::DefaultState, 0, true));
+ d->assignedTagsBtn->setToggleButton(true);
+
d->recentTagsBtn = new QToolButton(tagsSearch);
QPopupMenu *popupMenu = new QPopupMenu(d->recentTagsBtn);
QToolTip::add(d->recentTagsBtn, i18n("Recent Tags"));
- d->recentTagsBtn->setIconSet(kapp->iconLoader()->loadIcon("tag-recents", KIcon::NoGroup,
- KIcon::SizeSmall, KIcon::DefaultState, 0, true));
+ d->recentTagsBtn->setIconSet(kapp->iconLoader()->loadIcon("tag-recents",
+ KIcon::NoGroup, KIcon::SizeSmall,
+ KIcon::DefaultState, 0, true));
d->recentTagsBtn->setUsesBigPixmap(false);
d->recentTagsBtn->setPopup(popupMenu);
d->recentTagsBtn->setPopupDelay(1);
@ -243,6 +255,9 @
connect(d->tagsSearchEdit, SIGNAL(textChanged(const QString&)),
this, SLOT(slotTagsSearchChanged()));
+
+ connect(d->assignedTagsBtn, SIGNAL(toggled(bool)),
+ this, SLOT(slotAssignedTagsToggled(bool)));
// Initalize ---------------------------------------------
@ -627,7 +642,8 @
while (it.current())
{
TAlbumCheckListItem* item = dynamic_cast<TAlbumCheckListItem*>(it.current());
- item->setOn(true);
+ if (item->isVisible())
+ item->setOn(true);
++it;
}
break;
@ -638,7 +654,8 @
while (it.current())
{
TAlbumCheckListItem* item = dynamic_cast<TAlbumCheckListItem*>(it.current());
- item->setOn(false);
+ if (item->isVisible())
+ item->setOn(false);
++it;
}
break;
@ -649,11 +666,13 @
while (it.current())
{
TAlbumCheckListItem* item = dynamic_cast<TAlbumCheckListItem*>(it.current());
- TAlbum *tag = item->m_album;
- if (tag)
- if (!tag->isRoot())
- item->setOn(!item->isOn());
-
+ if (item->isVisible())
+ {
+ TAlbum *tag = item->m_album;
+ if (tag)
+ if (!tag->isRoot())
+ item->setOn(!item->isOn());
+ }
++it;
}
break;
@ -1133,5 +1152,52 @
}
}
+void ImageDescEditTab::slotAssignedTagsToggled(bool t)
+{
+ QListViewItemIterator it(d->tagsView);
+ while (it.current())
+ {
+ TAlbumCheckListItem* item = dynamic_cast<TAlbumCheckListItem*>(it.current());
+ TAlbum *tag = item->m_album;
+ if (tag)
+ {
+ if (!tag->isRoot())
+ {
+ if (t)
+ {
+ bool isOn = item->isOn();
+ item->setVisible(isOn);
+
+ if (isOn)
+ {
+ Album* parent = tag->parent();
+ while (parent && !parent->isRoot())
+ {
+ QCheckListItem *pitem = (QCheckListItem*)parent->extraData(this);
+ pitem->setVisible(true);
+ parent = parent->parent();
+ }
+ }
+ }
+ else
+ {
+ item->setVisible(true);
+ }
+ }
+ }
+ ++it;
+ }
+
+ TAlbum *root = AlbumManager::instance()->findTAlbum(0);
+ TAlbumCheckListItem *rootItem = (TAlbumCheckListItem*)(root->extraData(this));
+ if (rootItem)
+ {
+ if (t)
+ rootItem->setText(0, i18n("Assigned Tags"));
+ else
+ rootItem->setText(0, root->title());
+ }
+}
+
} // NameSpace Digikam
--- trunk/extragear/graphics/digikam/libs/imageproperties/imagedescedittab.h #614901:614902
@ -108,6 +108,7 @
void slotImageCaptionChanged(Q_LLONG imageId);
void slotRecentTagsMenuActivated(int);
+ void slotAssignedTagsToggled(bool);
private:
More information about the Digikam-devel
mailing list