author | zautrix <zautrix> | 2005-07-09 01:22:50 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-09 01:22:50 (UTC) |
commit | 3c756588a4f650fc6f2e5971d56d56b74d67bfda (patch) (unidiff) | |
tree | 8c62bc77c8248520ff3f0ecf508ab47550a1de74 /microkde/kdialog.cpp | |
parent | 1e11d41ecb6a912c4c0a2747eb1fa26626fdcca2 (diff) | |
download | kdepimpi-3c756588a4f650fc6f2e5971d56d56b74d67bfda.zip kdepimpi-3c756588a4f650fc6f2e5971d56d56b74d67bfda.tar.gz kdepimpi-3c756588a4f650fc6f2e5971d56d56b74d67bfda.tar.bz2 |
comp fixes
-rw-r--r-- | microkde/kdialog.cpp | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/microkde/kdialog.cpp b/microkde/kdialog.cpp index 961631e..f9e0126 100644 --- a/microkde/kdialog.cpp +++ b/microkde/kdialog.cpp | |||
@@ -2,5 +2,9 @@ | |||
2 | #include <kdialog.h> | 2 | #include <kdialog.h> |
3 | #include <qapp.h> | 3 | #include <qapp.h> |
4 | 4 | #include <qlabel.h> | |
5 | #include <qpushbutton.h> | ||
6 | #include <qlayout.h> | ||
7 | #include <qprogressbar.h> | ||
8 | #include <klocale.h> | ||
5 | 9 | ||
6 | KDialog::KDialog( QWidget *parent, const char *name, bool modal ) : | 10 | KDialog::KDialog( QWidget *parent, const char *name, bool modal ) : |
@@ -24,2 +28,44 @@ int KDialog::spacingHintSmall() { return 1; } | |||
24 | int KDialog::marginHintSmall() { return 1; } | 28 | int KDialog::marginHintSmall() { return 1; } |
25 | #endif | 29 | #endif |
30 | KProgressDialog::KProgressDialog( QWidget *parent, const char *name, bool modal ) : | ||
31 | QDialog( parent, name, modal ) | ||
32 | { | ||
33 | QVBoxLayout* lay= new QVBoxLayout ( this ); | ||
34 | mLabel = new QLabel ( "abc",this ); | ||
35 | mBar = new QProgressBar ( this ); | ||
36 | mButton = new QPushButton ( i18n("Cancel"),this ); | ||
37 | lay->addWidget ( mLabel ); | ||
38 | lay->addWidget ( mBar ); | ||
39 | lay->addWidget ( mButton ); | ||
40 | connect ( mButton , SIGNAL ( clicked () ), this, SIGNAL ( cancelled () )); | ||
41 | resize ( 220, sizeHint().height() +mLabel->sizeHint().height()); | ||
42 | |||
43 | } | ||
44 | |||
45 | void KProgressDialog::setLabelText ( const QString & t) | ||
46 | { | ||
47 | mLabel->setText( t ); | ||
48 | } | ||
49 | |||
50 | void KProgressDialog::setTotalSteps ( int totalSteps ) | ||
51 | { | ||
52 | setActiveWindow(); | ||
53 | setFocus(); | ||
54 | mBar->setTotalSteps ( totalSteps ); | ||
55 | } | ||
56 | void KProgressDialog::setProgress ( int progress ) | ||
57 | { | ||
58 | setActiveWindow(); | ||
59 | setFocus(); | ||
60 | mBar->setProgress ( progress ); | ||
61 | } | ||
62 | void KProgressDialog::accept() | ||
63 | { | ||
64 | |||
65 | // QDialog::accept(); | ||
66 | } | ||
67 | void KProgressDialog::reject() | ||
68 | { | ||
69 | emit cancelled (); | ||
70 | //QDialog::reject(); | ||
71 | } | ||