2 // This file is part of the aMule Project.
4 // Copyright (c) 2010 Werner Mahr (Vollstrecker) <amule@vollstreckernet.de>
6 // Any parts of this program contributed by third-party developers are copyrighted
7 // by their respective authors.
9 // This program is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation; either version 3 of the License, or
12 // (at your option) any later version.
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #ifndef plasmamule_applet_h
25 #define plasmamule_applet_h
27 #include <plasma/applet.h>
28 #include <plasma/dataengine.h>
30 #include <QGraphicsSceneDragDropEvent>
33 class PlasmaMuleApplet
: public Plasma::Applet
37 PlasmaMuleApplet(QObject
*parent
, const QVariantList
&args
);
40 void paintInterface(QPainter
*painter
, const QStyleOptionGraphicsItem
*option
, const QRect
& contentsRect
);
44 void onSourceAdded(const QString
&);
45 void onSourceRemoved(const QString
&);
46 void dataUpdated(const QString
&, const Plasma::DataEngine::Data
&);
49 void dragEnterEvent(QGraphicsSceneDragDropEvent
*event
);
50 void dropEvent(QGraphicsSceneDragDropEvent
*event
);
51 void contextMenuEvent(QGraphicsSceneContextMenuEvent
*event
);
54 void connectToEngine();
56 QString
calcSize (qlonglong
);
57 QStringList m_catDirs
, m_catNames
;
58 int m_ed2k_state
, m_ed2k_server_port
, m_kad_status
, m_clients_in_up_queue
, m_shared_files_count
, m_uptime
, m_debugChannel
;
59 QString m_ed2k_id_high_low
, m_ed2k_server_name
, m_ed2k_server_ip
, m_nickname
, m_version
;
60 double m_down_speed
, m_up_speed
;
61 qlonglong m_total_bytes_downloaded
, m_total_bytes_uploaded
, m_session_bytes_downloaded
, m_session_bytes_uploaded
;
62 bool m_os_active
, m_config_found
;
64 Plasma::DataEngine
* m_aMuleEngine
;
67 void engine_add_link(QString
, int);