summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-01-31 09:56:31 (UTC)
committer zautrix <zautrix>2005-01-31 09:56:31 (UTC)
commit3e0b1c7cd48903b6886e081210cd83b7441b48ac (patch) (side-by-side diff)
tree69c1937849a14b137df9c76285e061b1f4620df7 /korganizer
parent1c5f4d993bf5eeb4a21bacf61671a1a08ed1f3cd (diff)
downloadkdepimpi-3e0b1c7cd48903b6886e081210cd83b7441b48ac.zip
kdepimpi-3e0b1c7cd48903b6886e081210cd83b7441b48ac.tar.gz
kdepimpi-3e0b1c7cd48903b6886e081210cd83b7441b48ac.tar.bz2
color fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp10
-rw-r--r--korganizer/koprefs.cpp1
-rw-r--r--korganizer/koprefs.h1
-rw-r--r--korganizer/koprefsdialog.cpp6
4 files changed, 17 insertions, 1 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index ee9f39a..a05c60e 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -1,292 +1,300 @@
/*
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.
*/
#include <qlabel.h>
#include <qlayout.h>
#include <qhbox.h>
#include <qvbox.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qdragobject.h>
#include <qdrawutil.h>
#include <qpainter.h>
#include <kiconloader.h>
#include <kdebug.h>
#include <kglobal.h>
#include <klocale.h>
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#define AGENDA_ICON_SIZE 5
#else
#define AGENDA_ICON_SIZE 7
#endif
#include <libkcal/icaldrag.h>
#include <libkcal/vcaldrag.h>
#include <libkcal/kincidenceformatter.h>
extern int globalFlagBlockAgenda;
extern int globalFlagBlockAgendaItemPaint;
extern int globalFlagBlockAgendaItemUpdate;
#include "koprefs.h"
#include "koagendaitem.h"
//#include "koagendaitem.moc"
//--------------------------------------------------------------------------
QToolTipGroup *KOAgendaItem::mToolTipGroup = 0;
//--------------------------------------------------------------------------
KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday,
const char *name,WFlags) :
QWidget(parent, name), mIncidence(incidence), mDate(qd)
{
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold );
#endif
int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase
setWFlags ( wflags);
mAllDay = allday;
init ( incidence, qd );
setMouseTracking(true);
//setAcceptDrops(true);
xPaintCoord = -1;
yPaintCoord = -1;
}
void KOAgendaItem::init ( Incidence *incidence, QDate qd )
{
mIncidence = incidence;
mDate = qd;
mFirstMultiItem = 0;
mNextMultiItem = 0;
mLastMultiItem = 0;
computeText();
if ( (incidence->type() == "Todo") &&
( !((static_cast<Todo*>(incidence))->isCompleted()) &&
((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) {
if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date())
mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ;
else
mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor;
}
else {
QStringList categories = mIncidence->categories();
QString cat = categories.first();
if (cat.isEmpty()) {
- mBackgroundColor =KOPrefs::instance()->mEventColor;
+ if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) )
+ mBackgroundColor =KOPrefs::instance()->mTodoDoneColor;
+ else
+ mBackgroundColor =KOPrefs::instance()->mEventColor;
} else {
mBackgroundColor = *KOPrefs::instance()->categoryColor(cat);
+ if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) {
+ if ( mBackgroundColor == KOPrefs::instance()->mEventColor )
+ mBackgroundColor =KOPrefs::instance()->mTodoDoneColor;
+ }
}
+
}
mColorGroup = QColorGroup( mBackgroundColor.light(),
mBackgroundColor.dark(),mBackgroundColor.light(),
mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ;
setBackgroundColor( mBackgroundColor );
setCellXY(0,0,1);
setCellXWidth(0);
setSubCell(0);
setSubCells(1);
setMultiItem(0,0,0);
startMove();
mSelected = true;
select(false);
QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont);
mFontPixelSize = fontinf.height();;
hide();
xPaintCoord = -1;
yPaintCoord = -1;
}
KOAgendaItem::~KOAgendaItem()
{
// qDebug("deleteKOAgendaItem::~KOAgendaItem( ");
}
void KOAgendaItem::recreateIncidence()
{
#if 0
Incidence* newInc = mIncidence->clone();
newInc->recreate();
if ( mIncidence->doesRecur() ) {
mIncidence->addExDate( mDate );
newInc->recurrence()->unsetRecurs();
int len = mIncidence->dtStart().secsTo( ((Event*)mIncidence)->dtEnd());
QTime tim = mIncidence->dtStart().time();
newInc->setDtStart( QDateTime(mDate, tim) );
((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) );
}
#endif
mIncidence = mIncidence->recreateCloneException( mDate );
}
bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout)
{
int size = AGENDA_ICON_SIZE;
int yOff = 0;
int xOff = 0;
int x = pos().x() +3;
int y;
if ( mAllDay )
y = pos().y()+3;
else
y = mCellYTop * ( height() / cellHeight() ) +3;
if (mIncidence->cancelled()) {
int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x;
int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y;
p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 );
p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos );
if ( horLayout )
++xOff;
else
++yOff;
}
if (mIncidence->isAlarmEnabled()) {
p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red );
if ( horLayout )
++xOff;
else
++yOff;
}
if (mIncidence->recurrence()->doesRecur()) {
p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue );
if ( horLayout )
++xOff;
else
++yOff;
}
if (mIncidence->description().length() > 0) {
p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen );
if ( horLayout )
++xOff;
else
++yOff;
}
if (mIncidence->isReadOnly()) {
p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white );
if ( horLayout )
++xOff;
else
++yOff;
}
if (mIncidence->attendeeCount()>0) {
if (mIncidence->organizer() == KOPrefs::instance()->email()) {
p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, black );
if ( horLayout )
++xOff;
else
++yOff;
} else {
Attendee *me = mIncidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
if (me!=0) {
} else {
p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, yellow );
if ( horLayout )
++xOff;
else
++yOff;
}
p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkYellow );
if ( horLayout )
++xOff;
else
++yOff;
}
}
return ( yOff || xOff );
}
void KOAgendaItem::select(bool selected)
{
//qDebug("select %d %d",firstMultiItem(), nextMultiItem() );
if (mSelected == selected) return;
mSelected = selected;
if ( ! isVisible() )
return;
if ( firstMultiItem() )
firstMultiItem()->select( selected );
if ( !firstMultiItem() && nextMultiItem() ) {
KOAgendaItem * placeItem = nextMultiItem();
while ( placeItem ) {
placeItem->select( selected );
placeItem = placeItem->nextMultiItem();
}
}
globalFlagBlockAgendaItemUpdate = 0;
paintMe( selected );
globalFlagBlockAgendaItemUpdate = 1;
repaint( false );
}
/*
The eventFilter has to filter the mouse events of the agenda item childs. The
events are fed into the event handling method of KOAgendaItem. This allows the
KOAgenda to handle the KOAgendaItems by using an eventFilter.
*/
bool KOAgendaItem::eventFilter ( QObject *object, QEvent *e )
{
if (e->type() == QEvent::MouseButtonPress ||
e->type() == QEvent::MouseButtonDblClick ||
e->type() == QEvent::MouseButtonRelease ||
e->type() == QEvent::MouseMove) {
QMouseEvent *me = (QMouseEvent *)e;
QPoint itemPos = this->mapFromGlobal(((QWidget *)object)->
mapToGlobal(me->pos()));
QMouseEvent returnEvent (e->type(),itemPos,me->button(),me->state());
return event(&returnEvent);
} else {
return false;
}
}
void KOAgendaItem::repaintMe( )
{
paintMe ( mSelected );
}
void KOAgendaItem::paintMe( bool selected, QPainter* paint )
{
if ( globalFlagBlockAgendaItemUpdate && ! selected)
return;
QPainter pa;
if ( mSelected ) {
pa.begin( paintPixSel() );
} else {
if ( mAllDay )
pa.begin( paintPixAllday() );
else
pa.begin( paintPix() );
}
int x, yy, w, h;
float nfh;
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 32cc291..0548f14 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -8,384 +8,385 @@
(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 <time.h>
#ifndef _WIN32_
#include <unistd.h>
#endif
#include <qdir.h>
#include <qtextstream.h>
#include <qtextcodec.h>
#include <qstring.h>
#include <qregexp.h>
#include <qfont.h>
#include <qcolor.h>
#include <qstringlist.h>
#include <stdlib.h>
#include <kglobal.h>
#include <kconfig.h>
#include <klocale.h>
#include <kdebug.h>
#include <kemailsettings.h>
#include <kstaticdeleter.h>
#include <libkdepim/kpimglobalprefs.h>
#include "koprefs.h"
#include "mainwindow.h"
KOPrefs *KOPrefs::mInstance = 0;
static KStaticDeleter<KOPrefs> insd;
KOPrefs::KOPrefs() :
KPimPrefs("korganizerrc")
{
mCategoryColors.setAutoDelete(true);
fillMailDefaults();
mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
QColor defaultHolidayColor = QColor(255,0,0);
QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
QColor defaultTodoDueTodayColor = QColor(255,220,100);
QColor defaultTodoOverdueColor = QColor(255,153,125);
mTimeBarFont = QFont("helvetica",10);//,QFont::Bold);
mDefaultViewFont = QFont("helvetica",10);
mDefaultMonthViewFont = QFont("helvetica",8);
mMarcusBainsFont= QFont("helvetica",10);
mDateNavigatorFont= QFont("helvetica",10, QFont::Bold);
mEditBoxFont = QFont("helvetica",12);
mJornalViewFont = QFont("helvetica",12);
KPrefs::setCurrentGroup("General");
addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
addItemBool("ShowIconSearch",&mShowIconSearch,true);
addItemBool("ShowIconList",&mShowIconList,true);
addItemBool("ShowIconDay1",&mShowIconDay1,true);
addItemBool("ShowIconDay5",&mShowIconDay5,true);
addItemBool("ShowIconDay7",&mShowIconDay7,true);
addItemBool("ShowIconMonth",&mShowIconMonth,true);
addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
addItemBool("ShowIconBack",&mShowIconBack,true);
addItemBool("ShowIconToday",&mShowIconToday,true);
addItemBool("ShowIconForward",&mShowIconForward,true);
addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true);
addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true);
addItemBool("ShowIconNextDays",&mShowIconNextDays,true);
addItemBool("ShowIconNext",&mShowIconNext,true);
addItemBool("ShowIconJournal",&mShowIconJournal,true);
addItemBool("ShowIconStretch",&mShowIconStretch,true);
addItemInt("LastLoadedLanguage",&mOldLanguage,0);
addItemBool("AskForQuit",&mAskForQuit,false);
#ifndef DESKTOP_VERSION
addItemBool("ShowFullMenu",&mShowFullMenu,false);
#else
addItemBool("ShowFullMenu",&mShowFullMenu,true);
#endif
addItemBool("ToolBarHor",&mToolBarHor, true );
addItemBool("ToolBarUp",&mToolBarUp, false );
addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
addItemInt("Whats Next Days",&mWhatsNextDays,3);
addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true);
addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false);
addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
addItemInt("AllDay Size",&mAllDaySize,28);
QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
addItemStringList("LocationDefaults",&mLocationDefaults );
addItemStringList("EventSummary User",&mEventSummaryUser);
addItemStringList("TodoSummary User",&mTodoSummaryUser);
addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
addItemBool("Enable Project View",&mEnableProjectView,false);
addItemBool("Auto Save",&mAutoSave,false);
addItemInt("Auto Save Interval",&mAutoSaveInterval,3);
addItemBool("Confirm Deletes",&mConfirm,true);
addItemString("Archive File",&mArchiveFile);
addItemString("Html Export File",&mHtmlExportFile,
QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html"));
addItemBool("Html With Save",&mHtmlWithSave,false);
KPrefs::setCurrentGroup("Personal Settings");
addItemInt("Mail Client",&mMailClient,MailClientKMail);
addItemBool("Use Control Center Email",&mEmailControlCenter,false);
addItemBool("Bcc",&mBcc,false);
KPrefs::setCurrentGroup("Time & Date");
addItemInt("Default Start Time",&mStartTime,10);
addItemInt("Default Duration",&mDefaultDuration,2);
addItemInt("Default Alarm Time",&mAlarmTime,3);
KPrefs::setCurrentGroup("AlarmSettings");
addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20);
addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
KPrefs::setCurrentGroup("Calendar");
addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
KPrefs::setCurrentGroup("Fonts");
// qDebug(" KPrefs::setCurrentGroup(Fonts); ");
addItemFont("TimeBar Font",&mTimeBarFont);
addItemFont("MonthView Font",&mMonthViewFont);
addItemFont("AgendaView Font",&mAgendaViewFont);
addItemFont("MarcusBains Font",&mMarcusBainsFont);
addItemFont("TimeLabels Font",&mTimeLabelsFont);
addItemFont("TodoView Font",&mTodoViewFont);
addItemFont("ListView Font",&mListViewFont);
addItemFont("DateNavigator Font",&mDateNavigatorFont);
addItemFont("EditBox Font",&mEditBoxFont);
addItemFont("JournalView Font",&mJornalViewFont);
addItemFont("WhatsNextView Font",&mWhatsNextFont);
addItemFont("EventView Font",&mEventViewFont);
KPrefs::setCurrentGroup("RemoteSyncing");
addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
addItemInt("LastSyncTime",&mLastSyncTime,0);
#ifdef _WIN32_
QString hdp= locateLocal("data","korganizer")+"\\\\";
#else
QString hdp= locateLocal("data","korganizer")+"/";
#endif
KPrefs::setCurrentGroup("LoadSaveFileNames");
addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
KPrefs::setCurrentGroup("Locale");
addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
KPrefs::setCurrentGroup("Colors");
addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
+ addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) );
addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
addItemBool("UseAppColors",&mUseAppColors,false);
KPrefs::setCurrentGroup("Views");
addItemBool("Show Date Navigator",&mShowDateNavigator,true);
addItemInt("Hour Size",&mHourSize,8);
addItemBool("Show Daily Recurrences",&mDailyRecur,true);
addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
addItemBool("ShowShortMonthName",&mMonthShowShort,false);
addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
#ifdef DESKTOP_VERION
addItemBool("Enable ToolTips",&mEnableToolTips,true);
#else
addItemBool("Enable ToolTips",&mEnableToolTips,false);
#endif
addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true);
addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false);
addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
#ifdef DESKTOP_VERSION
addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
#else
addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
#endif
addItemInt("Day Begins",&mDayBegins,7);
addItemInt("Working Hours Start",&mWorkingHoursStart,8);
addItemInt("Working Hours End",&mWorkingHoursEnd,17);
addItemBool("Exclude Holidays",&mExcludeHolidays,true);
addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
addItemBool("Full View Month",&mFullViewMonth,true);
addItemBool("Full View Todo",&mFullViewTodo,true);
addItemBool("Quick Todo",&mEnableQuickTodo,false);
addItemInt("Next X Days",&mNextXDays,3);
KPrefs::setCurrentGroup("Printer");
KPrefs::setCurrentGroup("Layout");
addItemBool("CompactDialogs",&mCompactDialogs,false);
addItemBool("VerticalScreen",&mVerticalScreen,true);
KPrefs::setCurrentGroup("KOrganizer Plugins");
addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
KPrefs::setCurrentGroup("Group Scheduling");
addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
addItemStringList("AdditionalMails",&mAdditionalMails,"");
addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
KPrefs::setCurrentGroup( "Editors" );
addItemStringList( "EventTemplates", &mEventTemplates );
addItemStringList( "TodoTemplates", &mTodoTemplates );
addItemInt("DestinationPolicy",&mDestination,standardDestination);
}
KOPrefs::~KOPrefs()
{
if (mInstance == this)
mInstance = insd.setObject(0);
//qDebug("KOPrefs::~KOPrefs() ");
}
KOPrefs *KOPrefs::instance()
{
if (!mInstance) {
mInstance = insd.setObject(new KOPrefs());
mInstance->readConfig();
}
return mInstance;
}
void KOPrefs::usrSetDefaults()
{
}
void KOPrefs::fillMailDefaults()
{
if (mName.isEmpty()) mName = i18n("Anonymous");
if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
}
void KOPrefs::setTimeZoneIdDefault()
{
;
}
void KOPrefs::setCategoryDefaults()
{
mCustomCategories.clear();
mCustomCategories = getDefaultList();
QStringList::Iterator it;
for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
setCategoryColor(*it,mDefaultCategoryColor);
}
}
QStringList KOPrefs::getDefaultList()
{
QStringList retval ;
retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer")
<< i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner")
<< i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts")
<< i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids")
<< i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel")
<< i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping")
<< i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University")
<< i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ;
retval.sort();
return retval;
}
void KOPrefs::usrReadConfig()
{
config()->setGroup("General");
mCustomCategories = config()->readListEntry("Custom Categories");
if ( KPimGlobalPrefs::instance()->mPreferredLanguage != mOldLanguage ) {
mLocationDefaults.clear();
mEventSummaryUser.clear();
mTodoSummaryUser.clear();
}
mOldLoadedLanguage = mOldLanguage ;
mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
if (mLocationDefaults.isEmpty()) {
mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
<< i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
<< i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
// << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
mLocationDefaults.sort();
}
if (mEventSummaryUser.isEmpty()) {
mEventSummaryUser = getDefaultList() ;
}
if (mTodoSummaryUser.isEmpty()) {
mTodoSummaryUser = getDefaultList() ;
}
if (mCustomCategories.isEmpty()) setCategoryDefaults();
config()->setGroup("Personal Settings");
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index b3acda7..8b849fa 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -1,278 +1,279 @@
/*
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.
*/
#ifndef KOPREFS_H
#define KOPREFS_H
#include <libkdepim/kpimprefs.h>
#include <qdict.h>
class KConfig;
class QFont;
class QColor;
class QStringList;
class KOPrefs : public KPimPrefs
{
public:
enum { FormatVCalendar, FormatICalendar };
enum { MailClientKMail, MailClientSendmail };
enum { IMIPDummy, IMIPKMail };
enum { IMIPOutbox, IMIPdirectsend };
enum { neverAuto, addressbookAuto, selectedAuto };
enum { standardDestination, askDestination };
virtual ~KOPrefs();
/** Get instance of KOPrefs. It is made sure that there is only one
instance. */
static KOPrefs *instance();
/** Set preferences to default values */
void usrSetDefaults();
/** Read preferences from config file */
void usrReadConfig();
/** Write preferences to config file */
void usrWriteConfig();
void setCategoryDefaults();
protected:
void setTimeZoneIdDefault();
/** Fill empty mail fields with default values. */
void fillMailDefaults();
private:
/** Constructor disabled for public. Use instance() to create a KOPrefs
object. */
KOPrefs();
static KOPrefs *mInstance;
QStringList getDefaultList();
public:
// preferences data
KConfig* getConfig();
void setFullName(const QString &);
QString fullName();
void setEmail(const QString &);
QString email();
QString mAdditional;
bool mEmailControlCenter;
bool mBcc;
bool mAutoSave;
int mAutoSaveInterval;
bool mConfirm;
bool mEnableGroupScheduling;
bool mEnableProjectView;
int mDefaultFormat;
int mMailClient;
int mStartTime;
int mDefaultDuration;
int mAlarmTime;
int mWorkingHoursStart;
int mWorkingHoursEnd;
bool mExcludeHolidays;
bool mExcludeSaturdays;
bool mMarcusBainsShowSeconds;
QFont mTimeBarFont;
QFont mMonthViewFont;
QFont mAgendaViewFont;
QFont mMarcusBainsFont;
QFont mTimeLabelsFont;
QFont mTodoViewFont;
QFont mListViewFont;
QFont mDateNavigatorFont;
QFont mEditBoxFont;
QFont mJornalViewFont;
QFont mWhatsNextFont;
QFont mEventViewFont;
QColor mHolidayColor;
QColor mHighlightColor;
QColor mEventColor;
+ QColor mTodoDoneColor;
QColor mAgendaBgColor;
QColor mWorkingHoursColor;
QColor mTodoDueTodayColor;
QColor mTodoOverdueColor;
QColor mMonthViewEvenColor;
QColor mMonthViewOddColor;
QColor mMonthViewHolidayColor;
bool mMonthViewUsesDayColors;
bool mMonthViewSatSunTog;
QColor mAppColor1;
QColor mAppColor2;
bool mUseAppColors;
int mDayBegins;
int mHourSize;
int mAllDaySize;
bool mShowFullMenu;
bool mDailyRecur;
bool mWeeklyRecur;
bool mMonthDailyRecur;
bool mMonthWeeklyRecur;
bool mMonthShowIcons;
bool mMonthShowShort;
bool mEnableToolTips;
bool mEnableMonthScroll;
bool mFullViewMonth;
bool mMonthViewUsesCategoryColor;
bool mFullViewTodo;
bool mShowCompletedTodo;
bool mMarcusBainsEnabled;
int mNextXDays;
int mWhatsNextDays;
int mWhatsNextPrios;
bool mEnableQuickTodo;
bool mCompactDialogs;
bool mVerticalScreen;
bool mShowIconNewTodo;
bool mShowIconNewEvent;
bool mShowIconSearch;
bool mShowIconList;
bool mShowIconDay1;
bool mShowIconDay5;
bool mShowIconDay7;
bool mShowIconMonth;
bool mShowIconTodoview;
bool mShowIconBackFast;
bool mShowIconBack;
bool mShowIconToday;
bool mShowIconForward;
bool mShowIconForwardFast;
bool mShowIconWhatsThis;
bool mShowIconNextDays;
bool mShowIconNext;
bool mShowIconJournal;
bool mShowIconStretch;
bool mToolBarHor;
bool mToolBarUp;
bool mToolBarMiniIcons;
bool mAskForQuit;
bool mUsePassWd;
bool mShowSyncEvents;
bool mShowTodoInAgenda;
bool mShowTimeInAgenda;
bool mHideNonStartedTodos;
int mLastSyncTime;
void setCategoryColor(QString cat,const QColor & color);
QColor *categoryColor(QString cat);
QString mArchiveFile;
QString mHtmlExportFile;
bool mHtmlWithSave;
QStringList mSelectedPlugins;
QString mLastImportFile;
QString mLastVcalFile;
QString mLastSaveFile;
QString mLastLoadFile;
QString mDefaultAlarmFile;
int mIMIPScheduler;
int mIMIPSend;
QStringList mAdditionalMails;
int mIMIPAutoRefresh;
int mIMIPAutoInsertReply;
int mIMIPAutoInsertRequest;
int mIMIPAutoFreeBusy;
int mIMIPAutoFreeBusyReply;
QStringList mTodoTemplates;
QStringList mEventTemplates;
int mDestination;
bool mEditOnDoubleClick;
bool mViewChangeHoldFullscreen;
bool mViewChangeHoldNonFullscreen;
bool mCenterOnCurrentTime;
bool mSetTimeToDayStartAt;
bool mHighlightCurrentDay;
bool mUseHighlightLightColor;
bool mListViewMonthTimespan;
bool mWNViewShowsParents;
bool mWNViewShowsPast;
bool mWNViewShowLocation;
bool mTodoViewShowsPercentage;
bool mTodoViewUsesCatColors;
bool mTodoViewUsesSmallFont;
bool mTodoViewUsesForegroundColor;
bool mMonthViewUsesForegroundColor;
bool mHightlightDateTimeEdit;
bool mShortDateInViewer;
bool mShowDateNavigator;
QStringList mLocationDefaults;
QStringList mEventSummaryUser;
QStringList mTodoSummaryUser;
bool mUseInternalAlarmNotification;
int mAlarmPlayBeeps;
int mAlarmSuspendTime;
int mAlarmSuspendCount;
int mAlarmBeepInterval;
int mOldLanguage;
int mOldLoadedLanguage;
QString mActiveSyncPort;
QString mActiveSyncIP;
private:
QDict<QColor> mCategoryColors;
QColor mDefaultCategoryColor;
QFont mDefaultTimeBarFont;
QFont mDefaultViewFont;
QFont mDefaultMonthViewFont;
QString mName;
QString mEmail;
};
#endif
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 1b24f56..580dff2 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -987,384 +987,390 @@ void KOPrefsDialog::selectSoundFile()
fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this );
if ( fileName.length() > 0 )
mDefaultAlarmFile->setText( fileName );
}
void KOPrefsDialog::setupFontsTab()
{
QFrame *topFrame = addPage(i18n("Fonts"),0,0);
// DesktopIcon("fonts",KIcon::SizeMedium));
QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
topLayout->setSpacing(1);
topLayout->setMargin(3);
KPrefsDialogWidFont * tVFont;
int i = 0;
KPrefsDialogWidFont *timeLabelsFont =
addWidFont(i18n("23"),i18n("DateNavigator:(nr)"),
&(KOPrefs::instance()->mDateNavigatorFont),topFrame);
topLayout->addWidget(timeLabelsFont->label(),i,0);
topLayout->addWidget(timeLabelsFont->preview(),i,1);
topLayout->addWidget(timeLabelsFont->button(),i,2);
++i;
timeLabelsFont =
addWidFont(i18n("Mon 15"),i18n("Date Labels:"),
&(KOPrefs::instance()->mTimeLabelsFont),topFrame);
topLayout->addWidget(timeLabelsFont->label(),i,0);
topLayout->addWidget(timeLabelsFont->preview(),i,1);
topLayout->addWidget(timeLabelsFont->button(),i,2);
++i;
KPrefsDialogWidFont *timeBarFont =
addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"),
&(KOPrefs::instance()->mTimeBarFont),topFrame);
topLayout->addWidget(timeBarFont->label(),i,0);
topLayout->addWidget(timeBarFont->preview(),i,1);
topLayout->addWidget(timeBarFont->button(),i,2);
++i;
KPrefsDialogWidFont *marcusBainsFont =
addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"),
&(KOPrefs::instance()->mMarcusBainsFont),topFrame);
topLayout->addWidget(marcusBainsFont->label(),i,0);
topLayout->addWidget(marcusBainsFont->preview(),i,1);
topLayout->addWidget(marcusBainsFont->button(),i,2);
++i;
tVFont =
addWidFont(i18n("Summary"),i18n("Event Viewer:"),
&(KOPrefs::instance()->mEventViewFont),topFrame);
topLayout->addWidget(tVFont->label(),i,0);
topLayout->addWidget(tVFont->preview(),i,1);
topLayout->addWidget(tVFont->button(),i,2);
++i;
tVFont =
addWidFont(i18n("Details"),i18n("EditorBox:"),
&(KOPrefs::instance()->mEditBoxFont),topFrame);
topLayout->addWidget(tVFont->label(),i,0);
topLayout->addWidget(tVFont->preview(),i,1);
topLayout->addWidget(tVFont->button(),i,2);
++i;
topLayout->setColStretch(1,1);
topLayout->setRowStretch(4,1);
i = 0;
topFrame = addPage(i18n("View Fonts"),0,
DesktopIcon("fonts",KIcon::SizeMedium));
topLayout = new QGridLayout(topFrame,7,3);
topLayout->setSpacing(1);
topLayout->setMargin(3);
tVFont =
addWidFont(i18n("Configure KO"),i18n("What's Next View:"),
&(KOPrefs::instance()->mWhatsNextFont),topFrame);
topLayout->addWidget(tVFont->label(),i,0);
topLayout->addWidget(tVFont->preview(),i,1);
topLayout->addWidget(tVFont->button(),i,2);
++i;
KPrefsDialogWidFont *agendaViewFont =
addWidFont(i18n("Event text"),i18n("Agenda view:"),
&(KOPrefs::instance()->mAgendaViewFont),topFrame);
topLayout->addWidget(agendaViewFont->label(),i,0);
topLayout->addWidget(agendaViewFont->preview(),i,1);
topLayout->addWidget(agendaViewFont->button(),i,2);
++i;
KPrefsDialogWidFont *monthViewFont =
addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"),
i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame);
topLayout->addWidget(monthViewFont->label(),i,0);
topLayout->addWidget(monthViewFont->preview(),i,1);
topLayout->addWidget(monthViewFont->button(),i,2);
++i;
KPrefsDialogWidFont *lVFont =
addWidFont(i18n("Event"),i18n("List View:"),
&(KOPrefs::instance()->mListViewFont),topFrame);
topLayout->addWidget(lVFont->label(),i,0);
topLayout->addWidget(lVFont->preview(),i,1);
topLayout->addWidget(lVFont->button(),i,2);
++i;
tVFont =
addWidFont(i18n("ToDo"),i18n("ToDoView:"),
&(KOPrefs::instance()->mTodoViewFont),topFrame);
topLayout->addWidget(tVFont->label(),i,0);
topLayout->addWidget(tVFont->preview(),i,1);
topLayout->addWidget(tVFont->button(),i,2);
++i;
tVFont =
addWidFont(i18n("Today"),i18n("JournalView:"),
&(KOPrefs::instance()->mJornalViewFont),topFrame);
topLayout->addWidget(tVFont->label(),i,0);
topLayout->addWidget(tVFont->preview(),i,1);
topLayout->addWidget(tVFont->button(),i,2);
++i;
topLayout->setColStretch(1,1);
topLayout->setRowStretch(4,1);
}
void KOPrefsDialog::setupColorsTab()
{
QFrame *topFrame = addPage(i18n("Colors"),0,0);
// DesktopIcon("colorize",KIcon::SizeMedium));
QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
// topLayout->setSpacing(spacingHint());
// topLayout->setMargin(marginHint());
topLayout->setSpacing(2);
topLayout->setMargin(3);
int ii = 1;
QGroupBox *categoryGroup ;
categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"),
topFrame);
topLayout->addMultiCellWidget(categoryGroup,0,0,0,1);
mCategoryCombo = new QComboBox(categoryGroup);
mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor()));
mCategoryButton = new KColorButton(categoryGroup);
connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor()));
updateCategoryColor();
// Holiday Color
KPrefsDialogWidColor *holidayColor =
addWidColor(i18n("Holiday color:"),
&(KOPrefs::instance()->mHolidayColor),topFrame);
topLayout->addWidget(holidayColor->label(),ii,0);
topLayout->addWidget(holidayColor->button(),ii++,1);
// Highlight Color
KPrefsDialogWidColor *highlightColor =
addWidColor(i18n("Highlight color:"),
&(KOPrefs::instance()->mHighlightColor),topFrame);
topLayout->addWidget(highlightColor->label(),ii,0);
topLayout->addWidget(highlightColor->button(),ii++,1);
// Event color
KPrefsDialogWidColor *eventColor =
addWidColor(i18n("Default event color:"),
&(KOPrefs::instance()->mEventColor),topFrame);
topLayout->addWidget(eventColor->label(),ii,0);
topLayout->addWidget(eventColor->button(),ii++,1);
+ eventColor =
+ addWidColor(i18n("Default todo done color:"),
+ &(KOPrefs::instance()->mTodoDoneColor),topFrame);
+ topLayout->addWidget(eventColor->label(),ii,0);
+ topLayout->addWidget(eventColor->button(),ii++,1);
+
// agenda view background color
KPrefsDialogWidColor *agendaBgColor =
addWidColor(i18n("Agenda view background color:"),
&(KOPrefs::instance()->mAgendaBgColor),topFrame);
topLayout->addWidget(agendaBgColor->label(),ii,0);
topLayout->addWidget(agendaBgColor->button(),ii++,1);
// working hours color
KPrefsDialogWidColor *workingHoursColor =
addWidColor(i18n("Working hours color:"),
&(KOPrefs::instance()->mWorkingHoursColor),topFrame);
topLayout->addWidget(workingHoursColor->label(),ii,0);
topLayout->addWidget(workingHoursColor->button(),ii++,1);
KPrefsDialogWidBool *sb =
addWidBool(i18n("Use colors for application:"),
&(KOPrefs::instance()->mUseAppColors),topFrame);
topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 );
ii++;
KPrefsDialogWidColor * workingHoursColor1 =
addWidColor(i18n("Buttons, menus, etc.:"),
&(KOPrefs::instance()->mAppColor1),topFrame);
topLayout->addWidget(workingHoursColor1->label(),ii,0);
topLayout->addWidget(workingHoursColor1->button(),ii++,1);
KPrefsDialogWidColor * workingHoursColor2 =
addWidColor(i18n("Frames, labels, etc.:"),
&(KOPrefs::instance()->mAppColor2),topFrame);
topLayout->addWidget(workingHoursColor2->label(),ii,0);
topLayout->addWidget(workingHoursColor2->button(),ii++,1);
}
void KOPrefsDialog::setCategoryColor()
{
mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color()));
}
void KOPrefsDialog::updateCategoryColor()
{
QString cat = mCategoryCombo->currentText();
QColor *color = mCategoryDict.find(cat);
if (!color) {
color = KOPrefs::instance()->categoryColor(cat);
}
if (color) {
mCategoryButton->setColor(*color);
}
}
void KOPrefsDialog::setupPrinterTab()
{
mPrinterTab = addPage(i18n("Printing"),0,
DesktopIcon("fileprint",KIcon::SizeMedium));
QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2);
topLayout->setSpacing(spacingHint());
topLayout->setMargin(marginHint());
topLayout->setRowStretch(4,1);
}
void KOPrefsDialog::setupGroupSchedulingTab()
{
#if 0
QFrame *topFrame = addPage(i18n("Group Scheduling"),0,
DesktopIcon("personal",KIcon::SizeMedium));
QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
topLayout->setSpacing(spacingHint());
topLayout->setMargin(marginHint());
#if 0
KPrefsDialogWidRadios *schedulerGroup =
addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler),
topFrame);
schedulerGroup->addRadio("Dummy"); // Only for debugging
schedulerGroup->addRadio(i18n("Mail client"));
topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1);
#endif
KPrefsDialogWidRadios *sendGroup =
addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend),
topFrame);
sendGroup->addRadio(i18n("Send to outbox"));
sendGroup->addRadio(i18n("Send directly"));
topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1);
topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1);
mAMails = new QListView(topFrame);
mAMails->addColumn(i18n("Email"),300);
topLayout->addMultiCellWidget(mAMails,3,3,0,1);
topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0);
aEmailsEdit = new QLineEdit(topFrame);
aEmailsEdit->setEnabled(false);
topLayout->addWidget(aEmailsEdit,4,1);
QPushButton *add = new QPushButton(i18n("New"),topFrame,"new");
topLayout->addWidget(add,5,0);
QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove");
topLayout->addWidget(del,5,1);
//topLayout->setRowStretch(2,1);
connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) );
connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) );
connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem()));
connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput()));
#endif
}
void KOPrefsDialog::setupGroupAutomationTab()
{
return;
QFrame *topFrame = addPage(i18n("Group Automation"),0,
DesktopIcon("personal",KIcon::SizeMedium));
QGridLayout *topLayout = new QGridLayout(topFrame,5,1);
topLayout->setSpacing(spacingHint());
topLayout->setMargin(marginHint());
KPrefsDialogWidRadios *autoRefreshGroup =
addWidRadios(i18n("Auto Send Refresh"),
&(KOPrefs::instance()->mIMIPAutoRefresh),topFrame);
autoRefreshGroup->addRadio(i18n("Never"));
autoRefreshGroup->addRadio(i18n("If attendee is in addressbook"));
//autoRefreshGroup->addRadio(i18n("selected emails"));
topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0);
KPrefsDialogWidRadios *autoInsertGroup =
addWidRadios(i18n("Auto Insert IMIP Replies"),
&(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame);
autoInsertGroup->addRadio(i18n("Never"));
autoInsertGroup->addRadio(i18n("If attendee is in addressbook"));
//autoInsertGroup->addRadio(i18n("selected emails"));
topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0);
KPrefsDialogWidRadios *autoRequestGroup =
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()
{