-rw-r--r-- | libkdepim/ksyncmanager.h | 3 | ||||
-rw-r--r-- | microkde/kdialog.cpp | 48 | ||||
-rw-r--r-- | microkde/kdialog.h | 20 |
3 files changed, 69 insertions, 2 deletions
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index e6738b6..d3734da 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h | |||
@@ -27,12 +27,13 @@ | |||
27 | #include <qsocket.h> | 27 | #include <qsocket.h> |
28 | #include <qdatetime.h> | 28 | #include <qdatetime.h> |
29 | #include <qserversocket.h> | 29 | #include <qserversocket.h> |
30 | #include <qtextstream.h> | 30 | #include <qtextstream.h> |
31 | #include <qregexp.h> | 31 | #include <qregexp.h> |
32 | #include <qprogressdialog.h> | 32 | #include <qprogressdialog.h> |
33 | #include <kdialog.h> | ||
33 | 34 | ||
34 | class QPopupMenu; | 35 | class QPopupMenu; |
35 | class KSyncProfile; | 36 | class KSyncProfile; |
36 | class KPimPrefs; | 37 | class KPimPrefs; |
37 | class QWidget; | 38 | class QWidget; |
38 | class KSyncManager; | 39 | class KSyncManager; |
@@ -96,13 +97,13 @@ class KCommandSocket : public QObject | |||
96 | void readFileFromSocket(); | 97 | void readFileFromSocket(); |
97 | void deleteSocket(); | 98 | void deleteSocket(); |
98 | void writeFileToSocket(); | 99 | void writeFileToSocket(); |
99 | private : | 100 | private : |
100 | int mConnectCount; | 101 | int mConnectCount; |
101 | int mConnectMax; | 102 | int mConnectMax; |
102 | QProgressDialog mConnectProgress; | 103 | KProgressDialog mConnectProgress; |
103 | QWidget* tlw; | 104 | QWidget* tlw; |
104 | QSocket* mSocket; | 105 | QSocket* mSocket; |
105 | QString mPassWord; | 106 | QString mPassWord; |
106 | Q_UINT16 mPort; | 107 | Q_UINT16 mPort; |
107 | QString mHost; | 108 | QString mHost; |
108 | QString mFileName; | 109 | QString mFileName; |
diff --git a/microkde/kdialog.cpp b/microkde/kdialog.cpp index 961631e..f9e0126 100644 --- a/microkde/kdialog.cpp +++ b/microkde/kdialog.cpp | |||
@@ -1,10 +1,14 @@ | |||
1 | 1 | ||
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 ) : |
7 | QDialog( parent, name, modal ) | 11 | QDialog( parent, name, modal ) |
8 | { | 12 | { |
9 | ; | 13 | ; |
10 | 14 | ||
@@ -20,6 +24,48 @@ int KDialog::marginHintSmall() { return 4; } | |||
20 | int KDialog::spacingHint() { return 3; } | 24 | int KDialog::spacingHint() { return 3; } |
21 | int KDialog::marginHint() { return 3; } | 25 | int KDialog::marginHint() { return 3; } |
22 | 26 | ||
23 | int KDialog::spacingHintSmall() { return 1; } | 27 | 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 | } | ||
diff --git a/microkde/kdialog.h b/microkde/kdialog.h index 703d268..bc80689 100644 --- a/microkde/kdialog.h +++ b/microkde/kdialog.h | |||
@@ -1,18 +1,38 @@ | |||
1 | #ifndef MINIKDE_KDIALOG_H | 1 | #ifndef MINIKDE_KDIALOG_H |
2 | #define MINIKDE_KDIALOG_H | 2 | #define MINIKDE_KDIALOG_H |
3 | 3 | ||
4 | #include <qdialog.h> | 4 | #include <qdialog.h> |
5 | class QLabel; | ||
6 | class QProgressBar; | ||
7 | class QPushButton ; | ||
5 | 8 | ||
6 | class KDialog : public QDialog | 9 | class KDialog : public QDialog |
7 | { | 10 | { |
8 | Q_OBJECT | 11 | Q_OBJECT |
9 | public: | 12 | public: |
10 | KDialog( QWidget *parent=0, const char *name=0, bool modal=true ); | 13 | KDialog( QWidget *parent=0, const char *name=0, bool modal=true ); |
11 | 14 | ||
12 | static int spacingHint(); | 15 | static int spacingHint(); |
13 | static int marginHint(); | 16 | static int marginHint(); |
14 | static int spacingHintSmall(); | 17 | static int spacingHintSmall(); |
15 | static int marginHintSmall(); | 18 | static int marginHintSmall(); |
16 | }; | 19 | }; |
20 | class KProgressDialog : public QDialog | ||
21 | { | ||
22 | Q_OBJECT | ||
23 | public: | ||
24 | KProgressDialog( QWidget *parent=0, const char *name=0, bool modal=false ); | ||
25 | void setLabelText ( const QString & ); | ||
26 | void setTotalSteps ( int totalSteps ); | ||
27 | void setProgress ( int progress ); | ||
28 | void accept(); | ||
29 | void reject(); | ||
30 | private: | ||
31 | QLabel * mLabel; | ||
32 | QProgressBar *mBar; | ||
33 | QPushButton *mButton; | ||
34 | signals: | ||
35 | void cancelled (); | ||
36 | }; | ||
17 | 37 | ||
18 | #endif | 38 | #endif |