author | zautrix <zautrix> | 2005-06-09 16:17:14 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-09 16:17:14 (UTC) |
commit | 89c5159208fd982f527117e49d67ea1f90553dbe (patch) (side-by-side diff) | |
tree | b6b72ca9e0668e871a6969b25654945747015d0f /korganizer | |
parent | ad88eadf0bdb34cb4a93639b50a5566a06470c22 (diff) | |
download | kdepimpi-89c5159208fd982f527117e49d67ea1f90553dbe.zip kdepimpi-89c5159208fd982f527117e49d67ea1f90553dbe.tar.gz kdepimpi-89c5159208fd982f527117e49d67ea1f90553dbe.tar.bz2 |
dialog fixes
-rw-r--r-- | korganizer/calendarview.cpp | 10 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 | ||||
-rw-r--r-- | korganizer/kodialogmanager.cpp | 28 | ||||
-rw-r--r-- | korganizer/kodialogmanager.h | 1 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 28 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 9 |
6 files changed, 54 insertions, 23 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 7c7466b..4794414 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2521,11 +2521,10 @@ void CalendarView::edit_paste() changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); } - -void CalendarView::edit_options() +void CalendarView::edit_global_options() { QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; emit save(); emit saveStopTimer(); - mDialogManager->showOptionsDialog(); + mDialogManager->showGlobalOptionsDialog(); if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { emit saveStopTimer(); @@ -2541,5 +2540,8 @@ void CalendarView::edit_options() else qDebug("KO: No tz change "); - +} +void CalendarView::edit_options() +{ + mDialogManager->showOptionsDialog(); } diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 4600090..1215a99 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -350,4 +350,5 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser /** edit viewing and configuration options. */ void edit_options(); + void edit_global_options(); /** Functions for printing, previewing a print, and setting up printing diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index c927b37..aa30c52 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp @@ -89,4 +89,23 @@ void KODialogManager::createOutgoingDialog() } +void KODialogManager::showGlobalOptionsDialog( bool showSync ) +{ + if (!mOptionsDialog) { + mOptionsDialog = new KOPrefsDialog(0); + connect(mOptionsDialog,SIGNAL(configChanged()), + mMainView,SLOT(updateConfig())); + } + mOptionsDialog->readConfig(); +#ifndef DESKTOP_VERSION + mOptionsDialog->showMaximized(); +#else + mOptionsDialog->show(); +#endif + if ( showSync ) + mOptionsDialog->showSyncPage(); + mOptionsDialog->exec(); + delete mOptionsDialog; + mOptionsDialog = 0; +} void KODialogManager::showOptionsDialog( bool showSync ) { @@ -94,10 +113,6 @@ void KODialogManager::showOptionsDialog( bool showSync ) if (!mOptionsDialog) { mOptionsDialog = new KOPrefsDialog(mMainView); - //mOptionsDialog->readConfig(); connect(mOptionsDialog,SIGNAL(configChanged()), mMainView,SLOT(updateConfig())); - //connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), - // mOptionsDialog,SLOT(updateCategories())); - } mOptionsDialog->readConfig(); @@ -110,9 +125,10 @@ void KODialogManager::showOptionsDialog( bool showSync ) mOptionsDialog->showSyncPage(); mOptionsDialog->exec(); - + delete mOptionsDialog; + mOptionsDialog = 0; } void KODialogManager::showSyncOptions() { - showOptionsDialog( true ); + showGlobalOptionsDialog( true ); } diff --git a/korganizer/kodialogmanager.h b/korganizer/kodialogmanager.h index a6cc621..b68ddc2 100644 --- a/korganizer/kodialogmanager.h +++ b/korganizer/kodialogmanager.h @@ -72,4 +72,5 @@ class KODialogManager : public QObject public slots: void showOptionsDialog( bool showSync = false); + void showGlobalOptionsDialog(bool showSync = false); void showSyncOptions(); void showIncomingDialog(); diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index c9477e3..4b5b66a 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp @@ -87,6 +87,8 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : hideButtons(); #endif - + kdelibcfg = 0; + if ( !parent ) setupGlobalTab(); + else { setupMainTab(); // setupLocaleTab(); @@ -102,5 +104,5 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : //setupGroupSchedulingTab(); //setupGroupAutomationTab(); - + } } @@ -112,8 +114,8 @@ KOPrefsDialog::~KOPrefsDialog() void KOPrefsDialog::setupGlobalTab() { - QFrame *topFrame = addPage(i18n("Global"),0,0); - kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); - QVBoxLayout *topLayout = new QVBoxLayout(topFrame); - topLayout->addWidget( kdelibcfg ); + //QFrame *topFrame = addPage(i18n("Global"),0,0); + kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), this, "KCMKdeLibConfig" ); + setMainWidget( kdelibcfg ); + setCaption( i18n("KDE-Pim Global Settings")); @@ -241,5 +243,5 @@ void KOPrefsDialog::setupLocaleTab() void KOPrefsDialog::showSyncPage() { - showPage ( 0 ) ; + // showPage ( 0 ) ; kdelibcfg->showTimeZoneTab() ; @@ -1459,5 +1461,7 @@ void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, void KOPrefsDialog::usrReadConfig() { - kdelibcfg->readConfig(); + if ( kdelibcfg ) + kdelibcfg->readConfig(); + else { mNameEdit->setText(KOPrefs::instance()->fullName()); mEmailEdit->setText(KOPrefs::instance()->email()); @@ -1503,4 +1507,5 @@ void KOPrefsDialog::usrReadConfig() mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); + } } @@ -1508,6 +1513,7 @@ void KOPrefsDialog::usrReadConfig() void KOPrefsDialog::usrWriteConfig() { - - kdelibcfg->writeConfig(); + if ( kdelibcfg ) + kdelibcfg->writeConfig(); + else { // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text(); //KOPrefs::instance()->mRemoteUser = mRemoteUser->text(); @@ -1567,5 +1573,5 @@ void KOPrefsDialog::usrWriteConfig() KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; - + } } diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 25e76ee..2c04852 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -725,8 +725,13 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "configure" ); - action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); + action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), - mView, SLOT( edit_options() ) ); + mView, SLOT( edit_options() ) ); + icon = loadPixmap( pathString + "configure" ); + action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); + action->addTo( actionMenu ); + connect( action, SIGNAL( activated() ), + mView, SLOT( edit_global_options() ) ); actionMenu->insertSeparator(); |