summaryrefslogtreecommitdiffabout
path: root/microkde
Side-by-side diff
Diffstat (limited to 'microkde') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdialogbase.cpp12
-rw-r--r--microkde/kdialogbase.h4
2 files changed, 15 insertions, 1 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;
diff --git a/microkde/kdialogbase.h b/microkde/kdialogbase.h
index 199d2fa..7b44bfb 100644
--- a/microkde/kdialogbase.h
+++ b/microkde/kdialogbase.h
@@ -107,2 +107,3 @@ class KDialogBase : public KDialog
void closeClicked();
+ void defaultClicked();
@@ -135,3 +136,4 @@ class KDialogBase : public KDialog
QPushButton *mApplyButton;
- QPushButton *mCancelButton;
+ QPushButton *mCancelButton;
+ QPushButton *mDefaultButton;
};