Commit 9a18ff6f authored by Mehrdad Momeny's avatar Mehrdad Momeny

Using KStatusNotifierItem instead of old fashion KSystemTrayIcon

P.S: Can/Should I commit this to 4.5 branch?

svn path=/trunk/KDE/kdepim/blogilo/; revision=1145378
parent 2810e5fe
......@@ -41,7 +41,7 @@
#include "ui_editorsettingsbase.h"
#include <ktabwidget.h>
#include <ksystemtrayicon.h>
#include <KStatusNotifierItem>
#include <kstatusbar.h>
#include <KToggleAction>
#include <kactioncollection.h>
......@@ -50,16 +50,16 @@
#include <kmessagebox.h>
#include <KDE/KLocale>
#include <QDir>
#include <QMenu>
#include <QDockWidget>
#include <QProgressBar>
#include <KSelectAction>
#include <kimagefilepreview.h>
#include "uploadmediadialog.h"
#include <QTimer>
#include <KToolInvocation>
#include <KMenu>
#define TIMEOUT 5000
#include <KToolInvocation>
MainWindow::MainWindow()
: KXmlGuiWindow(), mCurrentBlogId(__currentBlogId)
......@@ -380,11 +380,12 @@ void MainWindow::setupSystemTray()
{
if( Settings::enableSysTrayIcon()) {
if ( !systemTray ) {
systemTray = new KSystemTrayIcon( this );
systemTray->setIcon(this->windowIcon());
systemTray->setToolTip( i18n("Blogilo") );
systemTray = new KStatusNotifierItem( this );
systemTray->setIconByName("blogilo");
systemTray->setToolTip( "blogilo", i18n("Blogilo"), i18n("A KDE Blogging Client") );
systemTray->contextMenu()->addAction( actionCollection()->action("new_post") );
systemTray->show();
systemTray->setCategory(KStatusNotifierItem::ApplicationStatus);
systemTray->setStatus(KStatusNotifierItem::Active);
}
} else if( systemTray ) {
systemTray->deleteLater();
......
......@@ -30,13 +30,13 @@
#include "bilboblog.h"
#include <QPointer>
class KStatusNotifierItem;
class KTabWidget;
class QProgressBar;
class QToolButton;
class Toolbox;
class KSelectAction;
class PostEntry;
class KSystemTrayIcon;
/**
Main window of blogilo...
......@@ -120,7 +120,7 @@ private:
Toolbox *toolbox;
QDockWidget *toolboxDock;
QPointer<PostEntry> activePost;
KSystemTrayIcon *systemTray;
KStatusNotifierItem *systemTray;
KTabWidget *tabPosts;
QToolButton *btnRemovePost;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment