]> icculus.org git repositories - duncan/yast2-qt4.git/blob - src/pkg/YQPkgDiskUsageWarningDialog.h
don't create QObjects in ycp thread - make timeouts work
[duncan/yast2-qt4.git] / src / pkg / YQPkgDiskUsageWarningDialog.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:       YQPkgDiskUsageWarningDialog.h
14
15   Author:     Stefan Hundhammer <sh@suse.de>
16
17 /-*/
18
19
20 #ifndef YQPkgDiskUsageWarningDialog_h
21 #define YQPkgDiskUsageWarningDialog_h
22
23 #include <qdialog.h>
24
25
26 class YQPkgDiskUsageList;
27
28
29 /**
30  * Warning dialog about partitions that are getting full or overflowing.
31  **/
32 class YQPkgDiskUsageWarningDialog : public QDialog
33 {
34     Q_OBJECT
35
36 public:
37     /**
38      * Static convenience method: Post a disk usage warning with text
39      * 'message', a list of partitions that are at least 'thresholdPercent'
40      * full and one ( default ) or two buttons.
41      *
42      * Returns 'true' if the user accepted ( i.e. clicked the 'accept' button )
43      * and 'false' if the user rejected ( i.e. clicked the 'reject' button or
44      * the window manager close button ).
45      **/
46     static bool diskUsageWarning( const QString &       message,
47                                   int                   thresholdPercent,
48                                   const QString &       acceptButtonLabel,
49                                   const QString &       rejectButtonLabel = QString::null );
50 protected:
51
52     /**
53      * Constructor: Creates a disk usage warning dialog with text 'message' on
54      * top, a list of partitions that are at least 'thresholdPercent' full and
55      * one ( default ) or two buttons.
56      *
57      * Not meant for public use. Applications should use the static
58      * 'diskUsageWarning' method instead.
59      **/
60     YQPkgDiskUsageWarningDialog( QWidget *              parent,
61                                  const QString &        message,
62                                  int                    thresholdPercent,
63                                  const QString &        acceptButtonLabel,
64                                  const QString &        rejectButtonLabel = QString::null );
65 };
66
67
68 #endif // ifndef YQPkgDiskUsageWarningDialog_h