diff --git a/distributionlistdialog.cpp b/distributionlistdialog.cpp index 16e4bb998..8cec5a509 100644 --- a/distributionlistdialog.cpp +++ b/distributionlistdialog.cpp @@ -93,10 +93,15 @@ class DistributionListItem : public Q3CheckListItem DistributionListDialog::DistributionListDialog( QWidget *parent ) - : KDialogBase( Plain, i18n("Save Distribution List"), User1 | Cancel, - User1, parent, 0, false, false, i18n("Save List") ) + : KDialog( parent ) { - QFrame *topFrame = plainPage(); + QFrame *topFrame = new QFrame( this ); + setMainWidget( topFrame ); + setCaption( i18n("Save Distribution List") ); + setButtons( User1 | Cancel ); + setDefaultButton( User1 ); + setModal( false ); + setButtonText( User1, i18n("Save List") ); QBoxLayout *topLayout = new QVBoxLayout( topFrame ); topLayout->setSpacing( spacingHint() ); diff --git a/distributionlistdialog.h b/distributionlistdialog.h index 1c282d0d0..2710e3643 100644 --- a/distributionlistdialog.h +++ b/distributionlistdialog.h @@ -21,14 +21,14 @@ #ifndef DISTRIBUTIONLISTDIALOG_H #define DISTRIBUTIONLISTDIALOG_H -#include +#include #include "recipientseditor.h" class QLineEdit; class K3ListView; -class DistributionListDialog : public KDialogBase +class DistributionListDialog : public KDialog { public: DistributionListDialog( QWidget *parent ); diff --git a/kmcomposewin.cpp b/kmcomposewin.cpp index f14120d53..9e91aab26 100644 --- a/kmcomposewin.cpp +++ b/kmcomposewin.cpp @@ -863,8 +863,8 @@ void KMComposeWin::rethinkFields(bool fromSlot) delete mGrid; mGrid = new QGridLayout(mMainWidget); - mGrid->setSpacing(KDialogBase::spacingHint()); - mGrid->setMargin(KDialogBase::marginHint()/2); + mGrid->setSpacing(KDialog::spacingHint()); + mGrid->setMargin(KDialog::marginHint()/2); mGrid->setColumnStretch(0, 1); mGrid->setColumnStretch(1, 100); mGrid->setColumnStretch(2, 1); @@ -4359,9 +4359,12 @@ void KMComposeWin::slotIdentityChanged( uint uoid ) //----------------------------------------------------------------------------- void KMComposeWin::slotSpellcheckConfig() { - KDialogBase dlg(KDialogBase::Plain, i18n("Spellchecker"), - KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, - this, 0, true, true ); + KDialog dlg(this); + dlg.setCaption( i18n("Spellchecker") ); + dlg.setButtons( KDialog::Ok|KDialog::Cancel ); + dlg.setDefaultButton( KDialog::Ok ); + dlg.setModal( true ); + dlg.enableButtonSeparator( true ); KWin kwin; Q3TabDialog qtd (this, "tabdialog", true); KSpellConfig mKSpellConfig (&qtd); diff --git a/kmfolderdia.cpp b/kmfolderdia.cpp index 0d2b45a0e..4fa60ee81 100644 --- a/kmfolderdia.cpp +++ b/kmfolderdia.cpp @@ -159,14 +159,16 @@ void KMFolderDialog::addTab( FolderDiaTab* tab ) void KMFolderDialog::slotApply() { if ( mFolder.isNull() && !mIsNewFolder ) { // deleted meanwhile? - KDialogBase::slotApply(); + //KDialog::slotApply(); +#warning "kde4: port it 'slotApply'" return; } for ( int i = 0 ; i < mTabs.count() ; ++i ) mTabs[i]->save(); if ( !mFolder.isNull() && mIsNewFolder ) // we just created it mIsNewFolder = false; // so it's not new anymore :) - KDialogBase::slotApply(); +#warning "kde4: port it slotApply" + //KDialogBase::slotApply(); } // Called when pressing Ok @@ -175,7 +177,7 @@ void KMFolderDialog::slotApply() void KMFolderDialog::slotOk() { if ( mFolder.isNull() && !mIsNewFolder ) { // deleted meanwhile? - KDialogBase::slotOk(); + KDialog::accept(); return; } @@ -193,14 +195,14 @@ void KMFolderDialog::slotOk() if ( mDelayedSavingTabs ) enableButtonOk( false ); else - KDialogBase::slotOk(); + KDialog::accept(); } void KMFolderDialog::slotReadyForAccept() { --mDelayedSavingTabs; if ( mDelayedSavingTabs == 0 ) - KDialogBase::slotOk(); + KDialog::accept(); } void KMFolderDialog::slotCancelAccept() diff --git a/kmmsgpartdlg.cpp b/kmmsgpartdlg.cpp index 86a723c97..0afd5e6be 100644 --- a/kmmsgpartdlg.cpp +++ b/kmmsgpartdlg.cpp @@ -49,10 +49,14 @@ static const int numEncodingTypes = KMMsgPartDialog::KMMsgPartDialog( const QString & caption, QWidget * parent, const char * name ) - : KDialogBase( Plain, - caption.isEmpty() ? i18n("Message Part Properties") : caption, - Ok|Cancel|Help, Ok, parent, name, true, true) + : KDialog( parent ) { + setCaption( caption.isEmpty() ? i18n("Message Part Properties") : caption ); + setButtons( Ok|Cancel|Help ); + setDefaultButton( Ok ); + setModal( true ); + enableButtonSeparator( true ); + // tmp vars: QGridLayout * glay; QLabel * label; @@ -62,19 +66,20 @@ KMMsgPartDialog::KMMsgPartDialog( const QString & caption, for ( int i = 0 ; i < numEncodingTypes ; ++i ) mI18nizedEncodings << i18n( encodingTypes[i].displayName ); - - glay = new QGridLayout( plainPage() ); + QFrame *frame = new QFrame( this ); + setMainWidget( frame ); + glay = new QGridLayout(frame ); glay->setSpacing( spacingHint() ); glay->setColumnStretch( 1, 1 ); glay->setRowStretch( 8, 1 ); // mimetype icon: - mIcon = new QLabel( plainPage() ); + mIcon = new QLabel( frame ); mIcon->setPixmap( DesktopIcon("unknown") ); glay->addWidget( mIcon, 0, 0, 2, 1); // row 0: Type combobox: - mMimeType = new KComboBox( true, plainPage() ); + mMimeType = new KComboBox( true, frame ); mMimeType->setInsertPolicy( QComboBox::NoInsert ); mMimeType->setValidator( new KMimeTypeValidator( mMimeType ) ); mMimeType->addItems( QStringList() @@ -98,7 +103,7 @@ KMMsgPartDialog::KMMsgPartDialog( const QString & caption, mMimeType->setWhatsThis( msg ); // row 1: Size label: - mSize = new QLabel( plainPage() ); + mSize = new QLabel( frame ); setSize( KIO::filesize_t(0) ); glay->addWidget( mSize, 1, 1 ); @@ -111,8 +116,8 @@ KMMsgPartDialog::KMMsgPartDialog( const QString & caption, mSize->setWhatsThis( msg ); // row 2: "Name" lineedit and label: - mFileName = new KLineEdit( plainPage() ); - label = new QLabel( i18n("&Name:"), plainPage() ); + mFileName = new KLineEdit( frame ); + label = new QLabel( i18n("&Name:"), frame ); label->setBuddy( mFileName ); glay->addWidget( label, 2, 0 ); glay->addWidget( mFileName, 2, 1 ); @@ -126,8 +131,8 @@ KMMsgPartDialog::KMMsgPartDialog( const QString & caption, mFileName->setWhatsThis( msg ); // row 3: "Description" lineedit and label: - mDescription = new KLineEdit( plainPage() ); - label = new QLabel( i18n("&Description:"), plainPage() ); + mDescription = new KLineEdit( frame ); + label = new QLabel( i18n("&Description:"), frame ); label->setBuddy( mDescription ); glay->addWidget( label, 3, 0 ); glay->addWidget( mDescription, 3, 1 ); @@ -141,10 +146,10 @@ KMMsgPartDialog::KMMsgPartDialog( const QString & caption, mDescription->setWhatsThis( msg ); // row 4: "Encoding" combobox and label: - mEncoding = new QComboBox( plainPage() ); + mEncoding = new QComboBox( frame ); mEncoding->setEditable( false ); mEncoding->addItems( mI18nizedEncodings ); - label = new QLabel( i18n("&Encoding:"), plainPage() ); + label = new QLabel( i18n("&Encoding:"), frame ); label->setBuddy( mEncoding ); glay->addWidget( label, 4, 0 ); glay->addWidget( mEncoding, 4, 1 ); @@ -162,7 +167,7 @@ KMMsgPartDialog::KMMsgPartDialog( const QString & caption, mEncoding->setWhatsThis( msg ); // row 5: "Suggest automatic display..." checkbox: - mInline = new QCheckBox( i18n("Suggest &automatic display"), plainPage() ); + mInline = new QCheckBox( i18n("Suggest &automatic display"), frame ); glay->addWidget( mInline, 5, 0, 1, 2 ); msg = i18n("

Check this option if you want to suggest to the " @@ -174,7 +179,7 @@ KMMsgPartDialog::KMMsgPartDialog( const QString & caption, mInline->setWhatsThis( msg ); // row 6: "Sign" checkbox: - mSigned = new QCheckBox( i18n("&Sign this part"), plainPage() ); + mSigned = new QCheckBox( i18n("&Sign this part"), frame ); glay->addWidget( mSigned, 6, 0, 1, 2 ); msg = i18n("

Check this option if you want this message part to be " @@ -184,7 +189,7 @@ KMMsgPartDialog::KMMsgPartDialog( const QString & caption, mSigned->setWhatsThis( msg ); // row 7: "Encrypt" checkbox: - mEncrypted = new QCheckBox( i18n("Encr&ypt this part"), plainPage() ); + mEncrypted = new QCheckBox( i18n("Encr&ypt this part"), frame ); glay->addWidget( mEncrypted, 7, 0, 1, 2 ); msg = i18n("

Check this option if you want this message part to be " diff --git a/kmmsgpartdlg.h b/kmmsgpartdlg.h index 9cdc0472d..4b41853fd 100644 --- a/kmmsgpartdlg.h +++ b/kmmsgpartdlg.h @@ -20,7 +20,7 @@ #ifndef kmmsgpartdlg_h #define kmmsgpartdlg_h -#include +#include #include //Added by qt3to4: #include @@ -38,7 +38,7 @@ class QLineEdit; /** @short GUI for KMMsgPartDialog @author Marc Mutz */ -class KMMsgPartDialog: public KDialogBase +class KMMsgPartDialog: public KDialog { Q_OBJECT diff --git a/managesievescriptsdialog.cpp b/managesievescriptsdialog.cpp index b554bc3a6..0cccdbaf7 100644 --- a/managesievescriptsdialog.cpp +++ b/managesievescriptsdialog.cpp @@ -34,21 +34,26 @@ inline const Q3CheckListItem * qcli_cast( const Q3ListViewItem * lvi ) { } KMail::ManageSieveScriptsDialog::ManageSieveScriptsDialog( QWidget * parent, const char * name ) - : KDialogBase( Plain, i18n( "Manage Sieve Scripts" ), Close, Close, - parent, name, false ), + : KDialog( parent ), mSieveEditor( 0 ), mContextMenuItem( 0 ), mWasActive( false ) { + setCaption( i18n( "Manage Sieve Scripts" ) ); + setButtons( Close ); + setDefaultButton( Close ); + setModal( false ); setAttribute( Qt::WA_GroupLeader ); setAttribute( Qt::WA_DeleteOnClose ); KWin::setIcons( winId(), qApp->windowIcon().pixmap(IconSize(K3Icon::Desktop),IconSize(K3Icon::Desktop)), qApp->windowIcon().pixmap(IconSize(K3Icon::Small),IconSize(K3Icon::Small)) ); - QVBoxLayout * vlay = new QVBoxLayout( plainPage() ); + QFrame *frame =new QFrame( this ); + setMainWidget( frame ); + QVBoxLayout * vlay = new QVBoxLayout( frame ); vlay->setSpacing( 0 ); vlay->setMargin( 0 ); - mListView = new Q3ListView( plainPage() ); + mListView = new Q3ListView( frame); mListView->addColumn( i18n( "Available Scripts" ) ); mListView->setResizeMode( Q3ListView::LastColumn ); mListView->setRootIsDecorated( true ); @@ -297,12 +302,18 @@ void KMail::ManageSieveScriptsDialog::slotNewScript() { } KMail::SieveEditor::SieveEditor( QWidget * parent, const char * name ) - : KDialogBase( Plain, i18n( "Edit Sieve Script" ), Ok|Cancel, Ok, parent, name ) + : KDialog( parent ) { - QVBoxLayout * vlay = new QVBoxLayout( plainPage() ); + setCaption( i18n( "Edit Sieve Script" ) ); + setButtons( Ok|Cancel ); + setDefaultButton( Ok ); + setModal( true ); + QFrame *frame = new Qframe( this ); + setMainWidget( frame ); + QVBoxLayout * vlay = new QVBoxLayout( frame ); vlay->setSpacing( spacingHint() ); vlay->setMargin( 0 ); - mTextEdit = new Q3TextEdit( plainPage() ); + mTextEdit = new Q3TextEdit( frame); vlay->addWidget( mTextEdit ); mTextEdit->setTextFormat( Qt::PlainText ); mTextEdit->setWordWrap( Q3TextEdit::NoWrap ); diff --git a/managesievescriptsdialog.h b/managesievescriptsdialog.h index 86abfb9a1..bc98b51ec 100644 --- a/managesievescriptsdialog.h +++ b/managesievescriptsdialog.h @@ -1,7 +1,7 @@ #ifndef __KMAIL__MANAGESIEVESCRIPTSDIALOG_H__ #define __KMAIL__MANAGESIEVESCRIPTSDIALOG_H__ -#include +#include #include #include @@ -14,7 +14,7 @@ namespace KMail { class SieveJob; class SieveEditor; -class ManageSieveScriptsDialog : public KDialogBase { +class ManageSieveScriptsDialog : public KDialog { Q_OBJECT public: ManageSieveScriptsDialog( QWidget * parent=0, const char * name=0 ); diff --git a/managesievescriptsdialog_p.h b/managesievescriptsdialog_p.h index cc5616d30..6aaabc768 100644 --- a/managesievescriptsdialog_p.h +++ b/managesievescriptsdialog_p.h @@ -1,13 +1,13 @@ #ifndef __KMAIL__MANAGESIEVESCRIPTSDIALOG_P_H__ #define __KMAIL__MANAGESIEVESCRIPTSDIALOG_P_H__ -#include +#include #include namespace KMail { -class SieveEditor : public KDialogBase { +class SieveEditor : public KDialog { Q_OBJECT Q_PROPERTY( QString script READ script WRITE setScript ) public: diff --git a/vacationdialog.cpp b/vacationdialog.cpp index 8e8258e80..3416cb349 100644 --- a/vacationdialog.cpp +++ b/vacationdialog.cpp @@ -44,14 +44,20 @@ namespace KMail { VacationDialog::VacationDialog( const QString & caption, QWidget * parent, const char * name, bool modal ) - : KDialogBase( Plain, caption, Ok|Cancel|Default, Ok, parent, name, modal ) + : KDialog( parent ) { + setCaption( caption ); + setButtons( Ok|Cancel|Default ); + setDefaultButton( Ok ); + setModal( modal ); + QFrame *frame = new QFrame( this ); + setMainWidget( frame ); KWin::setIcons( winId(), qApp->windowIcon().pixmap(IconSize(K3Icon::Desktop),IconSize(K3Icon::Desktop)), qApp->windowIcon().pixmap(IconSize(K3Icon::Small),IconSize(K3Icon::Small)) ); static const int rows = 4; int row = -1; - QGridLayout * glay = new QGridLayout( plainPage() ); + QGridLayout * glay = new QGridLayout( frame ); glay->setSpacing( spacingHint() ); glay->setMargin( 0 ); glay->setColumnStretch( 1, 1 ); @@ -60,26 +66,26 @@ namespace KMail { ++row; glay->addWidget( new QLabel( i18n("Configure vacation " "notifications to be sent:"), - plainPage() ), row, 0, 1, 2 ); + frame ), row, 0, 1, 2 ); // Activate checkbox: ++row; - mActiveCheck = new QCheckBox( i18n("&Activate vacation notifications"), plainPage() ); + mActiveCheck = new QCheckBox( i18n("&Activate vacation notifications"), frame ); glay->addWidget( mActiveCheck, row, 0, 1, 2 ); // Message text edit: ++row; glay->setRowStretch( row, 1 ); - mTextEdit = new Q3TextEdit( plainPage(), "mTextEdit" ); + mTextEdit = new Q3TextEdit( frame, "mTextEdit" ); mTextEdit->setTextFormat( Qt::PlainText ); glay->addWidget( mTextEdit, row, 0, 1, 2 ); // "Resent only after" spinbox and label: ++row; - mIntervalSpin = new KIntSpinBox( 1, 356, 1, 7, plainPage() ); + mIntervalSpin = new KIntSpinBox( 1, 356, 1, 7, frame ); mIntervalSpin->setObjectName( "mIntervalSpin" ); connect(mIntervalSpin, SIGNAL( valueChanged( int )), SLOT( slotIntervalSpinChanged( int ) ) ); - QLabel *label = new QLabel( i18n("&Resend notification only after:"), plainPage() ); + QLabel *label = new QLabel( i18n("&Resend notification only after:"), frame ); label->setBuddy( mIntervalSpin ); glay->addWidget( label, row, 0 ); glay->addWidget( mIntervalSpin, row, 1 ); diff --git a/vacationdialog.h b/vacationdialog.h index cdaaefb7f..597f8baad 100644 --- a/vacationdialog.h +++ b/vacationdialog.h @@ -15,7 +15,7 @@ #ifndef __KMAIL_VACATIONDIALOG_H__ #define __KMAIL_VACATIONDIALOG_H__ -#include "kdialogbase.h" +#include "kdialog.h" //Added by qt3to4: #include @@ -36,7 +36,7 @@ namespace KMime { namespace KMail { - class VacationDialog : public KDialogBase { + class VacationDialog : public KDialog { Q_OBJECT public: VacationDialog( const QString & caption, QWidget * parent=0, @@ -55,7 +55,7 @@ namespace KMail { KMime::Types::AddrSpecList mailAliases() const; virtual void setMailAliases( const KMime::Types::AddrSpecList & aliases ); virtual void setMailAliases( const QString & aliases ); - + private slots: void slotIntervalSpinChanged( int value );