[Digikam-devel] [Bug 139547] tag hierarchy automatic fill
Gilles Caulier
caulier.gilles at kdemail.net
Fri Jan 5 12:59:24 GMT 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=139547
------- Additional Comments From caulier.gilles kdemail net 2007-01-05 13:59 -------
SVN commit 620161 by cgilles:
digikam from trunk : Comments & Tags : add 3 new settings options to handlee how to auto select/deselect automaticly parents and childs tags in treelist view.
CCBUGS: 139547
M +71 -2 imagedescedittab.cpp
M +3 -3 imagedescedittab.h
M +3 -3 talbumlistview.cpp
M +2 -2 talbumlistview.h
--- trunk/extragear/graphics/digikam/libs/imageproperties/imagedescedittab.cpp #620160:620161
@ -76,6 +76,14 @
{
public:
+ enum ToggleAuto
+ {
+ None = 0,
+ Childs,
+ Parents,
+ Both
+ };
+
ImageDescEditTabPriv()
{
modified = false;
@ -92,6 +100,7 @
assignedTagsBtn = 0;
applyBtn = 0;
revertBtn = 0;
+ toggleAuto = None;
}
bool modified;
@ -117,6 +126,8 @
TAlbumListView *tagsView;
RatingWidget *ratingWidget;
+
+ ToggleAuto toggleAuto;
};
ImageDescEditTab::ImageDescEditTab(QWidget *parent, bool navBar)
@ -215,8 +226,8 @
connect(popupMenu, SIGNAL(activated(int)),
this, SLOT(slotRecentTagsMenuActivated(int)));
- connect(d->tagsView, SIGNAL(signalItemStateChanged()),
- this, SLOT(slotModified()));
+ connect(d->tagsView, SIGNAL(signalItemStateChanged(TAlbumCheckListItem *)),
+ this, SLOT(slotItemStateChanged(TAlbumCheckListItem *)));
connect(d->commentsEdit, SIGNAL(textChanged()),
this, SLOT(slotModified()));
@ -300,6 +311,13 @
connect(watch, SIGNAL(signalImageCaptionChanged(Q_LLONG)),
this, SLOT(slotImageCaptionChanged(Q_LLONG)));
+
+ // -- read config ---------------------------------------------------------
+
+ KConfig* config = kapp->config();
+ config->setGroup("Tag List View");
+ d->toggleAuto = (ImageDescEditTabPriv::ToggleAuto)(config->readNumEntry("Toggle Auto",
+ ImageDescEditTabPriv::None));
}
ImageDescEditTab::~ImageDescEditTab()
@ -314,6 +332,11 @
}
*/
+ KConfig* config = kapp->config();
+ config->setGroup("Tag List View");
+ config->writeEntry("Toggle Auto", (int)(d->toggleAuto));
+ config->sync();
+
delete d;
}
@ -507,6 +530,27 @
}
}
+void ImageDescEditTab::slotItemStateChanged(TAlbumCheckListItem *item)
+{
+ switch(d->toggleAuto)
+ {
+ case ImageDescEditTabPriv::Childs:
+ toggleChildTags(item->m_album, item->isOn());
+ break;
+ case ImageDescEditTabPriv::Parents:
+ toggleParentTags(item->m_album, item->isOn());
+ break;
+ case ImageDescEditTabPriv::Both:
+ toggleChildTags(item->m_album, item->isOn());
+ toggleParentTags(item->m_album, item->isOn());
+ break;
+ default:
+ break;
+ }
+
+ slotModified();
+}
+
void ImageDescEditTab::slotModified()
{
d->modified = true;
@ -633,7 +677,17 @
popmenu.insertItem(i18n("Deselect"), &deselectTagsMenu);
popmenu.insertItem(i18n("Invert Selection"), 16);
+ popmenu.insertSeparator(-1);
+ QPopupMenu toggleAutoMenu;
+ toggleAutoMenu.setCheckable(true);
+ toggleAutoMenu.insertItem(i18n("Childs"), 21);
+ toggleAutoMenu.insertItem(i18n("Parents"), 22);
+ toggleAutoMenu.insertItem(i18n("Both"), 23);
+ if (d->toggleAuto != ImageDescEditTabPriv::None)
+ toggleAutoMenu.setItemChecked(20 + d->toggleAuto, true);
+ popmenu.insertItem(i18n("Toogle Auto"), &toggleAutoMenu);
+
int choice = popmenu.exec((QCursor::pos()));
switch( choice )
{
@ -729,6 +783,21 @
item->setOn(false);
break;
}
+ case 21: // Toggle auto Childs tags.
+ {
+ d->toggleAuto = ImageDescEditTabPriv::Childs;
+ break;
+ }
+ case 22: // Toggle auto Parents tags.
+ {
+ d->toggleAuto = ImageDescEditTabPriv::Parents;
+ break;
+ }
+ case 23: // Toggle auto Childs and Parents tags.
+ {
+ d->toggleAuto = ImageDescEditTabPriv::Both;
+ break;
+ }
default:
break;
}
--- trunk/extragear/graphics/digikam/libs/imageproperties/imagedescedittab.h #620160:620161
@ -41,10 +41,10 @
class AlbumIconItem;
class Album;
class TAlbum;
+class TAlbumCheckListItem;
class ImageInfo;
class ImageDescEditTabPriv;
-
class DIGIKAM_EXPORT ImageDescEditTab : public NavigateBarTab
{
Q_OBJECT
@ -73,8 +73,7 @
void updateDate();
void updateRecentTags();
- void tagNew(TAlbum* parAlbum, const QString& _title=QString(),
- const QString& _icon=QString());
+ void tagNew(TAlbum* parAlbum, const QString& _title=QString(), const QString& _icon=QString());
void tagEdit(TAlbum* album);
void tagDelete(TAlbum *album);
@ -87,6 +86,7 @
void slotApplyAllChanges();
void slotRevertAllChanges();
+ void slotItemStateChanged(TAlbumCheckListItem *);
void slotModified();
void slotRightButtonClicked(QListViewItem *, const QPoint &, int);
void slotTagsSearchChanged();
--- trunk/extragear/graphics/digikam/libs/imageproperties/talbumlistview.cpp #620160:620161
@ -74,7 +74,7 @
{
QCheckListItem::stateChange(val);
TAlbumListView* view = dynamic_cast<TAlbumListView*>(listView());
- view->emitSignalItemStateChanged();
+ view->emitSignalItemStateChanged(this);
}
// ------------------------------------------------------------------------
@ -87,9 +87,9 @
viewport()->setAcceptDrops(true);
}
-void TAlbumListView::emitSignalItemStateChanged()
+void TAlbumListView::emitSignalItemStateChanged(TAlbumCheckListItem *item)
{
- emit signalItemStateChanged();
+ emit signalItemStateChanged(item);
}
QDragObject* TAlbumListView::dragObject()
--- trunk/extragear/graphics/digikam/libs/imageproperties/talbumlistview.h #620160:620161
@ -62,11 +62,11 @
TAlbumListView(QWidget* parent);
- void emitSignalItemStateChanged();
+ void emitSignalItemStateChanged(TAlbumCheckListItem *item);
signals:
- void signalItemStateChanged();
+ void signalItemStateChanged(TAlbumCheckListItem *item);
protected:
More information about the Digikam-devel
mailing list