dtor first
[personal-kdebase.git] / workspace / ksysguard / gui / ksysguard.h
bloba1558e77e9d62a2263d63daaa49c1af28adb251e
1 /*
2 KSysGuard, the KDE System Guard
4 Copyright (c) 1999, 2000 Chris Schlaeger <cs@kde.org>
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public
8 License version 2 or at your option version 3 as published by
9 the Free Software Foundation.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef KSG_KSYSGUARD_H
22 #define KSG_KSYSGUARD_H
24 #include <QEvent>
25 #include <QtDBus/QtDBus>
27 #include <kapplication.h>
28 #include <kxmlguiwindow.h>
30 #include <ksgrd/SensorClient.h>
33 class QSplitter;
34 class SensorBrowserWidget;
35 class Workspace;
37 class TopLevel : public KXmlGuiWindow, public KSGRD::SensorClient
39 Q_OBJECT
40 Q_CLASSINFO("D-Bus Interface", "org.kde.SystemMonitor")
42 public:
43 TopLevel();
45 virtual void saveProperties( KConfigGroup& );
46 virtual void readProperties( const KConfigGroup& );
48 virtual void answerReceived( int id, const QList<QByteArray> & );
50 void beATaskManager();
51 void initStatusBar();
53 public Q_SLOTS:
54 // calling ksysguard with kwin/kicker hot-key
55 Q_SCRIPTABLE Q_NOREPLY void showOnCurrentDesktop();
56 Q_SCRIPTABLE Q_NOREPLY void importWorkSheet( const QString &fileName );
57 Q_SCRIPTABLE Q_NOREPLY void removeWorkSheet( const QString &fileName );
58 Q_SCRIPTABLE Q_NOREPLY void getHotNewWorksheet();
59 Q_SCRIPTABLE QStringList listHosts();
60 Q_SCRIPTABLE QStringList listSensors( const QString &hostName );
62 protected:
63 virtual bool event( QEvent* );
64 virtual void timerEvent( QTimerEvent* );
65 virtual bool queryClose();
67 protected Q_SLOTS:
68 void connectHost();
69 void disconnectHost();
70 void updateStatusBar();
71 void editToolbars();
72 void slotNewToolbarConfig();
73 void currentTabChanged(int index);
75 private:
76 void setSwapInfo( long, long, const QString& );
77 void changeEvent( QEvent * event );
78 void retranslateUi();
80 QDBusMessage mDBusReply;
82 QSplitter* mSplitter;
83 void startSensorBrowserWidget(); ///creates an mSensorBrowser if it doesn't exist
85 SensorBrowserWidget* mSensorBrowser;
86 Workspace* mWorkSpace;
88 int mTimerId;
89 QAction *mNewWorksheetAction;
90 QAction *mInsertWorksheetAction;
91 QAction *mTabExportAction;
92 QAction *mTabRemoveAction;
93 QAction *mMonitorRemoteAction;
94 QAction *mHotNewWorksheetAction;
95 QAction *mQuitAction;
96 QAction *mConfigureSheetAction;
98 QLabel *sbProcessCount;
99 QLabel *sbCpuStat;
100 QLabel *sbMemTotal;
101 QLabel *sbSwapTotal;
103 QList<int> mSplitterSize;
106 extern TopLevel* Toplevel;
108 #endif