summaryrefslogtreecommitdiffabout
path: root/microkde/kdialogbase.cpp
Unidiff
Diffstat (limited to 'microkde/kdialogbase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdialogbase.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/microkde/kdialogbase.cpp b/microkde/kdialogbase.cpp
index 2251207..c953058 100644
--- a/microkde/kdialogbase.cpp
+++ b/microkde/kdialogbase.cpp
@@ -135,156 +135,156 @@ void KDialogBase::initLayout()
135 mTopLayout->setMargin( marginHint() ); 135 mTopLayout->setMargin( marginHint() );
136 mTopLayout->setSpacing( spacingHint() ); 136 mTopLayout->setSpacing( spacingHint() );
137 137
138 mTopLayout->addWidget( mMainWidget ); 138 mTopLayout->addWidget( mMainWidget );
139 139
140 QBoxLayout *buttonLayout = new QHBoxLayout; 140 QBoxLayout *buttonLayout = new QHBoxLayout;
141 mTopLayout->addLayout( buttonLayout ); 141 mTopLayout->addLayout( buttonLayout );
142 142
143 if ( mUser1Button ) buttonLayout->addWidget( mUser1Button ); 143 if ( mUser1Button ) buttonLayout->addWidget( mUser1Button );
144 if ( mUser2Button ) buttonLayout->addWidget( mUser2Button ); 144 if ( mUser2Button ) buttonLayout->addWidget( mUser2Button );
145 if ( mOkButton ) buttonLayout->addWidget( mOkButton ); 145 if ( mOkButton ) buttonLayout->addWidget( mOkButton );
146 if ( mApplyButton ) buttonLayout->addWidget( mApplyButton ); 146 if ( mApplyButton ) buttonLayout->addWidget( mApplyButton );
147 if ( mDefaultButton ) buttonLayout->addWidget( mDefaultButton ); 147 if ( mDefaultButton ) buttonLayout->addWidget( mDefaultButton );
148 if ( mCancelButton ) buttonLayout->addWidget( mCancelButton ); 148 if ( mCancelButton ) buttonLayout->addWidget( mCancelButton );
149 if ( mCloseButton ) buttonLayout->addWidget( mCloseButton ); 149 if ( mCloseButton ) buttonLayout->addWidget( mCloseButton );
150} 150}
151 151
152QFrame *KDialogBase::addPage( const QString &name ) 152QFrame *KDialogBase::addPage( const QString &name )
153{ 153{
154// kdDebug() << "KDialogBase::addPage(): " << name << endl; 154// kdDebug() << "KDialogBase::addPage(): " << name << endl;
155 QFrame *frame = new QFrame( tabWidget() ); 155 QFrame *frame = new QFrame( tabWidget() );
156 tabWidget()->addTab( frame, name ); 156 tabWidget()->addTab( frame, name );
157 return frame; 157 return frame;
158} 158}
159 159
160QFrame *KDialogBase::addPage( const QString &name, int, const QPixmap & ) 160QFrame *KDialogBase::addPage( const QString &name, int, const QPixmap & )
161{ 161{
162 return addPage( name ); 162 return addPage( name );
163} 163}
164 164
165 165
166void KDialogBase::setMainWidget( QWidget *widget ) 166void KDialogBase::setMainWidget( QWidget *widget )
167{ 167{
168 kdDebug() << "KDialogBase::setMainWidget()" << endl; 168 kdDebug() << "KDialogBase::setMainWidget()" << endl;
169 169
170 mMainWidget = widget; 170 mMainWidget = widget;
171 initLayout(); 171 initLayout();
172} 172}
173 173
174void KDialogBase::setButtonText( ButtonCode id, const QString &text ) 174void KDialogBase::setButtonText( ButtonCode id, const QString &text )
175{ 175{
176 QPushButton *button = findButton( id ); 176 QPushButton *button = findButton( id );
177 if ( button ) { 177 if ( button ) {
178 button->setText( text ); 178 button->setText( text );
179 } 179 }
180} 180}
181 181
182void KDialogBase::enableButton( ButtonCode id, bool state ) 182void KDialogBase::enableButton( ButtonCode id, bool state )
183{ 183{
184 QPushButton *button = findButton( id ); 184 QPushButton *button = findButton( id );
185 if ( button ) { 185 if ( button ) {
186 button->setEnabled( state ); 186 button->setEnabled( state );
187 } 187 }
188} 188}
189 189
190QPushButton *KDialogBase::findButton( ButtonCode id ) 190QPushButton *KDialogBase::findButton( ButtonCode id )
191{ 191{
192 QPushButton *button = 0; 192 QPushButton *button = 0;
193 switch ( id ) { 193 switch ( id ) {
194 case Ok: 194 case Ok:
195 button = mOkButton; 195 button = mOkButton;
196 break; 196 break;
197 case Apply: 197 case Apply:
198 button = mApplyButton; 198 button = mApplyButton;
199 break; 199 break;
200 case User1: 200 case User1:
201 button = mUser1Button; 201 button = mUser1Button;
202 break; 202 break;
203 case User2: 203 case User2:
204 button = mUser2Button; 204 button = mUser2Button;
205 break; 205 break;
206 case Cancel: 206 case Cancel:
207 button = mCancelButton; 207 button = mCancelButton;
208 break; 208 break;
209 case Default: 209 case Default:
210 button = mDefaultButton; 210 button = mDefaultButton;
211 break; 211 break;
212 case Close: 212 case Close:
213 button = mCloseButton; 213 button = mCloseButton;
214 break; 214 break;
215 default: 215 default:
216 break; 216 break;
217 } 217 }
218 return button; 218 return button;
219} 219}
220 220
221void KDialogBase::enableButtonOK( bool state ) 221void KDialogBase::enableButtonOK( bool state )
222{ 222{
223 enableButton( Ok, state ); 223 enableButton( Ok, state );
224} 224}
225 225
226void KDialogBase::enableButtonApply( bool state ) 226void KDialogBase::enableButtonApply( bool state )
227{ 227{
228 enableButton( Apply, state ); 228 enableButton( Apply, state );
229} 229}
230 230
231void KDialogBase::showButton( ButtonCode id, bool show ) 231void KDialogBase::showButton( ButtonCode id, bool show )
232{ 232{
233 QPushButton *button = findButton( id ); 233 QPushButton *button = findButton( id );
234 if ( button ) { 234 if ( button ) {
235 if ( show ) button->show(); 235 if ( show ) button->show();
236 else button->hide(); 236 else button->hide();
237 } 237 }
238} 238}
239 239
240int KDialogBase::pageIndex( QWidget *widget ) const 240int KDialogBase::pageIndex( QWidget *widget ) const
241{ 241{
242 return 0; 242 return 0;
243} 243}
244 244
245 245
246bool KDialogBase::showPage( int index ) 246bool KDialogBase::showPage( int index )
247{ 247{
248 tabWidget()->setCurrentPage( index );return false; 248 tabWidget()->setCurrentPage( index );return false;
249} 249}
250 250
251QFrame *KDialogBase::plainPage() 251QFrame *KDialogBase::plainPage()
252{ 252{
253 if ( !mPlainPage ) { 253 if ( !mPlainPage ) {
254 mPlainPage = new QFrame( this ); 254 mPlainPage = new QFrame( this );
255 setMainWidget( mPlainPage ); 255 setMainWidget( mPlainPage );
256 } 256 }
257 return mPlainPage; 257 return mPlainPage;
258} 258}
259 259
260void KDialogBase::slotOk() 260void KDialogBase::slotOk()
261{ 261{
262 emit okClicked(); 262 emit okClicked();
263 QDialog::accept(); 263 accept();
264} 264}
265 265
266void KDialogBase::slotApply() 266void KDialogBase::slotApply()
267{ 267{
268 emit applyClicked(); 268 emit applyClicked();
269} 269}
270 270
271void KDialogBase::slotCancel() 271void KDialogBase::slotCancel()
272{ 272{
273 emit cancelClicked(); 273 emit cancelClicked();
274 reject(); 274 reject();
275} 275}
276 276
277void KDialogBase::slotClose() 277void KDialogBase::slotClose()
278{ 278{
279 emit closeClicked(); 279 emit closeClicked();
280 reject(); 280 reject();
281} 281}
282 282
283void KDialogBase::slotUser1() 283void KDialogBase::slotUser1()
284{ 284{
285 emit user1Clicked(); 285 emit user1Clicked();
286} 286}
287void KDialogBase::slotUser2() 287void KDialogBase::slotUser2()
288{ 288{
289 emit user2Clicked(); 289 emit user2Clicked();
290} 290}