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

List:       kde-commits
Subject:    KDE/kdepim/mobile/lib
From:       Tobias Koenig <tokoe () kde ! org>
Date:       2010-12-08 12:19:40
Message-ID: 20101208121940.9C6C8AC8A5 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1204613 by tokoe:

Add action to shut down application and akonadi server.


 M  +7 -0      ApplicationGeneralActions.qml  
 M  +19 -0     kdeclarativefullscreenview.cpp  
 M  +1 -0      kdeclarativefullscreenview.h  


--- trunk/KDE/kdepim/mobile/lib/ApplicationGeneralActions.qml #1204612:1204613
@@ -42,6 +42,13 @@
   }
 
   KPIM.ActionListItem {
+    name : "quit_akonadi"
+    onPressAndHold: {
+      longPressed(name);
+    }
+  }
+
+  KPIM.ActionListItem {
     name : "wm_task_switch"
     onPressAndHold: {
       longPressed(name);
--- trunk/KDE/kdepim/mobile/lib/kdeclarativefullscreenview.cpp #1204612:1204613
@@ -21,6 +21,7 @@
 #include "stylesheetloader.h"
 
 #include <akonadi/control.h>
+#include <akonadi/servermanager.h>
 
 #include <KDebug>
 #include <KGlobalSettings>
@@ -145,6 +146,11 @@
 
   KAction *action = KStandardAction::close( this, SLOT(close()), this );
   mActionCollection->addAction( QLatin1String( "close" ), action );
+
+  action = new KAction( "Akonadi " + KStandardGuiItem::quit().text(), this ); \
//FIXME: use proper i18n after string freeze +  connect( action, SIGNAL( triggered() \
), SLOT( closeAkonadi() ) ); +  mActionCollection->addAction( QLatin1String( \
"quit_akonadi" ), action ); +
   action = new KAction( i18n( "Minimize Window" ), this );
   connect( action, SIGNAL(triggered()), SLOT(triggerTaskSwitcher()) );
   mActionCollection->addAction( QLatin1String( "wm_task_switch" ), action );
@@ -182,6 +188,19 @@
   }
 }
 
+void KDeclarativeFullScreenView::closeAkonadi()
+{
+  //FIXME: use proper i18n after string freeze
+  const QString message = QLatin1String( "Shutting down Akonadi will disable \
notifications\nabout new emails and upcoming events." ); +  const int result = \
KMessageBox::warningContinueCancel( 0, message ); +
+  if ( result == KMessageBox::Cancel )
+    return;
+
+  Akonadi::ServerManager::self()->stop();
+  close();
+}
+
 #ifdef Q_OS_WINCE
 bool KDeclarativeFullScreenView::RotateTo270Degrees()
 {
--- trunk/KDE/kdepim/mobile/lib/kdeclarativefullscreenview.h #1204612:1204613
@@ -80,6 +80,7 @@
     void delayedInit();
     void setQmlFile( const QString &source );
     void slotStatusChanged ( QDeclarativeView::Status );
+    void closeAkonadi();
 
   private:
 #ifdef Q_OS_WINCE


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

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