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

List:       kde-commits
Subject:    KDE/kdepim/akonadi/tray
From:       Davide Bettio <davide.bettio () kdemail ! net>
Date:       2009-05-05 21:53:15
Message-ID: 1241560395.006136.10280.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 964064 by bettio:

Ported akonaditray to KNotificationItem.


 M  +1 -1      CMakeLists.txt  
 M  +12 -16    dock.cpp  
 M  +4 -2      dock.h  


--- trunk/KDE/kdepim/akonadi/tray/CMakeLists.txt #964063:964064
@@ -8,7 +8,7 @@
 qt4_add_dbus_adaptor( tray_sources org.freedesktop.akonaditray.xml dock.h Dock )
 
 KDE4_ADD_EXECUTABLE(akonaditray ${tray_sources})
-TARGET_LINK_LIBRARIES(akonaditray ${KDE4_KIO_LIBS} ${KDE4_KDEUI_LIBS} \
${KDE4_KNOTIFYCONFIG_LIBS} ${AKONADI_COMMON_LIBRARIES} ${KDE4_AKONADI_LIBS}) \
+TARGET_LINK_LIBRARIES(akonaditray ${KNOTIFICATIONITEM_LIBRARIES} ${KDE4_KIO_LIBS} \
${KDE4_KDEUI_LIBS} ${KDE4_KNOTIFYCONFIG_LIBS} ${AKONADI_COMMON_LIBRARIES} \
${KDE4_AKONADI_LIBS})  
 INSTALL(TARGETS akonaditray ${INSTALL_TARGETS_DEFAULT_ARGS})
 INSTALL(FILES  akonaditray.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
--- trunk/KDE/kdepim/akonadi/tray/dock.cpp #964063:964064
@@ -48,8 +48,7 @@
 Tray::Tray() : QWidget()
 {
     hide();
-    Dock* docker = new Dock( this );
-    docker->show();
+    new Dock( this );
 }
 
 void Tray::setVisible( bool )
@@ -59,8 +58,9 @@
 }
 
 Dock::Dock( QWidget *parent )
-        : KSystemTrayIcon( KIcon( "akonadi" ), parent )
+        : KNotificationItem(parent )
 {
+    setIcon("akonadi");
     KMenu *menu = new KMenu();
     m_title = menu->addTitle( i18n( "Akonadi" ) );
 
@@ -73,13 +73,9 @@
     m_backupAction = menu->addAction( i18n( "Make &Backup..." ), this, SLOT( \
                slotStartBackup() ) );
     m_restoreAction = menu->addAction( i18n( "&Restore Backup..." ), this, SLOT( \
                slotStartRestore() ) );
     menu->addAction( KIcon( "configure" ), i18n( "&Configure..." ), this, SLOT( \
                slotConfigure() ) );
-    menu->addSeparator();
-    menu->addAction( KIcon( "application-exit" ), i18n( "Quit" ), this, SLOT( \
                slotQuit() ),
-                     KStandardShortcut::shortcut( KStandardShortcut::Quit \
).primary() );  
     setContextMenu( menu );
     connect( menu, SIGNAL( aboutToShow() ), SLOT( slotActivated() ) );
-    show();
 
     connect( ServerManager::self(), SIGNAL( started() ), SLOT( slotServerStarted() ) \
                );
     connect( ServerManager::self(), SIGNAL( stopped() ), SLOT( slotServerStopped() ) \
); @@ -101,24 +97,24 @@
 {
     updateMenu( true );
     KPassivePopup::message( i18n( "Akonadi available" ),
-                            i18n( "The Akonadi server has been started and can be \
used now." ), this ); +                            i18n( "The Akonadi server has been \
started and can be used now." ), associatedWidget() );  }
 
 void Dock::slotServerStopped()
 {
     updateMenu( false );
     KPassivePopup::message( i18n( "Akonadi not available" ),
-                            i18n( "The Akonadi server has been stopped, Akonadi \
related applications can no longer be used." ),this ); +                            \
i18n( "The Akonadi server has been stopped, Akonadi related applications can no \
longer be used." ), associatedWidget()  );  }
 
 void Dock::slotStopAkonadi()
 {
-    Akonadi::Control::stop( parentWidget() );
+    Akonadi::Control::stop( associatedWidget()  );
 }
 
 void Dock::slotStartAkonadi()
 {
-    Akonadi::Control::start( parentWidget() );
+    Akonadi::Control::start( associatedWidget()  );
 }
 
 void Dock::slotActivated()
@@ -131,7 +127,7 @@
     bool registered = ServerManager::isRunning();
     Q_ASSERT( registered );
 
-    QPointer<BackupAssistant> backup = new BackupAssistant( parentWidget() );
+    QPointer<BackupAssistant> backup = new BackupAssistant( associatedWidget()  );
     backup->exec();
     delete backup;
 }
@@ -141,7 +137,7 @@
     bool registered = ServerManager::isRunning();
     Q_ASSERT( registered );
 
-    QPointer<RestoreAssistant> restore = new RestoreAssistant( parentWidget() );
+    QPointer<RestoreAssistant> restore = new RestoreAssistant( associatedWidget()  \
);  restore->exec();
     delete restore;
 }
@@ -168,7 +164,7 @@
 void Dock::infoMessage( const QString &message, const QString &title )
 {
     KPassivePopup::message( title.isEmpty() ? i18n( "Akonadi message" ) : title,
-                            message, this );
+                            message, associatedWidget()  );
 }
 
 void Dock::slotInstanceError( const Akonadi::AgentInstance& agent, const QString& \
message ) @@ -178,13 +174,13 @@
 
 void Dock::errorMessage( const QString &message, const QString &title )
 {
-    KMessageBox::error( parentWidget(), message,
+    KMessageBox::error( associatedWidget() , message,
                         title.isEmpty() ?i18n( "Akonadi error" ) : title );
 }
 
 qlonglong Dock::getWinId()
 {
-    return ( qlonglong )parentWidget()->winId();
+    return ( qlonglong )associatedWidget() ->winId();
 }
 
 void Dock::slotConfigure()
--- trunk/KDE/kdepim/akonadi/tray/dock.h #964063:964064
@@ -21,7 +21,7 @@
 #ifndef DOCK_H
 #define DOCK_H
 
-#include <KSystemTrayIcon>
+#include <knotificationitem-1/knotificationitem.h>
 #include <QWidget>
 
 #include <akonadi/agentinstance.h>
@@ -29,6 +29,8 @@
 class QLabel;
 class QAction;
 
+using namespace Experimental;
+
 class Tray : public QWidget
 {
 public:
@@ -38,7 +40,7 @@
     void setVisible( bool );
 };
 
-class Dock : public KSystemTrayIcon
+class Dock : public KNotificationItem
 {
     Q_OBJECT
     Q_CLASSINFO( "D-Bus Interface", "org.kde.akonaditray" )


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

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