author | zautrix <zautrix> | 2005-02-21 13:34:06 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-21 13:34:06 (UTC) |
commit | ce261d6197d319d67f7b275813449f36ce42a730 (patch) (side-by-side diff) | |
tree | 6221eef1d00a918127377883eaf76f8162db6772 /microkde/kdialogbase.cpp | |
parent | b4ebc9c227f986369fe9b0193158f3893a29df08 (diff) | |
download | kdepimpi-ce261d6197d319d67f7b275813449f36ce42a730.zip kdepimpi-ce261d6197d319d67f7b275813449f36ce42a730.tar.gz kdepimpi-ce261d6197d319d67f7b275813449f36ce42a730.tar.bz2 |
default button fixes
-rw-r--r-- | microkde/kdialogbase.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/microkde/kdialogbase.cpp b/microkde/kdialogbase.cpp index d1f7630..801094a 100644 --- a/microkde/kdialogbase.cpp +++ b/microkde/kdialogbase.cpp @@ -10,34 +10,36 @@ #include "kdialogbase.h" KDialogBase::KDialogBase() { } KDialogBase::KDialogBase( QWidget *parent, const char *name, bool modal, const QString &caption, int buttonMask, ButtonCode defaultButton, bool separator, const QString &user1, const QString &user2, const QString &user3) : KDialog( parent, name, modal ) { init( caption, buttonMask, user1, user2 ); - if (findButton( defaultButton ) ) - (findButton( defaultButton ) )->setFocus(); + if (findButton( defaultButton ) ) { + (findButton( defaultButton ) )->setFocus(); + (findButton( defaultButton ) )->setDefault( true ); + } } KDialogBase::KDialogBase( int dialogFace, const QString &caption, int buttonMask, ButtonCode defaultButton, QWidget *parent, const char *name, bool modal, bool separator, const QString &user1, const QString &user2, const QString &user3) : KDialog( parent, name, modal ) { init( caption, buttonMask, user1, user2 ); if (findButton( defaultButton ) ) (findButton( defaultButton ) )->setFocus(); @@ -61,32 +63,33 @@ void KDialogBase::init( const QString &caption, int buttonMask, if ( buttonMask & User1 ) { mUser1Button = new QPushButton( user1, this ); connect( mUser1Button, SIGNAL( clicked() ), SLOT( slotUser1() ) ); } else { mUser1Button = 0; } if ( buttonMask & User2 ) { mUser2Button = new QPushButton( user2, this ); connect( mUser2Button, SIGNAL( clicked() ), SLOT( slotUser2() ) ); } else { mUser2Button = 0; } if ( buttonMask & Ok ) { mOkButton = new QPushButton( i18n("Ok"), this ); connect( mOkButton, SIGNAL( clicked() ), SLOT( slotOk() ) ); + mOkButton->setDefault( true ); } else { mOkButton = 0; } if ( 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; } |