1/*
2 * Copyright (C) 2007-2010 John Tapsell <johnflux@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License version 2 as
6 * published by the Free Software Foundation
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details
12 *
13 * You should have received a copy of the GNU Library General Public
14 * License along with this program; if not, write to the
15 * Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef KSYSTEMACTIVITYDIALOG__H
20#define KSYSTEMACTIVITYDIALOG__H
21
22#ifndef Q_WS_WIN
23
24#include <KDialog>
25
26#include "processui/ksysguardprocesslist.h"
27
28/** This creates a simple dialog box with a KSysguardProcessList
29 *
30 * It remembers the size and position of the dialog, and sets
31 * the dialog to always be over the other windows
32 */
33class KSystemActivityDialog : public KDialog
34{
35 public:
36 KSystemActivityDialog(QWidget *parent = NULL);
37
38 /** Show the dialog and set the focus
39 *
40 * This can be called even when the dialog is already showing to bring it
41 * to the front again and move it to the current desktop etc.
42 */
43 void run();
44
45 /** Set the text in the filter line in the process list widget */
46 void setFilterText(const QString &filterText);
47 QString filterText() const;
48
49 /** Save the settings if the user presses the ESC key */
50 virtual void reject();
51
52 protected:
53 /** Save the settings if the user clicks (x) button on the window */
54 void closeEvent(QCloseEvent *event);
55
56 private:
57 void saveDialogSettings();
58
59 KSysGuardProcessList m_processList;
60};
61#endif // not Q_WS_WIN
62
63#endif // KSYSTEMACTIVITYDIALOG__H
64