summaryrefslogtreecommitdiffabout
path: root/korganizer/koprefsdialog.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefsdialog.cpp286
1 files changed, 14 insertions, 272 deletions
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 4b5b66a..b782bb1 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -41,128 +41,121 @@
#include <qpushbutton.h>
#include <qstrlist.h>
#include <qapplication.h>
#include <kcolorbutton.h>
#include <kdebug.h>
#include <klocale.h>
#include <kglobal.h>
#include <kfontdialog.h>
#include <kfiledialog.h>
#include <kmessagebox.h>
#include <kcolordialog.h>
#include <kiconloader.h>
#include <kemailsettings.h>
#include <kstandarddirs.h>
#include <kglobalsettings.h>
#include <kurlrequester.h>
#include <klineedit.h>
#if defined(USE_SOLARIS)
#include <sys/param.h>
#define ZONEINFODIR "/usr/share/lib/zoneinfo"
#define INITFILE "/etc/default/init"
#endif
#include "koprefs.h"
#include "koprefsdialog.h"
#include "kpimglobalprefs.h"
KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
KPrefsDialog(KOPrefs::instance(),parent,name,true)
{
setFont( KGlobalSettings::generalMaxFont() );
setCaption( i18n("Preferences - some settings need a restart (nr)"));
mCategoryDict.setAutoDelete(true);
KGlobal::locale()->insertCatalogue("timezones");
mSpacingHint = spacingHintSmall();
mMarginHint = marginHintSmall();
#ifndef DESKTOP_VERSION
if ( QApplication::desktop()->height() == 480 )
hideButtons();
#endif
- kdelibcfg = 0;
- if ( !parent )
- setupGlobalTab();
- else {
+
setupMainTab();
// setupLocaleTab();
//setupTimeZoneTab();
setupTimeTab();
//setupLocaleDateTab();
setupFontsTab();
setupColorsTab();
setupViewsTab();
//setupSyncTab();
//setupSyncAlgTab();
//setupPrinterTab();
//setupGroupSchedulingTab();
//setupGroupAutomationTab();
- }
+
}
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"));
-
+
}
void KOPrefsDialog::setupLocaleDateTab()
{
#if 0
QFrame *topFrame = addPage(i18n("Date Format"),0,0);
QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
int iii = 0;
KPrefsDialogWidRadios *syncPrefsGroup =
addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
QString format;
if ( QApplication::desktop()->width() < 480 )
format = "(%d.%m.%Y)";
else
format = "(%d.%m.%Y|%A %d %B %Y)";
syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
if ( QApplication::desktop()->width() < 480 )
format = "(%m.%d.%Y)";
else
format = "(%m.%d.%Y|%A %B %d %Y)";
syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
if ( QApplication::desktop()->width() < 480 )
format = "(%Y-%m-%d)";
else
format = "(%Y-%m-%d|%A %Y %B %d)";
syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
syncPrefsGroup->addRadio(i18n("User defined"));
topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
++iii;
++iii;
QLabel * lab;
mUserDateFormatLong = new QLineEdit(topFrame);
lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
topLayout->addWidget(lab ,iii,0);
topLayout->addWidget(mUserDateFormatLong,iii,1);
++iii;
mUserDateFormatShort = new QLineEdit(topFrame);
lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
topLayout->addWidget(lab ,iii,0);
topLayout->addWidget(mUserDateFormatShort,iii,1);
++iii;
lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
++iii;
@@ -195,193 +188,96 @@ void KOPrefsDialog::setupLocaleTab()
topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
++iii;
syncPrefsGroup =
addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame);
if ( QApplication::desktop()->width() > 300 )
syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
syncPrefsGroup->addRadio(i18n("24:00"));
syncPrefsGroup->addRadio(i18n("12:00am"));
syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
++iii;
KPrefsDialogWidBool *sb;
if ( QApplication::desktop()->width() < 300 ) {
sb =
addWidBool(i18n("Week starts on Sunday"),
&(KOPrefs::instance()->mWeekStartsOnSunday),topFrame);
topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
++iii;
sb =
addWidBool(i18n("Use short date in (WN/E) view"),
&(KOPrefs::instance()->mShortDateInViewer),topFrame);
topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
}
else {
QWidget * hb = new QWidget( topFrame );
QHBoxLayout *hbLayout = new QHBoxLayout(hb);
sb =
addWidBool(i18n("Week starts on Sunday"),
&(KOPrefs::instance()->mWeekStartsOnSunday),hb);
hbLayout->addWidget(sb->checkBox() );
sb =
addWidBool(i18n("Use short date in (WN/E) view"),
&(KOPrefs::instance()->mShortDateInViewer),hb);
hbLayout->addWidget(sb->checkBox() );
topLayout->addMultiCellWidget(hb, iii,iii,0,1);
}
// KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION
#if 0
++iii;
sb =
addWidBool(i18n("Quick load/save (w/o Unicode)"),
&(KOPrefs::instance()->mUseQuicksave),topFrame);
topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
#endif
#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()
{
QFrame *topFrame = addPage(i18n("General"),0,0);
// DesktopIcon("identity",KIcon::SizeMedium));
QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
// KPrefsDialogWidBool *emailControlCenter =
// addWidBool(i18n("&Use email settings from Control Center"),
// &(KOPrefs::instance()->mEmailControlCenter),topFrame);
// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1);
// connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)),
// SLOT(toggleEmailSettings(bool)));
mNameEdit = new QLineEdit(topFrame);
mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
topLayout->addWidget(mNameLabel,0,0);
topLayout->addWidget(mNameEdit,0,1);
mEmailEdit = new QLineEdit(topFrame);
mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
topLayout->addWidget(mEmailLabel,1,0);
topLayout->addWidget(mEmailEdit,1,1);
KPrefsDialogWidBool *wb;
KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"),
&(KOPrefs::instance()->mShowFullMenu),topFrame);
topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1);
widbool = addWidBool(i18n("Mini icons in toolbar(nr)"),
&(KOPrefs::instance()->mToolBarMiniIcons),topFrame);
topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1);
KPrefsDialogWidBool *verticalScreen =
addWidBool(i18n("Show vertical screen (Needs restart)"),
&(KOPrefs::instance()->mVerticalScreen),topFrame);
//topLayout->addWidget(verticalScreen->checkBox(),ii++,0);
topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1);
int iii = 5;
@@ -1415,341 +1311,187 @@ void KOPrefsDialog::setupGroupAutomationTab()
addWidRadios(i18n("Auto Insert IMIP Requests"),
&(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame);
autoRequestGroup->addRadio(i18n("Never"));
autoRequestGroup->addRadio(i18n("If organizer is in addressbook"));
//autoInsertGroup->addRadio(i18n("selected emails"));
topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0);
KPrefsDialogWidRadios *autoFreeBusyGroup =
addWidRadios(i18n("Auto Send FreeBusy Information"),
&(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame);
autoFreeBusyGroup->addRadio(i18n("Never"));
autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook"));
//autoFreeBusyGroup->addRadio(i18n("selected emails"));
topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0);
KPrefsDialogWidRadios *autoFreeBusyReplyGroup =
addWidRadios(i18n("Auto Save FreeBusy Replies"),
&(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame);
autoFreeBusyReplyGroup->addRadio(i18n("Never"));
autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook"));
//autoFreeBusyGroup->addRadio(i18n("selected emails"));
topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0);
}
void KOPrefsDialog::showPrinterTab()
{
showPage(pageIndex(mPrinterTab));
}
void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
const QStringList *tags)
{
if (tags) {
int i = tags->findIndex(text);
if (i > 0) combo->setCurrentItem(i);
} else {
for(int i=0;i<combo->count();++i) {
if (combo->text(i) == text) {
combo->setCurrentItem(i);
break;
}
}
}
}
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);
mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays);
mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios);
// mAMails->clear();
// for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin();
// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) {
// QListViewItem *item = new QListViewItem(mAMails);
// item->setText(0,*it);
// mAMails->insertItem(item);
// }
- // 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 );
mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
- }
+
}
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()) {
KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
++it;
}
KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
KOPrefs::instance()->mAdditionalMails.clear();
// QListViewItem *item;
// item = mAMails->firstChild();
// while (item)
// {
// KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
// 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() ;
+
}
void KOPrefsDialog::updateCategories()
{
mCategoryCombo->clear();
mCategoryDict.clear();
mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
updateCategoryColor();
}
-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)
{
if (on) {
mEmailEdit->setEnabled(false);
mNameEdit->setEnabled(false);
mEmailLabel->setEnabled(false);
mNameLabel->setEnabled(false);
KEMailSettings settings;
mNameEdit->setText(settings.getSetting(KEMailSettings::RealName));
mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress));
} else {
mEmailEdit->setEnabled(true);
mNameEdit->setEnabled(true);
mEmailLabel->setEnabled(true);
mNameLabel->setEnabled(true);
}
}
void KOPrefsDialog::addItem()
{
// aEmailsEdit->setEnabled(true);
// QListViewItem *item = new QListViewItem(mAMails);
// mAMails->insertItem(item);
// mAMails->setSelected(item,true);
// aEmailsEdit->setText(i18n("(EmptyEmail)"));
}
void KOPrefsDialog::removeItem()
{
// QListViewItem *item;
// item = mAMails->selectedItem();
// if (!item) return;
// mAMails->takeItem(item);
// item = mAMails->selectedItem();
// if (!item) {
// aEmailsEdit->setText("");
// aEmailsEdit->setEnabled(false);
// }
// if (mAMails->childCount() == 0) {
// aEmailsEdit->setEnabled(false);
// }
}
void KOPrefsDialog::updateItem()
{
// QListViewItem *item;
// item = mAMails->selectedItem();
// if (!item) return;
// item->setText(0,aEmailsEdit->text());
}
void KOPrefsDialog::updateInput()
{
// QListViewItem *item;
// item = mAMails->selectedItem();
// if (!item) return;
// aEmailsEdit->setEnabled(true);
// 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
-
-}