• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Applets

plasmoidtaskprotocol.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   plasmoidprotocol.cpp                                                  *
00003  *                                                                         *
00004  *   Copyright (C) 2008 Jason Stubbs <jasonbstubbs@gmail.com>              *
00005  *   Copyright (C) 2008 Sebastian Kügler <sebas@kde.org>                   *
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  *   This program is distributed in the hope that it will be useful,       *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU General Public License for more details.                          *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU General Public License     *
00018  *   along with this program; if not, write to the                         *
00019  *   Free Software Foundation, Inc.,                                       *
00020  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
00021  ***************************************************************************/
00022 
00023 #include "plasmoidtask.h"
00024 #include "plasmoidtaskprotocol.h"
00025 
00026 #include <KDebug>
00027 
00028 namespace SystemTray
00029 {
00030 
00031 PlasmoidProtocol::PlasmoidProtocol(QObject *parent)
00032     : Protocol(parent)
00033 {
00034 }
00035 
00036 
00037 PlasmoidProtocol::~PlasmoidProtocol()
00038 {
00039 }
00040 
00041 
00042 void PlasmoidProtocol::init()
00043 {
00044     // TODO: Load plasmoids from config
00045     //newTask("battery");
00046     //newTask("notify");
00047     //newTask("kuiserver");
00048     //newTask("mid_control");
00049 }
00050 
00051 
00052 void PlasmoidProtocol::newTask(QString appletName)
00053 {
00054     if (m_tasks.contains(appletName)) {
00055         kDebug() << "Task " << appletName << "is already in here.";
00056         return;
00057     }
00058 
00059     kDebug() << "Registering task with the manager" << appletName;
00060     PlasmoidTask *task = new PlasmoidTask(appletName);
00061 
00062     if (!task->isValid()) {
00063         // we failed to load our applet *sob*
00064         delete task;
00065         return;
00066     }
00067 
00068     m_tasks[appletName] = task;
00069     connect(task, SIGNAL(taskDeleted(QString)), this, SLOT(cleanupTask(QString)));
00070     emit taskCreated(task);
00071 }
00072 
00073 
00074 void PlasmoidProtocol::cleanupTask(QString typeId)
00075 {
00076     kDebug() << "task with typeId" << typeId << "removed";
00077     m_tasks.remove(typeId);
00078 }
00079 
00080 }
00081 
00082 #include "plasmoidtaskprotocol.moc"

Applets

Skip menu "Applets"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal