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

List:       kde-commits
Subject:    playground/network/kcall
From:       George Kiagiadakis <gkiagiad () csd ! uoc ! gr>
Date:       2009-06-15 13:09:26
Message-ID: 1245071366.866619.2018.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 982285 by gkiagia:

Implement two approvers, one that is a systray icon and one that uses a knotify popup \
+ sound. The systray icon also acts as the main systray icon of kcall and uses the \
new knotificationitem api.

 M  +8 -2      CMakeLists.txt  
 A             abstractclientapprover.cpp   [License: GPL (v2+)]
 A             abstractclientapprover.h   [License: GPL (v2+)]
 A             cmake/modules/FindLibKNotificationItem-1.cmake  
 A             kcall.notifyrc  
 M  +19 -1     kcallapplication.cpp  
 M  +3 -0      kcallapplication.h  
 A             knotifyapprover.cpp   [License: GPL (v2+)]
 A             knotifyapprover.h   kcallapplication.h#981959 [License: GPL (v2+)]
 A             systrayicon.cpp   [License: GPL (v2+)]
 A             systrayicon.h   kcallapplication.h#981959 [License: GPL (v2+)]


--- trunk/playground/network/kcall/CMakeLists.txt #982284:982285
@@ -4,8 +4,10 @@
 
 find_package(KDE4 REQUIRED)
 find_package(TelepathyQt4 REQUIRED)
+find_package(LibKNotificationItem-1 REQUIRED)
 
-include_directories(${KDE4_INCLUDES} ${TELEPATHY_QT4_INCLUDE_DIR} \
${CMAKE_CURRENT_BINARY_DIR}) +include_directories(${KDE4_INCLUDES} \
${TELEPATHY_QT4_INCLUDE_DIR} +                    ${KNOTIFICATIONITEM_INCLUDE_DIR} \
${CMAKE_CURRENT_BINARY_DIR})  add_definitions(${KDE4_DEFINITIONS})
 
 add_subdirectory(callwindowpart)
@@ -17,6 +19,9 @@
     contactlistcontroller.cpp
     callwindow.cpp
     callhandler.cpp
+    abstractclientapprover.cpp
+    systrayicon.cpp
+    knotifyapprover.cpp
     models/treemodel.cpp
     models/contactsmodel.cpp
     models/pendingcontacts.cpp
@@ -26,7 +31,8 @@
 
 kde4_add_ui_files(kcall_SRCS mainwindow.ui)
 kde4_add_executable(kcall ${kcall_SRCS})
-target_link_libraries(kcall ${KDE4_KPARTS_LIBS} ${TELEPATHY_QT4_LIBRARIES})
+target_link_libraries(kcall ${KDE4_KPARTS_LIBS} ${TELEPATHY_QT4_LIBRARIES} \
${KNOTIFICATIONITEM_LIBRARIES})  
 install(TARGETS kcall ${INSTALL_TARGETS_DEFAULT_ARGS})
 #install(FILES kcallui.rc DESTINATION ${DATA_INSTALL_DIR}/kcall)
+install(FILES kcall.notifyrc DESTINATION ${DATA_INSTALL_DIR}/kcall)
--- trunk/playground/network/kcall/kcallapplication.cpp #982284:982285
@@ -17,6 +17,8 @@
 #include "kcallapplication.h"
 #include "mainwindow.h"
 #include "callhandler.h"
+#include "systrayicon.h"
+#include "knotifyapprover.h"
 #include "models/contactsmodel.h"
 #include <KDebug>
 #include <TelepathyQt4/AccountManager>
@@ -25,11 +27,13 @@
 
 struct KCallApplication::Private
 {
-    MainWindow *mainWindow;
+    QPointer<MainWindow> mainWindow;
     ContactsModel *contactsModel;
     Tp::AccountManagerPtr accountManager;
     Tp::ClientRegistrarPtr registrar;
     Tp::SharedPtr<CallHandler> callHandler;
+    Tp::SharedPtr<SystrayIcon> systrayIcon;
+    Tp::SharedPtr<KNotifyApprover> knotifyApprover;
 };
 
 KCallApplication::KCallApplication()
@@ -45,6 +49,10 @@
     d->registrar = Tp::ClientRegistrar::create();
     d->callHandler = Tp::SharedPtr<CallHandler>(new CallHandler());
     d->registrar->registerClient(Tp::AbstractClientPtr::dynamicCast(d->callHandler), \
"kcall"); +    d->systrayIcon = Tp::SharedPtr<SystrayIcon>(new SystrayIcon());
+    d->registrar->registerClient(Tp::AbstractClientPtr::dynamicCast(d->systrayIcon), \
"kcall_approver_systray"); +    d->knotifyApprover = \
Tp::SharedPtr<KNotifyApprover>(new KNotifyApprover()); +    \
d->registrar->registerClient(Tp::AbstractClientPtr::dynamicCast(d->knotifyApprover), \
"kcall_approver_knotify");  }
 
 KCallApplication::~KCallApplication()
@@ -66,6 +74,16 @@
     return d->contactsModel;
 }
 
+void KCallApplication::showHideMainWindow()
+{
+    if ( !d->mainWindow ) {
+        d->mainWindow = new MainWindow;
+        d->mainWindow->show();
+    } else {
+        d->mainWindow->setVisible( !d->mainWindow->isVisible() );
+    }
+}
+
 void KCallApplication::onAccountManagerReady(Tp::PendingOperation *op)
 {
     if ( op->isError() ) {
--- trunk/playground/network/kcall/kcallapplication.h #982284:982285
@@ -34,6 +34,9 @@
     static inline KCallApplication *instance()
     { return static_cast<KCallApplication*>(QCoreApplication::instance()); }
 
+public slots:
+    void showHideMainWindow();
+
 private slots:
     void onAccountManagerReady(Tp::PendingOperation *op);
     void onAccountCreated(const QString & path);


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

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