summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp1
-rw-r--r--korganizer/kodialogmanager.cpp23
-rw-r--r--korganizer/koprefsdialog.cpp286
-rw-r--r--korganizer/koprefsdialog.h12
4 files changed, 20 insertions, 302 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 4794414..2a55127 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2532,4 +2532,5 @@ void CalendarView::edit_global_options()
i18n("Timezone settings"),i18n("Reload"))) {
qDebug("KO: TZ reload cancelled ");
+ mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
return;
}
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp
index aa30c52..3dfa344 100644
--- a/korganizer/kodialogmanager.cpp
+++ b/korganizer/kodialogmanager.cpp
@@ -91,20 +91,8 @@ 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;
+ KPimPrefsGlobalDialog gc ( mMainView );
+ if ( showSync )
+ gc.showTZconfig();
+ gc.exec();
}
void KODialogManager::showOptionsDialog( bool showSync )
@@ -122,6 +110,5 @@ void KODialogManager::showOptionsDialog( bool showSync )
mOptionsDialog->show();
#endif
- if ( showSync )
- mOptionsDialog->showSyncPage();
+
mOptionsDialog->exec();
delete mOptionsDialog;
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 4b5b66a..b782bb1 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -87,8 +87,5 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
hideButtons();
#endif
- kdelibcfg = 0;
- if ( !parent )
- setupGlobalTab();
- else {
+
setupMainTab();
// setupLocaleTab();
@@ -104,5 +101,5 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
//setupGroupSchedulingTab();
//setupGroupAutomationTab();
- }
+
}
@@ -114,9 +111,5 @@ KOPrefsDialog::~KOPrefsDialog()
void KOPrefsDialog::setupGlobalTab()
{
- //QFrame *topFrame = addPage(i18n("Global"),0,0);
- kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), this, "KCMKdeLibConfig" );
- setMainWidget( kdelibcfg );
- setCaption( i18n("KDE-Pim Global Settings"));
-
+
}
@@ -241,101 +234,4 @@ void KOPrefsDialog::setupLocaleTab()
#endif
}
-void KOPrefsDialog::showSyncPage()
-{
- // showPage ( 0 ) ;
- kdelibcfg->showTimeZoneTab() ;
-
-}
-void KOPrefsDialog::setupSyncAlgTab()
-{
-#if 0
- QLabel * lab;
- QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0);
- mSetupSyncAlgTab = topFrame;
- QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
- topLayout->setSpacing(mSpacingHint);
- topLayout->setMargin(mMarginHint);
- int iii = 0;
-
- KPrefsDialogWidBool *sb =
- addWidBool(i18n("Ask for preferences before syncing"),
- &(KOPrefs::instance()->mAskForPreferences),topFrame);
- topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
-
- ++iii;
-
- KPrefsDialogWidRadios *syncPrefsGroup =
- addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs),
- topFrame);
- syncPrefsGroup->addRadio(i18n("Take local entry on conflict"));
- syncPrefsGroup->addRadio(i18n("Take remote entry on conflict"));
- syncPrefsGroup->addRadio(i18n("Take newest entry on conflict"));
- syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict"));
- syncPrefsGroup->addRadio(i18n("Force take local entry always"));
- syncPrefsGroup->addRadio(i18n("Force take remote entry always"));
- topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
- ++iii;
- sb =
- addWidBool(i18n("Show summary after syncing"),
- &(KOPrefs::instance()->mShowSyncSummary),topFrame);
- topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
-
- ++iii;
-#endif
-
-
-
-}
-
-
-void KOPrefsDialog::setupSyncTab()
-{
-#if 0
- QLabel * lab;
- QFrame *topFrame = addPage(i18n("Sync Network"),0,0);
- QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
- topLayout->setSpacing(mSpacingHint);
- topLayout->setMargin(mMarginHint);
- lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame);
- int iii = 0;
- topLayout->addMultiCellWidget(lab , iii,iii,0,1);
- ++iii;
-
- mRemoteIPEdit = new QLineEdit(topFrame);
- lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame);
- topLayout->addWidget(lab ,iii,0);
- topLayout->addWidget(mRemoteIPEdit,iii,1);
- ++iii;
- mRemoteUser = new QLineEdit(topFrame);
- lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame);
- topLayout->addWidget(lab ,iii,0);
- topLayout->addWidget(mRemoteUser, iii,1);
- ++iii;
-
- mRemoteFile = new QLineEdit(topFrame);
- lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame);
- topLayout->addWidget(lab ,iii,0);
- topLayout->addWidget(mRemoteFile,iii,1);
- ++iii;
-
- mLocalTempFile = new QLineEdit(topFrame);
- lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame);
- topLayout->addWidget(lab ,iii,0);
- topLayout->addWidget(mLocalTempFile,iii,1);
- ++iii;
-
- KPrefsDialogWidBool *wb =
- addWidBool(i18n("Write back synced file"),
- &(KOPrefs::instance()->mWriteBackFile),topFrame);
- topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
- ++iii;
- wb =
- addWidBool(i18n("Write back existing entries only"),
- &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame);
- topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
- ++iii;
-
-#endif
-}
void KOPrefsDialog::setupMainTab()
@@ -1461,22 +1357,13 @@ void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
void KOPrefsDialog::usrReadConfig()
{
- if ( kdelibcfg )
- kdelibcfg->readConfig();
- else {
+
mNameEdit->setText(KOPrefs::instance()->fullName());
mEmailEdit->setText(KOPrefs::instance()->email());
mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
- // QDate current ( 2001, 1,1);
- //mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
- //mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
- //setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId));
- //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
+
mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
- // if (KOPrefs::instance()->mAllDaySize > 47 )
- // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2;
- //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize);
mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays);
@@ -1491,15 +1378,6 @@ void KOPrefsDialog::usrReadConfig()
// }
- // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP);
- //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser);
- //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd);
- //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile);
-
//that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
- //QString dummy = KOPrefs::instance()->mUserDateFormatLong;
- //mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
- //dummy = KOPrefs::instance()->mUserDateFormatShort;
- //mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
updateCategories();
mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
@@ -1507,5 +1385,5 @@ void KOPrefsDialog::usrReadConfig()
mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
- }
+
}
@@ -1513,42 +1391,15 @@ void KOPrefsDialog::usrReadConfig()
void KOPrefsDialog::usrWriteConfig()
{
- if ( kdelibcfg )
- kdelibcfg->writeConfig();
- else {
- // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text();
- //KOPrefs::instance()->mRemoteUser = mRemoteUser->text();
- //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text();
- //KOPrefs::instance()->mRemoteFile= mRemoteFile->text();
- //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text();
+
+
KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
-
- //KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
- //KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
KOPrefs::instance()->setFullName(mNameEdit->text());
KOPrefs::instance()->setEmail(mEmailEdit->text());
KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
-
- // KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText();
- //QDate date;
- //date = mStartDateSavingEdit->date();
- //int sub = 0;
- //if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
- // sub = 1;
-// KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub;
-// date = mEndDateSavingEdit->date();
-// if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
-// sub = 1;
-// else
-// sub = 0;
-// KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub;
-// // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value();
-
KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
-
- //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value();
-
+
QDictIterator<QColor> it(mCategoryDict);
while (it.current()) {
@@ -1569,9 +1420,9 @@ void KOPrefsDialog::usrWriteConfig()
// item = item->nextSibling();
// }
- KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
- KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
- KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
- KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
- }
+ KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
+ KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
+ KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
+ KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
+
}
@@ -1584,27 +1435,4 @@ void KOPrefsDialog::updateCategories()
}
-void KOPrefsDialog::warningGroupScheduling()
-{
- warningExperimental(mEnableGroupScheduling->checkBox()->isChecked());
-}
-
-void KOPrefsDialog::warningProjectView()
-{
- warningExperimental(mEnableProjectView->checkBox()->isChecked());
-}
-
-void KOPrefsDialog::warningExperimental(bool on)
-{
- if (on) {
- KMessageBox::information(this,i18n("This is an experimental feature. "
- "It may not work, it may do nothing useful and it may cause data loss. "
- "Use with care.\n"
- "You have to restart KOrganizer for this setting to take effect."));
- } else {
- KMessageBox::information(this,
- i18n("You have to restart KOrganizer for this setting to take effect."));
- }
-}
-
void KOPrefsDialog::toggleEmailSettings(bool on)
{
@@ -1667,89 +1495,3 @@ void KOPrefsDialog::updateInput()
// aEmailsEdit->setText(item->text(0));
}
-void KOPrefsDialog::updateTimezoneOffset( int index )
-{
- /*
- qDebug("updateTimezoneOffset %d ", index);
- if ( index < 24 ) {
- mTimezoneOffsetSpin->setEnabled ( false );
- mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 );
-
-
- } else {
- if ( index == 24 ) {
- mTimezoneOffsetSpin->setEnabled ( true );
- mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
-
- } else {
- mTimezoneOffsetSpin->setEnabled ( false );
- mTimezoneOffsetSpin->setValue( 0 );
- }
- }
- */
-}
-
-void KOPrefsDialog::setupTimeZoneTab()
-{
-#if 0
- QFrame *topFrame = addPage(i18n("Time Zone"),0,0);
- // DesktopIcon("clock",KIcon::SizeMedium));
-
- QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
- topLayout->setSpacing(mSpacingHint);
- topLayout->setMargin(mMarginHint);
-
- QHBox *timeZoneBox = new QHBox( topFrame );
- topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
-
- new QLabel( i18n("Timezone:"), timeZoneBox );
- mTimeZoneCombo = new QComboBox( timeZoneBox );
- if ( QApplication::desktop()->width() < 300 ) {
- mTimeZoneCombo->setMaximumWidth(150);
- }
-
- QStringList list;
- list = KGlobal::locale()->timeZoneList();
- mTimeZoneCombo->insertStringList(list);
-
- // find the currently set time zone and select it
- QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId;
- int nCurrentlySet = 11;
- for (int i = 0; i < mTimeZoneCombo->count(); i++)
- {
- if (mTimeZoneCombo->text(i) == sCurrentlySet)
- {
- nCurrentlySet = i;
- break;
- }
- }
- mTimeZoneCombo->setCurrentItem(nCurrentlySet);
- int iii = 1;
- KPrefsDialogWidBool *sb =
- addWidBool(i18n("Timezone has daylight saving"),
- &(KOPrefs::instance()->mUseDaylightsaving),topFrame);
- topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
- ++iii;
- QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
- topLayout->addMultiCellWidget(lab, iii,iii,0,1);
- ++iii;
- lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
- topLayout->addMultiCellWidget(lab, iii,iii,0,1);
- ++iii;
- lab = new QLabel( i18n("Daylight start:"), topFrame );
- topLayout->addWidget(lab, iii,0);
- mStartDateSavingEdit = new KDateEdit(topFrame);
- topLayout->addWidget(mStartDateSavingEdit, iii,1);
- ++iii;
-
- lab = new QLabel( i18n("Daylight end:"), topFrame );
- topLayout->addWidget(lab, iii,0);
- mEndDateSavingEdit = new KDateEdit(topFrame);
- topLayout->addWidget(mEndDateSavingEdit, iii,1);
- ++iii;
- QDate current ( 2001, 1,1);
- mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
- mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
-#endif
-
-}
diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h
index 6892028..80d6545 100644
--- a/korganizer/koprefsdialog.h
+++ b/korganizer/koprefsdialog.h
@@ -58,16 +58,8 @@ class KOPrefsDialog : public KPrefsDialog
/** Update controls for categories */
void updateCategories();
- void showSyncPage();
protected slots:
void selectSoundFile();
void setCategoryColor();
void updateCategoryColor();
- void updateTimezoneOffset( int );
-
-
- void warningExperimental(bool on);
- void warningGroupScheduling();
- void warningProjectView();
-
void toggleEmailSettings(bool);
@@ -85,5 +77,4 @@ class KOPrefsDialog : public KPrefsDialog
void setupMainTab();
void setupTimeTab();
- void setupTimeZoneTab();
void setupLocaleTab();
void setupLocaleDateTab();
@@ -95,6 +86,4 @@ class KOPrefsDialog : public KPrefsDialog
void setupGroupSchedulingTab();
void setupGroupAutomationTab();
- void setupSyncTab();
- void setupSyncAlgTab();
void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0);
@@ -102,5 +91,4 @@ class KOPrefsDialog : public KPrefsDialog
private:
- KDEPIMConfigWidget* kdelibcfg;
KPrefsDialogWidBool *mEnableGroupScheduling;
KPrefsDialogWidBool *mEnableProjectView;