1
/***************************************************************************
2
* Copyright (C) 2011 Aaron Seigo *
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU General Public License as published by *
6
* the Free Software Foundation; either version 2 of the License, or *
7
* (at your option) any later version. *
9
* This program is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this program; if not, write to the *
16
* Free Software Foundation, Inc., *
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
18
***************************************************************************/
20
#include "showActivityManager.h"
22
#include <QGraphicsLinearLayout>
23
#include <QDBusConnection>
24
#include <QDBusMessage>
28
#include <Plasma/IconWidget>
29
#include <Plasma/ToolTipManager>
31
ShowActivityManager::ShowActivityManager(QObject *parent, const QVariantList &args)
32
: Plasma::Applet(parent, args)
34
setAspectRatioMode(Plasma::ConstrainedSquare);
35
QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(this);
37
m_icon = new Plasma::IconWidget(this);
38
m_icon->setSvg("widgets/activities");
39
connect(m_icon, SIGNAL(clicked()), this, SLOT(showManager()));
41
layout->addItem(m_icon);
43
Plasma::ToolTipContent content(i18n("Show Activity Manager"),
44
i18n("Click or press the Meta key and 'Q' to show the activity manager"),
45
KIcon("preferences-activities"));
46
Plasma::ToolTipManager::self()->setContent(this, content);
49
void ShowActivityManager::showManager()
51
QDBusMessage message = QDBusMessage::createMethodCall("org.kde.plasma-desktop",
54
"toggleActivityManager");
55
QDBusConnection::sessionBus().call(message, QDBus::NoBlock);
58
K_EXPORT_PLASMA_APPLET(org.kde.showActivityManager, ShowActivityManager)
60
#include "showActivityManager.moc"