~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to ksysguard/gui/ksysguard.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    KSysGuard, the KDE System Guard
 
3
 
 
4
    Copyright (c) 1999, 2000 Chris Schlaeger <cs@kde.org>
 
5
 
 
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.
 
10
 
 
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.
 
15
 
 
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.
 
19
*/
 
20
 
 
21
#ifndef KSG_KSYSGUARD_H
 
22
#define KSG_KSYSGUARD_H
 
23
 
 
24
#include <QEvent>
 
25
#include <QtDBus/QtDBus>
 
26
 
 
27
#include <kapplication.h>
 
28
#include <kxmlguiwindow.h>
 
29
 
 
30
#include <ksgrd/SensorClient.h>
 
31
 
 
32
class QSplitter;
 
33
class SensorBrowserWidget;
 
34
class Workspace;
 
35
 
 
36
 
 
37
class TopLevel : public KXmlGuiWindow, public KSGRD::SensorClient
 
38
{
 
39
  Q_OBJECT
 
40
  Q_CLASSINFO("D-Bus Interface", "org.kde.SystemMonitor")
 
41
 
 
42
  public:
 
43
    TopLevel();
 
44
 
 
45
    virtual void saveProperties( KConfigGroup& );
 
46
    virtual void readProperties( const KConfigGroup& );
 
47
 
 
48
    virtual void answerReceived( int id, const QList<QByteArray> & );
 
49
 
 
50
    void initStatusBar();
 
51
 
 
52
  public Q_SLOTS:
 
53
    Q_SCRIPTABLE Q_NOREPLY void showOnCurrentDesktop();
 
54
    Q_SCRIPTABLE Q_NOREPLY void importWorkSheet( const QString &fileName );
 
55
    Q_SCRIPTABLE Q_NOREPLY void removeWorkSheet( const QString &fileName );
 
56
    Q_SCRIPTABLE Q_NOREPLY void getHotNewWorksheet();
 
57
    Q_SCRIPTABLE QStringList listHosts();
 
58
    Q_SCRIPTABLE QStringList listSensors( const QString &hostName );
 
59
 
 
60
 
 
61
  protected:
 
62
    virtual bool event( QEvent* );
 
63
    virtual void timerEvent( QTimerEvent* );
 
64
    virtual bool queryClose();
 
65
 
 
66
  protected Q_SLOTS:
 
67
    void connectHost();
 
68
    void disconnectHost();
 
69
    void updateStatusBar();
 
70
    void currentTabChanged(int index);
 
71
    void updateProcessCount();
 
72
    void configureCurrentSheet();
 
73
 
 
74
  private:
 
75
    void setSwapInfo( qlonglong, qlonglong, const QString& );
 
76
    void changeEvent( QEvent * event );
 
77
    void retranslateUi();
 
78
 
 
79
    QDBusMessage mDBusReply;
 
80
 
 
81
    QSplitter* mSplitter;
 
82
    void startSensorBrowserWidget();  ///creates an mSensorBrowser if it doesn't exist
 
83
 
 
84
    SensorBrowserWidget* mSensorBrowser;
 
85
    Workspace* mWorkSpace;
 
86
 
 
87
    int mTimerId;
 
88
    QAction *mNewWorksheetAction;
 
89
    QAction *mInsertWorksheetAction;
 
90
    QAction *mTabExportAction;
 
91
    QAction *mTabRemoveAction;
 
92
    QAction *mMonitorRemoteAction;
 
93
    QAction *mHotNewWorksheetAction;
 
94
    QAction *mQuitAction;
 
95
    QAction *mConfigureSheetAction;
 
96
    QAction *mHotNewWorksheetUploadAction;
 
97
    KAction *mRefreshTabAction;
 
98
    QLabel *sbProcessCount;
 
99
    QLabel *sbCpuStat;
 
100
    QLabel *sbMemTotal;
 
101
    QLabel *sbSwapTotal;
 
102
 
 
103
    QList<int> mSplitterSize;
 
104
};
 
105
 
 
106
extern TopLevel* Toplevel;
 
107
 
 
108
#endif