1/* This file is part of the KDE Project
2 Copyright (c) 2006 Lukas Tinkl <ltinkl@suse.cz>
3 Copyright (c) 2008 Lubos Lunak <l.lunak@suse.cz>
4 Copyright (c) 2009 Ivo Anjo <knuckles@gmail.com>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef _FREESPACENOTIFIER_H_
21#define _FREESPACENOTIFIER_H_
22
23#include <QtCore/QTimer>
24#include <QtDBus/QDBusInterface>
25
26#include <KNotification>
27
28class FreeSpaceNotifier
29: public QObject
30{
31 Q_OBJECT
32 public:
33 FreeSpaceNotifier( QObject* parent = NULL );
34 virtual ~FreeSpaceNotifier();
35 private slots:
36 void checkFreeDiskSpace();
37 void resetLastAvailable();
38 void openFileManager();
39 void showConfiguration();
40 void cleanupNotification();
41 void configDialogClosed();
42 private:
43 QTimer timer;
44 QTimer* lastAvailTimer;
45 KNotification *notification;
46 qint64 lastAvail; // used to suppress repeated warnings when available space hasn't changed
47
48 void disableFSNotifier();
49 bool dbusError( QDBusInterface &iface );
50};
51
52#endif
53