summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2004-09-22 02:03:15 (UTC)
committer zautrix <zautrix>2004-09-22 02:03:15 (UTC)
commit633522024e48efc423155a04b71083a03696211d (patch) (unidiff)
treec383ee8fa3489351450b948eb83a42b504752131 /korganizer
parented2feaa9f7e2064e5b26ff678a25eb79ceae599b (diff)
downloadkdepimpi-633522024e48efc423155a04b71083a03696211d.zip
kdepimpi-633522024e48efc423155a04b71083a03696211d.tar.gz
kdepimpi-633522024e48efc423155a04b71083a03696211d.tar.bz2
global prefs integrated in kopi amd ompi
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefsdialog.cpp14
-rw-r--r--korganizer/koprefsdialog.h3
2 files changed, 16 insertions, 1 deletions
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 1c30faa..7dafcd8 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -1,228 +1,238 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qgroupbox.h> 26#include <qgroupbox.h>
27#include <qbuttongroup.h> 27#include <qbuttongroup.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qfont.h> 29#include <qfont.h>
30#include <qslider.h> 30#include <qslider.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qtextstream.h> 32#include <qtextstream.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qvbox.h> 34#include <qvbox.h>
35#include <qhbox.h> 35#include <qhbox.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qradiobutton.h> 40#include <qradiobutton.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qstrlist.h> 42#include <qstrlist.h>
43#include <qapplication.h> 43#include <qapplication.h>
44 44
45#include <kcolorbutton.h> 45#include <kcolorbutton.h>
46#include <kdebug.h> 46#include <kdebug.h>
47#include <klocale.h> 47#include <klocale.h>
48#include <kglobal.h> 48#include <kglobal.h>
49#include <kfontdialog.h> 49#include <kfontdialog.h>
50#include <kfiledialog.h> 50#include <kfiledialog.h>
51#include <kmessagebox.h> 51#include <kmessagebox.h>
52#include <kcolordialog.h> 52#include <kcolordialog.h>
53#include <kiconloader.h> 53#include <kiconloader.h>
54#include <kemailsettings.h> 54#include <kemailsettings.h>
55#include <kstandarddirs.h> 55#include <kstandarddirs.h>
56 56
57#include <kurlrequester.h> 57#include <kurlrequester.h>
58#include <klineedit.h> 58#include <klineedit.h>
59 59
60#if defined(USE_SOLARIS) 60#if defined(USE_SOLARIS)
61#include <sys/param.h> 61#include <sys/param.h>
62 62
63#define ZONEINFODIR "/usr/share/lib/zoneinfo" 63#define ZONEINFODIR "/usr/share/lib/zoneinfo"
64#define INITFILE "/etc/default/init" 64#define INITFILE "/etc/default/init"
65#endif 65#endif
66 66
67#include "koprefs.h" 67#include "koprefs.h"
68 68
69#include "koprefsdialog.h" 69#include "koprefsdialog.h"
70#include "kpimglobalprefs.h"
70 71
71 72
72KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : 73KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
73 KPrefsDialog(KOPrefs::instance(),parent,name,true) 74 KPrefsDialog(KOPrefs::instance(),parent,name,true)
74{ 75{
75 76
76 setCaption( i18n("Preferences - some settings need a restart (nr)")); 77 setCaption( i18n("Preferences - some settings need a restart (nr)"));
77 mCategoryDict.setAutoDelete(true); 78 mCategoryDict.setAutoDelete(true);
78 79
79 KGlobal::locale()->insertCatalogue("timezones"); 80 KGlobal::locale()->insertCatalogue("timezones");
80 81
82 setupGlobalTab();
81 setupMainTab(); 83 setupMainTab();
82 setupLocaleTab(); 84 setupLocaleTab();
83 setupTimeZoneTab(); 85 setupTimeZoneTab();
84 setupTimeTab(); 86 setupTimeTab();
85 setupLocaleDateTab(); 87 setupLocaleDateTab();
86 setupFontsTab(); 88 setupFontsTab();
87 setupColorsTab(); 89 setupColorsTab();
88 setupViewsTab(); 90 setupViewsTab();
89 //setupSyncTab(); 91 //setupSyncTab();
90 //setupSyncAlgTab(); 92 //setupSyncAlgTab();
91 //setupPrinterTab(); 93 //setupPrinterTab();
92 //setupGroupSchedulingTab(); 94 //setupGroupSchedulingTab();
93 //setupGroupAutomationTab(); 95 //setupGroupAutomationTab();
94} 96}
95 97
96 98
97KOPrefsDialog::~KOPrefsDialog() 99KOPrefsDialog::~KOPrefsDialog()
98{ 100{
99} 101}
100 102void KOPrefsDialog::setupGlobalTab()
103{
104 QFrame *topFrame = addPage(i18n("Global"),0,0);
105 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" );
106 QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
107 topLayout->addWidget( kdelibcfg );
108
109
110}
101void KOPrefsDialog::setupLocaleDateTab() 111void KOPrefsDialog::setupLocaleDateTab()
102{ 112{
103QFrame *topFrame = addPage(i18n("Date Format"),0,0); 113QFrame *topFrame = addPage(i18n("Date Format"),0,0);
104 QGridLayout *topLayout = new QGridLayout(topFrame,3,2); 114 QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
105 topLayout->setSpacing(spacingHint()); 115 topLayout->setSpacing(spacingHint());
106 topLayout->setMargin(marginHint()); 116 topLayout->setMargin(marginHint());
107 int iii = 0; 117 int iii = 0;
108 118
109 119
110 KPrefsDialogWidRadios *syncPrefsGroup = 120 KPrefsDialogWidRadios *syncPrefsGroup =
111 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); 121 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
112 QString format; 122 QString format;
113 if ( QApplication::desktop()->width() < 480 ) 123 if ( QApplication::desktop()->width() < 480 )
114 format = "(%d.%m.%Y)"; 124 format = "(%d.%m.%Y)";
115 else 125 else
116 format = "(%d.%m.%Y|%A %d %B %Y)"; 126 format = "(%d.%m.%Y|%A %d %B %Y)";
117 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 127 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
118 if ( QApplication::desktop()->width() < 480 ) 128 if ( QApplication::desktop()->width() < 480 )
119 format = "(%m.%d.%Y)"; 129 format = "(%m.%d.%Y)";
120 else 130 else
121 format = "(%m.%d.%Y|%A %B %d %Y)"; 131 format = "(%m.%d.%Y|%A %B %d %Y)";
122 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 132 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
123 if ( QApplication::desktop()->width() < 480 ) 133 if ( QApplication::desktop()->width() < 480 )
124 format = "(%Y-%m-%d)"; 134 format = "(%Y-%m-%d)";
125 else 135 else
126 format = "(%Y-%m-%d|%A %Y %B %d)"; 136 format = "(%Y-%m-%d|%A %Y %B %d)";
127 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 137 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
128 syncPrefsGroup->addRadio(i18n("User defined")); 138 syncPrefsGroup->addRadio(i18n("User defined"));
129 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 139 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
130 ++iii; 140 ++iii;
131 ++iii; 141 ++iii;
132 QLabel * lab; 142 QLabel * lab;
133 mUserDateFormatLong = new QLineEdit(topFrame); 143 mUserDateFormatLong = new QLineEdit(topFrame);
134 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 144 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
135 topLayout->addWidget(lab ,iii,0); 145 topLayout->addWidget(lab ,iii,0);
136 topLayout->addWidget(mUserDateFormatLong,iii,1); 146 topLayout->addWidget(mUserDateFormatLong,iii,1);
137 ++iii; 147 ++iii;
138 mUserDateFormatShort = new QLineEdit(topFrame); 148 mUserDateFormatShort = new QLineEdit(topFrame);
139 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 149 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
140 topLayout->addWidget(lab ,iii,0); 150 topLayout->addWidget(lab ,iii,0);
141 topLayout->addWidget(mUserDateFormatShort,iii,1); 151 topLayout->addWidget(mUserDateFormatShort,iii,1);
142 ++iii; 152 ++iii;
143 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 153 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
144 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 154 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
145 ++iii; 155 ++iii;
146 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 156 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
147 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 157 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
148 ++iii; 158 ++iii;
149 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 159 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
150 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 160 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
151 ++iii; 161 ++iii;
152 162
153} 163}
154 164
155void KOPrefsDialog::setupLocaleTab() 165void KOPrefsDialog::setupLocaleTab()
156{ 166{
157 QFrame *topFrame = addPage(i18n("Locale"),0,0); 167 QFrame *topFrame = addPage(i18n("Locale"),0,0);
158 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 168 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
159 topLayout->setSpacing(spacingHint()); 169 topLayout->setSpacing(spacingHint());
160 topLayout->setMargin(marginHint()); 170 topLayout->setMargin(marginHint());
161 int iii = 0; 171 int iii = 0;
162 KPrefsDialogWidRadios *syncPrefsGroup = 172 KPrefsDialogWidRadios *syncPrefsGroup =
163 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); 173 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
164 syncPrefsGroup->addRadio(i18n("English")); 174 syncPrefsGroup->addRadio(i18n("English"));
165 syncPrefsGroup->addRadio(i18n("German")); 175 syncPrefsGroup->addRadio(i18n("German"));
166 syncPrefsGroup->addRadio(i18n("French")); 176 syncPrefsGroup->addRadio(i18n("French"));
167 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 177 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
168 if ( QApplication::desktop()->width() < 300 ) 178 if ( QApplication::desktop()->width() < 300 )
169 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 179 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
170 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 180 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
171 ++iii; 181 ++iii;
172 182
173 syncPrefsGroup = 183 syncPrefsGroup =
174 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); 184 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame);
175 if ( QApplication::desktop()->width() > 300 ) 185 if ( QApplication::desktop()->width() > 300 )
176 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 186 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
177 syncPrefsGroup->addRadio(i18n("24:00")); 187 syncPrefsGroup->addRadio(i18n("24:00"));
178 syncPrefsGroup->addRadio(i18n("12:00am")); 188 syncPrefsGroup->addRadio(i18n("12:00am"));
179 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 189 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
180 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 190 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
181 ++iii; 191 ++iii;
182 KPrefsDialogWidBool *sb; 192 KPrefsDialogWidBool *sb;
183 if ( QApplication::desktop()->width() < 300 ) { 193 if ( QApplication::desktop()->width() < 300 ) {
184 sb = 194 sb =
185 addWidBool(i18n("Week starts on Sunday"), 195 addWidBool(i18n("Week starts on Sunday"),
186 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); 196 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame);
187 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 197 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
188 ++iii; 198 ++iii;
189 sb = 199 sb =
190 addWidBool(i18n("Use short date in (WN/E) view"), 200 addWidBool(i18n("Use short date in (WN/E) view"),
191 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 201 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
192 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 202 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
193 } 203 }
194 else { 204 else {
195 QWidget * hb = new QWidget( topFrame ); 205 QWidget * hb = new QWidget( topFrame );
196 QHBoxLayout *hbLayout = new QHBoxLayout(hb); 206 QHBoxLayout *hbLayout = new QHBoxLayout(hb);
197 sb = 207 sb =
198 addWidBool(i18n("Week starts on Sunday"), 208 addWidBool(i18n("Week starts on Sunday"),
199 &(KOPrefs::instance()->mWeekStartsOnSunday),hb); 209 &(KOPrefs::instance()->mWeekStartsOnSunday),hb);
200 hbLayout->addWidget(sb->checkBox() ); 210 hbLayout->addWidget(sb->checkBox() );
201 sb = 211 sb =
202 addWidBool(i18n("Use short date in (WN/E) view"), 212 addWidBool(i18n("Use short date in (WN/E) view"),
203 &(KOPrefs::instance()->mShortDateInViewer),hb); 213 &(KOPrefs::instance()->mShortDateInViewer),hb);
204 hbLayout->addWidget(sb->checkBox() ); 214 hbLayout->addWidget(sb->checkBox() );
205 topLayout->addMultiCellWidget(hb, iii,iii,0,1); 215 topLayout->addMultiCellWidget(hb, iii,iii,0,1);
206 216
207 } 217 }
208 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION 218 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION
209#if 0 219#if 0
210 ++iii; 220 ++iii;
211 sb = 221 sb =
212 addWidBool(i18n("Quick load/save (w/o Unicode)"), 222 addWidBool(i18n("Quick load/save (w/o Unicode)"),
213 &(KOPrefs::instance()->mUseQuicksave),topFrame); 223 &(KOPrefs::instance()->mUseQuicksave),topFrame);
214 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 224 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
215#endif 225#endif
216} 226}
217void KOPrefsDialog::showSyncPage() 227void KOPrefsDialog::showSyncPage()
218{ 228{
219 showPage ( 2 ) ; 229 showPage ( 2 ) ;
220 230
221} 231}
222void KOPrefsDialog::setupSyncAlgTab() 232void KOPrefsDialog::setupSyncAlgTab()
223{ 233{
224#if 0 234#if 0
225 QLabel * lab; 235 QLabel * lab;
226 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); 236 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0);
227 mSetupSyncAlgTab = topFrame; 237 mSetupSyncAlgTab = topFrame;
228 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 238 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
@@ -1196,305 +1206,307 @@ void KOPrefsDialog::setupPrinterTab()
1196} 1206}
1197 1207
1198void KOPrefsDialog::setupGroupSchedulingTab() 1208void KOPrefsDialog::setupGroupSchedulingTab()
1199{ 1209{
1200#if 0 1210#if 0
1201 QFrame *topFrame = addPage(i18n("Group Scheduling"),0, 1211 QFrame *topFrame = addPage(i18n("Group Scheduling"),0,
1202 DesktopIcon("personal",KIcon::SizeMedium)); 1212 DesktopIcon("personal",KIcon::SizeMedium));
1203 1213
1204 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 1214 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
1205 topLayout->setSpacing(spacingHint()); 1215 topLayout->setSpacing(spacingHint());
1206 topLayout->setMargin(marginHint()); 1216 topLayout->setMargin(marginHint());
1207 1217
1208#if 0 1218#if 0
1209 KPrefsDialogWidRadios *schedulerGroup = 1219 KPrefsDialogWidRadios *schedulerGroup =
1210 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), 1220 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler),
1211 topFrame); 1221 topFrame);
1212 schedulerGroup->addRadio("Dummy"); // Only for debugging 1222 schedulerGroup->addRadio("Dummy"); // Only for debugging
1213 schedulerGroup->addRadio(i18n("Mail client")); 1223 schedulerGroup->addRadio(i18n("Mail client"));
1214 1224
1215 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); 1225 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1);
1216#endif 1226#endif
1217 1227
1218 KPrefsDialogWidRadios *sendGroup = 1228 KPrefsDialogWidRadios *sendGroup =
1219 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), 1229 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend),
1220 topFrame); 1230 topFrame);
1221 sendGroup->addRadio(i18n("Send to outbox")); 1231 sendGroup->addRadio(i18n("Send to outbox"));
1222 sendGroup->addRadio(i18n("Send directly")); 1232 sendGroup->addRadio(i18n("Send directly"));
1223 1233
1224 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); 1234 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1);
1225 1235
1226 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); 1236 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1);
1227 mAMails = new QListView(topFrame); 1237 mAMails = new QListView(topFrame);
1228 mAMails->addColumn(i18n("Email"),300); 1238 mAMails->addColumn(i18n("Email"),300);
1229 topLayout->addMultiCellWidget(mAMails,3,3,0,1); 1239 topLayout->addMultiCellWidget(mAMails,3,3,0,1);
1230 1240
1231 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); 1241 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0);
1232 aEmailsEdit = new QLineEdit(topFrame); 1242 aEmailsEdit = new QLineEdit(topFrame);
1233 aEmailsEdit->setEnabled(false); 1243 aEmailsEdit->setEnabled(false);
1234 topLayout->addWidget(aEmailsEdit,4,1); 1244 topLayout->addWidget(aEmailsEdit,4,1);
1235 1245
1236 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); 1246 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new");
1237 topLayout->addWidget(add,5,0); 1247 topLayout->addWidget(add,5,0);
1238 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); 1248 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove");
1239 topLayout->addWidget(del,5,1); 1249 topLayout->addWidget(del,5,1);
1240 1250
1241 //topLayout->setRowStretch(2,1); 1251 //topLayout->setRowStretch(2,1);
1242 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); 1252 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) );
1243 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); 1253 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) );
1244 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); 1254 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem()));
1245 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); 1255 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput()));
1246#endif 1256#endif
1247} 1257}
1248 1258
1249void KOPrefsDialog::setupGroupAutomationTab() 1259void KOPrefsDialog::setupGroupAutomationTab()
1250{ 1260{
1251 return; 1261 return;
1252 QFrame *topFrame = addPage(i18n("Group Automation"),0, 1262 QFrame *topFrame = addPage(i18n("Group Automation"),0,
1253 DesktopIcon("personal",KIcon::SizeMedium)); 1263 DesktopIcon("personal",KIcon::SizeMedium));
1254 1264
1255 QGridLayout *topLayout = new QGridLayout(topFrame,5,1); 1265 QGridLayout *topLayout = new QGridLayout(topFrame,5,1);
1256 topLayout->setSpacing(spacingHint()); 1266 topLayout->setSpacing(spacingHint());
1257 topLayout->setMargin(marginHint()); 1267 topLayout->setMargin(marginHint());
1258 1268
1259 KPrefsDialogWidRadios *autoRefreshGroup = 1269 KPrefsDialogWidRadios *autoRefreshGroup =
1260 addWidRadios(i18n("Auto Send Refresh"), 1270 addWidRadios(i18n("Auto Send Refresh"),
1261 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); 1271 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame);
1262 autoRefreshGroup->addRadio(i18n("Never")); 1272 autoRefreshGroup->addRadio(i18n("Never"));
1263 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); 1273 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook"));
1264 //autoRefreshGroup->addRadio(i18n("selected emails")); 1274 //autoRefreshGroup->addRadio(i18n("selected emails"));
1265 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); 1275 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0);
1266 1276
1267 KPrefsDialogWidRadios *autoInsertGroup = 1277 KPrefsDialogWidRadios *autoInsertGroup =
1268 addWidRadios(i18n("Auto Insert IMIP Replies"), 1278 addWidRadios(i18n("Auto Insert IMIP Replies"),
1269 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); 1279 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame);
1270 autoInsertGroup->addRadio(i18n("Never")); 1280 autoInsertGroup->addRadio(i18n("Never"));
1271 autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); 1281 autoInsertGroup->addRadio(i18n("If attendee is in addressbook"));
1272 //autoInsertGroup->addRadio(i18n("selected emails")); 1282 //autoInsertGroup->addRadio(i18n("selected emails"));
1273 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); 1283 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0);
1274 1284
1275 KPrefsDialogWidRadios *autoRequestGroup = 1285 KPrefsDialogWidRadios *autoRequestGroup =
1276 addWidRadios(i18n("Auto Insert IMIP Requests"), 1286 addWidRadios(i18n("Auto Insert IMIP Requests"),
1277 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); 1287 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame);
1278 autoRequestGroup->addRadio(i18n("Never")); 1288 autoRequestGroup->addRadio(i18n("Never"));
1279 autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); 1289 autoRequestGroup->addRadio(i18n("If organizer is in addressbook"));
1280 //autoInsertGroup->addRadio(i18n("selected emails")); 1290 //autoInsertGroup->addRadio(i18n("selected emails"));
1281 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); 1291 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0);
1282 1292
1283 KPrefsDialogWidRadios *autoFreeBusyGroup = 1293 KPrefsDialogWidRadios *autoFreeBusyGroup =
1284 addWidRadios(i18n("Auto Send FreeBusy Information"), 1294 addWidRadios(i18n("Auto Send FreeBusy Information"),
1285 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); 1295 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame);
1286 autoFreeBusyGroup->addRadio(i18n("Never")); 1296 autoFreeBusyGroup->addRadio(i18n("Never"));
1287 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); 1297 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook"));
1288 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1298 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1289 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); 1299 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0);
1290 1300
1291 KPrefsDialogWidRadios *autoFreeBusyReplyGroup = 1301 KPrefsDialogWidRadios *autoFreeBusyReplyGroup =
1292 addWidRadios(i18n("Auto Save FreeBusy Replies"), 1302 addWidRadios(i18n("Auto Save FreeBusy Replies"),
1293 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); 1303 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame);
1294 autoFreeBusyReplyGroup->addRadio(i18n("Never")); 1304 autoFreeBusyReplyGroup->addRadio(i18n("Never"));
1295 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); 1305 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook"));
1296 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1306 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1297 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); 1307 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0);
1298} 1308}
1299 1309
1300void KOPrefsDialog::showPrinterTab() 1310void KOPrefsDialog::showPrinterTab()
1301{ 1311{
1302 showPage(pageIndex(mPrinterTab)); 1312 showPage(pageIndex(mPrinterTab));
1303} 1313}
1304 1314
1305 1315
1306void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, 1316void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
1307 const QStringList *tags) 1317 const QStringList *tags)
1308{ 1318{
1309 if (tags) { 1319 if (tags) {
1310 int i = tags->findIndex(text); 1320 int i = tags->findIndex(text);
1311 if (i > 0) combo->setCurrentItem(i); 1321 if (i > 0) combo->setCurrentItem(i);
1312 } else { 1322 } else {
1313 for(int i=0;i<combo->count();++i) { 1323 for(int i=0;i<combo->count();++i) {
1314 if (combo->text(i) == text) { 1324 if (combo->text(i) == text) {
1315 combo->setCurrentItem(i); 1325 combo->setCurrentItem(i);
1316 break; 1326 break;
1317 } 1327 }
1318 } 1328 }
1319 } 1329 }
1320} 1330}
1321 1331
1322void KOPrefsDialog::usrReadConfig() 1332void KOPrefsDialog::usrReadConfig()
1323{ 1333{
1334 kdelibcfg->readConfig();
1324 mNameEdit->setText(KOPrefs::instance()->fullName()); 1335 mNameEdit->setText(KOPrefs::instance()->fullName());
1325 mEmailEdit->setText(KOPrefs::instance()->email()); 1336 mEmailEdit->setText(KOPrefs::instance()->email());
1326 1337
1327 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); 1338 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
1328 QDate current ( 2001, 1,1); 1339 QDate current ( 2001, 1,1);
1329 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); 1340 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
1330 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); 1341 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
1331 setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId)); 1342 setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId));
1332 //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); 1343 //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
1333 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); 1344 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
1334 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); 1345 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
1335 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); 1346 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
1336 // if (KOPrefs::instance()->mAllDaySize > 47 ) 1347 // if (KOPrefs::instance()->mAllDaySize > 47 )
1337 // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2; 1348 // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2;
1338 //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize); 1349 //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize);
1339 1350
1340 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); 1351 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays);
1341 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); 1352 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays);
1342 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); 1353 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios);
1343 // mAMails->clear(); 1354 // mAMails->clear();
1344 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); 1355 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin();
1345// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { 1356// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) {
1346// QListViewItem *item = new QListViewItem(mAMails); 1357// QListViewItem *item = new QListViewItem(mAMails);
1347// item->setText(0,*it); 1358// item->setText(0,*it);
1348// mAMails->insertItem(item); 1359// mAMails->insertItem(item);
1349// } 1360// }
1350 1361
1351 // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP); 1362 // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP);
1352 //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser); 1363 //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser);
1353 //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd); 1364 //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd);
1354 //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile); 1365 //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile);
1355 1366
1356 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); 1367 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
1357 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); 1368 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
1358 QString dummy = KOPrefs::instance()->mUserDateFormatLong; 1369 QString dummy = KOPrefs::instance()->mUserDateFormatLong;
1359 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); 1370 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
1360 dummy = KOPrefs::instance()->mUserDateFormatShort; 1371 dummy = KOPrefs::instance()->mUserDateFormatShort;
1361 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); 1372 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
1362 updateCategories(); 1373 updateCategories();
1363 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); 1374 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
1364 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); 1375 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
1365 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); 1376 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
1366 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); 1377 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
1367} 1378}
1368 1379
1369 1380
1370void KOPrefsDialog::usrWriteConfig() 1381void KOPrefsDialog::usrWriteConfig()
1371{ 1382{
1372 1383
1384 kdelibcfg->writeConfig();
1373 // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text(); 1385 // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text();
1374 //KOPrefs::instance()->mRemoteUser = mRemoteUser->text(); 1386 //KOPrefs::instance()->mRemoteUser = mRemoteUser->text();
1375 //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text(); 1387 //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text();
1376 //KOPrefs::instance()->mRemoteFile= mRemoteFile->text(); 1388 //KOPrefs::instance()->mRemoteFile= mRemoteFile->text();
1377 //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text(); 1389 //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text();
1378 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); 1390 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
1379 1391
1380 KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); 1392 KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
1381 KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); 1393 KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
1382 KOPrefs::instance()->setFullName(mNameEdit->text()); 1394 KOPrefs::instance()->setFullName(mNameEdit->text());
1383 KOPrefs::instance()->setEmail(mEmailEdit->text()); 1395 KOPrefs::instance()->setEmail(mEmailEdit->text());
1384 1396
1385 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); 1397 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
1386 1398
1387 KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText(); 1399 KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText();
1388 QDate date; 1400 QDate date;
1389 date = mStartDateSavingEdit->date(); 1401 date = mStartDateSavingEdit->date();
1390 int sub = 0; 1402 int sub = 0;
1391 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 1403 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
1392 sub = 1; 1404 sub = 1;
1393 KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub; 1405 KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub;
1394 date = mEndDateSavingEdit->date(); 1406 date = mEndDateSavingEdit->date();
1395 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 1407 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
1396 sub = 1; 1408 sub = 1;
1397 else 1409 else
1398 sub = 0; 1410 sub = 0;
1399 KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub; 1411 KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub;
1400 // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value(); 1412 // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value();
1401 1413
1402 KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); 1414 KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
1403 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); 1415 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
1404 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); 1416 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
1405 1417
1406 //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value(); 1418 //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value();
1407 1419
1408 QDictIterator<QColor> it(mCategoryDict); 1420 QDictIterator<QColor> it(mCategoryDict);
1409 while (it.current()) { 1421 while (it.current()) {
1410 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); 1422 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
1411 ++it; 1423 ++it;
1412 } 1424 }
1413 1425
1414 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); 1426 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
1415 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); 1427 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
1416 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); 1428 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
1417 1429
1418 KOPrefs::instance()->mAdditionalMails.clear(); 1430 KOPrefs::instance()->mAdditionalMails.clear();
1419 // QListViewItem *item; 1431 // QListViewItem *item;
1420 // item = mAMails->firstChild(); 1432 // item = mAMails->firstChild();
1421 // while (item) 1433 // while (item)
1422 // { 1434 // {
1423 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); 1435 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
1424 // item = item->nextSibling(); 1436 // item = item->nextSibling();
1425 // } 1437 // }
1426 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); 1438 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
1427 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; 1439 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
1428 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; 1440 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
1429 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; 1441 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
1430 1442
1431} 1443}
1432 1444
1433void KOPrefsDialog::updateCategories() 1445void KOPrefsDialog::updateCategories()
1434{ 1446{
1435 mCategoryCombo->clear(); 1447 mCategoryCombo->clear();
1436 mCategoryDict.clear(); 1448 mCategoryDict.clear();
1437 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1449 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1438 updateCategoryColor(); 1450 updateCategoryColor();
1439} 1451}
1440 1452
1441void KOPrefsDialog::warningGroupScheduling() 1453void KOPrefsDialog::warningGroupScheduling()
1442{ 1454{
1443 warningExperimental(mEnableGroupScheduling->checkBox()->isChecked()); 1455 warningExperimental(mEnableGroupScheduling->checkBox()->isChecked());
1444} 1456}
1445 1457
1446void KOPrefsDialog::warningProjectView() 1458void KOPrefsDialog::warningProjectView()
1447{ 1459{
1448 warningExperimental(mEnableProjectView->checkBox()->isChecked()); 1460 warningExperimental(mEnableProjectView->checkBox()->isChecked());
1449} 1461}
1450 1462
1451void KOPrefsDialog::warningExperimental(bool on) 1463void KOPrefsDialog::warningExperimental(bool on)
1452{ 1464{
1453 if (on) { 1465 if (on) {
1454 KMessageBox::information(this,i18n("This is an experimental feature. " 1466 KMessageBox::information(this,i18n("This is an experimental feature. "
1455 "It may not work, it may do nothing useful and it may cause data loss. " 1467 "It may not work, it may do nothing useful and it may cause data loss. "
1456 "Use with care.\n" 1468 "Use with care.\n"
1457 "You have to restart KOrganizer for this setting to take effect.")); 1469 "You have to restart KOrganizer for this setting to take effect."));
1458 } else { 1470 } else {
1459 KMessageBox::information(this, 1471 KMessageBox::information(this,
1460 i18n("You have to restart KOrganizer for this setting to take effect.")); 1472 i18n("You have to restart KOrganizer for this setting to take effect."));
1461 } 1473 }
1462} 1474}
1463 1475
1464void KOPrefsDialog::toggleEmailSettings(bool on) 1476void KOPrefsDialog::toggleEmailSettings(bool on)
1465{ 1477{
1466 if (on) { 1478 if (on) {
1467 mEmailEdit->setEnabled(false); 1479 mEmailEdit->setEnabled(false);
1468 mNameEdit->setEnabled(false); 1480 mNameEdit->setEnabled(false);
1469 mEmailLabel->setEnabled(false); 1481 mEmailLabel->setEnabled(false);
1470 mNameLabel->setEnabled(false); 1482 mNameLabel->setEnabled(false);
1471 1483
1472 KEMailSettings settings; 1484 KEMailSettings settings;
1473 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); 1485 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName));
1474 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); 1486 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress));
1475 } else { 1487 } else {
1476 mEmailEdit->setEnabled(true); 1488 mEmailEdit->setEnabled(true);
1477 mNameEdit->setEnabled(true); 1489 mNameEdit->setEnabled(true);
1478 mEmailLabel->setEnabled(true); 1490 mEmailLabel->setEnabled(true);
1479 mNameLabel->setEnabled(true); 1491 mNameLabel->setEnabled(true);
1480 } 1492 }
1481} 1493}
1482 1494
1483void KOPrefsDialog::addItem() 1495void KOPrefsDialog::addItem()
1484{ 1496{
1485 // aEmailsEdit->setEnabled(true); 1497 // aEmailsEdit->setEnabled(true);
1486// QListViewItem *item = new QListViewItem(mAMails); 1498// QListViewItem *item = new QListViewItem(mAMails);
1487// mAMails->insertItem(item); 1499// mAMails->insertItem(item);
1488// mAMails->setSelected(item,true); 1500// mAMails->setSelected(item,true);
1489// aEmailsEdit->setText(i18n("(EmptyEmail)")); 1501// aEmailsEdit->setText(i18n("(EmptyEmail)"));
1490} 1502}
1491 1503
1492void KOPrefsDialog::removeItem() 1504void KOPrefsDialog::removeItem()
1493{ 1505{
1494// QListViewItem *item; 1506// QListViewItem *item;
1495// item = mAMails->selectedItem(); 1507// item = mAMails->selectedItem();
1496// if (!item) return; 1508// if (!item) return;
1497// mAMails->takeItem(item); 1509// mAMails->takeItem(item);
1498// item = mAMails->selectedItem(); 1510// item = mAMails->selectedItem();
1499// if (!item) { 1511// if (!item) {
1500// aEmailsEdit->setText(""); 1512// aEmailsEdit->setText("");
diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h
index 83dc1eb..e20969a 100644
--- a/korganizer/koprefsdialog.h
+++ b/korganizer/koprefsdialog.h
@@ -1,161 +1,164 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KOPREFSDIALOG_H 23#ifndef _KOPREFSDIALOG_H
24#define _KOPREFSDIALOG_H 24#define _KOPREFSDIALOG_H
25 25
26#include <qframe.h> 26#include <qframe.h>
27#include <qdict.h> 27#include <qdict.h>
28#include <qcolor.h> 28#include <qcolor.h>
29#include <qlistview.h> 29#include <qlistview.h>
30 30
31#include <kdialogbase.h> 31#include <kdialogbase.h>
32 32
33#include <libkdepim/kprefsdialog.h> 33#include <libkdepim/kprefsdialog.h>
34#include <libkdepim/kdateedit.h> 34#include <libkdepim/kdateedit.h>
35#include <kcmconfigs/kdepimconfigwidget.h>
35 36
36class KColorButton; 37class KColorButton;
37class QSpinBox; 38class QSpinBox;
38class QSlider; 39class QSlider;
39class KURLRequester; 40class KURLRequester;
40class QComboBox; 41class QComboBox;
41class QLineEdit; 42class QLineEdit;
42class QStringList; 43class QStringList;
43 44
44/** Dialog to change the korganizer configuration. 45/** Dialog to change the korganizer configuration.
45 */ 46 */
46class KOPrefsDialog : public KPrefsDialog 47class KOPrefsDialog : public KPrefsDialog
47{ 48{
48 Q_OBJECT 49 Q_OBJECT
49 public: 50 public:
50 /** Initialize dialog and pages */ 51 /** Initialize dialog and pages */
51 KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); 52 KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false);
52 ~KOPrefsDialog(); 53 ~KOPrefsDialog();
53 54
54 public slots: 55 public slots:
55 void showPrinterTab(); 56 void showPrinterTab();
56 57
57 /** Update controls for categories */ 58 /** Update controls for categories */
58 void updateCategories(); 59 void updateCategories();
59 void showSyncPage(); 60 void showSyncPage();
60 protected slots: 61 protected slots:
61 void selectSoundFile(); 62 void selectSoundFile();
62 void setCategoryColor(); 63 void setCategoryColor();
63 void updateCategoryColor(); 64 void updateCategoryColor();
64 void updateTimezoneOffset( int ); 65 void updateTimezoneOffset( int );
65 66
66 67
67 void warningExperimental(bool on); 68 void warningExperimental(bool on);
68 void warningGroupScheduling(); 69 void warningGroupScheduling();
69 void warningProjectView(); 70 void warningProjectView();
70 71
71 void toggleEmailSettings(bool); 72 void toggleEmailSettings(bool);
72 73
73 //additional emails 74 //additional emails
74 void addItem(); 75 void addItem();
75 void removeItem(); 76 void removeItem();
76 void updateItem(); 77 void updateItem();
77 void updateInput(); 78 void updateInput();
78 79
79 protected: 80 protected:
80 void usrReadConfig(); 81 void usrReadConfig();
81 void usrWriteConfig(); 82 void usrWriteConfig();
83 void setupGlobalTab();
82 84
83 void setupMainTab(); 85 void setupMainTab();
84 void setupTimeTab(); 86 void setupTimeTab();
85 void setupTimeZoneTab(); 87 void setupTimeZoneTab();
86 void setupLocaleTab(); 88 void setupLocaleTab();
87 void setupLocaleDateTab(); 89 void setupLocaleDateTab();
88 void setupFontsTab(); 90 void setupFontsTab();
89 void setupColorsTab(); 91 void setupColorsTab();
90 void setupViewsTab(); 92 void setupViewsTab();
91 void setupDisplayTab(); 93 void setupDisplayTab();
92 void setupPrinterTab(); 94 void setupPrinterTab();
93 void setupGroupSchedulingTab(); 95 void setupGroupSchedulingTab();
94 void setupGroupAutomationTab(); 96 void setupGroupAutomationTab();
95 void setupSyncTab(); 97 void setupSyncTab();
96 void setupSyncAlgTab(); 98 void setupSyncAlgTab();
97 99
98 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); 100 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0);
99 101
100 102
101 private: 103 private:
104 KDEPIMConfigWidget* kdelibcfg;
102 KPrefsDialogWidBool *mEnableGroupScheduling; 105 KPrefsDialogWidBool *mEnableGroupScheduling;
103 KPrefsDialogWidBool *mEnableProjectView; 106 KPrefsDialogWidBool *mEnableProjectView;
104 107
105 QFrame *mPrinterTab; 108 QFrame *mPrinterTab;
106 109
107 QLineEdit *nameEdit; 110 QLineEdit *nameEdit;
108 QLineEdit *emailEdit; 111 QLineEdit *emailEdit;
109 112
110 QComboBox *timeCombo; 113 QComboBox *timeCombo;
111 QComboBox *tzCombo; 114 QComboBox *tzCombo;
112 115
113 // widgets holding preferences data 116 // widgets holding preferences data
114 QLineEdit *mNameEdit; 117 QLineEdit *mNameEdit;
115 QLineEdit *mEmailEdit; 118 QLineEdit *mEmailEdit;
116 QLabel *mNameLabel; 119 QLabel *mNameLabel;
117 QLabel *mEmailLabel; 120 QLabel *mEmailLabel;
118 QLineEdit *mAdditionalEdit; 121 QLineEdit *mAdditionalEdit;
119 QSpinBox *mAutoSaveIntervalSpin; 122 QSpinBox *mAutoSaveIntervalSpin;
120 QSpinBox *mPrioSpin; 123 QSpinBox *mPrioSpin;
121 // QListView *mAMails; 124 // QListView *mAMails;
122 QLineEdit *aEmailsEdit; 125 QLineEdit *aEmailsEdit;
123 126
124 QComboBox *mTimeZoneCombo; 127 QComboBox *mTimeZoneCombo;
125 QStringList tzonenames; 128 QStringList tzonenames;
126 QSpinBox *mStartTimeSpin; 129 QSpinBox *mStartTimeSpin;
127 QSpinBox *mDefaultDurationSpin; 130 QSpinBox *mDefaultDurationSpin;
128 QComboBox *mAlarmTimeCombo; 131 QComboBox *mAlarmTimeCombo;
129 132
130 QComboBox *mCategoryCombo; 133 QComboBox *mCategoryCombo;
131 KColorButton *mCategoryButton; 134 KColorButton *mCategoryButton;
132 QDict<QColor> mCategoryDict; 135 QDict<QColor> mCategoryDict;
133 136
134 QSlider *mHourSizeSlider; 137 QSlider *mHourSizeSlider;
135 138
136 QSpinBox *mNextXDaysSpin; 139 QSpinBox *mNextXDaysSpin;
137 QSpinBox *mWhatsNextSpin; 140 QSpinBox *mWhatsNextSpin;
138 141
139 QLineEdit * mRemoteIPEdit; 142 QLineEdit * mRemoteIPEdit;
140 QLineEdit * mRemoteUser; 143 QLineEdit * mRemoteUser;
141 QLineEdit * mRemotePassWd; 144 QLineEdit * mRemotePassWd;
142 QLineEdit * mRemoteFile; 145 QLineEdit * mRemoteFile;
143 QLineEdit * mLocalTempFile; 146 QLineEdit * mLocalTempFile;
144 QWidget* mSetupSyncAlgTab; 147 QWidget* mSetupSyncAlgTab;
145 QLineEdit * mUserDateFormatLong; 148 QLineEdit * mUserDateFormatLong;
146 QLineEdit * mUserDateFormatShort; 149 QLineEdit * mUserDateFormatShort;
147 150
148 QSpinBox *mTimezoneOffsetSpin; 151 QSpinBox *mTimezoneOffsetSpin;
149 QSpinBox *mDaylightsavingStart; 152 QSpinBox *mDaylightsavingStart;
150 QSpinBox *mDaylightsavingEnd; 153 QSpinBox *mDaylightsavingEnd;
151 KDateEdit* mStartDateSavingEdit; 154 KDateEdit* mStartDateSavingEdit;
152 KDateEdit* mEndDateSavingEdit; 155 KDateEdit* mEndDateSavingEdit;
153 QSpinBox * mAlarmPlayBeeps; 156 QSpinBox * mAlarmPlayBeeps;
154 QSpinBox * mAlarmSuspendTime; 157 QSpinBox * mAlarmSuspendTime;
155 QSpinBox * mAlarmSuspendCount; 158 QSpinBox * mAlarmSuspendCount;
156 QSpinBox * mAlarmBeepInterval; 159 QSpinBox * mAlarmBeepInterval;
157 160
158 QLineEdit * mDefaultAlarmFile; 161 QLineEdit * mDefaultAlarmFile;
159}; 162};
160 163
161#endif 164#endif