-rw-r--r-- | microkde/kdialogbase.cpp | 12 | ||||
-rw-r--r-- | microkde/kdialogbase.h | 4 |
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 | |||
@@ -77,6 +77,13 @@ void KDialogBase::init( const QString &caption, int buttonMask, | |||
77 | } else { | 77 | } else { |
78 | mOkButton = 0; | 78 | mOkButton = 0; |
79 | } | 79 | } |
80 | if ( buttonMask & Default ) { | ||
81 | qDebug("buttonMask & Default "); | ||
82 | mDefaultButton = new QPushButton( i18n("Default"), this ); | ||
83 | connect( mDefaultButton, SIGNAL( clicked() ), SIGNAL( defaultClicked() ) ); | ||
84 | } else { | ||
85 | mDefaultButton = 0; | ||
86 | } | ||
80 | 87 | ||
81 | if ( buttonMask & Apply ) { | 88 | if ( buttonMask & Apply ) { |
82 | mApplyButton = new QPushButton( i18n("Apply"), this ); | 89 | mApplyButton = new QPushButton( i18n("Apply"), this ); |
@@ -115,6 +122,7 @@ void KDialogBase::hideButtons() | |||
115 | if ( mUser2Button ) mUser2Button->hide() ; | 122 | if ( mUser2Button ) mUser2Button->hide() ; |
116 | if ( mOkButton ) mOkButton->hide() ; | 123 | if ( mOkButton ) mOkButton->hide() ; |
117 | if ( mApplyButton ) mApplyButton->hide() ; | 124 | if ( mApplyButton ) mApplyButton->hide() ; |
125 | if ( mDefaultButton ) mDefaultButton->hide(); | ||
118 | if ( mCancelButton ) mCancelButton->hide() ; | 126 | if ( mCancelButton ) mCancelButton->hide() ; |
119 | if ( mCloseButton ) mCloseButton->hide() ; | 127 | if ( mCloseButton ) mCloseButton->hide() ; |
120 | 128 | ||
@@ -136,6 +144,7 @@ void KDialogBase::initLayout() | |||
136 | if ( mUser2Button ) buttonLayout->addWidget( mUser2Button ); | 144 | if ( mUser2Button ) buttonLayout->addWidget( mUser2Button ); |
137 | if ( mOkButton ) buttonLayout->addWidget( mOkButton ); | 145 | if ( mOkButton ) buttonLayout->addWidget( mOkButton ); |
138 | if ( mApplyButton ) buttonLayout->addWidget( mApplyButton ); | 146 | if ( mApplyButton ) buttonLayout->addWidget( mApplyButton ); |
147 | if ( mDefaultButton ) buttonLayout->addWidget( mDefaultButton ); | ||
139 | if ( mCancelButton ) buttonLayout->addWidget( mCancelButton ); | 148 | if ( mCancelButton ) buttonLayout->addWidget( mCancelButton ); |
140 | if ( mCloseButton ) buttonLayout->addWidget( mCloseButton ); | 149 | if ( mCloseButton ) buttonLayout->addWidget( mCloseButton ); |
141 | } | 150 | } |
@@ -196,6 +205,9 @@ QPushButton *KDialogBase::findButton( ButtonCode id ) | |||
196 | break; | 205 | break; |
197 | case Cancel: | 206 | case Cancel: |
198 | button = mCancelButton; | 207 | button = mCancelButton; |
208 | break; | ||
209 | case Default: | ||
210 | button = mDefaultButton; | ||
199 | break; | 211 | break; |
200 | case Close: | 212 | case Close: |
201 | button = mCloseButton; | 213 | button = mCloseButton; |
diff --git a/microkde/kdialogbase.h b/microkde/kdialogbase.h index 199d2fa..7b44bfb 100644 --- a/microkde/kdialogbase.h +++ b/microkde/kdialogbase.h | |||
@@ -105,6 +105,7 @@ class KDialogBase : public KDialog | |||
105 | * @ref slotClose() is not replaced. | 105 | * @ref slotClose() is not replaced. |
106 | */ | 106 | */ |
107 | void closeClicked(); | 107 | void closeClicked(); |
108 | void defaultClicked(); | ||
108 | 109 | ||
109 | protected slots: | 110 | protected slots: |
110 | virtual void slotOk(); | 111 | virtual void slotOk(); |
@@ -133,7 +134,8 @@ class KDialogBase : public KDialog | |||
133 | QPushButton *mCloseButton; | 134 | QPushButton *mCloseButton; |
134 | QPushButton *mOkButton; | 135 | QPushButton *mOkButton; |
135 | QPushButton *mApplyButton; | 136 | QPushButton *mApplyButton; |
136 | QPushButton *mCancelButton; | 137 | QPushButton *mCancelButton; |
138 | QPushButton *mDefaultButton; | ||
137 | }; | 139 | }; |
138 | 140 | ||
139 | #endif | 141 | #endif |