Commit b41498d0 authored by Laurent Montel's avatar Laurent Montel 😁

Add preference in systemtray menu

svn path=/trunk/KDE/kdegraphics/kruler/; revision=937243
parent dace7e11
......@@ -4,7 +4,7 @@ add_subdirectory( pics )
########### next target ###############
set(kruler_SRCS qautosizelabel.cpp klineal.cpp main.cpp)
set(kruler_SRCS qautosizelabel.cpp klineal.cpp main.cpp krulersystemtray.cpp)
kde4_add_ui_files(kruler_SRCS cfg_appearance.ui cfg_advanced.ui)
......
......@@ -47,6 +47,7 @@
#include <netwm.h>
#include "kruler.h"
#include "krulersystemtray.h"
#include "qautosizelabel.h"
#include "ui_cfg_appearance.h"
......@@ -259,7 +260,7 @@ void KLineal::createSystemTray()
mCloseButton->setIcon( closeAction->icon() );
mCloseButton->setToolTip( closeAction->text().remove( '&' ) );
connect( mCloseButton, SIGNAL( clicked() ), this, SLOT( slotClose() ) );
mTrayIcon = new KSystemTrayIcon( KIcon( "kruler" ), this );
mTrayIcon = new KRulerSystemTray( KIcon( "kruler" ), this,mActionCollection );
mTrayIcon->show();
}
......
......@@ -27,7 +27,7 @@ class KAction;
class KActionCollection;
class KIcon;
class KMenu;
class KSystemTrayIcon;
class KRulerSystemTray;
class KLineal : public QWidget {
Q_OBJECT
......@@ -96,7 +96,7 @@ private:
int mOpacity;
QToolButton *mBtnRotateLeft, *mBtnRotateRight;
QToolButton *mCloseButton;
KSystemTrayIcon *mTrayIcon;
KRulerSystemTray *mTrayIcon;
public slots:
void setOrientation( int );
......
/***************************************************************************
klineal.h - description
-------------------
Copyright : (C) 2009 by Montel Laurent <montel@kde.org>
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "krulersystemtray.h"
#include <QMenu>
KRulerSystemTray::KRulerSystemTray( const KIcon& icon, QWidget * parent, KActionCollection *actions)
: KSystemTrayIcon( icon, parent )
{
QMenu * cm = contextMenu();
cm->addAction( actions->action("preferences") );
}
#include "krulersystemtray.moc"
/***************************************************************************
klineal.h - description
-------------------
Copyright : (C) 2009 by Montel Laurent <montel@kde.org>
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef KRULERSYSTEMTRAY_H
#define KRULERSYSTEMTRAY_H
#include <kactioncollection.h>
#include <kicon.h>
#include <ksystemtrayicon.h>
class KRulerSystemTray : public KSystemTrayIcon
{
public:
KRulerSystemTray( const KIcon &icon, QWidget * parent, KActionCollection *actions);
};
#endif
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