[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/base/plasma/applets/leavenote
From:       Christian Weilbach <christian () whiletaker ! homeip ! net>
Date:       2008-08-09 13:22:51
Message-ID: 1218288171.300255.6922.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 844357 by weilbach:

Finish moving, building but not working yet.


 M  +1 -1      CMakeLists.txt  
 M  +4 -4      LeaveNoteHelperDaemon/CMakeLists.txt  
 M  +7 -3      LeaveNoteHelperDaemon/dbus/DaemonDBusHandler.cpp  
 M  +3 -3      plasma-leavenote.cpp  


--- trunk/playground/base/plasma/applets/leavenote/CMakeLists.txt #844356:844357
@@ -14,7 +14,7 @@
    )
 
 # build the message daemon
-#add_subdirectory(SimpleMessageDaemon)
+add_subdirectory(LeaveNoteHelperDaemon)
 
 # We add our source code here
 set(leavenote_SRCS plasma-leavenote.cpp)
--- trunk/playground/base/plasma/applets/leavenote/LeaveNoteHelperDaemon/CMakeLists.txt \
#844356:844357 @@ -6,14 +6,14 @@
 )
 
 qt4_add_dbus_adaptor(leavenotehelperdaemon_SRCS \
dbus/org.kde.LeaveNoteHelperDaemon.root.xml dbus/RootDBusHandler.h \
                LeaveNoteHelperDaemon::RootDBusHandler RootAdaptor RootAdaptor)
-qt4_add_dbus_adaptor(leavenotehelperdaemon_SRCS \
dbus/org.kde.LeaveNoteDaemon.daemon.xml dbus/DaemonDBusHandler.h \
LeaveNoteHelperDaemon::DaemonDBusHandler DaemonAdaptor DaemonAdaptor) \
+qt4_add_dbus_adaptor(leavenotehelperdaemon_SRCS \
dbus/org.kde.LeaveNoteHelperDaemon.daemon.xml dbus/DaemonDBusHandler.h \
LeaveNoteHelperDaemon::DaemonDBusHandler DaemonAdaptor DaemonAdaptor)  
 kde4_add_executable(leavenotehelperdaemon ${leavenotehelperdaemon_SRCS})
 target_link_libraries(leavenotehelperdaemon ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} \
)  install(FILES leavenotehelperdaemon.notifyrc 
-        DESTINATION ${DATA_INSTALL_DIR}/simplemessagedaemon)
+        DESTINATION ${DATA_INSTALL_DIR}/leavenotehelperdaemon)
 install(TARGETS leavenotehelperdaemon ${INSTALL_TARGETS_DEFAULT_ARGS})
-install(FILES dbus/org.kde.LeaveNoteHelper.root.xml
+install(FILES dbus/org.kde.LeaveNoteHelperDaemon.root.xml
               DESTINATION ${DBUS_INTERFACES_INSTALL_DIR})
-install(FILES dbus/org.kde.LeaveNoteHelper.daemon.xml
+install(FILES dbus/org.kde.LeaveNoteHelperDaemon.daemon.xml
               DESTINATION ${DBUS_INTERFACES_INSTALL_DIR})
--- trunk/playground/base/plasma/applets/leavenote/LeaveNoteHelperDaemon/dbus/DaemonDBusHandler.cpp \
#844356:844357 @@ -26,6 +26,7 @@
 #include <QtGui/QWidget>
 
 #include <KDebug>
+#include <KIcon>
 #include <KLocale>
 #include <KTextEdit>
 #include <KNotification>
@@ -48,7 +49,6 @@
     }
 
     DaemonDBusHandler::~DaemonDBusHandler(){
-        delete mNotification;
         delete mTimer;
     }
 
@@ -93,12 +93,14 @@
     void DaemonDBusHandler::newMessageSender( const QString& title, const QString& \
msg ){  if( ! mNotification )
         {
-            delete mNotification;
+            return;
         }
 
         mNotification= new KNotification ( "incomingNote", 0L,
                                             KNotification::Persistent );
         mNotification->setText( i18n( "Left note: %1", msg ) );
+        KIcon knotesIcon("knotes");
+        mNotification->setPixmap( knotesIcon.pixmap( 16, 16 ) );
         mNotification->setActions( QStringList() << i18n( "Load" )
                                                  << i18n( "Delete" ) );
         connect(mNotification, SIGNAL(activated(unsigned int)), 
@@ -110,7 +112,7 @@
     void DaemonDBusHandler::slotNotificationAction(unsigned int action){
         QString title = mNotificationToNote[sender()].first;
         QString msg = mNotificationToNote[sender()].second;
-        mNotificationToNote.remove(mNotification);
+        mNotificationToNote.remove(sender());
 
         switch(action){
             case 1:
@@ -132,6 +134,8 @@
             default:
                 return;
         };
+
+        qobject_cast<KNotification*>(sender())->close();
     }
 
 } // namespace LeaveNoteHelperDaemon
--- trunk/playground/base/plasma/applets/leavenote/plasma-leavenote.cpp \
#844356:844357 @@ -64,7 +64,7 @@
    /* start the simplemessagedaemon to keep track of the messages
     * even after the applet has vanished (screen unlock) */
    QProcess smd;
-   smd.startDetached("simplemessagedaemon");
+   smd.startDetached("leavenotehelperdaemon");
 //    smd.waitForStarted();
 
    /* initialize layout */
@@ -125,8 +125,8 @@
        return;
 
     QString time = KGlobal::locale()->formatTime(KDateTime::currentLocalDateTime().time());
                
-    QDBusInterface smdDBus( "org.kde.simplemessagedaemon", "/Daemon", 
-                               "org.kde.SimpleMessageDaemon" );
+    QDBusInterface smdDBus( "org.kde.leavenotehelperdaemon", "/Daemon", 
+                               "org.kde.LeaveNoteHelperDaemon" );
     smdDBus.call( "newMessage", 
                   i18nc("String + time",
                         "Somebody has left a note at %1", time),


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic