-rw-r--r-- | microkde/kdialog.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/microkde/kdialog.cpp b/microkde/kdialog.cpp index 8398956..57e7ea6 100644 --- a/microkde/kdialog.cpp +++ b/microkde/kdialog.cpp | |||
@@ -1,72 +1,74 @@ | |||
1 | 1 | ||
2 | #include <kdialog.h> | 2 | #include <kdialog.h> |
3 | #include <qapp.h> | 3 | #include <qapplication.h> |
4 | #include <qlabel.h> | 4 | #include <qlabel.h> |
5 | #include <qpushbutton.h> | 5 | #include <qpushbutton.h> |
6 | #include <qlayout.h> | 6 | #include <qlayout.h> |
7 | #include <qprogressbar.h> | 7 | #include <q3progressbar.h> |
8 | //Added by qt3to4: | ||
9 | #include <Q3VBoxLayout> | ||
8 | #include <klocale.h> | 10 | #include <klocale.h> |
9 | 11 | ||
10 | KDialog::KDialog( QWidget *parent, const char *name, bool modal ) : | 12 | KDialog::KDialog( QWidget *parent, const char *name, bool modal ) : |
11 | QDialog( parent, name, modal ) | 13 | QDialog( parent, name, modal ) |
12 | { | 14 | { |
13 | ; | 15 | ; |
14 | 16 | ||
15 | } | 17 | } |
16 | #ifdef DESKTOP_VERSION | 18 | #ifdef DESKTOP_VERSION |
17 | int KDialog::spacingHint() { return 7; } | 19 | int KDialog::spacingHint() { return 7; } |
18 | int KDialog::marginHint() { return 7; } | 20 | int KDialog::marginHint() { return 7; } |
19 | 21 | ||
20 | int KDialog::spacingHintSmall() { return 4; } | 22 | int KDialog::spacingHintSmall() { return 4; } |
21 | int KDialog::marginHintSmall() { return 4; } | 23 | int KDialog::marginHintSmall() { return 4; } |
22 | 24 | ||
23 | #else | 25 | #else |
24 | int KDialog::spacingHint() { return 3; } | 26 | int KDialog::spacingHint() { return 3; } |
25 | int KDialog::marginHint() { return 3; } | 27 | int KDialog::marginHint() { return 3; } |
26 | 28 | ||
27 | int KDialog::spacingHintSmall() { return 1; } | 29 | int KDialog::spacingHintSmall() { return 1; } |
28 | int KDialog::marginHintSmall() { return 1; } | 30 | int KDialog::marginHintSmall() { return 1; } |
29 | #endif | 31 | #endif |
30 | KProgressDialog::KProgressDialog( QWidget *parent, const char *name, bool modal ) : | 32 | KProgressDialog::KProgressDialog( QWidget *parent, const char *name, bool modal ) : |
31 | QDialog( parent, name, modal ) | 33 | QDialog( parent, name, modal ) |
32 | { | 34 | { |
33 | QVBoxLayout* lay= new QVBoxLayout ( this ); | 35 | Q3VBoxLayout* lay= new Q3VBoxLayout ( this ); |
34 | mLabel = new QLabel ( "abc",this ); | 36 | mLabel = new QLabel ( "abc",this ); |
35 | mBar = new QProgressBar ( this ); | 37 | mBar = new Q3ProgressBar ( this ); |
36 | mButton = new QPushButton ( i18n("Cancel"),this ); | 38 | mButton = new QPushButton ( i18n("Cancel"),this ); |
37 | lay->addWidget ( mLabel ); | 39 | lay->addWidget ( mLabel ); |
38 | lay->addWidget ( mBar ); | 40 | lay->addWidget ( mBar ); |
39 | lay->addWidget ( mButton ); | 41 | lay->addWidget ( mButton ); |
40 | connect ( mButton , SIGNAL ( clicked () ), this, SIGNAL ( cancelled () )); | 42 | connect ( mButton , SIGNAL ( clicked () ), this, SIGNAL ( cancelled () )); |
41 | resize ( 220, sizeHint().height() +mLabel->sizeHint().height()); | 43 | resize ( 220, sizeHint().height() +mLabel->sizeHint().height()); |
42 | 44 | ||
43 | } | 45 | } |
44 | 46 | ||
45 | void KProgressDialog::setLabelText ( const QString & t) | 47 | void KProgressDialog::setLabelText ( const QString & t) |
46 | { | 48 | { |
47 | mLabel->setText( t ); | 49 | mLabel->setText( t ); |
48 | } | 50 | } |
49 | 51 | ||
50 | void KProgressDialog::setTotalSteps ( int totalSteps ) | 52 | void KProgressDialog::setTotalSteps ( int totalSteps ) |
51 | { | 53 | { |
52 | setActiveWindow(); | 54 | setActiveWindow(); |
53 | setFocus(); | 55 | setFocus(); |
54 | mBar->setTotalSteps ( totalSteps ); | 56 | mBar->setTotalSteps ( totalSteps ); |
55 | } | 57 | } |
56 | void KProgressDialog::setProgress ( int progress ) | 58 | void KProgressDialog::setProgress ( int progress ) |
57 | { | 59 | { |
58 | setActiveWindow(); | 60 | setActiveWindow(); |
59 | setFocus(); | 61 | setFocus(); |
60 | mBar->setProgress ( progress ); | 62 | mBar->setProgress ( progress ); |
61 | } | 63 | } |
62 | void KProgressDialog::accept() | 64 | void KProgressDialog::accept() |
63 | { | 65 | { |
64 | mLabel->setText( i18n("Eeek, there I am ticklish!") ); | 66 | mLabel->setText( i18n("Eeek, there I am ticklish!") ); |
65 | move ( geometry().x()-20,geometry().y()+20); | 67 | move ( geometry().x()-20,geometry().y()+20); |
66 | // QDialog::accept(); | 68 | // QDialog::accept(); |
67 | } | 69 | } |
68 | void KProgressDialog::reject() | 70 | void KProgressDialog::reject() |
69 | { | 71 | { |
70 | emit cancelled (); | 72 | emit cancelled (); |
71 | //QDialog::reject(); | 73 | //QDialog::reject(); |
72 | } | 74 | } |