/*************************************************************************** * This file is part of netctl-gui * * * * netctl-gui 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 3 of the * * License, or (at your option) any later version. * * * * netctl-gui is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with netctl-gui. If not, see http://www.gnu.org/licenses/ * ***************************************************************************/ #ifndef NETCTL_PLASMOID_H #define NETCTL_PLASMOID_H #include #include #include #include #include #include #include class QGraphicsLinearLayout; class Netctl : public Plasma::Applet { Q_OBJECT public: Netctl(QObject *parent, const QVariantList &args); ~Netctl(); void init(); public slots: // events void sendNotification(const QString eventId, const QString message); void showGui(); // dataengine void dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data); // configuration interface void configAccepted(); void configChanged(); void setBigInterface(); void setSudo(); private slots: // ui void updateInterface(bool setHidden); // configuration interface void selectActiveIcon(); void selectGuiExe(); void selectInactiveIcon(); void selectNetctlExe(); // context menu void enableProfileSlot(); void startProfileSlot(QAction *profile); void stopProfileSlot(); void restartProfileSlot(); protected: void createConfigurationInterface(KConfigDialog *parent); QList contextualActions(); private: // ui QGraphicsLinearLayout *fullSpaceLayout; // icon Plasma::IconWidget *iconWidget; // text Plasma::Label *textLabel; bool status; QMap info; QStringList profileList; // context menu void createActions(); QList menuActions; QMenu *startProfileMenu; QAction *enableProfile; QAction *startProfile; QAction *stopProfile; QAction *restartProfile; // data engine Plasma::DataEngine *netctlEngine; void connectToEngine(); void disconnectFromEngine(); // notification // // configuration interface Ui::ConfigWindow uiConfig; // configuration int autoUpdateInterval; QMap bigInterface; QStringList formatLine; QMap paths; bool useSudo; }; K_EXPORT_PLASMA_APPLET(netctl, Netctl) #endif /* NETCTL_PLASMOID_H */