-rw-r--r-- | microkde/kdialogbase.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/microkde/kdialogbase.cpp b/microkde/kdialogbase.cpp index 2ea2053..c953058 100644 --- a/microkde/kdialogbase.cpp +++ b/microkde/kdialogbase.cpp @@ -79,2 +79,9 @@ void KDialogBase::init( const QString &caption, int buttonMask, } + if ( buttonMask & Default ) { + qDebug("buttonMask & Default "); + mDefaultButton = new QPushButton( i18n("Default"), this ); + connect( mDefaultButton, SIGNAL( clicked() ), SIGNAL( defaultClicked() ) ); + } else { + mDefaultButton = 0; + } @@ -117,2 +124,3 @@ void KDialogBase::hideButtons() if ( mApplyButton ) mApplyButton->hide() ; + if ( mDefaultButton ) mDefaultButton->hide(); if ( mCancelButton ) mCancelButton->hide() ; @@ -138,2 +146,3 @@ void KDialogBase::initLayout() if ( mApplyButton ) buttonLayout->addWidget( mApplyButton ); + if ( mDefaultButton ) buttonLayout->addWidget( mDefaultButton ); if ( mCancelButton ) buttonLayout->addWidget( mCancelButton ); @@ -198,2 +207,5 @@ QPushButton *KDialogBase::findButton( ButtonCode id ) button = mCancelButton; + break; + case Default: + button = mDefaultButton; break; |