summaryrefslogtreecommitdiffabout
path: root/kmicromail
authorzautrix <zautrix>2005-01-28 03:22:17 (UTC)
committer zautrix <zautrix>2005-01-28 03:22:17 (UTC)
commit94f0e8140c07696174dc3774dc2c11efad2ffa68 (patch) (unidiff)
treed95cc80e5c5221e8d9ce1cbf4b01cbf78fdf843a /kmicromail
parent6fb044008531ec883fc25a3ef2b43904930cfff6 (diff)
downloadkdepimpi-94f0e8140c07696174dc3774dc2c11efad2ffa68.zip
kdepimpi-94f0e8140c07696174dc3774dc2c11efad2ffa68.tar.gz
kdepimpi-94f0e8140c07696174dc3774dc2c11efad2ffa68.tar.bz2
missing config
Diffstat (limited to 'kmicromail') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/koprefs.cpp5
-rw-r--r--kmicromail/koprefs.h1
-rw-r--r--kmicromail/koprefsdialog.cpp19
-rw-r--r--kmicromail/mainwindow.cpp64
-rw-r--r--kmicromail/opiemail.cpp3
5 files changed, 68 insertions, 24 deletions
diff --git a/kmicromail/koprefs.cpp b/kmicromail/koprefs.cpp
index 2bae5f6..7b1e169 100644
--- a/kmicromail/koprefs.cpp
+++ b/kmicromail/koprefs.cpp
@@ -1,126 +1,129 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 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 <time.h> 24#include <time.h>
25#ifndef _WIN32_ 25#ifndef _WIN32_
26#include <unistd.h> 26#include <unistd.h>
27#endif 27#endif
28#include <qdir.h> 28#include <qdir.h>
29#include <qtextstream.h> 29#include <qtextstream.h>
30#include <qtextcodec.h> 30#include <qtextcodec.h>
31#include <qstring.h> 31#include <qstring.h>
32#include <qregexp.h> 32#include <qregexp.h>
33#include <qfont.h> 33#include <qfont.h>
34#include <qcolor.h> 34#include <qcolor.h>
35#include <qstringlist.h> 35#include <qstringlist.h>
36#include <stdlib.h> 36#include <stdlib.h>
37 37
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kconfig.h> 39#include <kconfig.h>
40#include <klocale.h> 40#include <klocale.h>
41#include <kdebug.h> 41#include <kdebug.h>
42#include <kemailsettings.h> 42#include <kemailsettings.h>
43#include <kstaticdeleter.h> 43#include <kstaticdeleter.h>
44 44
45#include "koprefs.h" 45#include "koprefs.h"
46#include "mainwindow.h" 46#include "mainwindow.h"
47 47
48 48
49KOPrefs *KOPrefs::mInstance = 0; 49KOPrefs *KOPrefs::mInstance = 0;
50static KStaticDeleter<KOPrefs> insd; 50static KStaticDeleter<KOPrefs> insd;
51 51
52KOPrefs::KOPrefs() : 52KOPrefs::KOPrefs() :
53 KPimPrefs("kopiemailrc") 53 KPimPrefs("kopiemailrc")
54{ 54{
55 mAppFont = QFont("helvetica",12); 55 mAppFont = QFont("helvetica",12);
56 mComposeFont = QFont("helvetica",12); 56 mComposeFont = QFont("helvetica",12);
57 mReadFont = QFont("helvetica",12); 57 mReadFont = QFont("helvetica",12);
58 58
59 KPrefs::setCurrentGroup("General"); 59 KPrefs::setCurrentGroup("General");
60 addItemString("SendCodec",&mSendCodec,i18n ("userdefined") ); 60 addItemString("SendCodec",&mSendCodec,i18n ("userdefined") );
61 addItemString("SenderName",&mName,i18n ("Please set at") ); 61 addItemString("SenderName",&mName,i18n ("Please set at") );
62 addItemString("SenderEmail",&mEmail,i18n ("Settings@General TAB") ); 62 addItemString("SenderEmail",&mEmail,i18n ("Settings@General TAB") );
63 addItemBool("ViewMailAsHtml",&mViewAsHtml,false); 63 addItemBool("ViewMailAsHtml",&mViewAsHtml,false);
64 addItemBool("SendMailLater",&mSendLater,true); 64 addItemBool("SendMailLater",&mSendLater,true);
65 addItemBool("ShowToField",&mShowToField,false); 65 addItemBool("ShowToField",&mShowToField,false);
66 addItemBool("UseKapi",&mUseKapi,false); 66 addItemBool("UseKapi",&mUseKapi,false);
67 addItemInt("CurrentCodec",&mCurrentCodec,0); 67 addItemInt("CurrentCodec",&mCurrentCodec,0);
68 68 addItemBool("ShowInfoSub",&mShowInfoSub,true);
69 addItemBool("ShowInfoFrom",&mShowInfoFrom,true);
70 addItemBool("ShowInfoTo",&mShowInfoTo,true);
71 addItemBool("ShowInfoStart",&mShowInfoStart,true);
69 KPrefs::setCurrentGroup("Fonts"); 72 KPrefs::setCurrentGroup("Fonts");
70 addItemFont("Application Font",&mAppFont); 73 addItemFont("Application Font",&mAppFont);
71 addItemFont("Compose Font",&mComposeFont); 74 addItemFont("Compose Font",&mComposeFont);
72 addItemFont("Read Font",&mReadFont); 75 addItemFont("Read Font",&mReadFont);
73 fillMailDefaults(); 76 fillMailDefaults();
74 isDirty = false; 77 isDirty = false;
75} 78}
76 79
77 80
78KOPrefs::~KOPrefs() 81KOPrefs::~KOPrefs()
79{ 82{
80 if ( isDirty ) 83 if ( isDirty )
81 writeConfig(); 84 writeConfig();
82 if (mInstance == this) 85 if (mInstance == this)
83 mInstance = insd.setObject(0); 86 mInstance = insd.setObject(0);
84 87
85} 88}
86 89
87 90
88KOPrefs *KOPrefs::instance() 91KOPrefs *KOPrefs::instance()
89{ 92{
90 if (!mInstance) { 93 if (!mInstance) {
91 mInstance = insd.setObject(new KOPrefs()); 94 mInstance = insd.setObject(new KOPrefs());
92 mInstance->readConfig(); 95 mInstance->readConfig();
93 } 96 }
94 97
95 return mInstance; 98 return mInstance;
96} 99}
97 100
98void KOPrefs::usrSetDefaults() 101void KOPrefs::usrSetDefaults()
99{ 102{
100 103
101} 104}
102 105
103void KOPrefs::fillMailDefaults() 106void KOPrefs::fillMailDefaults()
104{ 107{
105 if (mName.isEmpty()) mName = i18n ("Please set at"); 108 if (mName.isEmpty()) mName = i18n ("Please set at");
106 if (mEmail.isEmpty()) mEmail = i18n ("Settings@General TAB"); 109 if (mEmail.isEmpty()) mEmail = i18n ("Settings@General TAB");
107} 110}
108 111
109void KOPrefs::usrReadConfig() 112void KOPrefs::usrReadConfig()
110{ 113{
111 114
112 KPimPrefs::usrReadConfig(); 115 KPimPrefs::usrReadConfig();
113} 116}
114 117
115 118
116void KOPrefs::usrWriteConfig() 119void KOPrefs::usrWriteConfig()
117{ 120{
118 KPimPrefs::usrWriteConfig(); 121 KPimPrefs::usrWriteConfig();
119} 122}
120 123
121 124
122 125
123KConfig* KOPrefs::getConfig() 126KConfig* KOPrefs::getConfig()
124{ 127{
125 return config(); 128 return config();
126} 129}
diff --git a/kmicromail/koprefs.h b/kmicromail/koprefs.h
index f2c4fbb..f2501e3 100644
--- a/kmicromail/koprefs.h
+++ b/kmicromail/koprefs.h
@@ -1,80 +1,81 @@
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 KOPREFS_H 23#ifndef KOPREFS_H
24#define KOPREFS_H 24#define KOPREFS_H
25 25
26 26
27#include <libkdepim/kpimprefs.h> 27#include <libkdepim/kpimprefs.h>
28 28
29class KConfig; 29class KConfig;
30class QFont; 30class QFont;
31class QColor; 31class QColor;
32class QStringList; 32class QStringList;
33 33
34class KOPrefs : public KPimPrefs 34class KOPrefs : public KPimPrefs
35{ 35{
36 public: 36 public:
37 virtual ~KOPrefs(); 37 virtual ~KOPrefs();
38 38
39 /** Get instance of KOPrefs. It is made sure that there is only one 39 /** Get instance of KOPrefs. It is made sure that there is only one
40 instance. */ 40 instance. */
41 static KOPrefs *instance(); 41 static KOPrefs *instance();
42 42
43 /** Set preferences to default values */ 43 /** Set preferences to default values */
44 void usrSetDefaults(); 44 void usrSetDefaults();
45 45
46 /** Read preferences from config file */ 46 /** Read preferences from config file */
47 void usrReadConfig(); 47 void usrReadConfig();
48 48
49 /** Write preferences to config file */ 49 /** Write preferences to config file */
50 void usrWriteConfig(); 50 void usrWriteConfig();
51 void setCategoryDefaults(){;}; 51 void setCategoryDefaults(){;};
52 52
53 protected: 53 protected:
54 54
55 /** Fill empty mail fields with default values. */ 55 /** Fill empty mail fields with default values. */
56 void fillMailDefaults(); 56 void fillMailDefaults();
57 57
58 private: 58 private:
59 /** Constructor disabled for public. Use instance() to create a KOPrefs 59 /** Constructor disabled for public. Use instance() to create a KOPrefs
60 object. */ 60 object. */
61 KOPrefs(); 61 KOPrefs();
62 62
63 static KOPrefs *mInstance; 63 static KOPrefs *mInstance;
64 public: 64 public:
65 // preferences data 65 // preferences data
66 KConfig* getConfig(); 66 KConfig* getConfig();
67 QFont mAppFont; 67 QFont mAppFont;
68 QFont mComposeFont; 68 QFont mComposeFont;
69 QFont mReadFont; 69 QFont mReadFont;
70 QString mName; 70 QString mName;
71 QString mSendCodec; 71 QString mSendCodec;
72 QString mEmail; 72 QString mEmail;
73 QString mCurrentCodeName; 73 QString mCurrentCodeName;
74 int mCurrentCodec; 74 int mCurrentCodec;
75 bool mSendLater, mViewAsHtml, mUseKapi, isDirty, mShowToField; 75 bool mSendLater, mViewAsHtml, mUseKapi, isDirty, mShowToField;
76 bool mShowInfoSub, mShowInfoFrom, mShowInfoTo, mShowInfoStart;
76 private: 77 private:
77 78
78}; 79};
79 80
80#endif 81#endif
diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp
index 5c8a5a9..4af4a8c 100644
--- a/kmicromail/koprefsdialog.cpp
+++ b/kmicromail/koprefsdialog.cpp
@@ -1,1176 +1,1195 @@
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#include <kdialog.h> 23#include <kdialog.h>
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 <klineedit.h> 57#include <klineedit.h>
58 58
59 59
60#include "koprefs.h" 60#include "koprefs.h"
61 61
62#include "koprefsdialog.h" 62#include "koprefsdialog.h"
63//#include <kprefswidget.h> 63//#include <kprefswidget.h>
64 64
65 65
66KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : 66KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
67 KPrefsDialog(KOPrefs::instance(),parent,name,true) 67 KPrefsDialog(KOPrefs::instance(),parent,name,true)
68{ 68{
69 69
70 setCaption( i18n("Settings - some need a restart (nr)")); 70 setCaption( i18n("Settings - some need a restart (nr)"));
71 setupGlobalTab(); 71 setupGlobalTab();
72 setupMainTab(); 72 setupMainTab();
73 setupMailTab();; 73 setupMailTab();;
74 setupFontsTab(); 74 setupFontsTab();
75 readConfig(); 75 readConfig();
76 76
77#if 0 77#if 0
78 78
79 setupMainTab(); 79 setupMainTab();
80 setupLocaleTab(); 80 setupLocaleTab();
81 setupTimeZoneTab(); 81 setupTimeZoneTab();
82 setupTimeTab(); 82 setupTimeTab();
83 setupLocaleDateTab(); 83 setupLocaleDateTab();
84 setupFontsTab(); 84 setupFontsTab();
85 setupColorsTab(); 85 setupColorsTab();
86 setupViewsTab(); 86 setupViewsTab();
87 //setupSyncTab(); 87 //setupSyncTab();
88 //setupSyncAlgTab(); 88 //setupSyncAlgTab();
89 //setupPrinterTab(); 89 //setupPrinterTab();
90 //setupGroupSchedulingTab(); 90 //setupGroupSchedulingTab();
91 //setupGroupAutomationTab(); 91 //setupGroupAutomationTab();
92#endif 92#endif
93} 93}
94 94
95#include "kpimglobalprefs.h" 95#include "kpimglobalprefs.h"
96 96
97KOPrefsDialog::~KOPrefsDialog() 97KOPrefsDialog::~KOPrefsDialog()
98{ 98{
99} 99}
100void KOPrefsDialog::setupGlobalTab() 100void KOPrefsDialog::setupGlobalTab()
101{ 101{
102 QFrame *topFrame = addPage(i18n("Global"),0,0); 102 QFrame *topFrame = addPage(i18n("Global"),0,0);
103 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); 103 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" );
104 QVBoxLayout *topLayout = new QVBoxLayout(topFrame); 104 QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
105 topLayout->addWidget( kdelibcfg ); 105 topLayout->addWidget( kdelibcfg );
106 106
107 107
108} 108}
109void KOPrefsDialog::setupMainTab() 109void KOPrefsDialog::setupMainTab()
110{ 110{
111 QFrame *topFrame = addPage(i18n("General"),0,0); 111 QFrame *topFrame = addPage(i18n("General"),0,0);
112 112
113 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 113 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
114 topLayout->setSpacing(spacingHint()); 114 topLayout->setSpacing(spacingHint());
115 topLayout->setMargin(marginHint()); 115 topLayout->setMargin(marginHint());
116 116
117 117
118 mNameEdit = new QLineEdit(topFrame); 118 mNameEdit = new QLineEdit(topFrame);
119 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 119 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
120 topLayout->addWidget(mNameLabel,0,0); 120 topLayout->addWidget(mNameLabel,0,0);
121 topLayout->addWidget(mNameEdit,0,1); 121 topLayout->addWidget(mNameEdit,0,1);
122 122
123 mEmailEdit = new QLineEdit(topFrame); 123 mEmailEdit = new QLineEdit(topFrame);
124 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 124 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
125 topLayout->addWidget(mEmailLabel,1,0); 125 topLayout->addWidget(mEmailLabel,1,0);
126 topLayout->addWidget(mEmailEdit,1,1); 126 topLayout->addWidget(mEmailEdit,1,1);
127 QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); 127 QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame);
128 topLayout->addMultiCellWidget(lab,2,2,0,1); 128 topLayout->addMultiCellWidget(lab,2,2,0,1);
129 KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), 129 KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"),
130 &(KOPrefs::instance()->mUseKapi),topFrame); 130 &(KOPrefs::instance()->mUseKapi),topFrame);
131 topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); 131 topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1);
132} 132}
133 133
134void KOPrefsDialog::setupMailTab() 134void KOPrefsDialog::setupMailTab()
135{ 135{
136 QFrame *topFrame = addPage(i18n("Mail"),0,0); 136 QFrame *topFrame = addPage(i18n("Mail"),0,0);
137 137
138 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 138 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
139 topLayout->setSpacing(spacingHint()); 139 topLayout->setSpacing(spacingHint());
140 topLayout->setMargin(marginHint()); 140 topLayout->setMargin(marginHint());
141 141
142 KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), 142 KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"),
143 &(KOPrefs::instance()->mViewAsHtml),topFrame); 143 &(KOPrefs::instance()->mViewAsHtml),topFrame);
144 topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); 144 topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1);
145 145
146 146
147 ttt = addWidBool(i18n("Send mails later"), 147 ttt = addWidBool(i18n("Send mails later"),
148 &(KOPrefs::instance()->mSendLater),topFrame); 148 &(KOPrefs::instance()->mSendLater),topFrame);
149 topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); 149 topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1);
150 ttt = addWidBool(i18n("Show \"To\" field in list view"), 150 ttt = addWidBool(i18n("Show \"To\" field in list view"),
151 &(KOPrefs::instance()->mShowToField),topFrame); 151 &(KOPrefs::instance()->mShowToField),topFrame);
152 topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1); 152 topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1);
153
154 int iii =3;
155 ttt = addWidBool(i18n("Show info fields at startup"),
156 &(KOPrefs::instance()->mShowInfoStart),topFrame);
157 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1);
158 ++iii;
159 ttt = addWidBool(i18n("Show \"Subject\" info field"),
160 &(KOPrefs::instance()->mShowInfoSub),topFrame);
161 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1);
162 ++iii;
163 ttt = addWidBool(i18n("Show \"From\" info field"),
164 &(KOPrefs::instance()->mShowInfoFrom),topFrame);
165 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1);
166 ++iii;
167 ttt = addWidBool(i18n("Show \"To\" info field"),
168 &(KOPrefs::instance()->mShowInfoTo),topFrame);
169 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1);
170 ++iii;
171
153 /* 172 /*
154 mCodecEdit = new QLineEdit(topFrame); 173 mCodecEdit = new QLineEdit(topFrame);
155 topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1); 174 topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1);
156 topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1); 175 topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1);
157 topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1); 176 topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1);
158 */ 177 */
159} 178}
160void KOPrefsDialog::setupFontsTab() 179void KOPrefsDialog::setupFontsTab()
161{ 180{
162 181
163 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 182 QFrame *topFrame = addPage(i18n("Fonts"),0,0);
164 // DesktopIcon("fonts",KIcon::SizeMedium)); 183 // DesktopIcon("fonts",KIcon::SizeMedium));
165 184
166 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 185 QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
167 topLayout->setSpacing(1); 186 topLayout->setSpacing(1);
168 topLayout->setMargin(3); 187 topLayout->setMargin(3);
169 KPrefsDialogWidFont * tVFont; 188 KPrefsDialogWidFont * tVFont;
170 int i = 0; 189 int i = 0;
171 KPrefsDialogWidFont *timeLabelsFont = 190 KPrefsDialogWidFont *timeLabelsFont =
172 addWidFont(i18n("OK"),i18n("Application(nr)"), 191 addWidFont(i18n("OK"),i18n("Application(nr)"),
173 &(KOPrefs::instance()->mAppFont),topFrame); 192 &(KOPrefs::instance()->mAppFont),topFrame);
174 topLayout->addWidget(timeLabelsFont->label(),i,0); 193 topLayout->addWidget(timeLabelsFont->label(),i,0);
175 topLayout->addWidget(timeLabelsFont->preview(),i,1); 194 topLayout->addWidget(timeLabelsFont->preview(),i,1);
176 topLayout->addWidget(timeLabelsFont->button(),i,2); 195 topLayout->addWidget(timeLabelsFont->button(),i,2);
177 ++i; 196 ++i;
178 197
179 198
180 timeLabelsFont = 199 timeLabelsFont =
181 addWidFont(i18n("Dear Mr."),i18n("Compose mail:"), 200 addWidFont(i18n("Dear Mr."),i18n("Compose mail:"),
182 &(KOPrefs::instance()->mComposeFont),topFrame); 201 &(KOPrefs::instance()->mComposeFont),topFrame);
183 topLayout->addWidget(timeLabelsFont->label(),i,0); 202 topLayout->addWidget(timeLabelsFont->label(),i,0);
184 topLayout->addWidget(timeLabelsFont->preview(),i,1); 203 topLayout->addWidget(timeLabelsFont->preview(),i,1);
185 topLayout->addWidget(timeLabelsFont->button(),i,2); 204 topLayout->addWidget(timeLabelsFont->button(),i,2);
186 ++i; 205 ++i;
187 206
188 KPrefsDialogWidFont *timeBarFont = 207 KPrefsDialogWidFont *timeBarFont =
189 addWidFont(i18n("Hello"),i18n("Read mail:"), 208 addWidFont(i18n("Hello"),i18n("Read mail:"),
190 &(KOPrefs::instance()->mReadFont),topFrame); 209 &(KOPrefs::instance()->mReadFont),topFrame);
191 topLayout->addWidget(timeBarFont->label(),i,0); 210 topLayout->addWidget(timeBarFont->label(),i,0);
192 topLayout->addWidget(timeBarFont->preview(),i,1); 211 topLayout->addWidget(timeBarFont->preview(),i,1);
193 topLayout->addWidget(timeBarFont->button(),i,2); 212 topLayout->addWidget(timeBarFont->button(),i,2);
194 ++i; 213 ++i;
195 214
196 topLayout->setColStretch(1,1); 215 topLayout->setColStretch(1,1);
197 topLayout->setRowStretch(4,1); 216 topLayout->setRowStretch(4,1);
198 217
199} 218}
200void KOPrefsDialog::usrReadConfig() 219void KOPrefsDialog::usrReadConfig()
201{ 220{
202 221
203 mNameEdit->setText(KOPrefs::instance()->mName); 222 mNameEdit->setText(KOPrefs::instance()->mName);
204 mEmailEdit->setText(KOPrefs::instance()->mEmail); 223 mEmailEdit->setText(KOPrefs::instance()->mEmail);
205 //mCodecEdit->setText(KOPrefs::instance()->mSendCodec); 224 //mCodecEdit->setText(KOPrefs::instance()->mSendCodec);
206 kdelibcfg->readConfig(); 225 kdelibcfg->readConfig();
207} 226}
208void KOPrefsDialog::usrWriteConfig() 227void KOPrefsDialog::usrWriteConfig()
209{ 228{
210 KOPrefs::instance()->mName = mNameEdit->text(); 229 KOPrefs::instance()->mName = mNameEdit->text();
211 KOPrefs::instance()->mEmail = mEmailEdit->text(); 230 KOPrefs::instance()->mEmail = mEmailEdit->text();
212 //KOPrefs::instance()->mSendCodec = mCodecEdit->text(); 231 //KOPrefs::instance()->mSendCodec = mCodecEdit->text();
213 kdelibcfg->writeConfig(); 232 kdelibcfg->writeConfig();
214 233
215 234
216} 235}
217 236
218#if 0 237#if 0
219void KOPrefsDialog::setupLocaleDateTab() 238void KOPrefsDialog::setupLocaleDateTab()
220{ 239{
221QFrame *topFrame = addPage(i18n("Date Format"),0,0); 240QFrame *topFrame = addPage(i18n("Date Format"),0,0);
222 QGridLayout *topLayout = new QGridLayout(topFrame,3,2); 241 QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
223 topLayout->setSpacing(spacingHint()); 242 topLayout->setSpacing(spacingHint());
224 topLayout->setMargin(marginHint()); 243 topLayout->setMargin(marginHint());
225 int iii = 0; 244 int iii = 0;
226 245
227 246
228 KPrefsWidRadios *syncPrefsGroup = 247 KPrefsWidRadios *syncPrefsGroup =
229 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); 248 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
230 QString format; 249 QString format;
231 if ( QApplication::desktop()->width() < 480 ) 250 if ( QApplication::desktop()->width() < 480 )
232 format = "(%d.%m.%Y)"; 251 format = "(%d.%m.%Y)";
233 else 252 else
234 format = "(%d.%m.%Y|%A %d %B %Y)"; 253 format = "(%d.%m.%Y|%A %d %B %Y)";
235 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 254 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
236 if ( QApplication::desktop()->width() < 480 ) 255 if ( QApplication::desktop()->width() < 480 )
237 format = "(%m.%d.%Y)"; 256 format = "(%m.%d.%Y)";
238 else 257 else
239 format = "(%m.%d.%Y|%A %B %d %Y)"; 258 format = "(%m.%d.%Y|%A %B %d %Y)";
240 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 259 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
241 if ( QApplication::desktop()->width() < 480 ) 260 if ( QApplication::desktop()->width() < 480 )
242 format = "(%Y-%m-%d)"; 261 format = "(%Y-%m-%d)";
243 else 262 else
244 format = "(%Y-%m-%d|%A %Y %B %d)"; 263 format = "(%Y-%m-%d|%A %Y %B %d)";
245 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 264 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
246 syncPrefsGroup->addRadio(i18n("User defined")); 265 syncPrefsGroup->addRadio(i18n("User defined"));
247 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 266 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
248 ++iii; 267 ++iii;
249 ++iii; 268 ++iii;
250 QLabel * lab; 269 QLabel * lab;
251 mUserDateFormatLong = new QLineEdit(topFrame); 270 mUserDateFormatLong = new QLineEdit(topFrame);
252 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 271 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
253 topLayout->addWidget(lab ,iii,0); 272 topLayout->addWidget(lab ,iii,0);
254 topLayout->addWidget(mUserDateFormatLong,iii,1); 273 topLayout->addWidget(mUserDateFormatLong,iii,1);
255 ++iii; 274 ++iii;
256 mUserDateFormatShort = new QLineEdit(topFrame); 275 mUserDateFormatShort = new QLineEdit(topFrame);
257 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 276 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
258 topLayout->addWidget(lab ,iii,0); 277 topLayout->addWidget(lab ,iii,0);
259 topLayout->addWidget(mUserDateFormatShort,iii,1); 278 topLayout->addWidget(mUserDateFormatShort,iii,1);
260 ++iii; 279 ++iii;
261 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 280 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
262 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 281 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
263 ++iii; 282 ++iii;
264 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 283 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
265 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 284 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
266 ++iii; 285 ++iii;
267 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 286 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
268 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 287 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
269 ++iii; 288 ++iii;
270 289
271} 290}
272 291
273void KOPrefsDialog::setupLocaleTab() 292void KOPrefsDialog::setupLocaleTab()
274{ 293{
275 QFrame *topFrame = addPage(i18n("Locale"),0,0); 294 QFrame *topFrame = addPage(i18n("Locale"),0,0);
276 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 295 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
277 topLayout->setSpacing(spacingHint()); 296 topLayout->setSpacing(spacingHint());
278 topLayout->setMargin(marginHint()); 297 topLayout->setMargin(marginHint());
279 int iii = 0; 298 int iii = 0;
280 KPrefsWidRadios *syncPrefsGroup = 299 KPrefsWidRadios *syncPrefsGroup =
281 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); 300 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
282 syncPrefsGroup->addRadio(i18n("English")); 301 syncPrefsGroup->addRadio(i18n("English"));
283 syncPrefsGroup->addRadio(i18n("German")); 302 syncPrefsGroup->addRadio(i18n("German"));
284 syncPrefsGroup->addRadio(i18n("French")); 303 syncPrefsGroup->addRadio(i18n("French"));
285 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 304 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
286 if ( QApplication::desktop()->width() < 300 ) 305 if ( QApplication::desktop()->width() < 300 )
287 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 306 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
288 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 307 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
289 ++iii; 308 ++iii;
290 309
291 syncPrefsGroup = 310 syncPrefsGroup =
292 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); 311 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame);
293 if ( QApplication::desktop()->width() > 300 ) 312 if ( QApplication::desktop()->width() > 300 )
294 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 313 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
295 syncPrefsGroup->addRadio(i18n("24:00")); 314 syncPrefsGroup->addRadio(i18n("24:00"));
296 syncPrefsGroup->addRadio(i18n("12:00am")); 315 syncPrefsGroup->addRadio(i18n("12:00am"));
297 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 316 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
298 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 317 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
299 ++iii; 318 ++iii;
300 KPrefsDialogWidBool *sb; 319 KPrefsDialogWidBool *sb;
301 if ( QApplication::desktop()->width() < 300 ) { 320 if ( QApplication::desktop()->width() < 300 ) {
302 sb = 321 sb =
303 addWidBool(i18n("Week starts on Sunday"), 322 addWidBool(i18n("Week starts on Sunday"),
304 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); 323 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame);
305 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 324 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
306 ++iii; 325 ++iii;
307 sb = 326 sb =
308 addWidBool(i18n("Use short date in (WN/E) view"), 327 addWidBool(i18n("Use short date in (WN/E) view"),
309 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 328 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
310 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 329 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
311 } 330 }
312 else { 331 else {
313 QWidget * hb = new QWidget( topFrame ); 332 QWidget * hb = new QWidget( topFrame );
314 QHBoxLayout *hbLayout = new QHBoxLayout(hb); 333 QHBoxLayout *hbLayout = new QHBoxLayout(hb);
315 sb = 334 sb =
316 addWidBool(i18n("Week starts on Sunday"), 335 addWidBool(i18n("Week starts on Sunday"),
317 &(KOPrefs::instance()->mWeekStartsOnSunday),hb); 336 &(KOPrefs::instance()->mWeekStartsOnSunday),hb);
318 hbLayout->addWidget(sb->checkBox() ); 337 hbLayout->addWidget(sb->checkBox() );
319 sb = 338 sb =
320 addWidBool(i18n("Use short date in (WN/E) view"), 339 addWidBool(i18n("Use short date in (WN/E) view"),
321 &(KOPrefs::instance()->mShortDateInViewer),hb); 340 &(KOPrefs::instance()->mShortDateInViewer),hb);
322 hbLayout->addWidget(sb->checkBox() ); 341 hbLayout->addWidget(sb->checkBox() );
323 topLayout->addMultiCellWidget(hb, iii,iii,0,1); 342 topLayout->addMultiCellWidget(hb, iii,iii,0,1);
324 343
325 } 344 }
326 //#ifndef DESKTOP_VERSION 345 //#ifndef DESKTOP_VERSION
327#if 0 346#if 0
328 ++iii; 347 ++iii;
329 sb = 348 sb =
330 addWidBool(i18n("Quick load/save (w/o Unicode)"), 349 addWidBool(i18n("Quick load/save (w/o Unicode)"),
331 &(KOPrefs::instance()->mUseQuicksave),topFrame); 350 &(KOPrefs::instance()->mUseQuicksave),topFrame);
332 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 351 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
333#endif 352#endif
334} 353}
335void KOPrefsDialog::showSyncPage() 354void KOPrefsDialog::showSyncPage()
336{ 355{
337 showPage ( 2 ) ; 356 showPage ( 2 ) ;
338 357
339} 358}
340void KOPrefsDialog::setupSyncAlgTab() 359void KOPrefsDialog::setupSyncAlgTab()
341{ 360{
342#if 0 361#if 0
343 QLabel * lab; 362 QLabel * lab;
344 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); 363 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0);
345 mSetupSyncAlgTab = topFrame; 364 mSetupSyncAlgTab = topFrame;
346 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 365 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
347 topLayout->setSpacing(spacingHint()); 366 topLayout->setSpacing(spacingHint());
348 topLayout->setMargin(marginHint()); 367 topLayout->setMargin(marginHint());
349 int iii = 0; 368 int iii = 0;
350 369
351 KPrefsDialogWidBool *sb = 370 KPrefsDialogWidBool *sb =
352 addWidBool(i18n("Ask for preferences before syncing"), 371 addWidBool(i18n("Ask for preferences before syncing"),
353 &(KOPrefs::instance()->mAskForPreferences),topFrame); 372 &(KOPrefs::instance()->mAskForPreferences),topFrame);
354 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 373 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
355 374
356 ++iii; 375 ++iii;
357 376
358 KPrefsWidRadios *syncPrefsGroup = 377 KPrefsWidRadios *syncPrefsGroup =
359 addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), 378 addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs),
360 topFrame); 379 topFrame);
361 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); 380 syncPrefsGroup->addRadio(i18n("Take local entry on conflict"));
362 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); 381 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict"));
363 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); 382 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict"));
364 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); 383 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict"));
365 syncPrefsGroup->addRadio(i18n("Force take local entry always")); 384 syncPrefsGroup->addRadio(i18n("Force take local entry always"));
366 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); 385 syncPrefsGroup->addRadio(i18n("Force take remote entry always"));
367 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 386 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
368 ++iii; 387 ++iii;
369 sb = 388 sb =
370 addWidBool(i18n("Show summary after syncing"), 389 addWidBool(i18n("Show summary after syncing"),
371 &(KOPrefs::instance()->mShowSyncSummary),topFrame); 390 &(KOPrefs::instance()->mShowSyncSummary),topFrame);
372 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 391 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
373 392
374 ++iii; 393 ++iii;
375#endif 394#endif
376 395
377 396
378 397
379} 398}
380 399
381 400
382void KOPrefsDialog::setupSyncTab() 401void KOPrefsDialog::setupSyncTab()
383{ 402{
384#if 0 403#if 0
385 QLabel * lab; 404 QLabel * lab;
386 QFrame *topFrame = addPage(i18n("Sync Network"),0,0); 405 QFrame *topFrame = addPage(i18n("Sync Network"),0,0);
387 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 406 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
388 topLayout->setSpacing(spacingHint()); 407 topLayout->setSpacing(spacingHint());
389 topLayout->setMargin(marginHint()); 408 topLayout->setMargin(marginHint());
390 lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); 409 lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame);
391 int iii = 0; 410 int iii = 0;
392 topLayout->addMultiCellWidget(lab , iii,iii,0,1); 411 topLayout->addMultiCellWidget(lab , iii,iii,0,1);
393 ++iii; 412 ++iii;
394 413
395 mRemoteIPEdit = new QLineEdit(topFrame); 414 mRemoteIPEdit = new QLineEdit(topFrame);
396 lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); 415 lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame);
397 topLayout->addWidget(lab ,iii,0); 416 topLayout->addWidget(lab ,iii,0);
398 topLayout->addWidget(mRemoteIPEdit,iii,1); 417 topLayout->addWidget(mRemoteIPEdit,iii,1);
399 ++iii; 418 ++iii;
400 mRemoteUser = new QLineEdit(topFrame); 419 mRemoteUser = new QLineEdit(topFrame);
401 lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); 420 lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame);
402 topLayout->addWidget(lab ,iii,0); 421 topLayout->addWidget(lab ,iii,0);
403 topLayout->addWidget(mRemoteUser, iii,1); 422 topLayout->addWidget(mRemoteUser, iii,1);
404 ++iii; 423 ++iii;
405 424
406 mRemoteFile = new QLineEdit(topFrame); 425 mRemoteFile = new QLineEdit(topFrame);
407 lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); 426 lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame);
408 topLayout->addWidget(lab ,iii,0); 427 topLayout->addWidget(lab ,iii,0);
409 topLayout->addWidget(mRemoteFile,iii,1); 428 topLayout->addWidget(mRemoteFile,iii,1);
410 ++iii; 429 ++iii;
411 430
412 mLocalTempFile = new QLineEdit(topFrame); 431 mLocalTempFile = new QLineEdit(topFrame);
413 lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); 432 lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame);
414 topLayout->addWidget(lab ,iii,0); 433 topLayout->addWidget(lab ,iii,0);
415 topLayout->addWidget(mLocalTempFile,iii,1); 434 topLayout->addWidget(mLocalTempFile,iii,1);
416 ++iii; 435 ++iii;
417 436
418 KPrefsDialogWidBool *wb = 437 KPrefsDialogWidBool *wb =
419 addWidBool(i18n("Write back synced file"), 438 addWidBool(i18n("Write back synced file"),
420 &(KOPrefs::instance()->mWriteBackFile),topFrame); 439 &(KOPrefs::instance()->mWriteBackFile),topFrame);
421 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); 440 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
422 ++iii; 441 ++iii;
423 wb = 442 wb =
424 addWidBool(i18n("Write back existing entries only"), 443 addWidBool(i18n("Write back existing entries only"),
425 &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); 444 &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame);
426 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); 445 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
427 ++iii; 446 ++iii;
428 447
429#endif 448#endif
430} 449}
431 450
432void KOPrefsDialog::setupMainTab() 451void KOPrefsDialog::setupMainTab()
433{ 452{
434 QFrame *topFrame = addPage(i18n("General"),0,0); 453 QFrame *topFrame = addPage(i18n("General"),0,0);
435 // DesktopIcon("identity",KIcon::SizeMedium)); 454 // DesktopIcon("identity",KIcon::SizeMedium));
436 455
437 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 456 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
438 topLayout->setSpacing(spacingHint()); 457 topLayout->setSpacing(spacingHint());
439 topLayout->setMargin(marginHint()); 458 topLayout->setMargin(marginHint());
440 459
441 // KPrefsDialogWidBool *emailControlCenter = 460 // KPrefsDialogWidBool *emailControlCenter =
442// addWidBool(i18n("&Use email settings from Control Center"), 461// addWidBool(i18n("&Use email settings from Control Center"),
443// &(KOPrefs::instance()->mEmailControlCenter),topFrame); 462// &(KOPrefs::instance()->mEmailControlCenter),topFrame);
444// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); 463// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1);
445 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), 464 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)),
446 // SLOT(toggleEmailSettings(bool))); 465 // SLOT(toggleEmailSettings(bool)));
447 466
448 mNameEdit = new QLineEdit(topFrame); 467 mNameEdit = new QLineEdit(topFrame);
449 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 468 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
450 topLayout->addWidget(mNameLabel,0,0); 469 topLayout->addWidget(mNameLabel,0,0);
451 topLayout->addWidget(mNameEdit,0,1); 470 topLayout->addWidget(mNameEdit,0,1);
452 471
453 mEmailEdit = new QLineEdit(topFrame); 472 mEmailEdit = new QLineEdit(topFrame);
454 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 473 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
455 topLayout->addWidget(mEmailLabel,1,0); 474 topLayout->addWidget(mEmailLabel,1,0);
456 topLayout->addWidget(mEmailEdit,1,1); 475 topLayout->addWidget(mEmailEdit,1,1);
457 KPrefsDialogWidBool *wb; 476 KPrefsDialogWidBool *wb;
458 QHBox *dummy; 477 QHBox *dummy;
459 if ( QApplication::desktop()->width() > 480 ) { 478 if ( QApplication::desktop()->width() > 480 ) {
460 dummy = new QHBox(topFrame); 479 dummy = new QHBox(topFrame);
461 } else { 480 } else {
462 dummy = new QVBox(topFrame); 481 dummy = new QVBox(topFrame);
463 } 482 }
464 483
465 topLayout->addMultiCellWidget(dummy, 2,2,0,1); 484 topLayout->addMultiCellWidget(dummy, 2,2,0,1);
466 addWidBool(i18n("Full menu bar(nr)"), 485 addWidBool(i18n("Full menu bar(nr)"),
467 &(KOPrefs::instance()->mShowFullMenu),dummy); 486 &(KOPrefs::instance()->mShowFullMenu),dummy);
468 487
469 488
470 addWidBool(i18n("Mini icons in toolbar(nr)"), 489 addWidBool(i18n("Mini icons in toolbar(nr)"),
471 &(KOPrefs::instance()->mToolBarMiniIcons),dummy); 490 &(KOPrefs::instance()->mToolBarMiniIcons),dummy);
472 491
473 492
474 dummy = new QHBox(topFrame); 493 dummy = new QHBox(topFrame);
475 new QLabel(i18n("Days in What's Next:"),dummy); 494 new QLabel(i18n("Days in What's Next:"),dummy);
476 mWhatsNextSpin = new QSpinBox(1,14,1,dummy); 495 mWhatsNextSpin = new QSpinBox(1,14,1,dummy);
477 496
478 topLayout->addMultiCellWidget(dummy,3,3,0,1); 497 topLayout->addMultiCellWidget(dummy,3,3,0,1);
479 498
480 499
481 500
482 dummy = new QHBox(topFrame); 501 dummy = new QHBox(topFrame);
483 new QLabel(i18n("Days in Next-X-Days:"),dummy); 502 new QLabel(i18n("Days in Next-X-Days:"),dummy);
484 mNextXDaysSpin = new QSpinBox(2,14,1,dummy); 503 mNextXDaysSpin = new QSpinBox(2,14,1,dummy);
485 504
486 topLayout->addMultiCellWidget(dummy,4,4,0,1); 505 topLayout->addMultiCellWidget(dummy,4,4,0,1);
487 506
488 QHBox *prioBox = new QHBox(topFrame); 507 QHBox *prioBox = new QHBox(topFrame);
489 // intervalBox->setSpacing(spacingHint()); 508 // intervalBox->setSpacing(spacingHint());
490 topLayout->addMultiCellWidget(prioBox,5,5,0,1); 509 topLayout->addMultiCellWidget(prioBox,5,5,0,1);
491 QString messa = i18n("Show topmost todo prios in What's Next:"); 510 QString messa = i18n("Show topmost todo prios in What's Next:");
492 511
493 if ( QApplication::desktop()->width() < 300 ) 512 if ( QApplication::desktop()->width() < 300 )
494 messa = i18n("Show topmost todo prios in What's N.:"); 513 messa = i18n("Show topmost todo prios in What's N.:");
495 QLabel *prioLabel = new QLabel(messa, prioBox); 514 QLabel *prioLabel = new QLabel(messa, prioBox);
496 mPrioSpin = new QSpinBox(0,5,1,prioBox); 515 mPrioSpin = new QSpinBox(0,5,1,prioBox);
497 if ( QApplication::desktop()->width() < 300 ) 516 if ( QApplication::desktop()->width() < 300 )
498 mPrioSpin->setFixedWidth( 40 ); 517 mPrioSpin->setFixedWidth( 40 );
499 518
500 // KPrefsDialogWidBool *bcc = 519 // KPrefsDialogWidBool *bcc =
501// addWidBool(i18n("Send copy to owner when mailing events"), 520// addWidBool(i18n("Send copy to owner when mailing events"),
502// &(KOPrefs::instance()->mBcc),topFrame); 521// &(KOPrefs::instance()->mBcc),topFrame);
503// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); 522// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1);
504 523
505 524
506 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); 525 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame);
507 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); 526 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1);
508 527
509 // addWidBool(i18n("Enable automatic saving of calendar"), 528 // addWidBool(i18n("Enable automatic saving of calendar"),
510 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); 529 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup);
511 530
512 QHBox *intervalBox = new QHBox(topFrame); 531 QHBox *intervalBox = new QHBox(topFrame);
513 // intervalBox->setSpacing(spacingHint()); 532 // intervalBox->setSpacing(spacingHint());
514 topLayout->addMultiCellWidget(intervalBox,6,6,0,1); 533 topLayout->addMultiCellWidget(intervalBox,6,6,0,1);
515 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); 534 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox);
516 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); 535 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox);
517 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); 536 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin);
518 /* 537 /*
519 QHBox * agendasize = new QHBox ( topFrame ); 538 QHBox * agendasize = new QHBox ( topFrame );
520 539
521 new QLabel (i18n("AllDayAgenda Height:"), agendasize ); 540 new QLabel (i18n("AllDayAgenda Height:"), agendasize );
522 541
523 542
524 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); 543 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize);
525 topLayout->addMultiCellWidget(agendasize,7,7,0,1); 544 topLayout->addMultiCellWidget(agendasize,7,7,0,1);
526 */ 545 */
527 KPrefsDialogWidBool *verticalScreen = 546 KPrefsDialogWidBool *verticalScreen =
528 addWidBool(i18n("Show vertical screen (Needs restart)"), 547 addWidBool(i18n("Show vertical screen (Needs restart)"),
529 &(KOPrefs::instance()->mVerticalScreen),topFrame); 548 &(KOPrefs::instance()->mVerticalScreen),topFrame);
530 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); 549 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0);
531 topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1); 550 topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1);
532 551
533 KPrefsDialogWidBool *ask = 552 KPrefsDialogWidBool *ask =
534 addWidBool(i18n("Ask for quit when closing KO/Pi"), 553 addWidBool(i18n("Ask for quit when closing KO/Pi"),
535 &(KOPrefs::instance()->mAskForQuit),topFrame); 554 &(KOPrefs::instance()->mAskForQuit),topFrame);
536 topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1); 555 topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1);
537 556
538 557
539 /* 558 /*
540 KPrefsDialogWidBool *confirmCheck = 559 KPrefsDialogWidBool *confirmCheck =
541 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), 560 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm),
542 topFrame); 561 topFrame);
543 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); 562 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1);
544 563
545 564
546 mEnableGroupScheduling = 565 mEnableGroupScheduling =
547 addWidBool(i18n("Enable group scheduling"), 566 addWidBool(i18n("Enable group scheduling"),
548 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); 567 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame);
549 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); 568 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0);
550 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), 569 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()),
551 SLOT(warningGroupScheduling())); 570 SLOT(warningGroupScheduling()));
552 571
553 mEnableProjectView = 572 mEnableProjectView =
554 addWidBool(i18n("Enable project view"), 573 addWidBool(i18n("Enable project view"),
555 &(KOPrefs::instance()->mEnableProjectView),topFrame); 574 &(KOPrefs::instance()->mEnableProjectView),topFrame);
556 topLayout->addWidget(mEnableProjectView->checkBox(),9,0); 575 topLayout->addWidget(mEnableProjectView->checkBox(),9,0);
557 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), 576 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()),
558 SLOT(warningProjectView())); 577 SLOT(warningProjectView()));
559 578
560 // Can't be disabled anymore 579 // Can't be disabled anymore
561 mEnableGroupScheduling->checkBox()->hide(); 580 mEnableGroupScheduling->checkBox()->hide();
562 581
563 // Disable setting, because this feature now becomes stable 582 // Disable setting, because this feature now becomes stable
564 mEnableProjectView->checkBox()->hide(); 583 mEnableProjectView->checkBox()->hide();
565 584
566 KPrefsWidRadios *defaultFormatGroup = 585 KPrefsWidRadios *defaultFormatGroup =
567 addWidRadios(i18n("Default Calendar Format"), 586 addWidRadios(i18n("Default Calendar Format"),
568 &(KOPrefs::instance()->mDefaultFormat),topFrame); 587 &(KOPrefs::instance()->mDefaultFormat),topFrame);
569 defaultFormatGroup->addRadio(i18n("vCalendar")); 588 defaultFormatGroup->addRadio(i18n("vCalendar"));
570 defaultFormatGroup->addRadio(i18n("iCalendar")); 589 defaultFormatGroup->addRadio(i18n("iCalendar"));
571 590
572 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); 591 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1);
573 592
574 // Default format unconditionally is iCalendar 593 // Default format unconditionally is iCalendar
575 defaultFormatGroup->groupBox()->hide(); 594 defaultFormatGroup->groupBox()->hide();
576 595
577 KPrefsWidRadios *mailClientGroup = 596 KPrefsWidRadios *mailClientGroup =
578 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), 597 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient),
579 topFrame); 598 topFrame);
580 mailClientGroup->addRadio(i18n("KMail")); 599 mailClientGroup->addRadio(i18n("KMail"));
581 mailClientGroup->addRadio(i18n("Sendmail")); 600 mailClientGroup->addRadio(i18n("Sendmail"));
582 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); 601 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1);
583 602
584 KPrefsDialogWidBool *htmlsave = 603 KPrefsDialogWidBool *htmlsave =
585 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), 604 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave),
586 topFrame); 605 topFrame);
587 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); 606 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1);
588 607
589 KPrefsWidRadios *destinationGroup = 608 KPrefsWidRadios *destinationGroup =
590 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), 609 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination),
591 topFrame); 610 topFrame);
592 destinationGroup->addRadio(i18n("be added to the standard resource")); 611 destinationGroup->addRadio(i18n("be added to the standard resource"));
593 destinationGroup->addRadio(i18n("be asked which resource to use")); 612 destinationGroup->addRadio(i18n("be asked which resource to use"));
594 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); 613 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1);
595 614
596 topLayout->setRowStretch(14,1); 615 topLayout->setRowStretch(14,1);
597 */ 616 */
598} 617}
599 618
600 619
601void KOPrefsDialog::setupTimeTab() 620void KOPrefsDialog::setupTimeTab()
602{ 621{
603 QFrame *topFrame = addPage(i18n("Time"),0,0); 622 QFrame *topFrame = addPage(i18n("Time"),0,0);
604 // DesktopIcon("clock",KIcon::SizeMedium)); 623 // DesktopIcon("clock",KIcon::SizeMedium));
605 624
606 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 625 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
607 topLayout->setSpacing(spacingHint()); 626 topLayout->setSpacing(spacingHint());
608 topLayout->setMargin(marginHint()); 627 topLayout->setMargin(marginHint());
609 628
610 QHBox *dummy = new QHBox(topFrame); 629 QHBox *dummy = new QHBox(topFrame);
611 KPrefsWidTime *dayBegins = 630 KPrefsWidTime *dayBegins =
612 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 631 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
613 dummy); 632 dummy);
614 //topLayout->addWidget(dayBegins->label(),2,0); 633 //topLayout->addWidget(dayBegins->label(),2,0);
615 634
616 //topLayout->addWidget(dayBegins->spinBox(),2,1); 635 //topLayout->addWidget(dayBegins->spinBox(),2,1);
617 topLayout->addMultiCellWidget(dummy,0,0,0,1); 636 topLayout->addMultiCellWidget(dummy,0,0,0,1);
618 637
619 topLayout->addWidget(new QLabel(i18n("Default appointment time:"), 638 topLayout->addWidget(new QLabel(i18n("Default appointment time:"),
620 topFrame),1,0); 639 topFrame),1,0);
621 mStartTimeSpin = new QSpinBox(0,23,1,topFrame); 640 mStartTimeSpin = new QSpinBox(0,23,1,topFrame);
622 mStartTimeSpin->setSuffix(":00"); 641 mStartTimeSpin->setSuffix(":00");
623 topLayout->addWidget(mStartTimeSpin,1,1); 642 topLayout->addWidget(mStartTimeSpin,1,1);
624 643
625 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), 644 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"),
626 topFrame),2,0); 645 topFrame),2,0);
627 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); 646 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame);
628 mDefaultDurationSpin->setSuffix(":00"); 647 mDefaultDurationSpin->setSuffix(":00");
629 topLayout->addWidget(mDefaultDurationSpin,2,1); 648 topLayout->addWidget(mDefaultDurationSpin,2,1);
630 649
631 QStringList alarmList; 650 QStringList alarmList;
632 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") 651 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes")
633 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; 652 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ;
634 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), 653 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame),
635 3,0); 654 3,0);
636 mAlarmTimeCombo = new QComboBox(topFrame); 655 mAlarmTimeCombo = new QComboBox(topFrame);
637 mAlarmTimeCombo->insertStringList(alarmList); 656 mAlarmTimeCombo->insertStringList(alarmList);
638 topLayout->addWidget(mAlarmTimeCombo,3,1); 657 topLayout->addWidget(mAlarmTimeCombo,3,1);
639 658
640 659
641 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, 660 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal,
642 i18n("Working Hours"), 661 i18n("Working Hours"),
643 topFrame); 662 topFrame);
644 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); 663 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1);
645 workingHoursGroup->layout()->setSpacing( 0 ); 664 workingHoursGroup->layout()->setSpacing( 0 );
646 workingHoursGroup->layout()->setMargin( 4 ); 665 workingHoursGroup->layout()->setMargin( 4 );
647 QHBox *workStartBox = new QHBox(workingHoursGroup); 666 QHBox *workStartBox = new QHBox(workingHoursGroup);
648 // workStartBox->setMargin( 0 ); 667 // workStartBox->setMargin( 0 );
649 addWidTime(i18n("Daily starting hour:"), 668 addWidTime(i18n("Daily starting hour:"),
650 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); 669 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox);
651 670
652 QHBox *workEndBox = new QHBox(workingHoursGroup); 671 QHBox *workEndBox = new QHBox(workingHoursGroup);
653 //workEndBox->setMargin( 0 ); 672 //workEndBox->setMargin( 0 );
654 addWidTime(i18n("Daily ending hour:"), 673 addWidTime(i18n("Daily ending hour:"),
655 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); 674 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox);
656 QVBox *excludeBox = new QVBox(workingHoursGroup); 675 QVBox *excludeBox = new QVBox(workingHoursGroup);
657 //excludeBox->setMargin( 0 ); 676 //excludeBox->setMargin( 0 );
658 addWidBool(i18n("Exclude holidays"), 677 addWidBool(i18n("Exclude holidays"),
659 &(KOPrefs::instance()->mExcludeHolidays),excludeBox); 678 &(KOPrefs::instance()->mExcludeHolidays),excludeBox);
660 679
661 addWidBool(i18n("Exclude Saturdays"), 680 addWidBool(i18n("Exclude Saturdays"),
662 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); 681 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox);
663 682
664// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), 683// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"),
665 // &(KOPrefs::instance()->mMarcusBainsShowSeconds), 684 // &(KOPrefs::instance()->mMarcusBainsShowSeconds),
666 // topFrame); 685 // topFrame);
667// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); 686// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0);
668 687
669 // topLayout->setRowStretch(6,1); 688 // topLayout->setRowStretch(6,1);
670} 689}
671 690
672 691
673void KOPrefsDialog::setupViewsTab() 692void KOPrefsDialog::setupViewsTab()
674{ 693{
675 694
676 QFrame *topFrame = addPage(i18n("Views"),0,0); 695 QFrame *topFrame = addPage(i18n("Views"),0,0);
677 // DesktopIcon("viewmag",KIcon::SizeMedium)); 696 // DesktopIcon("viewmag",KIcon::SizeMedium));
678 697
679 QGridLayout *topLayout = new QGridLayout(topFrame,6,1); 698 QGridLayout *topLayout = new QGridLayout(topFrame,6,1);
680 topLayout->setSpacing(spacingHint()); 699 topLayout->setSpacing(spacingHint());
681 topLayout->setMargin(marginHint()); 700 topLayout->setMargin(marginHint());
682 701
683// QBoxLayout *dayBeginsLayout = new QHBoxLayout; 702// QBoxLayout *dayBeginsLayout = new QHBoxLayout;
684// topLayout->addLayout(dayBeginsLayout,0,0); 703// topLayout->addLayout(dayBeginsLayout,0,0);
685 704
686// KPrefsWidTime *dayBegins = 705// KPrefsWidTime *dayBegins =
687// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 706// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
688// topFrame); 707// topFrame);
689// dayBeginsLayout->addWidget(dayBegins->label()); 708// dayBeginsLayout->addWidget(dayBegins->label());
690// dayBeginsLayout->addStretch(1); 709// dayBeginsLayout->addStretch(1);
691// dayBeginsLayout->addWidget(dayBegins->spinBox()); 710// dayBeginsLayout->addWidget(dayBegins->spinBox());
692 711
693// QBoxLayout *nextDaysLayout = new QHBoxLayout; 712// QBoxLayout *nextDaysLayout = new QHBoxLayout;
694// topLayout->addLayout(nextDaysLayout,1,0); 713// topLayout->addLayout(nextDaysLayout,1,0);
695// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); 714// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame));
696// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); 715// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame);
697// nextDaysLayout->addStretch(1); 716// nextDaysLayout->addStretch(1);
698// nextDaysLayout->addWidget(mNextXDaysSpin); 717// nextDaysLayout->addWidget(mNextXDaysSpin);
699 718
700 719
701 int ii = 0; 720 int ii = 0;
702 KPrefsDialogWidBool *dummy = 721 KPrefsDialogWidBool *dummy =
703 addWidBool(i18n("Edit item on doubleclick (if not, show)"), 722 addWidBool(i18n("Edit item on doubleclick (if not, show)"),
704 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); 723 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame);
705 topLayout->addWidget(dummy->checkBox(),ii++,0); 724 topLayout->addWidget(dummy->checkBox(),ii++,0);
706 725
707 dummy = 726 dummy =
708 addWidBool(i18n("Highlight current day in agenda"), 727 addWidBool(i18n("Highlight current day in agenda"),
709 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); 728 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame);
710 topLayout->addWidget(dummy->checkBox(),ii++,0); 729 topLayout->addWidget(dummy->checkBox(),ii++,0);
711 730
712 dummy = 731 dummy =
713 addWidBool(i18n("Use light color for highlight current day"), 732 addWidBool(i18n("Use light color for highlight current day"),
714 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); 733 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame);
715 topLayout->addWidget(dummy->checkBox(),ii++,0); 734 topLayout->addWidget(dummy->checkBox(),ii++,0);
716 735
717 KPrefsDialogWidBool *dailyRecur = 736 KPrefsDialogWidBool *dailyRecur =
718 addWidBool(i18n("Show events that recur daily in date nav."), 737 addWidBool(i18n("Show events that recur daily in date nav."),
719 &(KOPrefs::instance()->mDailyRecur),topFrame); 738 &(KOPrefs::instance()->mDailyRecur),topFrame);
720 topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 739 topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
721 740
722 KPrefsDialogWidBool *weeklyRecur = 741 KPrefsDialogWidBool *weeklyRecur =
723 addWidBool(i18n("Show ev. that recur weekly in date nav."), 742 addWidBool(i18n("Show ev. that recur weekly in date nav."),
724 &(KOPrefs::instance()->mWeeklyRecur),topFrame); 743 &(KOPrefs::instance()->mWeeklyRecur),topFrame);
725 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); 744 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
726 if ( QApplication::desktop()->width() > 640 ) { 745 if ( QApplication::desktop()->width() > 640 ) {
727 746
728 KPrefsDialogWidBool *enableToolTips = 747 KPrefsDialogWidBool *enableToolTips =
729 addWidBool(i18n("Enable tooltips displaying summary of ev."), 748 addWidBool(i18n("Enable tooltips displaying summary of ev."),
730 &(KOPrefs::instance()->mEnableToolTips),topFrame); 749 &(KOPrefs::instance()->mEnableToolTips),topFrame);
731 topLayout->addWidget(enableToolTips->checkBox(),ii++,0); 750 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
732 751
733 } 752 }
734 KPrefsDialogWidBool *passwdk = 753 KPrefsDialogWidBool *passwdk =
735 addWidBool(i18n("Show parent To-Do's in What's Next view"), 754 addWidBool(i18n("Show parent To-Do's in What's Next view"),
736 &(KOPrefs::instance()->mWNViewShowsParents),topFrame); 755 &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
737 topLayout->addWidget(passwdk->checkBox(), ii++,0); 756 topLayout->addWidget(passwdk->checkBox(), ii++,0);
738 757
739 passwdk = 758 passwdk =
740 addWidBool(i18n("Show location in What's Next view"), 759 addWidBool(i18n("Show location in What's Next view"),
741 &(KOPrefs::instance()->mWNViewShowLocation),topFrame); 760 &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
742 topLayout->addWidget(passwdk->checkBox(), ii++,0); 761 topLayout->addWidget(passwdk->checkBox(), ii++,0);
743 762
744 passwdk = 763 passwdk =
745 addWidBool(i18n("Show Sync Events in WN/Agenda view"), 764 addWidBool(i18n("Show Sync Events in WN/Agenda view"),
746 &(KOPrefs::instance()->mShowSyncEvents),topFrame); 765 &(KOPrefs::instance()->mShowSyncEvents),topFrame);
747 topLayout->addWidget(passwdk->checkBox(), ii++,0); 766 topLayout->addWidget(passwdk->checkBox(), ii++,0);
748 767
749 768
750 KPrefsDialogWidBool *marcusBainsEnabled = 769 KPrefsDialogWidBool *marcusBainsEnabled =
751 addWidBool(i18n("Show Marcus Bains line"), 770 addWidBool(i18n("Show Marcus Bains line"),
752 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); 771 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame);
753 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); 772 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0);
754 773
755 774
756 // topLayout->addWidget(hourSizeGroup,ii++,0); 775 // topLayout->addWidget(hourSizeGroup,ii++,0);
757 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); 776 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
758 //topLayout->setRowStretch(11,1); 777 //topLayout->setRowStretch(11,1);
759 778
760 779
761 780
762 781
763 782
764 783
765 topFrame = addPage(i18n("ViewChange"),0,0); 784 topFrame = addPage(i18n("ViewChange"),0,0);
766 // DesktopIcon("viewmag",KIcon::SizeMedium)); 785 // DesktopIcon("viewmag",KIcon::SizeMedium));
767 786
768 topLayout = new QGridLayout(topFrame,6,1); 787 topLayout = new QGridLayout(topFrame,6,1);
769 topLayout->setSpacing(spacingHint()); 788 topLayout->setSpacing(spacingHint());
770 topLayout->setMargin(marginHint()); 789 topLayout->setMargin(marginHint());
771 ii = 0; 790 ii = 0;
772 791
773 792
774 dummy = 793 dummy =
775 addWidBool(i18n("Hold fullscreen on view change"), 794 addWidBool(i18n("Hold fullscreen on view change"),
776 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); 795 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
777 topLayout->addWidget(dummy->checkBox(),ii++,0); 796 topLayout->addWidget(dummy->checkBox(),ii++,0);
778 797
779 dummy = 798 dummy =
780 addWidBool(i18n("Hold non-fullscreen on view change"), 799 addWidBool(i18n("Hold non-fullscreen on view change"),
781 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); 800 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame);
782 topLayout->addWidget(dummy->checkBox(),ii++,0); 801 topLayout->addWidget(dummy->checkBox(),ii++,0);
783 802
784 803
785 KPrefsDialogWidBool *fullViewTodo = 804 KPrefsDialogWidBool *fullViewTodo =
786 addWidBool(i18n("Event list view uses full window"), 805 addWidBool(i18n("Event list view uses full window"),
787 &(KOPrefs::instance()->mFullViewTodo),topFrame); 806 &(KOPrefs::instance()->mFullViewTodo),topFrame);
788 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); 807 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0);
789 808
790 KPrefsDialogWidBool *fullViewMonth = 809 KPrefsDialogWidBool *fullViewMonth =
791 addWidBool(i18n("Next days view uses full window"), 810 addWidBool(i18n("Next days view uses full window"),
792 &(KOPrefs::instance()->mFullViewMonth),topFrame); 811 &(KOPrefs::instance()->mFullViewMonth),topFrame);
793 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); 812 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0);
794 813
795 dummy = 814 dummy =
796 addWidBool(i18n("Set agenda to DayBeginsAt on change"), 815 addWidBool(i18n("Set agenda to DayBeginsAt on change"),
797 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); 816 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame);
798 topLayout->addWidget(dummy->checkBox(),ii++,0); 817 topLayout->addWidget(dummy->checkBox(),ii++,0);
799 818
800 dummy = 819 dummy =
801 addWidBool(i18n("Set agenda to current time on change"), 820 addWidBool(i18n("Set agenda to current time on change"),
802 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); 821 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame);
803 topLayout->addWidget(dummy->checkBox(),ii++,0); 822 topLayout->addWidget(dummy->checkBox(),ii++,0);
804 823
805 dummy = 824 dummy =
806 addWidBool(i18n("Listview uses monthly timespan"), 825 addWidBool(i18n("Listview uses monthly timespan"),
807 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); 826 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame);
808 topLayout->addWidget(dummy->checkBox(),ii++,0); 827 topLayout->addWidget(dummy->checkBox(),ii++,0);
809 dummy = 828 dummy =
810 addWidBool(i18n("Highlight selection in Time Edit"), 829 addWidBool(i18n("Highlight selection in Time Edit"),
811 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); 830 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
812 topLayout->addWidget( dummy->checkBox(), ii++,0); 831 topLayout->addWidget( dummy->checkBox(), ii++,0);
813 832
814 833
815 834
816 835
817 836
818 topFrame = addPage(i18n("Month View"),0,0); 837 topFrame = addPage(i18n("Month View"),0,0);
819 // DesktopIcon("viewmag",KIcon::SizeMedium)); 838 // DesktopIcon("viewmag",KIcon::SizeMedium));
820 839
821 topLayout = new QGridLayout(topFrame,5,1); 840 topLayout = new QGridLayout(topFrame,5,1);
822 topLayout->setSpacing(spacingHint()); 841 topLayout->setSpacing(spacingHint());
823 topLayout->setMargin(marginHint()); 842 topLayout->setMargin(marginHint());
824 ii = 0; 843 ii = 0;
825 QLabel *lab; 844 QLabel *lab;
826 QHBox *habo = new QHBox( topFrame ); 845 QHBox *habo = new QHBox( topFrame );
827 if ( QApplication::desktop()->width() < 320 ) { 846 if ( QApplication::desktop()->width() < 320 ) {
828 lab = new QLabel ( i18n("Show events that recur "), topFrame ); 847 lab = new QLabel ( i18n("Show events that recur "), topFrame );
829 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 848 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
830 ii++; 849 ii++;
831 850
832 } else { 851 } else {
833 new QLabel ( i18n("Show events that recur "), habo ); 852 new QLabel ( i18n("Show events that recur "), habo );
834 853
835 } 854 }
836 dailyRecur = 855 dailyRecur =
837 addWidBool(i18n("daily"), 856 addWidBool(i18n("daily"),
838 &(KOPrefs::instance()->mMonthDailyRecur),habo); 857 &(KOPrefs::instance()->mMonthDailyRecur),habo);
839 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 858 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
840 859
841 weeklyRecur = 860 weeklyRecur =
842 addWidBool(i18n("weekly"), 861 addWidBool(i18n("weekly"),
843 &(KOPrefs::instance()->mMonthWeeklyRecur),habo); 862 &(KOPrefs::instance()->mMonthWeeklyRecur),habo);
844 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 863 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
845 ii++; 864 ii++;
846 865
847 866
848 habo = new QHBox( topFrame ); 867 habo = new QHBox( topFrame );
849 if ( QApplication::desktop()->width() < 320 ) { 868 if ( QApplication::desktop()->width() < 320 ) {
850 lab = new QLabel (i18n("Show in every cell ") , topFrame ); 869 lab = new QLabel (i18n("Show in every cell ") , topFrame );
851 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 870 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
852 ii++; 871 ii++;
853 872
854 } else { 873 } else {
855 new QLabel ( i18n("Show in every cell "), habo ); 874 new QLabel ( i18n("Show in every cell "), habo );
856 } 875 }
857 weeklyRecur = 876 weeklyRecur =
858 addWidBool(i18n("short month"), 877 addWidBool(i18n("short month"),
859 &(KOPrefs::instance()->mMonthShowShort),habo); 878 &(KOPrefs::instance()->mMonthShowShort),habo);
860 weeklyRecur = 879 weeklyRecur =
861 addWidBool(i18n("icons"), 880 addWidBool(i18n("icons"),
862 &(KOPrefs::instance()->mMonthShowIcons),habo); 881 &(KOPrefs::instance()->mMonthShowIcons),habo);
863 882
864 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 883 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
865 ii++; 884 ii++;
866#ifdef DESKTOP_VERSION 885#ifdef DESKTOP_VERSION
867 KPrefsDialogWidBool *enableMonthScroll = 886 KPrefsDialogWidBool *enableMonthScroll =
868 addWidBool(i18n("Enable scrollbars in month view cells"), 887 addWidBool(i18n("Enable scrollbars in month view cells"),
869 &(KOPrefs::instance()->mEnableMonthScroll),topFrame); 888 &(KOPrefs::instance()->mEnableMonthScroll),topFrame);
870 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); 889 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0);
871#endif 890#endif
872 891
873 dummy = 892 dummy =
874 addWidBool(i18n("Show Sat/Sun together"), 893 addWidBool(i18n("Show Sat/Sun together"),
875 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); 894 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame);
876 topLayout->addWidget(dummy->checkBox(),ii++,0); 895 topLayout->addWidget(dummy->checkBox(),ii++,0);
877 896
878 KPrefsDialogWidBool *coloredCategoriesInMonthView = 897 KPrefsDialogWidBool *coloredCategoriesInMonthView =
879 addWidBool(i18n("Month view uses category colors"), 898 addWidBool(i18n("Month view uses category colors"),
880 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); 899 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame);
881 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 900 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
882 901
883 dummy = 902 dummy =
884 addWidBool(i18n("Categorie colors are applied to text"), 903 addWidBool(i18n("Categorie colors are applied to text"),
885 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); 904 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame);
886 topLayout->addWidget(dummy->checkBox(),ii++,0); 905 topLayout->addWidget(dummy->checkBox(),ii++,0);
887 coloredCategoriesInMonthView = 906 coloredCategoriesInMonthView =
888 addWidBool(i18n("Month view uses day colors"), 907 addWidBool(i18n("Month view uses day colors"),
889 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); 908 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
890 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 909 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
891 910
892 KPrefsWidColor *holidayColor = 911 KPrefsWidColor *holidayColor =
893 addWidColor(i18n("Day color odd months"), 912 addWidColor(i18n("Day color odd months"),
894 &(KOPrefs::instance()->mMonthViewOddColor),topFrame); 913 &(KOPrefs::instance()->mMonthViewOddColor),topFrame);
895 topLayout->addWidget(holidayColor->label(),ii,0); 914 topLayout->addWidget(holidayColor->label(),ii,0);
896 topLayout->addWidget(holidayColor->button(),ii++,1); 915 topLayout->addWidget(holidayColor->button(),ii++,1);
897 916
898 holidayColor = 917 holidayColor =
899 addWidColor(i18n("Day color even months"), 918 addWidColor(i18n("Day color even months"),
900 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); 919 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame);
901 topLayout->addWidget(holidayColor->label(),ii,0); 920 topLayout->addWidget(holidayColor->label(),ii,0);
902 topLayout->addWidget(holidayColor->button(),ii++,1); 921 topLayout->addWidget(holidayColor->button(),ii++,1);
903 922
904 923
905 holidayColor = 924 holidayColor =
906 addWidColor(i18n("Color for Sundays + category \"Holiday\""), 925 addWidColor(i18n("Color for Sundays + category \"Holiday\""),
907 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); 926 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
908 topLayout->addWidget(holidayColor->label(),ii,0); 927 topLayout->addWidget(holidayColor->label(),ii,0);
909 topLayout->addWidget(holidayColor->button(),ii++,1); 928 topLayout->addWidget(holidayColor->button(),ii++,1);
910 929
911 // *********************** Todo View 930 // *********************** Todo View
912 931
913 topFrame = addPage(i18n("Todo View"),0,0); 932 topFrame = addPage(i18n("Todo View"),0,0);
914 // DesktopIcon("viewmag",KIcon::SizeMedium)); 933 // DesktopIcon("viewmag",KIcon::SizeMedium));
915 934
916 topLayout = new QGridLayout(topFrame,4,1); 935 topLayout = new QGridLayout(topFrame,4,1);
917 topLayout->setSpacing(spacingHint()); 936 topLayout->setSpacing(spacingHint());
918 topLayout->setMargin(marginHint()); 937 topLayout->setMargin(marginHint());
919 ii = 0; 938 ii = 0;
920 939
921 KPrefsDialogWidBool *showCompletedTodo = 940 KPrefsDialogWidBool *showCompletedTodo =
922 addWidBool(i18n("To-do view shows completed Todos"), 941 addWidBool(i18n("To-do view shows completed Todos"),
923 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 942 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
924 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); 943 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
925 dummy = 944 dummy =
926 addWidBool(i18n("To-do view shows complete as 'xx %'"), 945 addWidBool(i18n("To-do view shows complete as 'xx %'"),
927 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); 946 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
928 topLayout->addWidget(dummy->checkBox(),ii++,0); 947 topLayout->addWidget(dummy->checkBox(),ii++,0);
929 948
930 dummy = 949 dummy =
931 addWidBool(i18n("Small To-do view uses smaller font"), 950 addWidBool(i18n("Small To-do view uses smaller font"),
932 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); 951 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
933 topLayout->addWidget(dummy->checkBox(),ii++,0); 952 topLayout->addWidget(dummy->checkBox(),ii++,0);
934 953
935 954
936 955
937 dummy = 956 dummy =
938 addWidBool(i18n("Todo view uses category colors"), 957 addWidBool(i18n("Todo view uses category colors"),
939 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); 958 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
940 topLayout->addWidget(dummy->checkBox(),ii++,0); 959 topLayout->addWidget(dummy->checkBox(),ii++,0);
941 960
942 961
943 QWidget* wid = new QWidget( topFrame ); 962 QWidget* wid = new QWidget( topFrame );
944 // Todo due today color 963 // Todo due today color
945 KPrefsWidColor *todoDueTodayColor = 964 KPrefsWidColor *todoDueTodayColor =
946 addWidColor(i18n("Todo due today color:"), 965 addWidColor(i18n("Todo due today color:"),
947 &(KOPrefs::instance()->mTodoDueTodayColor),wid); 966 &(KOPrefs::instance()->mTodoDueTodayColor),wid);
948 QHBoxLayout *widLayout = new QHBoxLayout(wid); 967 QHBoxLayout *widLayout = new QHBoxLayout(wid);
949 widLayout->addWidget( todoDueTodayColor->label() ); 968 widLayout->addWidget( todoDueTodayColor->label() );
950 widLayout->addWidget( todoDueTodayColor->button() ); 969 widLayout->addWidget( todoDueTodayColor->button() );
951 topLayout->addWidget(wid,ii++,0); 970 topLayout->addWidget(wid,ii++,0);
952 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 971 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
953 972
954 // Todo overdue color 973 // Todo overdue color
955 wid = new QWidget( topFrame ); 974 wid = new QWidget( topFrame );
956 widLayout = new QHBoxLayout(wid); 975 widLayout = new QHBoxLayout(wid);
957 KPrefsWidColor *todoOverdueColor = 976 KPrefsWidColor *todoOverdueColor =
958 addWidColor(i18n("Todo overdue color:"), 977 addWidColor(i18n("Todo overdue color:"),
959 &(KOPrefs::instance()->mTodoOverdueColor),wid); 978 &(KOPrefs::instance()->mTodoOverdueColor),wid);
960 widLayout->addWidget(todoOverdueColor->label()); 979 widLayout->addWidget(todoOverdueColor->label());
961 widLayout->addWidget(todoOverdueColor->button()); 980 widLayout->addWidget(todoOverdueColor->button());
962 topLayout->addWidget(wid,ii++,0); 981 topLayout->addWidget(wid,ii++,0);
963 982
964 dummy = 983 dummy =
965 addWidBool(i18n("Colors are applied to text"), 984 addWidBool(i18n("Colors are applied to text"),
966 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 985 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
967 topLayout->addWidget(dummy->checkBox(),ii++,0); 986 topLayout->addWidget(dummy->checkBox(),ii++,0);
968 987
969 dummy = 988 dummy =
970 addWidBool(i18n("Allday Agenda view shows todos"), 989 addWidBool(i18n("Allday Agenda view shows todos"),
971 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); 990 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
972 topLayout->addWidget(dummy->checkBox(),ii++,0); 991 topLayout->addWidget(dummy->checkBox(),ii++,0);
973 992
974 993
975 994
976 995
977 topFrame = addPage(i18n("Alarm"),0,0); 996 topFrame = addPage(i18n("Alarm"),0,0);
978 // DesktopIcon("viewmag",KIcon::SizeMedium)); 997 // DesktopIcon("viewmag",KIcon::SizeMedium));
979 998
980 topLayout = new QGridLayout(topFrame,2,1); 999 topLayout = new QGridLayout(topFrame,2,1);
981 topLayout->setSpacing(spacingHint()); 1000 topLayout->setSpacing(spacingHint());
982 topLayout->setMargin(marginHint()); 1001 topLayout->setMargin(marginHint());
983 int iii = 0; 1002 int iii = 0;
984 1003
985 dummy = 1004 dummy =
986 addWidBool(i18n("Use internal alarm notification"), 1005 addWidBool(i18n("Use internal alarm notification"),
987 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); 1006 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
988 topLayout->addWidget(dummy->checkBox(),iii++,0); 1007 topLayout->addWidget(dummy->checkBox(),iii++,0);
989 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); 1008 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
990 1009
991 topLayout->addWidget(lab ,iii++,0); 1010 topLayout->addWidget(lab ,iii++,0);
992#ifndef DESKTOP_VERSION 1011#ifndef DESKTOP_VERSION
993 lab->setAlignment( AlignLeft|WordBreak|AlignTop); 1012 lab->setAlignment( AlignLeft|WordBreak|AlignTop);
994#else 1013#else
995 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 1014 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
996 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 1015 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
997#endif 1016#endif
998 1017
999 QHBox* dummyBox = new QHBox(topFrame); 1018 QHBox* dummyBox = new QHBox(topFrame);
1000 new QLabel(i18n("Play beeps count:"),dummyBox); 1019 new QLabel(i18n("Play beeps count:"),dummyBox);
1001 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); 1020 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
1002 topLayout->addWidget(dummyBox,iii++,0); 1021 topLayout->addWidget(dummyBox,iii++,0);
1003 1022
1004 dummyBox = new QHBox(topFrame); 1023 dummyBox = new QHBox(topFrame);
1005 new QLabel(i18n("Beeps interval in sec:"),dummyBox); 1024 new QLabel(i18n("Beeps interval in sec:"),dummyBox);
1006 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); 1025 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
1007 topLayout->addWidget(dummyBox,iii++,0); 1026 topLayout->addWidget(dummyBox,iii++,0);
1008 1027
1009 dummyBox = new QHBox(topFrame); 1028 dummyBox = new QHBox(topFrame);
1010 new QLabel(i18n("Default suspend time in min:"),dummyBox); 1029 new QLabel(i18n("Default suspend time in min:"),dummyBox);
1011 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); 1030 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
1012 topLayout->addWidget(dummyBox,iii++,0); 1031 topLayout->addWidget(dummyBox,iii++,0);
1013 1032
1014 dummyBox = new QHBox(topFrame); 1033 dummyBox = new QHBox(topFrame);
1015 new QLabel(i18n("Auto suspend count:"),dummyBox); 1034 new QLabel(i18n("Auto suspend count:"),dummyBox);
1016 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); 1035 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox);
1017 topLayout->addWidget(dummyBox,iii++,0); 1036 topLayout->addWidget(dummyBox,iii++,0);
1018 1037
1019 1038
1020 1039
1021 1040
1022 1041
1023 1042
1024 1043
1025 QHBox* hbo = new QHBox ( topFrame ); 1044 QHBox* hbo = new QHBox ( topFrame );
1026 mDefaultAlarmFile = new QLineEdit(hbo); 1045 mDefaultAlarmFile = new QLineEdit(hbo);
1027 QPushButton * loadTemplate = new QPushButton(hbo); 1046 QPushButton * loadTemplate = new QPushButton(hbo);
1028 QPixmap icon; 1047 QPixmap icon;
1029 if ( QApplication::desktop()->width() < 321 ) 1048 if ( QApplication::desktop()->width() < 321 )
1030 icon = SmallIcon("fileimport16"); 1049 icon = SmallIcon("fileimport16");
1031 else 1050 else
1032 icon = SmallIcon("fileimport"); 1051 icon = SmallIcon("fileimport");
1033 loadTemplate->setIconSet (icon ) ; 1052 loadTemplate->setIconSet (icon ) ;
1034 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); 1053 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) );
1035 int size = loadTemplate->sizeHint().height(); 1054 int size = loadTemplate->sizeHint().height();
1036 loadTemplate->setFixedSize( size, size ); 1055 loadTemplate->setFixedSize( size, size );
1037 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); 1056 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame);
1038 // topLayout->addWidget(lab ,iii++,0); 1057 // topLayout->addWidget(lab ,iii++,0);
1039 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); 1058 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame);
1040 topLayout->addWidget(lab ,iii++,0); 1059 topLayout->addWidget(lab ,iii++,0);
1041 topLayout->addWidget(hbo,iii++,0); 1060 topLayout->addWidget(hbo,iii++,0);
1042 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); 1061 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame);
1043 1062
1044// topLayout->addWidget(lab ,iii++,0); 1063// topLayout->addWidget(lab ,iii++,0);
1045// #ifndef DESKTOP_VERSION 1064// #ifndef DESKTOP_VERSION
1046// lab->setAlignment( AlignLeft|WordBreak|AlignTop); 1065// lab->setAlignment( AlignLeft|WordBreak|AlignTop);
1047// #else 1066// #else
1048// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 1067// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
1049// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 1068// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
1050// #endif 1069// #endif
1051 1070
1052 1071
1053} 1072}
1054 1073
1055void KOPrefsDialog::selectSoundFile() 1074void KOPrefsDialog::selectSoundFile()
1056{ 1075{
1057 QString fileName = mDefaultAlarmFile->text(); 1076 QString fileName = mDefaultAlarmFile->text();
1058 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); 1077 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this );
1059 if ( fileName.length() > 0 ) 1078 if ( fileName.length() > 0 )
1060 mDefaultAlarmFile->setText( fileName ); 1079 mDefaultAlarmFile->setText( fileName );
1061} 1080}
1062void KOPrefsDialog::setupFontsTab() 1081void KOPrefsDialog::setupFontsTab()
1063{ 1082{
1064 1083
1065 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 1084 QFrame *topFrame = addPage(i18n("Fonts"),0,0);
1066 // DesktopIcon("fonts",KIcon::SizeMedium)); 1085 // DesktopIcon("fonts",KIcon::SizeMedium));
1067 1086
1068 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 1087 QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
1069 topLayout->setSpacing(1); 1088 topLayout->setSpacing(1);
1070 topLayout->setMargin(3); 1089 topLayout->setMargin(3);
1071 KPrefsDialogWidFont * tVFont; 1090 KPrefsDialogWidFont * tVFont;
1072 int i = 0; 1091 int i = 0;
1073 KPrefsDialogWidFont *timeLabelsFont = 1092 KPrefsDialogWidFont *timeLabelsFont =
1074 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), 1093 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"),
1075 &(KOPrefs::instance()->mDateNavigatorFont),topFrame); 1094 &(KOPrefs::instance()->mDateNavigatorFont),topFrame);
1076 topLayout->addWidget(timeLabelsFont->label(),i,0); 1095 topLayout->addWidget(timeLabelsFont->label(),i,0);
1077 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1096 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1078 topLayout->addWidget(timeLabelsFont->button(),i,2); 1097 topLayout->addWidget(timeLabelsFont->button(),i,2);
1079 ++i; 1098 ++i;
1080 1099
1081 1100
1082 timeLabelsFont = 1101 timeLabelsFont =
1083 addWidFont(i18n("Mon 15"),i18n("Date Labels:"), 1102 addWidFont(i18n("Mon 15"),i18n("Date Labels:"),
1084 &(KOPrefs::instance()->mTimeLabelsFont),topFrame); 1103 &(KOPrefs::instance()->mTimeLabelsFont),topFrame);
1085 topLayout->addWidget(timeLabelsFont->label(),i,0); 1104 topLayout->addWidget(timeLabelsFont->label(),i,0);
1086 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1105 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1087 topLayout->addWidget(timeLabelsFont->button(),i,2); 1106 topLayout->addWidget(timeLabelsFont->button(),i,2);
1088 ++i; 1107 ++i;
1089 1108
1090 KPrefsDialogWidFont *timeBarFont = 1109 KPrefsDialogWidFont *timeBarFont =
1091 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), 1110 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"),
1092 &(KOPrefs::instance()->mTimeBarFont),topFrame); 1111 &(KOPrefs::instance()->mTimeBarFont),topFrame);
1093 topLayout->addWidget(timeBarFont->label(),i,0); 1112 topLayout->addWidget(timeBarFont->label(),i,0);
1094 topLayout->addWidget(timeBarFont->preview(),i,1); 1113 topLayout->addWidget(timeBarFont->preview(),i,1);
1095 topLayout->addWidget(timeBarFont->button(),i,2); 1114 topLayout->addWidget(timeBarFont->button(),i,2);
1096 ++i; 1115 ++i;
1097 1116
1098 1117
1099 KPrefsDialogWidFont *marcusBainsFont = 1118 KPrefsDialogWidFont *marcusBainsFont =
1100 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), 1119 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"),
1101 &(KOPrefs::instance()->mMarcusBainsFont),topFrame); 1120 &(KOPrefs::instance()->mMarcusBainsFont),topFrame);
1102 topLayout->addWidget(marcusBainsFont->label(),i,0); 1121 topLayout->addWidget(marcusBainsFont->label(),i,0);
1103 topLayout->addWidget(marcusBainsFont->preview(),i,1); 1122 topLayout->addWidget(marcusBainsFont->preview(),i,1);
1104 topLayout->addWidget(marcusBainsFont->button(),i,2); 1123 topLayout->addWidget(marcusBainsFont->button(),i,2);
1105 ++i; 1124 ++i;
1106 1125
1107 tVFont = 1126 tVFont =
1108 addWidFont(i18n("Summary"),i18n("Event Viewer:"), 1127 addWidFont(i18n("Summary"),i18n("Event Viewer:"),
1109 &(KOPrefs::instance()->mEventViewFont),topFrame); 1128 &(KOPrefs::instance()->mEventViewFont),topFrame);
1110 topLayout->addWidget(tVFont->label(),i,0); 1129 topLayout->addWidget(tVFont->label(),i,0);
1111 topLayout->addWidget(tVFont->preview(),i,1); 1130 topLayout->addWidget(tVFont->preview(),i,1);
1112 topLayout->addWidget(tVFont->button(),i,2); 1131 topLayout->addWidget(tVFont->button(),i,2);
1113 ++i; 1132 ++i;
1114 1133
1115 1134
1116 1135
1117 tVFont = 1136 tVFont =
1118 addWidFont(i18n("Details"),i18n("EditorBox:"), 1137 addWidFont(i18n("Details"),i18n("EditorBox:"),
1119 &(KOPrefs::instance()->mEditBoxFont),topFrame); 1138 &(KOPrefs::instance()->mEditBoxFont),topFrame);
1120 topLayout->addWidget(tVFont->label(),i,0); 1139 topLayout->addWidget(tVFont->label(),i,0);
1121 topLayout->addWidget(tVFont->preview(),i,1); 1140 topLayout->addWidget(tVFont->preview(),i,1);
1122 topLayout->addWidget(tVFont->button(),i,2); 1141 topLayout->addWidget(tVFont->button(),i,2);
1123 ++i; 1142 ++i;
1124 1143
1125 1144
1126 1145
1127 topLayout->setColStretch(1,1); 1146 topLayout->setColStretch(1,1);
1128 topLayout->setRowStretch(4,1); 1147 topLayout->setRowStretch(4,1);
1129 1148
1130 1149
1131 i = 0; 1150 i = 0;
1132 topFrame = addPage(i18n("View Fonts"),0, 1151 topFrame = addPage(i18n("View Fonts"),0,
1133 DesktopIcon("fonts",KIcon::SizeMedium)); 1152 DesktopIcon("fonts",KIcon::SizeMedium));
1134 1153
1135 topLayout = new QGridLayout(topFrame,7,3); 1154 topLayout = new QGridLayout(topFrame,7,3);
1136 topLayout->setSpacing(1); 1155 topLayout->setSpacing(1);
1137 topLayout->setMargin(3); 1156 topLayout->setMargin(3);
1138 1157
1139 tVFont = 1158 tVFont =
1140 addWidFont(i18n("Configure KO"),i18n("What's Next View:"), 1159 addWidFont(i18n("Configure KO"),i18n("What's Next View:"),
1141 &(KOPrefs::instance()->mWhatsNextFont),topFrame); 1160 &(KOPrefs::instance()->mWhatsNextFont),topFrame);
1142 topLayout->addWidget(tVFont->label(),i,0); 1161 topLayout->addWidget(tVFont->label(),i,0);
1143 topLayout->addWidget(tVFont->preview(),i,1); 1162 topLayout->addWidget(tVFont->preview(),i,1);
1144 topLayout->addWidget(tVFont->button(),i,2); 1163 topLayout->addWidget(tVFont->button(),i,2);
1145 ++i; 1164 ++i;
1146 KPrefsDialogWidFont *agendaViewFont = 1165 KPrefsDialogWidFont *agendaViewFont =
1147 addWidFont(i18n("Event text"),i18n("Agenda view:"), 1166 addWidFont(i18n("Event text"),i18n("Agenda view:"),
1148 &(KOPrefs::instance()->mAgendaViewFont),topFrame); 1167 &(KOPrefs::instance()->mAgendaViewFont),topFrame);
1149 topLayout->addWidget(agendaViewFont->label(),i,0); 1168 topLayout->addWidget(agendaViewFont->label(),i,0);
1150 topLayout->addWidget(agendaViewFont->preview(),i,1); 1169 topLayout->addWidget(agendaViewFont->preview(),i,1);
1151 topLayout->addWidget(agendaViewFont->button(),i,2); 1170 topLayout->addWidget(agendaViewFont->button(),i,2);
1152 ++i; 1171 ++i;
1153 1172
1154 1173
1155 KPrefsDialogWidFont *monthViewFont = 1174 KPrefsDialogWidFont *monthViewFont =
1156 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), 1175 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"),
1157 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); 1176 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame);
1158 topLayout->addWidget(monthViewFont->label(),i,0); 1177 topLayout->addWidget(monthViewFont->label(),i,0);
1159 topLayout->addWidget(monthViewFont->preview(),i,1); 1178 topLayout->addWidget(monthViewFont->preview(),i,1);
1160 topLayout->addWidget(monthViewFont->button(),i,2); 1179 topLayout->addWidget(monthViewFont->button(),i,2);
1161 ++i; 1180 ++i;
1162 1181
1163 1182
1164 KPrefsDialogWidFont *lVFont = 1183 KPrefsDialogWidFont *lVFont =
1165 addWidFont(i18n("Event"),i18n("List View:"), 1184 addWidFont(i18n("Event"),i18n("List View:"),
1166 &(KOPrefs::instance()->mListViewFont),topFrame); 1185 &(KOPrefs::instance()->mListViewFont),topFrame);
1167 topLayout->addWidget(lVFont->label(),i,0); 1186 topLayout->addWidget(lVFont->label(),i,0);
1168 topLayout->addWidget(lVFont->preview(),i,1); 1187 topLayout->addWidget(lVFont->preview(),i,1);
1169 topLayout->addWidget(lVFont->button(),i,2); 1188 topLayout->addWidget(lVFont->button(),i,2);
1170 ++i; 1189 ++i;
1171 1190
1172 1191
1173 tVFont = 1192 tVFont =
1174 addWidFont(i18n("ToDo"),i18n("ToDoView:"), 1193 addWidFont(i18n("ToDo"),i18n("ToDoView:"),
1175 &(KOPrefs::instance()->mTodoViewFont),topFrame); 1194 &(KOPrefs::instance()->mTodoViewFont),topFrame);
1176 topLayout->addWidget(tVFont->label(),i,0); 1195 topLayout->addWidget(tVFont->label(),i,0);
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp
index 250d114..0794e00 100644
--- a/kmicromail/mainwindow.cpp
+++ b/kmicromail/mainwindow.cpp
@@ -1,394 +1,414 @@
1 1
2// CHANGED 2004-08-06 Lutz Rogowski 2// CHANGED 2004-08-06 Lutz Rogowski
3#include <qlabel.h> 3#include <qlabel.h>
4#include <qvbox.h> 4#include <qvbox.h>
5#include <qheader.h> 5#include <qheader.h>
6#include <qtimer.h> 6#include <qtimer.h>
7#include <qlayout.h> 7#include <qlayout.h>
8//#include <kdialog.h> 8//#include <kdialog.h>
9#include <kiconloader.h> 9#include <kiconloader.h>
10#include <kapplication.h> 10#include <kapplication.h>
11 11
12#ifdef DESKTOP_VERSION 12#ifdef DESKTOP_VERSION
13#include <qapplication.h> 13#include <qapplication.h>
14#include <qstatusbar.h> 14#include <qstatusbar.h>
15#include <kabc/stdaddressbook.h> 15#include <kabc/stdaddressbook.h>
16extern QStatusBar* globalSstatusBarMainWindow; 16extern QStatusBar* globalSstatusBarMainWindow;
17#else 17#else
18#include <qpe/qpeapplication.h> 18#include <qpe/qpeapplication.h>
19#include <klocale.h> 19#include <klocale.h>
20#endif 20#endif
21#include "defines.h" 21#include "defines.h"
22#include "koprefs.h"
22#include "mainwindow.h" 23#include "mainwindow.h"
23#include "mailistviewitem.h" 24#include "mailistviewitem.h"
24#include <KDGanttMinimizeSplitter.h> 25#include <KDGanttMinimizeSplitter.h>
25 26
26#include "koprefs.h" 27#include "koprefs.h"
27 28
28MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) 29MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
29 : QMainWindow( parent, name ) //, flags ) 30 : QMainWindow( parent, name ) //, flags )
30{ 31{
31#ifdef DESKTOP_VERSION 32#ifdef DESKTOP_VERSION
32 globalSstatusBarMainWindow = statusBar(); 33 globalSstatusBarMainWindow = statusBar();
33#endif 34#endif
34 setCaption( i18n( "KOpieMail/Pi" ) ); 35 setCaption( i18n( "KOpieMail/Pi" ) );
35 setToolBarsMovable( false ); 36 setToolBarsMovable( false );
36 //KABC::StdAddressBook::self(); 37 //KABC::StdAddressBook::self();
37 toolBar = new QToolBar( this ); 38 toolBar = new QToolBar( this );
38 menuBar = new QPEMenuBar( toolBar ); 39 menuBar = new QPEMenuBar( toolBar );
39 mailMenu = new QPopupMenu( menuBar ); 40 mailMenu = new QPopupMenu( menuBar );
40 menuBar->insertItem( i18n( "Mail" ), mailMenu ); 41 menuBar->insertItem( i18n( "Mail" ), mailMenu );
41 settingsMenu = new QPopupMenu( menuBar ); 42 settingsMenu = new QPopupMenu( menuBar );
42 menuBar->insertItem( i18n( "Settings" ), settingsMenu ); 43 menuBar->insertItem( i18n( "Settings" ), settingsMenu );
43 44
44 addToolBar( toolBar ); 45 addToolBar( toolBar );
45 toolBar->setHorizontalStretchable( true ); 46 toolBar->setHorizontalStretchable( true );
46 QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), 47 QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"),
47 0, 0, this ); 48 0, 0, this );
48 connect(getMail, SIGNAL( activated() ), 49 connect(getMail, SIGNAL( activated() ),
49 SLOT( slotGetAllMail() ) ); 50 SLOT( slotGetAllMail() ) );
50 getMail->addTo( mailMenu ); 51 getMail->addTo( mailMenu );
51 52
52 getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), 53 getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"),
53 0, 0, this ); 54 0, 0, this );
54 getMail->addTo( toolBar ); 55 getMail->addTo( toolBar );
55 getMail->addTo( mailMenu ); 56 getMail->addTo( mailMenu );
56 connect(getMail, SIGNAL( activated() ), 57 connect(getMail, SIGNAL( activated() ),
57 SLOT( slotGetMail() ) ); 58 SLOT( slotGetMail() ) );
58 59
59 composeMail = new QAction( i18n( "Compose new mail" ), SmallIcon("composemail"), 60 composeMail = new QAction( i18n( "Compose new mail" ), SmallIcon("composemail"),
60 0, 0, this ); 61 0, 0, this );
61 composeMail->addTo( toolBar ); 62 composeMail->addTo( toolBar );
62 composeMail->addTo( mailMenu ); 63 composeMail->addTo( mailMenu );
63 64
64 sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") , 65 sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") ,
65 0, 0, this ); 66 0, 0, this );
66 sendQueued->addTo( toolBar ); 67 sendQueued->addTo( toolBar );
67 sendQueued->addTo( mailMenu ); 68 sendQueued->addTo( mailMenu );
68 69
69 /* 70 /*
70 syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC, 71 syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC,
71 0, 0, this ); 72 0, 0, this );
72 syncFolders->addTo( toolBar ); 73 syncFolders->addTo( toolBar );
73 syncFolders->addTo( mailMenu ); 74 syncFolders->addTo( mailMenu );
74 */ 75 */
75 76
76 showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") , 77 showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") ,
77 0, 0, this, 0, true ); 78 0, 0, this, 0, true );
78 showFolders->addTo( toolBar ); 79 showFolders->addTo( toolBar );
79 showFolders->addTo( mailMenu ); 80 showFolders->addTo( mailMenu );
80 showFolders->setOn( true ); 81 showFolders->setOn( true );
81 connect(showFolders, SIGNAL( toggled(bool) ), 82 connect(showFolders, SIGNAL( toggled(bool) ),
82 SLOT( slotShowFolders(bool) ) ); 83 SLOT( slotShowFolders(bool) ) );
83 84
84 /* 85 /*
85 searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), 86 searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ),
86 0, 0, this ); 87 0, 0, this );
87 searchMails->addTo( toolBar ); 88 searchMails->kopddTo( toolBar );
88 searchMails->addTo( mailMenu ); 89 searchMails->addTo( mailMenu );
89 */ 90 */
90 91
91 deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this); 92 deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this);
92 deleteMails->addTo( toolBar ); 93 deleteMails->addTo( toolBar );
93 deleteMails->addTo( mailMenu ); 94 deleteMails->addTo( mailMenu );
94 connect( deleteMails, SIGNAL( activated() ), 95 connect( deleteMails, SIGNAL( activated() ),
95 SLOT( slotDeleteAllMail() ) ); 96 SLOT( slotDeleteAllMail() ) );
96 97
97 editSettings = new QAction( i18n( "Edit settings" ), SmallIcon("SettingsIcon") , 98 editSettings = new QAction( i18n( "Edit settings" ), SmallIcon("SettingsIcon") ,
98 0, 0, this ); 99 0, 0, this );
99 editSettings->addTo( settingsMenu ); 100 editSettings->addTo( settingsMenu );
100 connect( editSettings, SIGNAL( activated() ), 101 connect( editSettings, SIGNAL( activated() ),
101 SLOT( slotEditSettings() ) ); 102 SLOT( slotEditSettings() ) );
102 editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , 103 editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") ,
103 0, 0, this ); 104 0, 0, this );
104 editAccounts->addTo( settingsMenu ); 105 editAccounts->addTo( settingsMenu );
105 codecMenu = new QPopupMenu( menuBar ); 106 codecMenu = new QPopupMenu( menuBar );
106 codecMenu->insertItem( "Western (iso-8859-1)",0,0); 107 codecMenu->insertItem( "Western (iso-8859-1)",0,0);
107 codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1); 108 codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1);
108 codecMenu->insertItem( "Western (iso-8859-15)",2,2); 109 codecMenu->insertItem( "Western (iso-8859-15)",2,2);
109 codecMenu->insertItem( "Chinese (big-5)",3,3); 110 codecMenu->insertItem( "Chinese (big-5)",3,3);
110 codecMenu->insertItem( "Unicode (utf-8)",4,4); 111 codecMenu->insertItem( "Unicode (utf-8)",4,4);
111 codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5); 112 codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5);
112 //disabled 113 //disabled
113 //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu); 114 //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu);
114 //setCentralWidget( view ); 115 //setCentralWidget( view );
115 116
116 QVBox* wrapperBox = new QVBox( this ); 117 QVBox* wrapperBox = new QVBox( this );
117 setCentralWidget( wrapperBox ); 118 setCentralWidget( wrapperBox );
118 119
119 // QWidget *view = new QWidget( wrapperBox ); 120 // QWidget *view = new QWidget( wrapperBox );
120 KDGanttMinimizeSplitter* splithor = new KDGanttMinimizeSplitter( Qt::Vertical, wrapperBox); 121 KDGanttMinimizeSplitter* splithor = new KDGanttMinimizeSplitter( Qt::Vertical, wrapperBox);
121 splithor->setMinimizeDirection( KDGanttMinimizeSplitter::Down); 122 splithor->setMinimizeDirection( KDGanttMinimizeSplitter::Down);
122 KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor); 123 KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor);
123 split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); 124 split->setMinimizeDirection( KDGanttMinimizeSplitter::Left);
124 //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); 125 //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight );
125 QWidget* infoBox = new QWidget( splithor ); 126 subLE = 0;
126 QGridLayout *griLay = new QGridLayout( infoBox, 2,2); 127 fromLE = 0;
127 griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); 128 toLE = 0;
128 griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); 129 if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) {
129 griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); 130 QWidget* infoBox = new QWidget( splithor );
130 griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; 131 QGridLayout *griLay = new QGridLayout( infoBox, 2,2);
131 griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; 132 if ( KOPrefs::instance()->mShowInfoSub ) {
132 griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; 133 griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 );
133 infoBox->setMaximumHeight( infoBox->sizeHint().height() ); 134 griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ;
135 }
136 if ( KOPrefs::instance()->mShowInfoFrom ) {
137 griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 );
138 griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ;
139 }
140 if ( KOPrefs::instance()->mShowInfoTo ) {
141 griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 );
142 griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ;
143 }
144 infoBox->setMaximumHeight( infoBox->sizeHint().height() );
145 if ( !KOPrefs::instance()->mShowInfoStart ) {
146 QTimer::singleShot( 1,splithor, SLOT ( toggle() ) );
147 }
148 }
149
150
134 folderView = new AccountView( split ); 151 folderView = new AccountView( split );
135 folderView->header()->hide(); 152 folderView->header()->hide();
136 folderView->setRootIsDecorated( false ); 153 folderView->setRootIsDecorated( false );
137 folderView->addColumn( i18n( "Mailbox" ) ); 154 folderView->addColumn( i18n( "Mailbox" ) );
138 155
139 //layout->addWidget( folderView ); 156 //layout->addWidget( folderView );
140 157
141 mailView = new QListView( split ); 158 mailView = new QListView( split );
142 mailView->addColumn( i18n( " " ) ); 159 mailView->addColumn( i18n( " " ) );
143 mailView->addColumn( i18n( "Subject" ),QListView::Manual ); 160 mailView->addColumn( i18n( "Subject" ),QListView::Manual );
144 mailView->addColumn( i18n( "Sender" ),QListView::Manual ); 161 mailView->addColumn( i18n( "Sender" ),QListView::Manual );
145 mailView->addColumn( i18n( "Size" ),QListView::Manual); 162 mailView->addColumn( i18n( "Size" ),QListView::Manual);
146 mailView->addColumn( i18n( "Date" ),QListView::Manual); 163 mailView->addColumn( i18n( "Date" ),QListView::Manual);
147 if ( KOPrefs::instance()->mShowToField ) 164 if ( KOPrefs::instance()->mShowToField )
148 mailView->addColumn( i18n( "To" ),QListView::Manual); 165 mailView->addColumn( i18n( "To" ),QListView::Manual);
149 mailView->setAllColumnsShowFocus(true); 166 mailView->setAllColumnsShowFocus(true);
150 //mailView->setSorting(-1); 167 //mailView->setSorting(-1);
151 mailView->setRootIsDecorated( false ); 168 mailView->setRootIsDecorated( false );
152 statusWidget = new StatusWidget( wrapperBox ); 169 statusWidget = new StatusWidget( wrapperBox );
153 statusWidget->hide(); 170 statusWidget->hide();
154 171
155 //layout->addWidget( mailView ); 172 //layout->addWidget( mailView );
156 //layout->setStretchFactor( folderView, 1 ); 173 //layout->setStretchFactor( folderView, 1 );
157 //layout->setStretchFactor( mailView, 2 ); 174 //layout->setStretchFactor( mailView, 2 );
158 175
159 slotAdjustLayout(); 176 slotAdjustLayout();
160#ifndef DESKTOP_VERSION 177#ifndef DESKTOP_VERSION
161 QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); 178 QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold);
162 QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); 179 QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold);
163 QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); 180 if ( subLE )
164 QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); 181 QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold);
165 QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); 182 if ( fromLE )
183 QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold);
184 if ( toLE )
185 QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold);
166#endif 186#endif
167 connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, 187 connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this,
168 SLOT( mailLeftClicked(QListViewItem*) ) ); 188 SLOT( mailLeftClicked(QListViewItem*) ) );
169 connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, 189 connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this,
170 SLOT( mailLeftClicked(QListViewItem*) ) ); 190 SLOT( mailLeftClicked(QListViewItem*) ) );
171 connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, 191 connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this,
172 SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); 192 SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) );
173 connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), 193 connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)),
174 this,SLOT(refreshMailView(const QValueList<RecMailP>&))); 194 this,SLOT(refreshMailView(const QValueList<RecMailP>&)));
175 195
176 connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, 196 connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this,
177 SLOT( setInfoFields(QListViewItem*) ) ); 197 SLOT( setInfoFields(QListViewItem*) ) );
178 198
179 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); 199 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) );
180 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); 200 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) );
181// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); 201// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) );
182 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); 202 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) );
183 //mailView->setMultiSelection ( true ); 203 //mailView->setMultiSelection ( true );
184 mailView->setSelectionMode( QListView::Extended ); 204 mailView->setSelectionMode( QListView::Extended );
185 QValueList<int> list; 205 QValueList<int> list;
186 int fw = 100; 206 int fw = 100;
187 if ( QApplication::desktop()->width() > 320 ) 207 if ( QApplication::desktop()->width() > 320 )
188 fw = 50; 208 fw = 50;
189 list.append( fw ); 209 list.append( fw );
190 list.append( 100 ); 210 list.append( 100 );
191 split->setSizes( list ); 211 split->setSizes( list );
192 QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); 212 QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) );
193 mailView->setShowSortIndicator ( true ); 213 mailView->setShowSortIndicator ( true );
194 QLabel *spacer = new QLabel( toolBar ); 214 QLabel *spacer = new QLabel( toolBar );
195 spacer->setBackgroundMode( QWidget::PaletteButton ); 215 spacer->setBackgroundMode( QWidget::PaletteButton );
196 toolBar->setStretchableWidget( spacer ); 216 toolBar->setStretchableWidget( spacer );
197 217
198 QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); 218 QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this);
199 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); 219 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) );
200 if ( QApplication::desktop()->width() > 320 ) 220 if ( QApplication::desktop()->width() > 320 )
201 closeMail->addTo(toolBar); 221 closeMail->addTo(toolBar);
202 closeMail->addTo(mailMenu); 222 closeMail->addTo(mailMenu);
203 223
204 224
205 QPopupMenu* helpMenu = new QPopupMenu( menuBar ); 225 QPopupMenu* helpMenu = new QPopupMenu( menuBar );
206 menuBar->insertItem( i18n( "Help" ), helpMenu ); 226 menuBar->insertItem( i18n( "Help" ), helpMenu );
207 QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); 227 QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this);
208 connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); 228 connect( li, SIGNAL( activated() ), SLOT( showAbout()) );
209 li->addTo(helpMenu); 229 li->addTo(helpMenu);
210 li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); 230 li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this);
211 connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); 231 connect( li, SIGNAL( activated() ), SLOT( showLicence()) );
212 li->addTo(helpMenu); 232 li->addTo(helpMenu);
213 li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); 233 li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this);
214 connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); 234 connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) );
215 li->addTo(helpMenu); 235 li->addTo(helpMenu);
216 connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); 236 connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) );
217 slotSetCodec( KOPrefs::instance()->mCurrentCodec ); 237 slotSetCodec( KOPrefs::instance()->mCurrentCodec );
218#ifdef DESKTOP_VERSION 238#ifdef DESKTOP_VERSION
219 resize ( 640, 480 ); 239 resize ( 640, 480 );
220#endif 240#endif
221} 241}
222 242
223MainWindow::~MainWindow() 243MainWindow::~MainWindow()
224{ 244{
225} 245}
226 246
227void MainWindow::setInfoFields(QListViewItem* item ) 247void MainWindow::setInfoFields(QListViewItem* item )
228{ 248{
229 if ( item == 0) { 249 if ( item == 0) {
230 subLE->setText(""); 250 if ( subLE ) subLE->setText("");
231 fromLE->setText(""); 251 if ( fromLE ) fromLE->setText("");
232 toLE->setText(""); 252 if ( toLE ) toLE->setText("");
233 return; 253 return;
234 } 254 }
235 RecMailP mail = ((MailListViewItem*)item)->data(); 255 RecMailP mail = ((MailListViewItem*)item)->data();
236 subLE->setText(mail->getSubject()); 256 if ( subLE ) subLE->setText(mail->getSubject());
237 fromLE->setText(mail->getFrom()); 257 if ( fromLE ) fromLE->setText(mail->getFrom());
238 toLE->setText(mail->To().join(";" )); 258 if ( toLE ) toLE->setText(mail->To().join(";" ));
239 subLE->setCursorPosition(0); 259 if ( subLE ) subLE->setCursorPosition(0);
240 fromLE->setCursorPosition(0); 260 if ( fromLE ) fromLE->setCursorPosition(0);
241 toLE->setCursorPosition(0); 261 if ( toLE ) toLE->setCursorPosition(0);
242 262
243} 263}
244void MainWindow::slotSetCodec( int codec ) 264void MainWindow::slotSetCodec( int codec )
245{ 265{
246 codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false ); 266 codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false );
247 //qDebug("codec %d ", codec); 267 //qDebug("codec %d ", codec);
248 KOPrefs::instance()->mCurrentCodec = codec; 268 KOPrefs::instance()->mCurrentCodec = codec;
249 KOPrefs::instance()->isDirty = true; 269 KOPrefs::instance()->isDirty = true;
250 QString name; 270 QString name;
251 switch ( codec ) { 271 switch ( codec ) {
252 case 0: 272 case 0:
253 name = "iso-8859-1"; 273 name = "iso-8859-1";
254 break; 274 break;
255 case 1: 275 case 1:
256 name = "iso-8859-5"; 276 name = "iso-8859-5";
257 break; 277 break;
258 case 2: 278 case 2:
259 name = "iso-8859-15"; 279 name = "iso-8859-15";
260 break; 280 break;
261 case 3: 281 case 3:
262 name = "big-5"; 282 name = "big-5";
263 break; 283 break;
264 case 4: 284 case 4:
265 name = "utf-8"; 285 name = "utf-8";
266 break; 286 break;
267 case 5: 287 case 5:
268 name = KOPrefs::instance()->mSendCodec.lower(); 288 name = KOPrefs::instance()->mSendCodec.lower();
269 break; 289 break;
270 } 290 }
271 KOPrefs::instance()->mCurrentCodeName = name ; 291 KOPrefs::instance()->mCurrentCodeName = name ;
272 codecMenu->changeItem ( 5, "Userdefined ("+KOPrefs::instance()->mSendCodec+")"); 292 codecMenu->changeItem ( 5, "Userdefined ("+KOPrefs::instance()->mSendCodec+")");
273 codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, true ); 293 codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, true );
274} 294}
275void MainWindow::showLicence() 295void MainWindow::showLicence()
276{ 296{
277 KApplication::showLicence(); 297 KApplication::showLicence();
278} 298}
279void MainWindow::showAbout() 299void MainWindow::showAbout()
280{ 300{
281 QString version; 301 QString version;
282#include <../version> 302#include <../version>
283 303
284 QString cap = "About KOpieMail/Pi"; 304 QString cap = "About KOpieMail/Pi";
285 QString text =i18n("KOpieMail/Platform-independent\n") + 305 QString text =i18n("KOpieMail/Platform-independent\n") +
286 "(OM/Pi) " + version + " - " 306 "(OM/Pi) " + version + " - "
287 307
288#ifdef DESKTOP_VERSION 308#ifdef DESKTOP_VERSION
289 "Desktop Edition\n" 309 "Desktop Edition\n"
290#else 310#else
291 "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" 311 "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n"
292#endif 312#endif
293 "www.pi-sync.net\n\n" 313 "www.pi-sync.net\n\n"
294 314
295 315
296 316
297"Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net>\n" 317"Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net>\n"
298 "KOpieMail/Pi is based on Opie Mail\n" 318 "KOpieMail/Pi is based on Opie Mail\n"
299 "Copyright (c) Rajko Albrecht and the Opie team\n" 319 "Copyright (c) Rajko Albrecht and the Opie team\n"
300 "KOpieMail/Pi is licensed under the GPL\n" 320 "KOpieMail/Pi is licensed under the GPL\n"
301 "\n" 321 "\n"
302 "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" 322 "KOpieMail/Pi uses LibEtPan - a mail stuff library\n"
303 "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" 323 "Copyright (C) 2001, 2002 - DINH Viet Hoa\n"
304 "libEtPan has its own licence - see LibEtPan licence\n"; 324 "libEtPan has its own licence - see LibEtPan licence\n";
305 325
306 KApplication::showText( cap, text ); 326 KApplication::showText( cap, text );
307} 327}
308void MainWindow::showEtpanLicence() 328void MainWindow::showEtpanLicence()
309{ 329{
310 KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); 330 KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" );
311 331
312} 332}
313void MainWindow::appMessage(const QCString &, const QByteArray &) 333void MainWindow::appMessage(const QCString &, const QByteArray &)
314{ 334{
315 qDebug("appMessage implemented by subclass"); 335 qDebug("appMessage implemented by subclass");
316} 336}
317 337
318void MainWindow::slotAdjustLayout() { 338void MainWindow::slotAdjustLayout() {
319 339
320 /* 340 /*
321 QWidget *d = QApplication::desktop(); 341 QWidget *d = QApplication::desktop();
322 342
323 if ( d->width() < d->height() ) { 343 if ( d->width() < d->height() ) {
324 layout->setDirection( QBoxLayout::TopToBottom ); 344 layout->setDirection( QBoxLayout::TopToBottom );
325 } else { 345 } else {
326 layout->setDirection( QBoxLayout::LeftToRight ); 346 layout->setDirection( QBoxLayout::LeftToRight );
327 } 347 }
328 */ 348 */
329} 349}
330 350
331void MainWindow::slotAdjustColumns() 351void MainWindow::slotAdjustColumns()
332{ 352{
333 bool hidden = folderView->isHidden(); 353 bool hidden = folderView->isHidden();
334 if ( hidden ) folderView->show(); 354 if ( hidden ) folderView->show();
335 folderView->setColumnWidth( 0, folderView->visibleWidth() ); 355 folderView->setColumnWidth( 0, folderView->visibleWidth() );
336 if ( hidden ) folderView->hide(); 356 if ( hidden ) folderView->hide();
337 357
338 mailView->setColumnWidth( 0, 10 ); 358 mailView->setColumnWidth( 0, 10 );
339 mailView->setColumnWidth( 1, 100 ); 359 mailView->setColumnWidth( 1, 100 );
340 mailView->setColumnWidth( 2, 100 ); 360 mailView->setColumnWidth( 2, 100 );
341 mailView->setColumnWidth( 3, 50 ); 361 mailView->setColumnWidth( 3, 50 );
342 mailView->setColumnWidth( 4, 120 ); 362 mailView->setColumnWidth( 4, 120 );
343 if ( KOPrefs::instance()->mShowToField ) 363 if ( KOPrefs::instance()->mShowToField )
344 mailView->setColumnWidth( 5, 100 ); 364 mailView->setColumnWidth( 5, 100 );
345} 365}
346 366
347void MainWindow::slotEditSettings() 367void MainWindow::slotEditSettings()
348{ 368{
349} 369}
350 370
351void MainWindow::slotShowFolders( bool ) 371void MainWindow::slotShowFolders( bool )
352{ 372{
353 qDebug("not implemented: "); 373 qDebug("not implemented: ");
354} 374}
355 375
356void MainWindow::refreshMailView(const QValueList<RecMailP>&) 376void MainWindow::refreshMailView(const QValueList<RecMailP>&)
357{ 377{
358 qDebug("not implemented: "); 378 qDebug("not implemented: ");
359} 379}
360 380
361void MainWindow::mailLeftClicked(QListViewItem * ) 381void MainWindow::mailLeftClicked(QListViewItem * )
362{ 382{
363 qDebug("not implemented: "); 383 qDebug("not implemented: ");
364} 384}
365 385
366void MainWindow::displayMail() 386void MainWindow::displayMail()
367{ 387{
368 qDebug("not implemented: "); 388 qDebug("not implemented: ");
369} 389}
370 390
371void MainWindow::slotDeleteMail() 391void MainWindow::slotDeleteMail()
372{ 392{
373 qDebug("not implemented: "); 393 qDebug("not implemented: ");
374} 394}
375 395
376void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) 396void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int )
377{ 397{
378 qDebug("not implemented: "); 398 qDebug("not implemented: ");
379} 399}
380 400
381void MainWindow::slotSendQueued() 401void MainWindow::slotSendQueued()
382{ 402{
383 qDebug("not implemented: "); 403 qDebug("not implemented: ");
384} 404}
385 405
386void MainWindow::slotEditAccounts() 406void MainWindow::slotEditAccounts()
387{ 407{
388 qDebug("not implemented: "); 408 qDebug("not implemented: ");
389} 409}
390 410
391void MainWindow::slotComposeMail() 411void MainWindow::slotComposeMail()
392{ 412{
393 qDebug("not implemented: "); 413 qDebug("not implemented: ");
394} 414}
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 68f0eb3..f56711d 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -1,640 +1,641 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2// CHANGED 2004-08-06 Lutz Rogowski 2// CHANGED 2004-08-06 Lutz Rogowski
3 3
4 4
5#define protected public 5#define protected public
6#include <qwidget.h> 6#include <qwidget.h>
7#undef protected 7#undef protected
8#include "koprefsdialog.h" 8#include "koprefsdialog.h"
9#include <kapplication.h> 9#include <kapplication.h>
10#include <libkdepim/externalapphandler.h> 10#include <libkdepim/externalapphandler.h>
11#include <libkdepim/kpimglobalprefs.h> 11#include <libkdepim/kpimglobalprefs.h>
12#ifdef MINIKDE_KDIALOG_H 12#ifdef MINIKDE_KDIALOG_H
13#undef MINIKDE_KDIALOG_H 13#undef MINIKDE_KDIALOG_H
14#endif 14#endif
15#include "settingsdialog.h" 15#include "settingsdialog.h"
16#include "opiemail.h" 16#include "opiemail.h"
17#include "editaccounts.h" 17#include "editaccounts.h"
18#include "composemail.h" 18#include "composemail.h"
19#include "mailistviewitem.h" 19#include "mailistviewitem.h"
20#include "viewmail.h" 20#include "viewmail.h"
21#include "selectstore.h" 21#include "selectstore.h"
22#include "selectsmtp.h" 22#include "selectsmtp.h"
23#include "accountitem.h" 23#include "accountitem.h"
24#include "accountview.h" 24#include "accountview.h"
25#include "klocale.h" 25#include "klocale.h"
26 26
27#include <qmessagebox.h> 27#include <qmessagebox.h>
28#include <qtimer.h> 28#include <qtimer.h>
29#include <qcursor.h> 29#include <qcursor.h>
30#include <qtextbrowser.h> 30#include <qtextbrowser.h>
31#include <qregexp.h> 31#include <qregexp.h>
32#include <qpe/global.h> 32#include <qpe/global.h>
33 33
34#ifdef DESKTOP_VERSION 34#ifdef DESKTOP_VERSION
35#include <qapplication.h> 35#include <qapplication.h>
36#else 36#else
37#include <qpe/qpeapplication.h> 37#include <qpe/qpeapplication.h>
38#endif 38#endif
39#include <libmailwrapper/smtpwrapper.h> 39#include <libmailwrapper/smtpwrapper.h>
40#include <libmailwrapper/mailtypes.h> 40#include <libmailwrapper/mailtypes.h>
41#include <libmailwrapper/abstractmail.h> 41#include <libmailwrapper/abstractmail.h>
42#include "koprefs.h" 42#include "koprefs.h"
43 43
44//using namespace Opie::Core; 44//using namespace Opie::Core;
45 45
46OpieMail::OpieMail( QWidget *parent, const char *name ) 46OpieMail::OpieMail( QWidget *parent, const char *name )
47 : MainWindow( parent, name) //, WStyle_ContextHelp ) 47 : MainWindow( parent, name) //, WStyle_ContextHelp )
48{ 48{
49 settings = new Settings(); 49 settings = new Settings();
50 tb = 0; 50 tb = 0;
51 setIcon(SmallIcon( "kmicromail" ) ); 51 setIcon(SmallIcon( "kmicromail" ) );
52 folderView->populate( settings->getAccounts() ); 52 folderView->populate( settings->getAccounts() );
53 53
54} 54}
55 55
56OpieMail::~OpieMail() 56OpieMail::~OpieMail()
57{ 57{
58 if (settings) delete settings; 58 if (settings) delete settings;
59 if ( tb ) 59 if ( tb )
60 delete tb; 60 delete tb;
61} 61}
62 62
63void OpieMail::appMessage(const QCString &msg, const QByteArray &data) 63void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
64{ 64{
65 65
66} 66}
67#include <stdlib.h> 67#include <stdlib.h>
68void OpieMail::message(const QCString &msg, const QByteArray &data) 68void OpieMail::message(const QCString &msg, const QByteArray &data)
69{ 69{
70 // copied from old mail2 70 // copied from old mail2
71 static int ii = 0; 71 static int ii = 0;
72 //qDebug("QCOP CALL ############################# %d ", ii); 72 //qDebug("QCOP CALL ############################# %d ", ii);
73 //QString mess ( msg ); 73 //QString mess ( msg );
74 //qDebug("Message = %s ",mess.latin1()); 74 //qDebug("Message = %s ",mess.latin1());
75 ++ii; 75 ++ii;
76 //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); 76 //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this);
77 77
78 mPendingEmail = QString::null; 78 mPendingEmail = QString::null;
79 mPendingName = QString::null; 79 mPendingName = QString::null;
80 if (msg == "writeMail(QString,QString)") 80 if (msg == "writeMail(QString,QString)")
81 { 81 {
82 //qDebug("writeMail(QString,QString) "); 82 //qDebug("writeMail(QString,QString) ");
83 QDataStream stream(data,IO_ReadOnly); 83 QDataStream stream(data,IO_ReadOnly);
84 stream >> mPendingName >> mPendingEmail; 84 stream >> mPendingName >> mPendingEmail;
85 // removing the whitespaces at beginning and end is needed! 85 // removing the whitespaces at beginning and end is needed!
86 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); 86 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
87 } 87 }
88 else if (msg == "newMail()") 88 else if (msg == "newMail()")
89 { 89 {
90 //qDebug("slotComposeMail() "); 90 //qDebug("slotComposeMail() ");
91 // we cannot call slotComposeMail(); directly, because may be executing a QCOP call 91 // we cannot call slotComposeMail(); directly, because may be executing a QCOP call
92 // and a QCOP call does not like a processevents in his execution 92 // and a QCOP call does not like a processevents in his execution
93 // with the Qtimer we call slotComposeMail() after we reached the main event loop 93 // with the Qtimer we call slotComposeMail() after we reached the main event loop
94 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); 94 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
95 // slotComposeMail(); 95 // slotComposeMail();
96 } 96 }
97 else if (msg == "newMail(QString)") 97 else if (msg == "newMail(QString)")
98 { 98 {
99 //qDebug(" newMail(QString)"); 99 //qDebug(" newMail(QString)");
100 QDataStream stream(data,IO_ReadOnly); 100 QDataStream stream(data,IO_ReadOnly);
101 stream >> mPendingName; 101 stream >> mPendingName;
102 // the format is 102 // the format is
103 // NAME <EMAIL>:SUBJECT 103 // NAME <EMAIL>:SUBJECT
104 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); 104 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
105 } else { 105 } else {
106 mPendingData = data; 106 mPendingData = data;
107 mPendingMessage = msg; 107 mPendingMessage = msg;
108 QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) ); 108 QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) );
109 } 109 }
110 110
111 //qDebug("END OpieMail::message "); 111 //qDebug("END OpieMail::message ");
112} 112}
113void OpieMail::slotExtAppHandler() 113void OpieMail::slotExtAppHandler()
114{ 114{
115 ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData ); 115 ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData );
116} 116}
117void OpieMail::slotwriteMail2(const QString& namemail ) 117void OpieMail::slotwriteMail2(const QString& namemail )
118{ 118{
119 //qDebug("OpieMail::slotwriteMail2 "); 119 //qDebug("OpieMail::slotwriteMail2 ");
120 //qApp->processEvents(); 120 //qApp->processEvents();
121 ComposeMail compose( settings, this, 0, true ); 121 ComposeMail compose( settings, this, 0, true );
122 if ( !namemail.isEmpty() ) { 122 if ( !namemail.isEmpty() ) {
123 QString to = namemail; 123 QString to = namemail;
124 if ( namemail.find( " <") > 1 ) { 124 if ( namemail.find( " <") > 1 ) {
125 to = "\"" +to.replace( QRegExp( " <"), "\" <") ; 125 to = "\"" +to.replace( QRegExp( " <"), "\" <") ;
126 } else 126 } else
127 if ( namemail.find( "<") > 1 ) { 127 if ( namemail.find( "<") > 1 ) {
128 to = "\"" +to.replace( QRegExp( "<"), "\" <") ; 128 to = "\"" +to.replace( QRegExp( "<"), "\" <") ;
129 } 129 }
130 int sub = to.find( ">:"); 130 int sub = to.find( ">:");
131 if ( sub > 0 ) { 131 if ( sub > 0 ) {
132 compose.setTo( to.left(sub+1) ); 132 compose.setTo( to.left(sub+1) );
133 compose.setSubject( to.mid(sub+2) ); 133 compose.setSubject( to.mid(sub+2) );
134 } else 134 } else
135 compose.setTo( to ); 135 compose.setTo( to );
136 } 136 }
137 compose.slotAdjustColumns(); 137 compose.slotAdjustColumns();
138#ifndef DESKTOP_VERSION 138#ifndef DESKTOP_VERSION
139 compose.showMaximized(); 139 compose.showMaximized();
140#endif 140#endif
141 compose.exec(); 141 compose.exec();
142 raise(); 142 raise();
143 //qDebug("retttich "); 143 //qDebug("retttich ");
144} 144}
145void OpieMail::slotwriteMail(const QString&name,const QString&email) 145void OpieMail::slotwriteMail(const QString&name,const QString&email)
146{ 146{
147 // qDebug("OpieMail::slotwriteMail "); 147 // qDebug("OpieMail::slotwriteMail ");
148 ComposeMail compose( settings, this, 0, true ); 148 ComposeMail compose( settings, this, 0, true );
149 if (!email.isEmpty()) 149 if (!email.isEmpty())
150 { 150 {
151 if (!name.isEmpty()) 151 if (!name.isEmpty())
152 { 152 {
153 compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); 153 compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">");
154 } 154 }
155 else 155 else
156 { 156 {
157 compose.setTo(email); 157 compose.setTo(email);
158 } 158 }
159 } 159 }
160 compose.slotAdjustColumns(); 160 compose.slotAdjustColumns();
161#ifndef DESKTOP_VERSION 161#ifndef DESKTOP_VERSION
162 compose.showMaximized(); 162 compose.showMaximized();
163#endif 163#endif
164 compose.exec(); 164 compose.exec();
165 raise(); 165 raise();
166} 166}
167 167
168void OpieMail::slotComposeMail() 168void OpieMail::slotComposeMail()
169{ 169{
170 if ( mPendingEmail == QString::null && mPendingName == QString::null) 170 if ( mPendingEmail == QString::null && mPendingName == QString::null)
171 slotwriteMail2( QString () ); 171 slotwriteMail2( QString () );
172 else { 172 else {
173 if ( mPendingEmail == QString::null ) 173 if ( mPendingEmail == QString::null )
174 slotwriteMail2( mPendingName ); 174 slotwriteMail2( mPendingName );
175 else 175 else
176 slotwriteMail( mPendingName, mPendingEmail ); 176 slotwriteMail( mPendingName, mPendingEmail );
177 } 177 }
178 //slotwriteMail(0l,0l); 178 //slotwriteMail(0l,0l);
179} 179}
180 180
181void OpieMail::slotSendQueued() 181void OpieMail::slotSendQueued()
182{ 182{
183 SMTPaccount *smtp = 0; 183 SMTPaccount *smtp = 0;
184 184
185 QList<Account> list = settings->getAccounts(); 185 QList<Account> list = settings->getAccounts();
186 QList<SMTPaccount> smtpList; 186 QList<SMTPaccount> smtpList;
187 smtpList.setAutoDelete(false); 187 smtpList.setAutoDelete(false);
188 Account *it; 188 Account *it;
189 for ( it = list.first(); it; it = list.next() ) 189 for ( it = list.first(); it; it = list.next() )
190 { 190 {
191 if ( it->getType() == MAILLIB::A_SMTP ) 191 if ( it->getType() == MAILLIB::A_SMTP )
192 { 192 {
193 smtp = static_cast<SMTPaccount *>(it); 193 smtp = static_cast<SMTPaccount *>(it);
194 smtpList.append(smtp); 194 smtpList.append(smtp);
195 } 195 }
196 } 196 }
197 if (smtpList.count()==0) 197 if (smtpList.count()==0)
198 { 198 {
199 QMessageBox::information(0,i18n("Info"),i18n("Define a smtp account first!\n")); 199 QMessageBox::information(0,i18n("Info"),i18n("Define a smtp account first!\n"));
200 return; 200 return;
201 } 201 }
202 if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to send\nall queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) 202 if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to send\nall queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
203 return; 203 return;
204 if (smtpList.count()==1) 204 if (smtpList.count()==1)
205 { 205 {
206 smtp = smtpList.at(0); 206 smtp = smtpList.at(0);
207 } 207 }
208 else 208 else
209 { 209 {
210 smtp = 0; 210 smtp = 0;
211 selectsmtp selsmtp; 211 selectsmtp selsmtp;
212 selsmtp.setSelectionlist(&smtpList); 212 selsmtp.setSelectionlist(&smtpList);
213#ifndef DESKTOP_VERSION 213#ifndef DESKTOP_VERSION
214 selsmtp.showMaximized(); 214 selsmtp.showMaximized();
215#endif 215#endif
216 if ( selsmtp.exec() == QDialog::Accepted ) 216 if ( selsmtp.exec() == QDialog::Accepted )
217 { 217 {
218 smtp = selsmtp.selected_smtp(); 218 smtp = selsmtp.selected_smtp();
219 } 219 }
220 } 220 }
221 if (smtp) 221 if (smtp)
222 { 222 {
223 223
224 Global::statusMessage("Sending mails...!"); 224 Global::statusMessage("Sending mails...!");
225 SMTPwrapper * wrap = new SMTPwrapper(smtp); 225 SMTPwrapper * wrap = new SMTPwrapper(smtp);
226 if ( wrap->flushOutbox() ) 226 if ( wrap->flushOutbox() )
227 { 227 {
228 Global::statusMessage("Mails sent!"); 228 Global::statusMessage("Mails sent!");
229 } 229 }
230 delete wrap; 230 delete wrap;
231 } 231 }
232 // pending refresh list view, if outgoing is displayed 232 // pending refresh list view, if outgoing is displayed
233} 233}
234 234
235void OpieMail::slotSearchMails() 235void OpieMail::slotSearchMails()
236{ 236{
237 qDebug("OpieMail::slotSearchMails():not implemented "); 237 qDebug("OpieMail::slotSearchMails():not implemented ");
238} 238}
239 239
240void OpieMail::slotEditSettings() 240void OpieMail::slotEditSettings()
241{ 241{
242 242
243 KOPrefsDialog settingsDialog( this, "koprefs", true ); 243 KOPrefsDialog settingsDialog( this, "koprefs", true );
244#ifndef DESKTOP_VERSION 244#ifndef DESKTOP_VERSION
245 settingsDialog.showMaximized(); 245 settingsDialog.showMaximized();
246#endif 246#endif
247 settingsDialog.exec(); 247 settingsDialog.exec();
248 248
249 slotSetCodec( KOPrefs::instance()->mCurrentCodec ); 249 slotSetCodec( KOPrefs::instance()->mCurrentCodec );
250 // KApplication::execDialog(settingsDialog); 250 // KApplication::execDialog(settingsDialog);
251} 251}
252 252
253void OpieMail::slotEditAccounts() 253void OpieMail::slotEditAccounts()
254{ 254{
255 EditAccounts eaDialog( settings, this, 0, true ); 255 EditAccounts eaDialog( settings, this, 0, true );
256 eaDialog.slotAdjustColumns(); 256 eaDialog.slotAdjustColumns();
257#ifndef DESKTOP_VERSION 257#ifndef DESKTOP_VERSION
258 eaDialog.showMaximized(); 258 eaDialog.showMaximized();
259#endif 259#endif
260 eaDialog.exec(); 260 eaDialog.exec();
261 if ( settings ) delete settings; 261 if ( settings ) delete settings;
262 settings = new Settings(); 262 settings = new Settings();
263 263
264 folderView->populate( settings->getAccounts() ); 264 folderView->populate( settings->getAccounts() );
265} 265}
266void OpieMail::replyMail() 266void OpieMail::replyMail()
267{ 267{
268 268
269 QListViewItem*item = mailView->currentItem(); 269 QListViewItem*item = mailView->currentItem();
270 if (!item) return; 270 if (!item) return;
271 RecMailP mail = ((MailListViewItem*)item)->data(); 271 RecMailP mail = ((MailListViewItem*)item)->data();
272 RecBodyP body = folderView->fetchBody(mail); 272 RecBodyP body = folderView->fetchBody(mail);
273 273
274 QString rtext; 274 QString rtext;
275 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose 275 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
276 .arg( mail->getFrom()) 276 .arg( mail->getFrom())
277 .arg( mail->getDate()); 277 .arg( mail->getDate());
278 278
279 QString text = body->Bodytext(); 279 QString text = body->Bodytext();
280 QStringList lines = QStringList::split(QRegExp("\\n"), text); 280 QStringList lines = QStringList::split(QRegExp("\\n"), text);
281 QStringList::Iterator it; 281 QStringList::Iterator it;
282 for (it = lines.begin(); it != lines.end(); it++) 282 for (it = lines.begin(); it != lines.end(); it++)
283 { 283 {
284 rtext += "> " + *it + "\n"; 284 rtext += "> " + *it + "\n";
285 } 285 }
286 rtext += "\n"; 286 rtext += "\n";
287 287
288 QString prefix; 288 QString prefix;
289 if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; 289 if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = "";
290 else prefix = "Re: "; // no i18n on purpose 290 else prefix = "Re: "; // no i18n on purpose
291 291
292 Settings *settings = new Settings(); 292 Settings *settings = new Settings();
293 ComposeMail composer( settings ,this, 0, true); 293 ComposeMail composer( settings ,this, 0, true);
294 if (mail->Replyto().isEmpty()) { 294 if (mail->Replyto().isEmpty()) {
295 composer.setTo( mail->getFrom()); 295 composer.setTo( mail->getFrom());
296 } else { 296 } else {
297 composer.setTo( mail->Replyto()); 297 composer.setTo( mail->Replyto());
298 } 298 }
299 composer.setSubject( prefix + mail->getSubject()); 299 composer.setSubject( prefix + mail->getSubject());
300 composer.setMessage( rtext ); 300 composer.setMessage( rtext );
301 composer.setInReplyTo( mail->Msgid()); 301 composer.setInReplyTo( mail->Msgid());
302 composer.setCharset( body->getCharset() ); 302 composer.setCharset( body->getCharset() );
303 if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) 303 if ( QDialog::Accepted == KApplication::execDialog( &composer ) )
304 { 304 {
305 mail->Wrapper()->answeredMail(mail); 305 mail->Wrapper()->answeredMail(mail);
306 } 306 }
307 delete settings; 307 delete settings;
308 308
309} 309}
310void OpieMail::closeViewMail(ViewMail * vm) 310void OpieMail::closeViewMail(ViewMail * vm)
311{ 311{
312 vm->hide(); 312 vm->hide();
313} 313}
314 314
315void OpieMail::slotDownloadMail( ) 315void OpieMail::slotDownloadMail( )
316{ 316{
317 QListViewItem*item = mailView->currentItem(); 317 QListViewItem*item = mailView->currentItem();
318 if (!item ) { 318 if (!item ) {
319 Global::statusMessage("Error: No item slected!"); 319 Global::statusMessage("Error: No item slected!");
320 return; 320 return;
321 } 321 }
322 RecMailP mail = ((MailListViewItem*)item)->data(); 322 RecMailP mail = ((MailListViewItem*)item)->data();
323 Account * acc = mail->Wrapper()->getAccount(); 323 Account * acc = mail->Wrapper()->getAccount();
324 if ( !acc ) { 324 if ( !acc ) {
325 Global::statusMessage("Mail is already stored locally!"); 325 Global::statusMessage("Mail is already stored locally!");
326 return; 326 return;
327 } 327 }
328 QString lfName = acc->getLocalFolder(); 328 QString lfName = acc->getLocalFolder();
329 //qDebug("local folder " + lfName ); 329 //qDebug("local folder " + lfName );
330 if ( lfName.isEmpty() ) 330 if ( lfName.isEmpty() )
331 lfName = acc->getAccountName(); 331 lfName = acc->getAccountName();
332 AbstractMail* targetMail = folderView->allAccounts()[0]->getWrapper(); 332 AbstractMail* targetMail = folderView->allAccounts()[0]->getWrapper();
333 //qDebug("target %d %d ",targetMail,mail->Wrapper() ); 333 //qDebug("target %d %d ",targetMail,mail->Wrapper() );
334 if ( targetMail == mail->Wrapper() ) { 334 if ( targetMail == mail->Wrapper() ) {
335 Global::statusMessage("Mail is already locally stored!"); 335 Global::statusMessage("Mail is already locally stored!");
336 return; 336 return;
337 } 337 }
338 if ( !targetMail->createMbox(lfName)) { 338 if ( !targetMail->createMbox(lfName)) {
339 Global::statusMessage("Error creating folder!"); 339 Global::statusMessage("Error creating folder!");
340 return; 340 return;
341 } 341 }
342 Global::statusMessage("Fetching mail...please wait!"); 342 Global::statusMessage("Fetching mail...please wait!");
343 qApp->processEvents(); 343 qApp->processEvents();
344 encodedString*st = 0; 344 encodedString*st = 0;
345 st = mail->Wrapper()->fetchRawBody(mail); 345 st = mail->Wrapper()->fetchRawBody(mail);
346 if ( st ) { 346 if ( st ) {
347 targetMail->storeMessage(st->Content(),st->Length(),lfName); 347 targetMail->storeMessage(st->Content(),st->Length(),lfName);
348 Global::statusMessage("Mail stored in "+ lfName); 348 Global::statusMessage("Mail stored in "+ lfName);
349 delete st; 349 delete st;
350 } else { 350 } else {
351 Global::statusMessage("Error: Cannot fetch mail!"); 351 Global::statusMessage("Error: Cannot fetch mail!");
352 } 352 }
353} 353}
354 354
355 355
356void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) 356void OpieMail::deleteAndDisplayNextMail(ViewMail * vm)
357{ 357{
358 QListViewItem*item = mailView->currentItem(); 358 QListViewItem*item = mailView->currentItem();
359 if (!item ) { 359 if (!item ) {
360 closeViewMail(vm); 360 closeViewMail(vm);
361 return; 361 return;
362 } 362 }
363 RecMailP mail = ((MailListViewItem*)item)->data(); 363 RecMailP mail = ((MailListViewItem*)item)->data();
364 mail->Wrapper()->deleteMail( mail ); 364 mail->Wrapper()->deleteMail( mail );
365 item = item->itemBelow(); 365 item = item->itemBelow();
366 if (!item ) { 366 if (!item ) {
367 closeViewMail(vm); 367 closeViewMail(vm);
368 return; 368 return;
369 } 369 }
370 mailView->setCurrentItem(item); 370 mailView->setCurrentItem(item);
371 mail = ((MailListViewItem*)item)->data(); 371 mail = ((MailListViewItem*)item)->data();
372 RecBodyP body = folderView->fetchBody(mail); 372 RecBodyP body = folderView->fetchBody(mail);
373 vm->setBody( body ); 373 vm->setBody( body );
374 vm->setMail( mail ); 374 vm->setMail( mail );
375} 375}
376void OpieMail::displayNextMail(ViewMail * vm) 376void OpieMail::displayNextMail(ViewMail * vm)
377{ 377{
378 QListViewItem*item = mailView->currentItem(); 378 QListViewItem*item = mailView->currentItem();
379 if (!item) return; 379 if (!item) return;
380 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); 380 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
381 item = item->itemBelow(); 381 item = item->itemBelow();
382 if (!item) { 382 if (!item) {
383 vm->setCaption(i18n("End of List" )); 383 vm->setCaption(i18n("End of List" ));
384 return; 384 return;
385 } 385 }
386 mailView->setCurrentItem(item); 386 mailView->setCurrentItem(item);
387 RecMailP mail = ((MailListViewItem*)item)->data(); 387 RecMailP mail = ((MailListViewItem*)item)->data();
388 RecBodyP body = folderView->fetchBody(mail); 388 RecBodyP body = folderView->fetchBody(mail);
389 vm->setBody( body ); 389 vm->setBody( body );
390 vm->setMail( mail ); 390 vm->setMail( mail );
391} 391}
392void OpieMail::displayMail() 392void OpieMail::displayMail()
393{ 393{
394 QListViewItem*item = mailView->currentItem(); 394 QListViewItem*item = mailView->currentItem();
395 if (!item) return; 395 if (!item) return;
396 RecMailP mail = ((MailListViewItem*)item)->data(); 396 RecMailP mail = ((MailListViewItem*)item)->data();
397 RecBodyP body = folderView->fetchBody(mail); 397 RecBodyP body = folderView->fetchBody(mail);
398 ViewMail readMail( this,"", Qt::WType_Modal ); 398 ViewMail readMail( this,"", Qt::WType_Modal );
399 readMail.setBody( body ); 399 readMail.setBody( body );
400 readMail.setMail( mail ); 400 readMail.setMail( mail );
401#ifndef DESKTOP_VERSION 401#ifndef DESKTOP_VERSION
402 readMail.showMaximized(); 402 readMail.showMaximized();
403#else 403#else
404 readMail.resize( 640, 480); 404 readMail.resize( 640, 480);
405#endif 405#endif
406 connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); 406 connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) );
407 connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); 407 connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) );
408 connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) ); 408 connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) );
409 409
410 readMail.exec(); 410 readMail.exec();
411 411
412 if ( readMail.deleted ) 412 if ( readMail.deleted )
413 { 413 {
414 folderView->refreshCurrent(); 414 folderView->refreshCurrent();
415 } 415 }
416 else 416 else
417 { 417 {
418 QListViewItem*item = mailView->currentItem(); 418 QListViewItem*item = mailView->currentItem();
419 if (item) 419 if (item)
420 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); 420 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
421 } 421 }
422} 422}
423void OpieMail::slotGetAllMail() 423void OpieMail::slotGetAllMail()
424{ 424{
425 QListViewItem * item = folderView->firstChild(); 425 QListViewItem * item = folderView->firstChild();
426 while ( item ){ 426 while ( item ){
427 ((AccountViewItem *)item)->contextMenuSelected( 101 ); 427 ((AccountViewItem *)item)->contextMenuSelected( 101 );
428 item = item->nextSibling (); 428 item = item->nextSibling ();
429 } 429 }
430} 430}
431void OpieMail::slotGetMail() 431void OpieMail::slotGetMail()
432{ 432{
433 QListViewItem * item = folderView->currentItem(); 433 QListViewItem * item = folderView->currentItem();
434 if ( ! item ) return; 434 if ( ! item ) return;
435 ((AccountViewItem *)item)->contextMenuSelected( 101 ); 435 ((AccountViewItem *)item)->contextMenuSelected( 101 );
436} 436}
437void OpieMail::slotDeleteMail() 437void OpieMail::slotDeleteMail()
438{ 438{
439 if (!mailView->currentItem()) return; 439 if (!mailView->currentItem()) return;
440 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); 440 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data();
441 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 441 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
442 { 442 {
443 mail->Wrapper()->deleteMail( mail ); 443 mail->Wrapper()->deleteMail( mail );
444 folderView->refreshCurrent(); 444 folderView->refreshCurrent();
445 } 445 }
446} 446}
447void OpieMail::slotDeleteAllMail() 447void OpieMail::slotDeleteAllMail()
448{ 448{
449 449
450 QValueList<RecMailP> t; 450 QValueList<RecMailP> t;
451 if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 451 if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
452 { 452 {
453 MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); 453 MailListViewItem* item = (MailListViewItem*)mailView->firstChild ();
454 while ( item ) { 454 while ( item ) {
455 if ( item->isSelected() ) { 455 if ( item->isSelected() ) {
456 t.append( item->data() ); 456 t.append( item->data() );
457 } 457 }
458 item = (MailListViewItem*)item->nextSibling(); 458 item = (MailListViewItem*)item->nextSibling();
459 } 459 }
460 } 460 }
461 else 461 else
462 return; 462 return;
463 if ( t.count() == 0 ) 463 if ( t.count() == 0 )
464 return; 464 return;
465 RecMailP mail = t.first(); 465 RecMailP mail = t.first();
466 mail->Wrapper()->deleteMailList(t); 466 mail->Wrapper()->deleteMailList(t);
467 folderView->refreshCurrent(); 467 folderView->refreshCurrent();
468 468
469 469
470} 470}
471void OpieMail::clearSelection() 471void OpieMail::clearSelection()
472{ 472{
473 mailView->clearSelection(); 473 mailView->clearSelection();
474 474
475} 475}
476 476
477void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) 477void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
478{ 478{
479 if (!mailView->currentItem()) return; 479 if (!mailView->currentItem()) return;
480 MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); 480 MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType();
481 /* just the RIGHT button - or hold on pda */ 481 /* just the RIGHT button - or hold on pda */
482 if (button!=2) {return;} 482 if (button!=2) {return;}
483 if (!item) return; 483 if (!item) return;
484 QPopupMenu *m = new QPopupMenu(0); 484 QPopupMenu *m = new QPopupMenu(0);
485 if (m) 485 if (m)
486 { 486 {
487 if (mailtype==MAILLIB::A_NNTP) { 487 if (mailtype==MAILLIB::A_NNTP) {
488 m->insertItem(i18n("Read this posting"),this,SLOT(displayMail())); 488 m->insertItem(i18n("Read this posting"),this,SLOT(displayMail()));
489 m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail())); 489 m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail()));
490 m->insertSeparator(); 490 m->insertSeparator();
491 m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail())); 491 m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail()));
492 m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); 492 m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection()));
493 } else { 493 } else {
494 if (folderView->currentisDraft()) { 494 if (folderView->currentisDraft()) {
495 m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail())); 495 m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail()));
496 } 496 }
497 m->insertItem(i18n("Reply to this mail"),this,SLOT(replyMail())); 497 m->insertItem(i18n("Reply to this mail"),this,SLOT(replyMail()));
498 m->insertSeparator();
499 m->insertItem(i18n("Read this mail"),this,SLOT(displayMail())); 498 m->insertItem(i18n("Read this mail"),this,SLOT(displayMail()));
499 m->insertSeparator();
500 m->insertItem(i18n("Move/Copy this mail"),this,SLOT(slotMoveCopyMail())); 500 m->insertItem(i18n("Move/Copy this mail"),this,SLOT(slotMoveCopyMail()));
501 m->insertItem(i18n("Delete this mail"),this,SLOT(slotDeleteMail())); 501 m->insertItem(i18n("Delete this mail"),this,SLOT(slotDeleteMail()));
502 m->insertSeparator(); 502 m->insertSeparator();
503 m->insertItem(i18n("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail())); 503 m->insertItem(i18n("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail()));
504 m->insertItem(i18n("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); 504 m->insertItem(i18n("Delete all selected mails"),this,SLOT(slotDeleteAllMail()));
505 m->insertSeparator();
505 m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); 506 m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection()));
506 } 507 }
507 m->setFocus(); 508 m->setFocus();
508 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); 509 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) );
509 delete m; 510 delete m;
510 } 511 }
511} 512}
512 513
513void OpieMail::slotShowFolders( bool show ) 514void OpieMail::slotShowFolders( bool show )
514{ 515{
515 if ( show && folderView->isHidden() ) 516 if ( show && folderView->isHidden() )
516 { 517 {
517 folderView->show(); 518 folderView->show();
518 } 519 }
519 else if ( !show && !folderView->isHidden() ) 520 else if ( !show && !folderView->isHidden() )
520 { 521 {
521 folderView->hide(); 522 folderView->hide();
522 } 523 }
523} 524}
524 525
525void OpieMail::refreshMailView(const QValueList<RecMailP>&list) 526void OpieMail::refreshMailView(const QValueList<RecMailP>&list)
526{ 527{
527 MailListViewItem*item = 0; 528 MailListViewItem*item = 0;
528 mailView->clear(); 529 mailView->clear();
529 530
530 QValueList<RecMailP>::ConstIterator it; 531 QValueList<RecMailP>::ConstIterator it;
531 for (it = list.begin(); it != list.end();++it) 532 for (it = list.begin(); it != list.end();++it)
532 { 533 {
533 item = new MailListViewItem(mailView,item); 534 item = new MailListViewItem(mailView,item);
534 item->storeData((*it)); 535 item->storeData((*it));
535 item->showEntry(); 536 item->showEntry();
536 } 537 }
537 mailView->setSorting ( 4, false ); 538 mailView->setSorting ( 4, false );
538} 539}
539 540
540void OpieMail::mailLeftClicked( QListViewItem *item ) 541void OpieMail::mailLeftClicked( QListViewItem *item )
541{ 542{
542 mailView->clearSelection(); 543 mailView->clearSelection();
543 /* just LEFT button - or tap with stylus on pda */ 544 /* just LEFT button - or tap with stylus on pda */
544 //if (button!=1) return; 545 //if (button!=1) return;
545 if (!item) return; 546 if (!item) return;
546 if (folderView->currentisDraft()) { 547 if (folderView->currentisDraft()) {
547 reEditMail(); 548 reEditMail();
548 } else { 549 } else {
549 displayMail(); 550 displayMail();
550 } 551 }
551} 552}
552 553
553void OpieMail::slotMoveCopyMail() 554void OpieMail::slotMoveCopyMail()
554{ 555{
555 if (!mailView->currentItem()) return; 556 if (!mailView->currentItem()) return;
556 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); 557 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data();
557 AbstractMail*targetMail = 0; 558 AbstractMail*targetMail = 0;
558 QString targetFolder = ""; 559 QString targetFolder = "";
559 Selectstore sels; 560 Selectstore sels;
560 folderView->setupFolderselect(&sels); 561 folderView->setupFolderselect(&sels);
561 if (!sels.exec()) return; 562 if (!sels.exec()) return;
562 targetMail = sels.currentMail(); 563 targetMail = sels.currentMail();
563 targetFolder = sels.currentFolder(); 564 targetFolder = sels.currentFolder();
564 if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || 565 if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) ||
565 targetFolder.isEmpty()) 566 targetFolder.isEmpty())
566 { 567 {
567 return; 568 return;
568 } 569 }
569 if (sels.newFolder() && !targetMail->createMbox(targetFolder)) 570 if (sels.newFolder() && !targetMail->createMbox(targetFolder))
570 { 571 {
571 QMessageBox::critical(0,i18n("Error creating new Folder"), 572 QMessageBox::critical(0,i18n("Error creating new Folder"),
572 i18n("<center>Error while creating<br>new folder - breaking.</center>")); 573 i18n("<center>Error while creating<br>new folder - breaking.</center>"));
573 return; 574 return;
574 } 575 }
575 sels.hide(); 576 sels.hide();
576 qApp->processEvents(); 577 qApp->processEvents();
577 // qDebug("hiding sels "); 578 // qDebug("hiding sels ");
578 mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); 579 mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails());
579 folderView->refreshCurrent(); 580 folderView->refreshCurrent();
580} 581}
581 582
582void OpieMail::slotMoveCopyAllMail() 583void OpieMail::slotMoveCopyAllMail()
583{ 584{
584 585
585 if (!mailView->currentItem()) return; 586 if (!mailView->currentItem()) return;
586 QValueList<RecMailP> t; 587 QValueList<RecMailP> t;
587 // if ( QMessageBox::warning(this, i18n("Move/Copy all selected mails"), i18n("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 588 // if ( QMessageBox::warning(this, i18n("Move/Copy all selected mails"), i18n("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
588 { 589 {
589 MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); 590 MailListViewItem* item = (MailListViewItem*)mailView->firstChild ();
590 while ( item ) { 591 while ( item ) {
591 if ( item->isSelected() ) { 592 if ( item->isSelected() ) {
592 t.append( item->data() ); 593 t.append( item->data() );
593 } 594 }
594 item = (MailListViewItem*)item->nextSibling(); 595 item = (MailListViewItem*)item->nextSibling();
595 } 596 }
596 } 597 }
597 // else 598 // else
598 // return; 599 // return;
599 if ( t.count() == 0 ) 600 if ( t.count() == 0 )
600 return; 601 return;
601 RecMailP mail = t.first(); 602 RecMailP mail = t.first();
602 AbstractMail*targetMail = 0; 603 AbstractMail*targetMail = 0;
603 QString targetFolder = ""; 604 QString targetFolder = "";
604 Selectstore sels; 605 Selectstore sels;
605 folderView->setupFolderselect(&sels); 606 folderView->setupFolderselect(&sels);
606 if (!sels.exec()) return; 607 if (!sels.exec()) return;
607 targetMail = sels.currentMail(); 608 targetMail = sels.currentMail();
608 targetFolder = sels.currentFolder(); 609 targetFolder = sels.currentFolder();
609 if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || 610 if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) ||
610 targetFolder.isEmpty()) 611 targetFolder.isEmpty())
611 { 612 {
612 return; 613 return;
613 } 614 }
614 if (sels.newFolder() && !targetMail->createMbox(targetFolder)) 615 if (sels.newFolder() && !targetMail->createMbox(targetFolder))
615 { 616 {
616 QMessageBox::critical(0,i18n("Error creating new Folder"), 617 QMessageBox::critical(0,i18n("Error creating new Folder"),
617 i18n("<center>Error while creating<br>new folder - breaking.</center>")); 618 i18n("<center>Error while creating<br>new folder - breaking.</center>"));
618 return; 619 return;
619 } 620 }
620 sels.hide(); 621 sels.hide();
621 qApp->processEvents(); 622 qApp->processEvents();
622 //qDebug("hiding sels "); 623 //qDebug("hiding sels ");
623 mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); 624 mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails());
624 folderView->refreshCurrent(); 625 folderView->refreshCurrent();
625} 626}
626 627
627void OpieMail::reEditMail() 628void OpieMail::reEditMail()
628{ 629{
629 if (!mailView->currentItem()) return; 630 if (!mailView->currentItem()) return;
630 631
631 ComposeMail compose( settings, this, 0, true ); 632 ComposeMail compose( settings, this, 0, true );
632 compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); 633 compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data());
633 compose.slotAdjustColumns(); 634 compose.slotAdjustColumns();
634#ifndef DESKTOP_VERSION 635#ifndef DESKTOP_VERSION
635 compose.showMaximized(); 636 compose.showMaximized();
636#else 637#else
637 compose.resize(640,480); 638 compose.resize(640,480);
638#endif 639#endif
639 compose.exec(); 640 compose.exec();
640} 641}