summaryrefslogtreecommitdiffabout
path: root/microkde/kdialogbase.cpp
Side-by-side diff
Diffstat (limited to 'microkde/kdialogbase.cpp') (more/less context) (show whitespace changes)
-rw-r--r--microkde/kdialogbase.cpp12
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
@@ -74,12 +74,19 @@ void KDialogBase::init( const QString &caption, int buttonMask,
if ( buttonMask & Ok ) {
mOkButton = new QPushButton( i18n("Ok"), this );
connect( mOkButton, SIGNAL( clicked() ), SLOT( slotOk() ) );
} else {
mOkButton = 0;
}
+ if ( buttonMask & Default ) {
+ qDebug("buttonMask & Default ");
+ mDefaultButton = new QPushButton( i18n("Default"), this );
+ connect( mDefaultButton, SIGNAL( clicked() ), SIGNAL( defaultClicked() ) );
+ } else {
+ mDefaultButton = 0;
+ }
if ( buttonMask & Apply ) {
mApplyButton = new QPushButton( i18n("Apply"), this );
connect( mApplyButton, SIGNAL( clicked() ), SLOT( slotApply() ) );
} else {
mApplyButton = 0;
@@ -112,12 +119,13 @@ QTabWidget *KDialogBase::tabWidget()
void KDialogBase::hideButtons()
{
if ( mUser1Button ) mUser1Button->hide() ;
if ( mUser2Button ) mUser2Button->hide() ;
if ( mOkButton ) mOkButton->hide() ;
if ( mApplyButton ) mApplyButton->hide() ;
+ if ( mDefaultButton ) mDefaultButton->hide();
if ( mCancelButton ) mCancelButton->hide() ;
if ( mCloseButton ) mCloseButton->hide() ;
}
void KDialogBase::initLayout()
{
@@ -133,12 +141,13 @@ void KDialogBase::initLayout()
mTopLayout->addLayout( buttonLayout );
if ( mUser1Button ) buttonLayout->addWidget( mUser1Button );
if ( mUser2Button ) buttonLayout->addWidget( mUser2Button );
if ( mOkButton ) buttonLayout->addWidget( mOkButton );
if ( mApplyButton ) buttonLayout->addWidget( mApplyButton );
+ if ( mDefaultButton ) buttonLayout->addWidget( mDefaultButton );
if ( mCancelButton ) buttonLayout->addWidget( mCancelButton );
if ( mCloseButton ) buttonLayout->addWidget( mCloseButton );
}
QFrame *KDialogBase::addPage( const QString &name )
{
@@ -194,12 +203,15 @@ QPushButton *KDialogBase::findButton( ButtonCode id )
case User2:
button = mUser2Button;
break;
case Cancel:
button = mCancelButton;
break;
+ case Default:
+ button = mDefaultButton;
+ break;
case Close:
button = mCloseButton;
break;
default:
break;
}