-rw-r--r-- | microkde/kdialogbase.cpp | 25 | ||||
-rw-r--r-- | microkde/kutils/kcmultidialog.cpp | 23 |
2 files changed, 25 insertions, 23 deletions
diff --git a/microkde/kdialogbase.cpp b/microkde/kdialogbase.cpp index c953058..d1f7630 100644 --- a/microkde/kdialogbase.cpp +++ b/microkde/kdialogbase.cpp | |||
@@ -15,9 +15,9 @@ KDialogBase::KDialogBase() | |||
15 | 15 | ||
16 | KDialogBase::KDialogBase( QWidget *parent, const char *name, bool modal, | 16 | KDialogBase::KDialogBase( QWidget *parent, const char *name, bool modal, |
17 | const QString &caption, | 17 | const QString &caption, |
18 | int buttonMask, ButtonCode defaultButton, | 18 | int buttonMask, ButtonCode defaultButton, |
19 | bool separator, | 19 | bool separator, |
20 | const QString &user1, | 20 | const QString &user1, |
21 | const QString &user2, | 21 | const QString &user2, |
22 | const QString &user3) : | 22 | const QString &user3) : |
23 | KDialog( parent, name, modal ) | 23 | KDialog( parent, name, modal ) |
@@ -27,11 +27,11 @@ KDialogBase::KDialogBase( QWidget *parent, const char *name, bool modal, | |||
27 | (findButton( defaultButton ) )->setFocus(); | 27 | (findButton( defaultButton ) )->setFocus(); |
28 | 28 | ||
29 | } | 29 | } |
30 | 30 | ||
31 | KDialogBase::KDialogBase( int dialogFace, const QString &caption, | 31 | KDialogBase::KDialogBase( int dialogFace, const QString &caption, |
32 | int buttonMask, ButtonCode defaultButton, | 32 | int buttonMask, ButtonCode defaultButton, |
33 | QWidget *parent, const char *name, bool modal, | 33 | QWidget *parent, const char *name, bool modal, |
34 | bool separator, | 34 | bool separator, |
35 | const QString &user1, | 35 | const QString &user1, |
36 | const QString &user2, | 36 | const QString &user2, |
37 | const QString &user3) : | 37 | const QString &user3) : |
@@ -77,9 +77,8 @@ void KDialogBase::init( const QString &caption, int buttonMask, | |||
77 | } else { | 77 | } else { |
78 | mOkButton = 0; | 78 | mOkButton = 0; |
79 | } | 79 | } |
80 | if ( buttonMask & Default ) { | 80 | if ( buttonMask & Default ) { |
81 | qDebug("buttonMask & Default "); | ||
82 | mDefaultButton = new QPushButton( i18n("Default"), this ); | 81 | mDefaultButton = new QPushButton( i18n("Default"), this ); |
83 | connect( mDefaultButton, SIGNAL( clicked() ), SIGNAL( defaultClicked() ) ); | 82 | connect( mDefaultButton, SIGNAL( clicked() ), SIGNAL( defaultClicked() ) ); |
84 | } else { | 83 | } else { |
85 | mDefaultButton = 0; | 84 | mDefaultButton = 0; |
@@ -103,9 +102,9 @@ void KDialogBase::init( const QString &caption, int buttonMask, | |||
103 | mCloseButton = new QPushButton( i18n("Close"), this ); | 102 | mCloseButton = new QPushButton( i18n("Close"), this ); |
104 | connect( mCloseButton, SIGNAL( clicked() ), SLOT( slotClose() ) ); | 103 | connect( mCloseButton, SIGNAL( clicked() ), SLOT( slotClose() ) ); |
105 | } else { | 104 | } else { |
106 | mCloseButton = 0; | 105 | mCloseButton = 0; |
107 | } | 106 | } |
108 | } | 107 | } |
109 | 108 | ||
110 | QTabWidget *KDialogBase::tabWidget() | 109 | QTabWidget *KDialogBase::tabWidget() |
111 | { | 110 | { |
@@ -124,23 +123,23 @@ void KDialogBase::hideButtons() | |||
124 | if ( mApplyButton ) mApplyButton->hide() ; | 123 | if ( mApplyButton ) mApplyButton->hide() ; |
125 | if ( mDefaultButton ) mDefaultButton->hide(); | 124 | if ( mDefaultButton ) mDefaultButton->hide(); |
126 | if ( mCancelButton ) mCancelButton->hide() ; | 125 | if ( mCancelButton ) mCancelButton->hide() ; |
127 | if ( mCloseButton ) mCloseButton->hide() ; | 126 | if ( mCloseButton ) mCloseButton->hide() ; |
128 | 127 | ||
129 | } | 128 | } |
130 | void KDialogBase::initLayout() | 129 | void KDialogBase::initLayout() |
131 | { | 130 | { |
132 | 131 | ||
133 | delete mTopLayout; | 132 | delete mTopLayout; |
134 | mTopLayout = new QVBoxLayout( this ); | 133 | mTopLayout = new QVBoxLayout( this ); |
135 | mTopLayout->setMargin( marginHint() ); | 134 | mTopLayout->setMargin( marginHint() ); |
136 | mTopLayout->setSpacing( spacingHint() ); | 135 | mTopLayout->setSpacing( spacingHint() ); |
137 | 136 | ||
138 | mTopLayout->addWidget( mMainWidget ); | 137 | mTopLayout->addWidget( mMainWidget ); |
139 | 138 | ||
140 | QBoxLayout *buttonLayout = new QHBoxLayout; | 139 | QBoxLayout *buttonLayout = new QHBoxLayout; |
141 | mTopLayout->addLayout( buttonLayout ); | 140 | mTopLayout->addLayout( buttonLayout ); |
142 | 141 | ||
143 | if ( mUser1Button ) buttonLayout->addWidget( mUser1Button ); | 142 | if ( mUser1Button ) buttonLayout->addWidget( mUser1Button ); |
144 | if ( mUser2Button ) buttonLayout->addWidget( mUser2Button ); | 143 | if ( mUser2Button ) buttonLayout->addWidget( mUser2Button ); |
145 | if ( mOkButton ) buttonLayout->addWidget( mOkButton ); | 144 | if ( mOkButton ) buttonLayout->addWidget( mOkButton ); |
146 | if ( mApplyButton ) buttonLayout->addWidget( mApplyButton ); | 145 | if ( mApplyButton ) buttonLayout->addWidget( mApplyButton ); |
@@ -204,17 +203,17 @@ QPushButton *KDialogBase::findButton( ButtonCode id ) | |||
204 | button = mUser2Button; | 203 | button = mUser2Button; |
205 | break; | 204 | break; |
206 | case Cancel: | 205 | case Cancel: |
207 | button = mCancelButton; | 206 | button = mCancelButton; |
208 | break; | 207 | break; |
209 | case Default: | 208 | case Default: |
210 | button = mDefaultButton; | 209 | button = mDefaultButton; |
211 | break; | 210 | break; |
212 | case Close: | 211 | case Close: |
213 | button = mCloseButton; | 212 | button = mCloseButton; |
214 | break; | 213 | break; |
215 | default: | 214 | default: |
216 | break; | 215 | break; |
217 | } | 216 | } |
218 | return button; | 217 | return button; |
219 | } | 218 | } |
220 | 219 | ||
diff --git a/microkde/kutils/kcmultidialog.cpp b/microkde/kutils/kcmultidialog.cpp index 4136622..13be2ce 100644 --- a/microkde/kutils/kcmultidialog.cpp +++ b/microkde/kutils/kcmultidialog.cpp | |||
@@ -42,19 +42,22 @@ KCMultiDialog::KCMultiDialog(const QString& baseGroup, QWidget *parent, const ch | |||
42 | parent, name, modal, true), d(0L) | 42 | parent, name, modal, true), d(0L) |
43 | { | 43 | { |
44 | enableButton(Apply, false); | 44 | enableButton(Apply, false); |
45 | //connect(this, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShow(QWidget *))); | 45 | //connect(this, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShow(QWidget *))); |
46 | |||
47 | connect( this, SIGNAL( defaultClicked() ), SLOT( slotDefault() ) ); | ||
48 | |||
46 | _baseGroup = baseGroup; | 49 | _baseGroup = baseGroup; |
47 | mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed ); | 50 | mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed ); |
48 | setMainWidget(mMainWidget ); | 51 | setMainWidget(mMainWidget ); |
49 | #ifdef DESKTOP_VERSION | 52 | #ifdef DESKTOP_VERSION |
50 | resize(640,480); | 53 | resize(640,480); |
51 | #else | 54 | #else |
52 | resize(640,480); | 55 | resize(640,480); |
53 | setMaximumSize( KMIN(KGlobal::getDesktopWidth()-5, 640), KMIN(KGlobal::getDesktopHeight()-20, 480)); | 56 | setMaximumSize( KMIN(KGlobal::getDesktopWidth()-5, 640), KMIN(KGlobal::getDesktopHeight()-20, 480)); |
54 | //showMaximized(); | 57 | //showMaximized(); |
55 | #endif | 58 | #endif |
56 | 59 | ||
57 | } | 60 | } |
58 | 61 | ||
59 | KCMultiDialog::~KCMultiDialog() | 62 | KCMultiDialog::~KCMultiDialog() |
60 | { | 63 | { |
@@ -64,9 +67,9 @@ KCMultiDialog::~KCMultiDialog() | |||
64 | void KCMultiDialog::slotDefault() | 67 | void KCMultiDialog::slotDefault() |
65 | { | 68 | { |
66 | 69 | ||
67 | int curPageIndex = mMainWidget->activePageIndex(); | 70 | int curPageIndex = mMainWidget->activePageIndex(); |
68 | 71 | ||
69 | QPtrListIterator<KCModule> it(modules); | 72 | QPtrListIterator<KCModule> it(modules); |
70 | for (; it.current(); ++it) | 73 | for (; it.current(); ++it) |
71 | { | 74 | { |
72 | if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex) | 75 | if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex) |
@@ -75,9 +78,9 @@ void KCMultiDialog::slotDefault() | |||
75 | clientChanged(true); | 78 | clientChanged(true); |
76 | return; | 79 | return; |
77 | } | 80 | } |
78 | } | 81 | } |
79 | 82 | ||
80 | } | 83 | } |
81 | 84 | ||
82 | void KCMultiDialog::slotApply() | 85 | void KCMultiDialog::slotApply() |
83 | { | 86 | { |
@@ -88,16 +91,16 @@ qDebug("KCMultiDialog::slotApply clicked"); | |||
88 | (*it)->save(); | 91 | (*it)->save(); |
89 | clientChanged(false); | 92 | clientChanged(false); |
90 | 93 | ||
91 | emit applyClicked(); | 94 | emit applyClicked(); |
92 | 95 | ||
93 | } | 96 | } |
94 | 97 | ||
95 | 98 | ||
96 | void KCMultiDialog::slotOk() | 99 | void KCMultiDialog::slotOk() |
97 | { | 100 | { |
98 | qDebug("KCMultiDialog::slotOk clicked"); | 101 | qDebug("KCMultiDialog::slotOk clicked"); |
99 | 102 | ||
100 | QPtrListIterator<KCModule> it(modules); | 103 | QPtrListIterator<KCModule> it(modules); |
101 | for (; it.current(); ++it) | 104 | for (; it.current(); ++it) |
102 | (*it)->save(); | 105 | (*it)->save(); |
103 | accept(); | 106 | accept(); |
@@ -118,17 +121,17 @@ void KCMultiDialog::slotHelp() | |||
118 | process.detach(); | 121 | process.detach(); |
119 | } else { | 122 | } else { |
120 | new KRun(url); | 123 | new KRun(url); |
121 | } | 124 | } |
122 | */ | 125 | */ |
123 | } | 126 | } |
124 | 127 | ||
125 | void KCMultiDialog::clientChanged(bool state) | 128 | void KCMultiDialog::clientChanged(bool state) |
126 | { | 129 | { |
127 | enableButton(Apply, state); | 130 | enableButton(Apply, state); |
128 | } | 131 | } |
129 | 132 | ||
130 | /*US | 133 | /*US |
131 | void KCMultiDialog::addModule(const QString& path, bool withfallback) | 134 | void KCMultiDialog::addModule(const QString& path, bool withfallback) |
132 | { | 135 | { |
133 | kdDebug(1208) << "KCMultiDialog::addModule " << path << endl; | 136 | kdDebug(1208) << "KCMultiDialog::addModule " << path << endl; |
134 | 137 | ||
@@ -156,9 +159,9 @@ void KCMultiDialog::addModule(KCModule* module ) //, const QString& modulename, | |||
156 | { | 159 | { |
157 | 160 | ||
158 | modules.append(module); | 161 | modules.append(module); |
159 | connect(module, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool))); | 162 | connect(module, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool))); |
160 | 163 | ||
161 | 164 | ||
162 | } | 165 | } |
163 | 166 | ||
164 | void KCMultiDialog::slotAboutToShow(QWidget *page) | 167 | void KCMultiDialog::slotAboutToShow(QWidget *page) |
@@ -196,6 +199,6 @@ void KCMultiDialog::slotAboutToShow(QWidget *page) | |||
196 | 199 | ||
197 | QApplication::restoreOverrideCursor(); | 200 | QApplication::restoreOverrideCursor(); |
198 | */ | 201 | */ |
199 | 202 | ||
200 | qDebug("KCMultiDialog::slotAboutToShow not implemented"); | 203 | qDebug("KCMultiDialog::slotAboutToShow not implemented"); |
201 | } | 204 | } |