-rw-r--r-- | microkde/kdialogbase.cpp | 25 | ||||
-rw-r--r-- | microkde/kutils/kcmultidialog.cpp | 23 |
2 files changed, 25 insertions, 23 deletions
diff --git a/microkde/kdialogbase.cpp b/microkde/kdialogbase.cpp index c953058..d1f7630 100644 --- a/microkde/kdialogbase.cpp +++ b/microkde/kdialogbase.cpp @@ -11,31 +11,31 @@ KDialogBase::KDialogBase() { } KDialogBase::KDialogBase( QWidget *parent, const char *name, bool modal, const QString &caption, int buttonMask, ButtonCode defaultButton, - bool separator, + 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(); } -KDialogBase::KDialogBase( int dialogFace, const QString &caption, - int buttonMask, ButtonCode defaultButton, - QWidget *parent, const char *name, bool modal, +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 ) ) @@ -73,17 +73,16 @@ 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 ); @@ -99,17 +98,17 @@ void KDialogBase::init( const QString &caption, int buttonMask, mCancelButton = 0; } if ( buttonMask & Close ) { mCloseButton = new QPushButton( i18n("Close"), this ); connect( mCloseButton, SIGNAL( clicked() ), SLOT( slotClose() ) ); } else { mCloseButton = 0; - } + } } QTabWidget *KDialogBase::tabWidget() { if ( !mTabWidget ) { mTabWidget = new QTabWidget( this ); setMainWidget( mTabWidget ); } @@ -120,31 +119,31 @@ 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() { - + delete mTopLayout; mTopLayout = new QVBoxLayout( this ); mTopLayout->setMargin( marginHint() ); mTopLayout->setSpacing( spacingHint() ); - + mTopLayout->addWidget( mMainWidget ); - + QBoxLayout *buttonLayout = new QHBoxLayout; 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 ); } @@ -200,25 +199,25 @@ QPushButton *KDialogBase::findButton( ButtonCode id ) case User1: button = mUser1Button; break; case User2: button = mUser2Button; break; case Cancel: button = mCancelButton; - break; + break; case Default: button = mDefaultButton; break; case Close: button = mCloseButton; break; default: - break; + break; } return button; } void KDialogBase::enableButtonOK( bool state ) { enableButton( Ok, state ); } diff --git a/microkde/kutils/kcmultidialog.cpp b/microkde/kutils/kcmultidialog.cpp index 4136622..13be2ce 100644 --- a/microkde/kutils/kcmultidialog.cpp +++ b/microkde/kutils/kcmultidialog.cpp @@ -38,70 +38,73 @@ //US #include "kcmoduleloader.h" KCMultiDialog::KCMultiDialog(const QString& baseGroup, QWidget *parent, const char *name, bool modal) : KDialogBase(IconList, i18n("Configure"), Default |Cancel | Apply | Ok, Ok, parent, name, modal, true), d(0L) { enableButton(Apply, false); //connect(this, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShow(QWidget *))); + + connect( this, SIGNAL( defaultClicked() ), SLOT( slotDefault() ) ); + _baseGroup = baseGroup; mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed ); setMainWidget(mMainWidget ); #ifdef DESKTOP_VERSION resize(640,480); #else - resize(640,480); + resize(640,480); setMaximumSize( KMIN(KGlobal::getDesktopWidth()-5, 640), KMIN(KGlobal::getDesktopHeight()-20, 480)); //showMaximized(); #endif - + } KCMultiDialog::~KCMultiDialog() { //US moduleDict.setAutoDelete(true); } void KCMultiDialog::slotDefault() { int curPageIndex = mMainWidget->activePageIndex(); - + QPtrListIterator<KCModule> it(modules); for (; it.current(); ++it) { if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex) { (*it)->defaults(); clientChanged(true); return; } } - + } void KCMultiDialog::slotApply() { qDebug("KCMultiDialog::slotApply clicked"); QPtrListIterator<KCModule> it(modules); for (; it.current(); ++it) (*it)->save(); clientChanged(false); emit applyClicked(); - + } void KCMultiDialog::slotOk() { qDebug("KCMultiDialog::slotOk clicked"); - + QPtrListIterator<KCModule> it(modules); for (; it.current(); ++it) (*it)->save(); accept(); emit okClicked(); } @@ -114,25 +117,25 @@ void KCMultiDialog::slotHelp() KProcess process; process << "khelpcenter" << url.url(); process.start(KProcess::DontCare); process.detach(); } else { new KRun(url); } -*/ +*/ } void KCMultiDialog::clientChanged(bool state) { enableButton(Apply, state); } -/*US +/*US void KCMultiDialog::addModule(const QString& path, bool withfallback) { kdDebug(1208) << "KCMultiDialog::addModule " << path << endl; KCModuleInfo info(path, _baseGroup); QHBox* page = addHBoxPage(info.moduleName(), info.comment(), KGlobal::iconLoader()->loadIcon(info.icon(), KIcon::Desktop, KIcon::SizeMedium)); @@ -152,17 +155,17 @@ QVBox * KCMultiDialog::getNewVBoxPage( const QString & modulename ) } //US special method for microkde. We dop noty want to load everything dynamically. void KCMultiDialog::addModule(KCModule* module ) //, const QString& modulename, const QString& iconname) { modules.append(module); connect(module, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool))); - + } void KCMultiDialog::slotAboutToShow(QWidget *page) { /*US LoadInfo *loadInfo = moduleDict[page]; if (!loadInfo) @@ -192,10 +195,10 @@ void KCMultiDialog::slotAboutToShow(QWidget *page) //KCGlobal::repairAccels( topLevelWidget() ); delete loadInfo; QApplication::restoreOverrideCursor(); */ -qDebug("KCMultiDialog::slotAboutToShow not implemented"); +qDebug("KCMultiDialog::slotAboutToShow not implemented"); } |