[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/base/nepomuk-kde/annotation/lib/gui
From: Sebastian Trueg <sebastian () trueg ! de>
Date: 2010-05-20 16:43:32
Message-ID: 20100520164332.96E1DAC8BB () svn ! kde ! org
[Download RAW message or body]
SVN commit 1128913 by trueg:
New signal to setup menu before it is constructed
M +4 -1 annotationmenu.cpp
M +11 -0 annotationmenu.h
--- trunk/playground/base/nepomuk-kde/annotation/lib/gui/annotationmenu.cpp \
#1128912:1128913 @@ -562,6 +562,8 @@
void Nepomuk::AnnotationMenu::Private::_k_menuAboutToShow()
{
+ emit q->aboutToBeConstructed( q );
+
if ( !m_menuCreated ) {
m_menuCreated = true;
@@ -805,6 +807,7 @@
{
kDebug();
+ if ( !annotation->exists( m_resources.first() ) ) {
if ( !( m_configFlags & AnnotationMenu::UseSubMenus ) &&
!m_annotationTitleCreated ) {
m_annotationTitleCreated = true;
@@ -813,9 +816,9 @@
m_annotationsBusyAction );
}
- if ( !annotation->exists( m_resources.first() ) )
q->insertAction( m_annotationsBusyAction, createAnnotationAction( annotation \
) ); }
+}
void Nepomuk::AnnotationMenu::Private::_k_annotationModelFinished()
--- trunk/playground/base/nepomuk-kde/annotation/lib/gui/annotationmenu.h \
#1128912:1128913 @@ -36,6 +36,9 @@
}
}
+// TODO: add protected method or some other way to get confirmation before actually \
creating an annotation +// the simplest would be: "virtual bool \
confirmAnnotation( const QString& humanReadableDescription ) const" +
namespace Nepomuk {
class Resource;
@@ -119,6 +122,14 @@
void resourcesAnnotated();
/**
+ * %AnnotationMenu is a dynamic menu which is build based on its settings.
+ * In certain situations these settings are not clear until the very moment
+ * the menu will be constructed. This signal can be used to configure the \
menu + * before it will be shown.
+ */
+ void aboutToBeConstructed( Nepomuk::AnnotationMenu* menu );
+
+ /**
* Since AnnotationMenu uses the QMenu::aboutToShow() signal internally
* and connection order is not guranteed in Qt it is recommended to use
* this signal instead to ensure that added actions are actually inserted
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic