summaryrefslogtreecommitdiffabout
path: root/korganizer/koprefsdialog.cpp
authorzautrix <zautrix>2004-06-29 12:52:18 (UTC)
committer zautrix <zautrix>2004-06-29 12:52:18 (UTC)
commit275e70532bb26ed78ce2d3bebf980dd745368ec2 (patch) (side-by-side diff)
treec9252a9ec50856c86cc1165007f841c50d5cdc51 /korganizer/koprefsdialog.cpp
parent7b2b9f2b05809b9577837551ad864d88b9b355ef (diff)
downloadkdepimpi-275e70532bb26ed78ce2d3bebf980dd745368ec2.zip
kdepimpi-275e70532bb26ed78ce2d3bebf980dd745368ec2.tar.gz
kdepimpi-275e70532bb26ed78ce2d3bebf980dd745368ec2.tar.bz2
Removed the include moc on KO dir
Diffstat (limited to 'korganizer/koprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefsdialog.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 04fffe2..da6644f 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -1,454 +1,453 @@
/*
This file is part of KOrganizer.
Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qlayout.h>
#include <qlabel.h>
#include <qgroupbox.h>
#include <qbuttongroup.h>
#include <qlineedit.h>
#include <qfont.h>
#include <qslider.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qcombobox.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qregexp.h>
#include <qspinbox.h>
#include <qdatetime.h>
#include <qcheckbox.h>
#include <qradiobutton.h>
#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 <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 "koprefsdialog.moc"
KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
KPrefsDialog(KOPrefs::instance(),parent,name,true)
{
setCaption( i18n("Preferences - some settings need a restart (nr)"));
mCategoryDict.setAutoDelete(true);
KGlobal::locale()->insertCatalogue("timezones");
setupMainTab();
setupLocaleTab();
setupTimeZoneTab();
setupTimeTab();
setupLocaleDateTab();
setupFontsTab();
setupColorsTab();
setupViewsTab();
//setupSyncTab();
//setupSyncAlgTab();
//setupPrinterTab();
//setupGroupSchedulingTab();
//setupGroupAutomationTab();
}
KOPrefsDialog::~KOPrefsDialog()
{
}
void KOPrefsDialog::setupLocaleDateTab()
{
QFrame *topFrame = addPage(i18n("Date Format"),0,0);
QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
topLayout->setSpacing(spacingHint());
topLayout->setMargin(marginHint());
int iii = 0;
KPrefsWidRadios *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;
lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
++iii;
lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
++iii;
}
void KOPrefsDialog::setupLocaleTab()
{
QFrame *topFrame = addPage(i18n("Locale"),0,0);
QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
topLayout->setSpacing(spacingHint());
topLayout->setMargin(marginHint());
int iii = 0;
KPrefsWidRadios *syncPrefsGroup =
addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
syncPrefsGroup->addRadio(i18n("English"));
syncPrefsGroup->addRadio(i18n("German"));
syncPrefsGroup->addRadio(i18n("French(nyi)"));
syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
if ( QApplication::desktop()->width() < 300 )
;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
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;
KPrefsWidBool *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);
}
//#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
}
void KOPrefsDialog::showSyncPage()
{
showPage ( 2 ) ;
}
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(spacingHint());
topLayout->setMargin(marginHint());
int iii = 0;
KPrefsWidBool *sb =
addWidBool(i18n("Ask for preferences before syncing"),
&(KOPrefs::instance()->mAskForPreferences),topFrame);
topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
++iii;
KPrefsWidRadios *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(spacingHint());
topLayout->setMargin(marginHint());
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;
KPrefsWidBool *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,6,2);
topLayout->setSpacing(spacingHint());
topLayout->setMargin(marginHint());
// KPrefsWidBool *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);
KPrefsWidBool *wb;
QHBox *dummy;
if ( QApplication::desktop()->width() > 480 ) {
dummy = new QHBox(topFrame);
} else {
dummy = new QVBox(topFrame);
}
topLayout->addMultiCellWidget(dummy, 2,2,0,1);
addWidBool(i18n("Full menu bar(nr)"),
&(KOPrefs::instance()->mShowFullMenu),dummy);
addWidBool(i18n("Mini icons in toolbar(nr)"),
&(KOPrefs::instance()->mToolBarMiniIcons),dummy);
dummy = new QHBox(topFrame);
new QLabel(i18n("Days in What's Next:"),dummy);
mWhatsNextSpin = new QSpinBox(1,14,1,dummy);
topLayout->addMultiCellWidget(dummy,3,3,0,1);
dummy = new QHBox(topFrame);
new QLabel(i18n("Days in Next-X-Days:"),dummy);
mNextXDaysSpin = new QSpinBox(2,14,1,dummy);
topLayout->addMultiCellWidget(dummy,4,4,0,1);
QHBox *prioBox = new QHBox(topFrame);
// intervalBox->setSpacing(spacingHint());
topLayout->addMultiCellWidget(prioBox,5,5,0,1);
QString messa = i18n("Show topmost todo prios in What's Next:");
if ( QApplication::desktop()->width() < 300 )
messa = i18n("Show topmost todo prios in What's N.:");
QLabel *prioLabel = new QLabel(messa, prioBox);
mPrioSpin = new QSpinBox(0,5,1,prioBox);
if ( QApplication::desktop()->width() < 300 )
mPrioSpin->setFixedWidth( 40 );
// KPrefsWidBool *bcc =
// addWidBool(i18n("Send copy to owner when mailing events"),
// &(KOPrefs::instance()->mBcc),topFrame);
// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1);
// QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame);
//topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1);
// addWidBool(i18n("Enable automatic saving of calendar"),
// &(KOPrefs::instance()->mAutoSave),autoSaveGroup);
QHBox *intervalBox = new QHBox(topFrame);
// intervalBox->setSpacing(spacingHint());
topLayout->addMultiCellWidget(intervalBox,6,6,0,1);
QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox);
mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox);
autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin);
/*
QHBox * agendasize = new QHBox ( topFrame );
new QLabel (i18n("AllDayAgenda Height:"), agendasize );
mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize);
topLayout->addMultiCellWidget(agendasize,7,7,0,1);
*/
KPrefsWidBool *verticalScreen =
addWidBool(i18n("Show vertical screen (Needs restart)"),
&(KOPrefs::instance()->mVerticalScreen),topFrame);
//topLayout->addWidget(verticalScreen->checkBox(),ii++,0);
topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1);
KPrefsWidBool *ask =
addWidBool(i18n("Ask for quit when closing KO/Pi"),
&(KOPrefs::instance()->mAskForQuit),topFrame);
topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1);
/*
KPrefsWidBool *confirmCheck =
addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm),
topFrame);
topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1);
mEnableGroupScheduling =
addWidBool(i18n("Enable group scheduling"),
&(KOPrefs::instance()->mEnableGroupScheduling),topFrame);
topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0);
connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()),
SLOT(warningGroupScheduling()));
mEnableProjectView =
addWidBool(i18n("Enable project view"),
&(KOPrefs::instance()->mEnableProjectView),topFrame);
topLayout->addWidget(mEnableProjectView->checkBox(),9,0);
connect(mEnableProjectView->checkBox(),SIGNAL(clicked()),
SLOT(warningProjectView()));
// Can't be disabled anymore
mEnableGroupScheduling->checkBox()->hide();
// Disable setting, because this feature now becomes stable
mEnableProjectView->checkBox()->hide();
KPrefsWidRadios *defaultFormatGroup =
addWidRadios(i18n("Default Calendar Format"),
&(KOPrefs::instance()->mDefaultFormat),topFrame);
defaultFormatGroup->addRadio(i18n("vCalendar"));
defaultFormatGroup->addRadio(i18n("iCalendar"));