-rw-r--r-- | kaddressbook/kabprefs.cpp | 4 | ||||
-rw-r--r-- | kalarmd/alarmdialog.cpp | 9 | ||||
-rw-r--r-- | kmicromail/koprefs.cpp | 11 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 12 | ||||
-rw-r--r-- | microkde/kdatetbl.cpp | 2 |
5 files changed, 15 insertions, 23 deletions
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp index a2095d4..01e84d0 100644 --- a/kaddressbook/kabprefs.cpp +++ b/kaddressbook/kabprefs.cpp | |||
@@ -1,155 +1,155 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
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 | //US#ifdef KAB_EMBEDDED | 24 | //US#ifdef KAB_EMBEDDED |
25 | //#include <qstring.h> | 25 | //#include <qstring.h> |
26 | //#endif //KAB_EMBEDDED | 26 | //#endif //KAB_EMBEDDED |
27 | 27 | ||
28 | #include <qtextstream.h> | 28 | #include <qtextstream.h> |
29 | #include <qfile.h> | 29 | #include <qfile.h> |
30 | #include <qregexp.h> | 30 | #include <qregexp.h> |
31 | #include <stdlib.h> | 31 | #include <stdlib.h> |
32 | #include <libkdepim/kpimglobalprefs.h> | 32 | #include <libkdepim/kpimglobalprefs.h> |
33 | 33 | ||
34 | #include <kconfig.h> | 34 | #include <kconfig.h> |
35 | #include <klocale.h> | 35 | #include <klocale.h> |
36 | #include <kstaticdeleter.h> | 36 | #include <kstaticdeleter.h> |
37 | #include <kglobalsettings.h> | ||
37 | //US#include <kdebug.h> // defines kdDebug() | 38 | //US#include <kdebug.h> // defines kdDebug() |
38 | 39 | ||
39 | #include "kabprefs.h" | 40 | #include "kabprefs.h" |
40 | 41 | ||
41 | #ifdef DESKTOP_VERSION | 42 | #ifdef DESKTOP_VERSION |
42 | #include <qapplication.h> | 43 | #include <qapplication.h> |
43 | #endif | 44 | #endif |
44 | 45 | ||
45 | KABPrefs *KABPrefs::sInstance = 0; | 46 | KABPrefs *KABPrefs::sInstance = 0; |
46 | static KStaticDeleter<KABPrefs> staticDeleterAB; | 47 | static KStaticDeleter<KABPrefs> staticDeleterAB; |
47 | 48 | ||
48 | KABPrefs::KABPrefs() | 49 | KABPrefs::KABPrefs() |
49 | : KPimPrefs("kaddressbookrc") | 50 | : KPimPrefs("kaddressbookrc") |
50 | { | 51 | { |
51 | mDetailsFont = QFont("helvetica",12); | ||
52 | KPrefs::setCurrentGroup( "Views" ); | 52 | KPrefs::setCurrentGroup( "Views" ); |
53 | addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); | 53 | addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); |
54 | 54 | ||
55 | KPrefs::setCurrentGroup( "General" ); | 55 | KPrefs::setCurrentGroup( "General" ); |
56 | addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); | 56 | addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); |
57 | addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); | 57 | addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); |
58 | 58 | ||
59 | #ifdef KAB_EMBEDDED | 59 | #ifdef KAB_EMBEDDED |
60 | addItemBool("AskForQuit",&mAskForQuit,true); | 60 | addItemBool("AskForQuit",&mAskForQuit,true); |
61 | addItemBool("ToolBarHor",&mToolBarHor, true ); | 61 | addItemBool("ToolBarHor",&mToolBarHor, true ); |
62 | addItemBool("ToolBarUp",&mToolBarUp, false ); | 62 | addItemBool("ToolBarUp",&mToolBarUp, false ); |
63 | addItemBool("SearchWithReturn",&mSearchWithReturn, false ); | 63 | addItemBool("SearchWithReturn",&mSearchWithReturn, false ); |
64 | addItemFont("DetailsFont",&mDetailsFont); | 64 | addItemFont("DetailsFont",&mDetailsFont,KGlobalSettings::generalFont()); |
65 | 65 | ||
66 | 66 | ||
67 | #endif //KAB_EMBEDDED | 67 | #endif //KAB_EMBEDDED |
68 | 68 | ||
69 | KPrefs::setCurrentGroup( "MainWindow" ); | 69 | KPrefs::setCurrentGroup( "MainWindow" ); |
70 | bool m_visible = false; | 70 | bool m_visible = false; |
71 | #ifdef DESKTOP_VERSION | 71 | #ifdef DESKTOP_VERSION |
72 | m_visible = true; | 72 | m_visible = true; |
73 | #endif | 73 | #endif |
74 | addItemBool( "FullMenuBarVisible", &mFullMenuBarVisible, m_visible ); | 74 | addItemBool( "FullMenuBarVisible", &mFullMenuBarVisible, m_visible ); |
75 | addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); | 75 | addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); |
76 | addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); | 76 | addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); |
77 | addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); | 77 | addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); |
78 | addItemIntList( "DetailsSplitter", &mDetailsSplitter ); | 78 | addItemIntList( "DetailsSplitter", &mDetailsSplitter ); |
79 | addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true ); | 79 | addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true ); |
80 | 80 | ||
81 | 81 | ||
82 | KPrefs::setCurrentGroup( "Extensions_General" ); | 82 | KPrefs::setCurrentGroup( "Extensions_General" ); |
83 | QStringList defaultExtensions; | 83 | QStringList defaultExtensions; |
84 | defaultExtensions << "merge"; | 84 | defaultExtensions << "merge"; |
85 | defaultExtensions << "distribution_list_editor"; | 85 | defaultExtensions << "distribution_list_editor"; |
86 | addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); | 86 | addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); |
87 | addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); | 87 | addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); |
88 | 88 | ||
89 | KPrefs::setCurrentGroup( "Views" ); | 89 | KPrefs::setCurrentGroup( "Views" ); |
90 | QString defaultView = i18n( "Default Table View" ); | 90 | QString defaultView = i18n( "Default Table View" ); |
91 | addItemString( "CurrentView", &mCurrentView, defaultView ); | 91 | addItemString( "CurrentView", &mCurrentView, defaultView ); |
92 | addItemStringList( "ViewNames", &mViewNames, defaultView ); | 92 | addItemStringList( "ViewNames", &mViewNames, defaultView ); |
93 | 93 | ||
94 | KPrefs::setCurrentGroup( "Filters" ); | 94 | KPrefs::setCurrentGroup( "Filters" ); |
95 | addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); | 95 | addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); |
96 | 96 | ||
97 | } | 97 | } |
98 | 98 | ||
99 | KABPrefs::~KABPrefs() | 99 | KABPrefs::~KABPrefs() |
100 | { | 100 | { |
101 | //qDebug("KABPrefs::~KABPrefs() "); | 101 | //qDebug("KABPrefs::~KABPrefs() "); |
102 | if (sInstance == this) | 102 | if (sInstance == this) |
103 | sInstance = staticDeleterAB.setObject(0); | 103 | sInstance = staticDeleterAB.setObject(0); |
104 | } | 104 | } |
105 | 105 | ||
106 | KABPrefs *KABPrefs::instance() | 106 | KABPrefs *KABPrefs::instance() |
107 | { | 107 | { |
108 | if ( !sInstance ) { | 108 | if ( !sInstance ) { |
109 | #ifdef KAB_EMBEDDED | 109 | #ifdef KAB_EMBEDDED |
110 | sInstance = staticDeleterAB.setObject( new KABPrefs() ); | 110 | sInstance = staticDeleterAB.setObject( new KABPrefs() ); |
111 | #else //KAB_EMBEDDED | 111 | #else //KAB_EMBEDDED |
112 | //US the following line has changed ???. Why | 112 | //US the following line has changed ???. Why |
113 | staticDeleterAB.setObject( sInstance, new KABPrefs() ); | 113 | staticDeleterAB.setObject( sInstance, new KABPrefs() ); |
114 | #endif //KAB_EMBEDDED | 114 | #endif //KAB_EMBEDDED |
115 | sInstance->readConfig(); | 115 | sInstance->readConfig(); |
116 | } | 116 | } |
117 | 117 | ||
118 | return sInstance; | 118 | return sInstance; |
119 | } | 119 | } |
120 | 120 | ||
121 | void KABPrefs::setCategoryDefaults() | 121 | void KABPrefs::setCategoryDefaults() |
122 | { | 122 | { |
123 | mCustomCategories.clear(); | 123 | mCustomCategories.clear(); |
124 | 124 | ||
125 | mCustomCategories << i18n( "Business" ) << i18n( "Family" ) << i18n( "School" ) | 125 | mCustomCategories << i18n( "Business" ) << i18n( "Family" ) << i18n( "School" ) |
126 | << i18n( "Customer" ) << i18n( "Friend" ); | 126 | << i18n( "Customer" ) << i18n( "Friend" ); |
127 | } | 127 | } |
128 | 128 | ||
129 | // US introduce a nonconst way to return the config object. | 129 | // US introduce a nonconst way to return the config object. |
130 | KConfig* KABPrefs::getConfig() | 130 | KConfig* KABPrefs::getConfig() |
131 | { | 131 | { |
132 | return config(); | 132 | return config(); |
133 | } | 133 | } |
134 | void KABPrefs::usrReadConfig() | 134 | void KABPrefs::usrReadConfig() |
135 | { | 135 | { |
136 | KPimPrefs::usrReadConfig(); | 136 | KPimPrefs::usrReadConfig(); |
137 | } | 137 | } |
138 | 138 | ||
139 | 139 | ||
140 | /*US | 140 | /*US |
141 | void KABPrefs::usrSetDefaults() | 141 | void KABPrefs::usrSetDefaults() |
142 | { | 142 | { |
143 | KPimPrefs::usrSetDefaults(); | 143 | KPimPrefs::usrSetDefaults(); |
144 | } | 144 | } |
145 | 145 | ||
146 | void KABPrefs::usrReadConfig() | 146 | void KABPrefs::usrReadConfig() |
147 | { | 147 | { |
148 | KPimPrefs::usrReadConfig(); | 148 | KPimPrefs::usrReadConfig(); |
149 | } | 149 | } |
150 | 150 | ||
151 | void KABPrefs::usrWriteConfig() | 151 | void KABPrefs::usrWriteConfig() |
152 | { | 152 | { |
153 | KPimPrefs::usrWriteConfig(); | 153 | KPimPrefs::usrWriteConfig(); |
154 | } | 154 | } |
155 | */ | 155 | */ |
diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp index 521781e..751ba57 100644 --- a/kalarmd/alarmdialog.cpp +++ b/kalarmd/alarmdialog.cpp | |||
@@ -1,171 +1,174 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the KDE alarm daemon. | 2 | This file is part of the KDE alarm daemon. |
3 | Copyright (c) 2000 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000 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 | // $Id$ | 24 | // $Id$ |
25 | 25 | ||
26 | #include <qhbox.h> | 26 | #include <qhbox.h> |
27 | #include <qvbox.h> | 27 | #include <qvbox.h> |
28 | #include <qapp.h> | 28 | #include <qapp.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qlayout.h> | 30 | #include <qlayout.h> |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qtimer.h> | 32 | #include <qtimer.h> |
33 | #include <qsound.h> | 33 | #include <qsound.h> |
34 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
35 | #include <qspinbox.h> | 35 | #include <qspinbox.h> |
36 | #include <stdlib.h> | 36 | #include <stdlib.h> |
37 | #ifndef _WIN32_ | 37 | #ifndef _WIN32_ |
38 | #include <unistd.h> | 38 | #include <unistd.h> |
39 | #include <sys/ioctl.h> | 39 | #include <sys/ioctl.h> |
40 | #endif | 40 | #endif |
41 | #include <stdio.h> | 41 | #include <stdio.h> |
42 | #include <fcntl.h> | 42 | #include <fcntl.h> |
43 | 43 | ||
44 | #ifndef DESKTOP_VERSION | 44 | #ifndef DESKTOP_VERSION |
45 | #include <qtopia/alarmserver.h> | 45 | #include <qtopia/alarmserver.h> |
46 | #include <qpe/resource.h> | 46 | #include <qpe/resource.h> |
47 | #include <qtopia/sound.h> | 47 | #include <qtopia/sound.h> |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | #include "alarmdialog.h" | 50 | #include "alarmdialog.h" |
51 | 51 | ||
52 | 52 | ||
53 | AlarmDialog::AlarmDialog(QWidget *parent,const char *name) | 53 | AlarmDialog::AlarmDialog(QWidget *parent,const char *name) |
54 | : QDialog (parent, name, true, Qt::WStyle_StaysOnTop ) | 54 | : QDialog (parent, name, true, Qt::WStyle_StaysOnTop ) |
55 | { | 55 | { |
56 | setCaption( "KO/Pi Alarm!" ); | 56 | setCaption( "KO/Pi Alarm!" ); |
57 | QVBoxLayout* layout = new QVBoxLayout( this); | 57 | QVBoxLayout* layout = new QVBoxLayout( this); |
58 | QLabel* l = new QLabel("The following event triggered alarm:",this); | 58 | QLabel* l = new QLabel("The following event triggered alarm:",this); |
59 | layout->addWidget ( l ); | 59 | layout->addWidget ( l ); |
60 | l->setAlignment( AlignCenter); | 60 | l->setAlignment( AlignCenter); |
61 | mMessage = new QLabel ( " ", this ); | 61 | mMessage = new QLabel ( " ", this ); |
62 | int fs = 18; | 62 | int fs = 18; |
63 | int fs2 = 12; | 63 | int fs2 = 12; |
64 | if ( QApplication::desktop()->width() < 480 ) { | 64 | if ( QApplication::desktop()->width() < 480 ) { |
65 | setMaximumSize(220, 260); | 65 | setMaximumSize(220, 260); |
66 | fs2 = 10; | 66 | fs2 = 10; |
67 | } | 67 | } |
68 | else { | 68 | else { |
69 | setMaximumSize(440, 440); | 69 | setMaximumSize(440, 440); |
70 | } | 70 | } |
71 | layout->setSpacing( 3 ); | 71 | layout->setSpacing( 3 ); |
72 | layout->setMargin( 3 ); | 72 | layout->setMargin( 3 ); |
73 | 73 | QFont fo = QApplication::font(); | |
74 | l->setFont( QFont("helvetica",fs2, QFont::Bold) ); | 74 | fo.setBold( true ); |
75 | mMessage->setFont( QFont("helvetica",fs, QFont::Bold) ); | 75 | fo.setPointSize( fs2 ); |
76 | l->setFont( fo ); | ||
77 | fo.setPointSize( fs ); | ||
78 | mMessage->setFont(fo ); | ||
76 | mMessage->setAlignment( AlignCenter); | 79 | mMessage->setAlignment( AlignCenter); |
77 | l = new QLabel("Missed Alarms:",this); | 80 | l = new QLabel("Missed Alarms:",this); |
78 | l->setAlignment( AlignCenter); | 81 | l->setAlignment( AlignCenter); |
79 | layout->addWidget ( mMessage ); | 82 | layout->addWidget ( mMessage ); |
80 | layout->addWidget ( l ); | 83 | layout->addWidget ( l ); |
81 | mMissedAlarms= new QLabel ( "", this ); | 84 | mMissedAlarms= new QLabel ( "", this ); |
82 | mMissedAlarms->setAlignment( AlignCenter); | 85 | mMissedAlarms->setAlignment( AlignCenter); |
83 | 86 | ||
84 | playSoundTimer = new QTimer( this ); | 87 | playSoundTimer = new QTimer( this ); |
85 | connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) ); | 88 | connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) ); |
86 | 89 | ||
87 | playSoundTimer->stop(); | 90 | playSoundTimer->stop(); |
88 | 91 | ||
89 | layout->addWidget ( mMissedAlarms ); | 92 | layout->addWidget ( mMissedAlarms ); |
90 | QHBox *suspendBox = new QHBox( this ); | 93 | QHBox *suspendBox = new QHBox( this ); |
91 | suspendBox->setSpacing(3); | 94 | suspendBox->setSpacing(3); |
92 | layout->addWidget ( suspendBox ); | 95 | layout->addWidget ( suspendBox ); |
93 | (void)new QLabel("Suspend duration (minutes):",suspendBox); | 96 | (void)new QLabel("Suspend duration (minutes):",suspendBox); |
94 | mSuspendSpin = new QSpinBox(1,1440,1,suspendBox); | 97 | mSuspendSpin = new QSpinBox(1,1440,1,suspendBox); |
95 | mSuspendSpin->setValue(7); // default suspend duration | 98 | mSuspendSpin->setValue(7); // default suspend duration |
96 | QHBox * bbox = new QHBox ( this ); | 99 | QHBox * bbox = new QHBox ( this ); |
97 | layout->addWidget ( bbox ); | 100 | layout->addWidget ( bbox ); |
98 | bbox->layout()->setSpacing( 5 ); | 101 | bbox->layout()->setSpacing( 5 ); |
99 | QPushButton* suspend = new QPushButton( "Suspend", bbox); | 102 | QPushButton* suspend = new QPushButton( "Suspend", bbox); |
100 | QPushButton* silen = new QPushButton( " Stop sound ", bbox); | 103 | QPushButton* silen = new QPushButton( " Stop sound ", bbox); |
101 | QPushButton* okbut = new QPushButton( "Ok", bbox); | 104 | QPushButton* okbut = new QPushButton( "Ok", bbox); |
102 | connect (silen , SIGNAL( clicked() ), this, SLOT (silent() ) ); | 105 | connect (silen , SIGNAL( clicked() ), this, SLOT (silent() ) ); |
103 | connect (suspend , SIGNAL( clicked() ), this, SLOT (slotSuspend() ) ); | 106 | connect (suspend , SIGNAL( clicked() ), this, SLOT (slotSuspend() ) ); |
104 | connect (okbut , SIGNAL( clicked() ), this, SLOT (slotOk() ) ); | 107 | connect (okbut , SIGNAL( clicked() ), this, SLOT (slotOk() ) ); |
105 | #ifndef _WIN32_ | 108 | #ifndef _WIN32_ |
106 | if ( QFile::exists ( "/dev/sharp_led" ) ) | 109 | if ( QFile::exists ( "/dev/sharp_led" ) ) |
107 | fd_led = open ( "/dev/sharp_led", O_RDWR|O_NONBLOCK ); | 110 | fd_led = open ( "/dev/sharp_led", O_RDWR|O_NONBLOCK ); |
108 | else | 111 | else |
109 | #endif | 112 | #endif |
110 | fd_led = 0; | 113 | fd_led = 0; |
111 | statusLED.which = SHARP_LED_SALARM; | 114 | statusLED.which = SHARP_LED_SALARM; |
112 | mSilent = false; | 115 | mSilent = false; |
113 | mSuspendCounter = 0; | 116 | mSuspendCounter = 0; |
114 | setServerNotification( true ); | 117 | setServerNotification( true ); |
115 | } | 118 | } |
116 | void AlarmDialog::reject () | 119 | void AlarmDialog::reject () |
117 | { | 120 | { |
118 | QTimer::singleShot ( 3000, this, SLOT (suspend()) ); | 121 | QTimer::singleShot ( 3000, this, SLOT (suspend()) ); |
119 | slotSuspend(); | 122 | slotSuspend(); |
120 | } | 123 | } |
121 | AlarmDialog::~AlarmDialog() | 124 | AlarmDialog::~AlarmDialog() |
122 | { | 125 | { |
123 | } | 126 | } |
124 | void AlarmDialog::silent () | 127 | void AlarmDialog::silent () |
125 | { | 128 | { |
126 | mSilent = true; | 129 | mSilent = true; |
127 | } | 130 | } |
128 | void AlarmDialog::accept() | 131 | void AlarmDialog::accept() |
129 | { | 132 | { |
130 | slotOk(); | 133 | slotOk(); |
131 | } | 134 | } |
132 | 135 | ||
133 | void AlarmDialog::suspend() | 136 | void AlarmDialog::suspend() |
134 | { | 137 | { |
135 | #ifdef DESKTOP_VERSION | 138 | #ifdef DESKTOP_VERSION |
136 | 139 | ||
137 | #else | 140 | #else |
138 | Sound::soundAlarm (); | 141 | Sound::soundAlarm (); |
139 | #endif | 142 | #endif |
140 | } | 143 | } |
141 | void AlarmDialog::slotOk() | 144 | void AlarmDialog::slotOk() |
142 | { | 145 | { |
143 | mStopAlarm = true; | 146 | mStopAlarm = true; |
144 | mMissedAlarms->setText(""); | 147 | mMissedAlarms->setText(""); |
145 | mMessage->setText(""); | 148 | mMessage->setText(""); |
146 | #ifndef _WIN32_ | 149 | #ifndef _WIN32_ |
147 | if ( fd_led > 0 ) { | 150 | if ( fd_led > 0 ) { |
148 | statusLED.status = LED_SALARM_OFF ; | 151 | statusLED.status = LED_SALARM_OFF ; |
149 | ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED); | 152 | ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED); |
150 | } | 153 | } |
151 | #endif | 154 | #endif |
152 | QDialog::accept(); | 155 | QDialog::accept(); |
153 | } | 156 | } |
154 | 157 | ||
155 | void AlarmDialog::slotSuspend() | 158 | void AlarmDialog::slotSuspend() |
156 | { | 159 | { |
157 | //qDebug("AlarmDialog::suspend() "); // emit suspendSignal(mSuspendSpin->value()); | 160 | //qDebug("AlarmDialog::suspend() "); // emit suspendSignal(mSuspendSpin->value()); |
158 | mStopAlarm = true; | 161 | mStopAlarm = true; |
159 | QDateTime nextA = QDateTime::currentDateTime().addSecs( mSuspendSpin->value() * 60 ); | 162 | QDateTime nextA = QDateTime::currentDateTime().addSecs( mSuspendSpin->value() * 60 ); |
160 | QString mess = "suspend_alarm" +mFileName+"+++" ; | 163 | QString mess = "suspend_alarm" +mFileName+"+++" ; |
161 | if ( mMessage->text().left( 10 ) !="Suspended:" ) | 164 | if ( mMessage->text().left( 10 ) !="Suspended:" ) |
162 | mess += "Suspended:\n"; | 165 | mess += "Suspended:\n"; |
163 | mess +=mMessage->text(); | 166 | mess +=mMessage->text(); |
164 | #ifndef DESKTOP_VERSION | 167 | #ifndef DESKTOP_VERSION |
165 | if ( mServerNotification ) | 168 | if ( mServerNotification ) |
166 | AlarmServer::addAlarm ( nextA,"koalarm",mess.latin1()); | 169 | AlarmServer::addAlarm ( nextA,"koalarm",mess.latin1()); |
167 | #endif | 170 | #endif |
168 | emit addAlarm( nextA , mess ); | 171 | emit addAlarm( nextA , mess ); |
169 | slotOk(); | 172 | slotOk(); |
170 | } | 173 | } |
171 | 174 | ||
diff --git a/kmicromail/koprefs.cpp b/kmicromail/koprefs.cpp index 7b1e169..e4b61dc 100644 --- a/kmicromail/koprefs.cpp +++ b/kmicromail/koprefs.cpp | |||
@@ -1,129 +1,126 @@ | |||
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 | #include <kglobalsettings.h> | ||
44 | 45 | ||
45 | #include "koprefs.h" | 46 | #include "koprefs.h" |
46 | #include "mainwindow.h" | 47 | #include "mainwindow.h" |
47 | 48 | ||
48 | 49 | ||
49 | KOPrefs *KOPrefs::mInstance = 0; | 50 | KOPrefs *KOPrefs::mInstance = 0; |
50 | static KStaticDeleter<KOPrefs> insd; | 51 | static KStaticDeleter<KOPrefs> insd; |
51 | 52 | ||
52 | KOPrefs::KOPrefs() : | 53 | KOPrefs::KOPrefs() : |
53 | KPimPrefs("kopiemailrc") | 54 | KPimPrefs("kopiemailrc") |
54 | { | 55 | { |
55 | mAppFont = QFont("helvetica",12); | ||
56 | mComposeFont = QFont("helvetica",12); | ||
57 | mReadFont = QFont("helvetica",12); | ||
58 | |||
59 | KPrefs::setCurrentGroup("General"); | 56 | KPrefs::setCurrentGroup("General"); |
60 | addItemString("SendCodec",&mSendCodec,i18n ("userdefined") ); | 57 | addItemString("SendCodec",&mSendCodec,i18n ("userdefined") ); |
61 | addItemString("SenderName",&mName,i18n ("Please set at") ); | 58 | addItemString("SenderName",&mName,i18n ("Please set at") ); |
62 | addItemString("SenderEmail",&mEmail,i18n ("Settings@General TAB") ); | 59 | addItemString("SenderEmail",&mEmail,i18n ("Settings@General TAB") ); |
63 | addItemBool("ViewMailAsHtml",&mViewAsHtml,false); | 60 | addItemBool("ViewMailAsHtml",&mViewAsHtml,false); |
64 | addItemBool("SendMailLater",&mSendLater,true); | 61 | addItemBool("SendMailLater",&mSendLater,true); |
65 | addItemBool("ShowToField",&mShowToField,false); | 62 | addItemBool("ShowToField",&mShowToField,false); |
66 | addItemBool("UseKapi",&mUseKapi,false); | 63 | addItemBool("UseKapi",&mUseKapi,false); |
67 | addItemInt("CurrentCodec",&mCurrentCodec,0); | 64 | addItemInt("CurrentCodec",&mCurrentCodec,0); |
68 | addItemBool("ShowInfoSub",&mShowInfoSub,true); | 65 | addItemBool("ShowInfoSub",&mShowInfoSub,true); |
69 | addItemBool("ShowInfoFrom",&mShowInfoFrom,true); | 66 | addItemBool("ShowInfoFrom",&mShowInfoFrom,true); |
70 | addItemBool("ShowInfoTo",&mShowInfoTo,true); | 67 | addItemBool("ShowInfoTo",&mShowInfoTo,true); |
71 | addItemBool("ShowInfoStart",&mShowInfoStart,true); | 68 | addItemBool("ShowInfoStart",&mShowInfoStart,true); |
72 | KPrefs::setCurrentGroup("Fonts"); | 69 | KPrefs::setCurrentGroup("Fonts"); |
73 | addItemFont("Application Font",&mAppFont); | 70 | addItemFont("Application Font",&mAppFont,KGlobalSettings::generalFont()); |
74 | addItemFont("Compose Font",&mComposeFont); | 71 | addItemFont("Compose Font",&mComposeFont,KGlobalSettings::generalFont()); |
75 | addItemFont("Read Font",&mReadFont); | 72 | addItemFont("Read Font",&mReadFont,KGlobalSettings::generalFont()); |
76 | fillMailDefaults(); | 73 | fillMailDefaults(); |
77 | isDirty = false; | 74 | isDirty = false; |
78 | } | 75 | } |
79 | 76 | ||
80 | 77 | ||
81 | KOPrefs::~KOPrefs() | 78 | KOPrefs::~KOPrefs() |
82 | { | 79 | { |
83 | if ( isDirty ) | 80 | if ( isDirty ) |
84 | writeConfig(); | 81 | writeConfig(); |
85 | if (mInstance == this) | 82 | if (mInstance == this) |
86 | mInstance = insd.setObject(0); | 83 | mInstance = insd.setObject(0); |
87 | 84 | ||
88 | } | 85 | } |
89 | 86 | ||
90 | 87 | ||
91 | KOPrefs *KOPrefs::instance() | 88 | KOPrefs *KOPrefs::instance() |
92 | { | 89 | { |
93 | if (!mInstance) { | 90 | if (!mInstance) { |
94 | mInstance = insd.setObject(new KOPrefs()); | 91 | mInstance = insd.setObject(new KOPrefs()); |
95 | mInstance->readConfig(); | 92 | mInstance->readConfig(); |
96 | } | 93 | } |
97 | 94 | ||
98 | return mInstance; | 95 | return mInstance; |
99 | } | 96 | } |
100 | 97 | ||
101 | void KOPrefs::usrSetDefaults() | 98 | void KOPrefs::usrSetDefaults() |
102 | { | 99 | { |
103 | 100 | ||
104 | } | 101 | } |
105 | 102 | ||
106 | void KOPrefs::fillMailDefaults() | 103 | void KOPrefs::fillMailDefaults() |
107 | { | 104 | { |
108 | if (mName.isEmpty()) mName = i18n ("Please set at"); | 105 | if (mName.isEmpty()) mName = i18n ("Please set at"); |
109 | if (mEmail.isEmpty()) mEmail = i18n ("Settings@General TAB"); | 106 | if (mEmail.isEmpty()) mEmail = i18n ("Settings@General TAB"); |
110 | } | 107 | } |
111 | 108 | ||
112 | void KOPrefs::usrReadConfig() | 109 | void KOPrefs::usrReadConfig() |
113 | { | 110 | { |
114 | 111 | ||
115 | KPimPrefs::usrReadConfig(); | 112 | KPimPrefs::usrReadConfig(); |
116 | } | 113 | } |
117 | 114 | ||
118 | 115 | ||
119 | void KOPrefs::usrWriteConfig() | 116 | void KOPrefs::usrWriteConfig() |
120 | { | 117 | { |
121 | KPimPrefs::usrWriteConfig(); | 118 | KPimPrefs::usrWriteConfig(); |
122 | } | 119 | } |
123 | 120 | ||
124 | 121 | ||
125 | 122 | ||
126 | KConfig* KOPrefs::getConfig() | 123 | KConfig* KOPrefs::getConfig() |
127 | { | 124 | { |
128 | return config(); | 125 | return config(); |
129 | } | 126 | } |
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 5bfe2a1..7efb6a6 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -1,172 +1,162 @@ | |||
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 <kglobalsettings.h> | 39 | #include <kglobalsettings.h> |
40 | #include <kconfig.h> | 40 | #include <kconfig.h> |
41 | #include <klocale.h> | 41 | #include <klocale.h> |
42 | #include <kdebug.h> | 42 | #include <kdebug.h> |
43 | #include <kemailsettings.h> | 43 | #include <kemailsettings.h> |
44 | #include <kstaticdeleter.h> | 44 | #include <kstaticdeleter.h> |
45 | #include <libkdepim/kpimglobalprefs.h> | 45 | #include <libkdepim/kpimglobalprefs.h> |
46 | 46 | ||
47 | #include "koprefs.h" | 47 | #include "koprefs.h" |
48 | #include "mainwindow.h" | 48 | #include "mainwindow.h" |
49 | 49 | ||
50 | KOPrefs *KOPrefs::mInstance = 0; | 50 | KOPrefs *KOPrefs::mInstance = 0; |
51 | static KStaticDeleter<KOPrefs> insd; | 51 | static KStaticDeleter<KOPrefs> insd; |
52 | 52 | ||
53 | KOPrefs::KOPrefs() : | 53 | KOPrefs::KOPrefs() : |
54 | KPimPrefs("korganizerrc") | 54 | KPimPrefs("korganizerrc") |
55 | { | 55 | { |
56 | mCategoryColors.setAutoDelete(true); | 56 | mCategoryColors.setAutoDelete(true); |
57 | fillMailDefaults(); | 57 | fillMailDefaults(); |
58 | mDefaultCategoryColor = QColor(175,210,255);//196,196,196); | 58 | mDefaultCategoryColor = QColor(175,210,255);//196,196,196); |
59 | QColor defaultHolidayColor = QColor(255,0,0); | 59 | QColor defaultHolidayColor = QColor(255,0,0); |
60 | QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); | 60 | QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); |
61 | QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); | 61 | QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); |
62 | QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); | 62 | QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); |
63 | QColor defaultTodoDueTodayColor = QColor(255,220,100); | 63 | QColor defaultTodoDueTodayColor = QColor(255,220,100); |
64 | QColor defaultTodoOverdueColor = QColor(255,153,125); | 64 | QColor defaultTodoOverdueColor = QColor(255,153,125); |
65 | 65 | ||
66 | /* | 66 | |
67 | mTimeBarFont = QFont("helvetica",10);//,QFont::Bold); | ||
68 | mDefaultViewFont = QFont("helvetica",10); | ||
69 | mDefaultMonthViewFont = QFont("helvetica",8); | ||
70 | mMarcusBainsFont= QFont("helvetica",10); | ||
71 | mDateNavigatorFont= QFont("helvetica",10, QFont::Bold); | ||
72 | mEditBoxFont = QFont("helvetica",12); | ||
73 | mJornalViewFont = QFont("helvetica",12); | ||
74 | */ | ||
75 | |||
76 | |||
77 | KPrefs::setCurrentGroup("General"); | 67 | KPrefs::setCurrentGroup("General"); |
78 | 68 | ||
79 | 69 | ||
80 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); | 70 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); |
81 | 71 | ||
82 | addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); | 72 | addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); |
83 | addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); | 73 | addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); |
84 | addItemBool("ShowIconSearch",&mShowIconSearch,true); | 74 | addItemBool("ShowIconSearch",&mShowIconSearch,true); |
85 | addItemBool("ShowIconList",&mShowIconList,true); | 75 | addItemBool("ShowIconList",&mShowIconList,true); |
86 | addItemBool("ShowIconDay1",&mShowIconDay1,true); | 76 | addItemBool("ShowIconDay1",&mShowIconDay1,true); |
87 | addItemBool("ShowIconDay5",&mShowIconDay5,true); | 77 | addItemBool("ShowIconDay5",&mShowIconDay5,true); |
88 | addItemBool("ShowIconDay7",&mShowIconDay7,true); | 78 | addItemBool("ShowIconDay7",&mShowIconDay7,true); |
89 | addItemBool("ShowIconMonth",&mShowIconMonth,true); | 79 | addItemBool("ShowIconMonth",&mShowIconMonth,true); |
90 | addItemBool("ShowIconTodoview",&mShowIconTodoview,true); | 80 | addItemBool("ShowIconTodoview",&mShowIconTodoview,true); |
91 | addItemBool("ShowIconBackFast",&mShowIconBackFast,true); | 81 | addItemBool("ShowIconBackFast",&mShowIconBackFast,true); |
92 | addItemBool("ShowIconBack",&mShowIconBack,true); | 82 | addItemBool("ShowIconBack",&mShowIconBack,true); |
93 | addItemBool("ShowIconToday",&mShowIconToday,true); | 83 | addItemBool("ShowIconToday",&mShowIconToday,true); |
94 | addItemBool("ShowIconForward",&mShowIconForward,true); | 84 | addItemBool("ShowIconForward",&mShowIconForward,true); |
95 | addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); | 85 | addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); |
96 | addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); | 86 | addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); |
97 | addItemBool("ShowIconNextDays",&mShowIconNextDays,true); | 87 | addItemBool("ShowIconNextDays",&mShowIconNextDays,true); |
98 | addItemBool("ShowIconNext",&mShowIconNext,true); | 88 | addItemBool("ShowIconNext",&mShowIconNext,true); |
99 | addItemBool("ShowIconJournal",&mShowIconJournal,true); | 89 | addItemBool("ShowIconJournal",&mShowIconJournal,true); |
100 | addItemBool("ShowIconStretch",&mShowIconStretch,true); | 90 | addItemBool("ShowIconStretch",&mShowIconStretch,true); |
101 | addItemInt("LastLoadedLanguage",&mOldLanguage,0); | 91 | addItemInt("LastLoadedLanguage",&mOldLanguage,0); |
102 | 92 | ||
103 | addItemBool("AskForQuit",&mAskForQuit,false); | 93 | addItemBool("AskForQuit",&mAskForQuit,false); |
104 | 94 | ||
105 | #ifndef DESKTOP_VERSION | 95 | #ifndef DESKTOP_VERSION |
106 | addItemBool("ShowFullMenu",&mShowFullMenu,false); | 96 | addItemBool("ShowFullMenu",&mShowFullMenu,false); |
107 | #else | 97 | #else |
108 | addItemBool("ShowFullMenu",&mShowFullMenu,true); | 98 | addItemBool("ShowFullMenu",&mShowFullMenu,true); |
109 | #endif | 99 | #endif |
110 | addItemBool("ToolBarHor",&mToolBarHor, true ); | 100 | addItemBool("ToolBarHor",&mToolBarHor, true ); |
111 | addItemBool("ToolBarUp",&mToolBarUp, false ); | 101 | addItemBool("ToolBarUp",&mToolBarUp, false ); |
112 | addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); | 102 | addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); |
113 | addItemInt("Whats Next Days",&mWhatsNextDays,3); | 103 | addItemInt("Whats Next Days",&mWhatsNextDays,3); |
114 | addItemInt("Whats Next Prios",&mWhatsNextPrios,1); | 104 | addItemInt("Whats Next Prios",&mWhatsNextPrios,1); |
115 | 105 | ||
116 | addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); | 106 | addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); |
117 | addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); | 107 | addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); |
118 | addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); | 108 | addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); |
119 | addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); | 109 | addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); |
120 | addItemInt("AllDay Size",&mAllDaySize,28); | 110 | addItemInt("AllDay Size",&mAllDaySize,28); |
121 | QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; | 111 | QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; |
122 | addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); | 112 | addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); |
123 | 113 | ||
124 | addItemStringList("LocationDefaults",&mLocationDefaults ); | 114 | addItemStringList("LocationDefaults",&mLocationDefaults ); |
125 | addItemStringList("EventSummary User",&mEventSummaryUser); | 115 | addItemStringList("EventSummary User",&mEventSummaryUser); |
126 | addItemStringList("TodoSummary User",&mTodoSummaryUser); | 116 | addItemStringList("TodoSummary User",&mTodoSummaryUser); |
127 | 117 | ||
128 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); | 118 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); |
129 | addItemBool("Enable Project View",&mEnableProjectView,false); | 119 | addItemBool("Enable Project View",&mEnableProjectView,false); |
130 | addItemBool("Auto Save",&mAutoSave,false); | 120 | addItemBool("Auto Save",&mAutoSave,false); |
131 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); | 121 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); |
132 | addItemBool("Confirm Deletes",&mConfirm,true); | 122 | addItemBool("Confirm Deletes",&mConfirm,true); |
133 | addItemString("Archive File",&mArchiveFile); | 123 | addItemString("Archive File",&mArchiveFile); |
134 | addItemString("Html Export File",&mHtmlExportFile, | 124 | addItemString("Html Export File",&mHtmlExportFile, |
135 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); | 125 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); |
136 | addItemBool("Html With Save",&mHtmlWithSave,false); | 126 | addItemBool("Html With Save",&mHtmlWithSave,false); |
137 | 127 | ||
138 | KPrefs::setCurrentGroup("Personal Settings"); | 128 | KPrefs::setCurrentGroup("Personal Settings"); |
139 | 129 | ||
140 | addItemInt("Mail Client",&mMailClient,MailClientKMail); | 130 | addItemInt("Mail Client",&mMailClient,MailClientKMail); |
141 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); | 131 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); |
142 | addItemBool("Bcc",&mBcc,false); | 132 | addItemBool("Bcc",&mBcc,false); |
143 | 133 | ||
144 | KPrefs::setCurrentGroup("Time & Date"); | 134 | KPrefs::setCurrentGroup("Time & Date"); |
145 | 135 | ||
146 | 136 | ||
147 | addItemInt("Default Start Time",&mStartTime,10); | 137 | addItemInt("Default Start Time",&mStartTime,10); |
148 | addItemInt("Default Duration",&mDefaultDuration,2); | 138 | addItemInt("Default Duration",&mDefaultDuration,2); |
149 | addItemInt("Default Alarm Time",&mAlarmTime,3); | 139 | addItemInt("Default Alarm Time",&mAlarmTime,3); |
150 | KPrefs::setCurrentGroup("AlarmSettings"); | 140 | KPrefs::setCurrentGroup("AlarmSettings"); |
151 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); | 141 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); |
152 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); | 142 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); |
153 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); | 143 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); |
154 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); | 144 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); |
155 | 145 | ||
156 | 146 | ||
157 | KPrefs::setCurrentGroup("Calendar"); | 147 | KPrefs::setCurrentGroup("Calendar"); |
158 | 148 | ||
159 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); | 149 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); |
160 | 150 | ||
161 | KPrefs::setCurrentGroup("Fonts"); | 151 | KPrefs::setCurrentGroup("Fonts"); |
162 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); | 152 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); |
163 | addItemFont("TimeBar Font",&mTimeBarFont,KGlobalSettings::generalFont() ); | 153 | addItemFont("TimeBar Font",&mTimeBarFont,KGlobalSettings::generalFont() ); |
164 | addItemFont("MonthView Font",&mMonthViewFont,KGlobalSettings::generalFont()); | 154 | addItemFont("MonthView Font",&mMonthViewFont,KGlobalSettings::generalFont()); |
165 | addItemFont("AgendaView Font",&mAgendaViewFont,KGlobalSettings::generalFont()); | 155 | addItemFont("AgendaView Font",&mAgendaViewFont,KGlobalSettings::generalFont()); |
166 | addItemFont("MarcusBains Font",&mMarcusBainsFont,KGlobalSettings::generalFont()); | 156 | addItemFont("MarcusBains Font",&mMarcusBainsFont,KGlobalSettings::generalFont()); |
167 | addItemFont("TimeLabels Font",&mTimeLabelsFont,KGlobalSettings::generalFont()); | 157 | addItemFont("TimeLabels Font",&mTimeLabelsFont,KGlobalSettings::generalFont()); |
168 | addItemFont("TodoView Font",&mTodoViewFont,KGlobalSettings::generalFont()); | 158 | addItemFont("TodoView Font",&mTodoViewFont,KGlobalSettings::generalFont()); |
169 | addItemFont("ListView Font",&mListViewFont,KGlobalSettings::generalFont()); | 159 | addItemFont("ListView Font",&mListViewFont,KGlobalSettings::generalFont()); |
170 | addItemFont("DateNavigator Font",&mDateNavigatorFont,KGlobalSettings::generalFont()); | 160 | addItemFont("DateNavigator Font",&mDateNavigatorFont,KGlobalSettings::generalFont()); |
171 | addItemFont("EditBox Font",&mEditBoxFont,KGlobalSettings::generalFont()); | 161 | addItemFont("EditBox Font",&mEditBoxFont,KGlobalSettings::generalFont()); |
172 | addItemFont("JournalView Font",&mJornalViewFont,KGlobalSettings::generalFont()); | 162 | addItemFont("JournalView Font",&mJornalViewFont,KGlobalSettings::generalFont()); |
diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp index a9924ba..1024796 100644 --- a/microkde/kdatetbl.cpp +++ b/microkde/kdatetbl.cpp | |||
@@ -364,192 +364,194 @@ KDateTable::contentsMousePressEvent(QMouseEvent *e) | |||
364 | { // this date is in the next month | 364 | { // this date is in the next month |
365 | KNotifyClient::beep(); | 365 | KNotifyClient::beep(); |
366 | return; | 366 | return; |
367 | } | 367 | } |
368 | #endif | 368 | #endif |
369 | temp=firstday+date.day()-dayoff-1; | 369 | temp=firstday+date.day()-dayoff-1; |
370 | QDate da = QDate(date.year(), date.month(),1); | 370 | QDate da = QDate(date.year(), date.month(),1); |
371 | setDate(da.addDays( pos-firstday+dayoff-1)); | 371 | setDate(da.addDays( pos-firstday+dayoff-1)); |
372 | updateCell(temp/7+1, temp%7); // Update the previously selected cell | 372 | updateCell(temp/7+1, temp%7); // Update the previously selected cell |
373 | updateCell(row, col); // Update the selected cell | 373 | updateCell(row, col); // Update the selected cell |
374 | // assert(QDate(date.year(), date.month(), pos-firstday+dayoff).isValid()); | 374 | // assert(QDate(date.year(), date.month(), pos-firstday+dayoff).isValid()); |
375 | emit(tableClicked()); | 375 | emit(tableClicked()); |
376 | } | 376 | } |
377 | 377 | ||
378 | bool | 378 | bool |
379 | KDateTable::setDate(const QDate& date_) | 379 | KDateTable::setDate(const QDate& date_) |
380 | { | 380 | { |
381 | bool changed=false; | 381 | bool changed=false; |
382 | QDate temp; | 382 | QDate temp; |
383 | mMarkCurrent = false; | 383 | mMarkCurrent = false; |
384 | // ----- | 384 | // ----- |
385 | if(!date_.isValid()) | 385 | if(!date_.isValid()) |
386 | { | 386 | { |
387 | kdDebug() << "KDateTable::setDate: refusing to set invalid date." << endl; | 387 | kdDebug() << "KDateTable::setDate: refusing to set invalid date." << endl; |
388 | return false; | 388 | return false; |
389 | } | 389 | } |
390 | if(date!=date_) | 390 | if(date!=date_) |
391 | { | 391 | { |
392 | date=date_; | 392 | date=date_; |
393 | changed=true; | 393 | changed=true; |
394 | } | 394 | } |
395 | mMarkCurrent = ( date.month() == QDate::currentDate().month() && date.year() == QDate::currentDate().year() ); | 395 | mMarkCurrent = ( date.month() == QDate::currentDate().month() && date.year() == QDate::currentDate().year() ); |
396 | temp.setYMD(date.year(), date.month(), 1); | 396 | temp.setYMD(date.year(), date.month(), 1); |
397 | firstday=temp.dayOfWeek(); | 397 | firstday=temp.dayOfWeek(); |
398 | if(firstday==1) firstday=8; | 398 | if(firstday==1) firstday=8; |
399 | numdays=date.daysInMonth(); | 399 | numdays=date.daysInMonth(); |
400 | if(date.month()==1) | 400 | if(date.month()==1) |
401 | { // set to december of previous year | 401 | { // set to december of previous year |
402 | temp.setYMD(date.year()-1, 12, 1); | 402 | temp.setYMD(date.year()-1, 12, 1); |
403 | } else { // set to previous month | 403 | } else { // set to previous month |
404 | temp.setYMD(date.year(), date.month()-1, 1); | 404 | temp.setYMD(date.year(), date.month()-1, 1); |
405 | } | 405 | } |
406 | numDaysPrevMonth=temp.daysInMonth(); | 406 | numDaysPrevMonth=temp.daysInMonth(); |
407 | if(changed) | 407 | if(changed) |
408 | { | 408 | { |
409 | repaintContents(false); | 409 | repaintContents(false); |
410 | } | 410 | } |
411 | emit(dateChanged(date)); | 411 | emit(dateChanged(date)); |
412 | return true; | 412 | return true; |
413 | } | 413 | } |
414 | 414 | ||
415 | const QDate& | 415 | const QDate& |
416 | KDateTable::getDate() const | 416 | KDateTable::getDate() const |
417 | { | 417 | { |
418 | return date; | 418 | return date; |
419 | } | 419 | } |
420 | 420 | ||
421 | void KDateTable::focusInEvent( QFocusEvent *e ) | 421 | void KDateTable::focusInEvent( QFocusEvent *e ) |
422 | { | 422 | { |
423 | repaintContents(false); | 423 | repaintContents(false); |
424 | QGridView::focusInEvent( e ); | 424 | QGridView::focusInEvent( e ); |
425 | } | 425 | } |
426 | 426 | ||
427 | void KDateTable::focusOutEvent( QFocusEvent *e ) | 427 | void KDateTable::focusOutEvent( QFocusEvent *e ) |
428 | { | 428 | { |
429 | repaintContents(false); | 429 | repaintContents(false); |
430 | QGridView::focusOutEvent( e ); | 430 | QGridView::focusOutEvent( e ); |
431 | } | 431 | } |
432 | 432 | ||
433 | QSize | 433 | QSize |
434 | KDateTable::sizeHint() const | 434 | KDateTable::sizeHint() const |
435 | { | 435 | { |
436 | if(maxCell.height()>0 && maxCell.width()>0) | 436 | if(maxCell.height()>0 && maxCell.width()>0) |
437 | { | 437 | { |
438 | return QSize((maxCell.width()+2)*numCols()+2*frameWidth(), | 438 | return QSize((maxCell.width()+2)*numCols()+2*frameWidth(), |
439 | (maxCell.height()+4)*numRows()+2*frameWidth()); | 439 | (maxCell.height()+4)*numRows()+2*frameWidth()); |
440 | } else { | 440 | } else { |
441 | return QSize(-1, -1); | 441 | return QSize(-1, -1); |
442 | } | 442 | } |
443 | } | 443 | } |
444 | 444 | ||
445 | KDateInternalMonthPicker::KDateInternalMonthPicker | 445 | KDateInternalMonthPicker::KDateInternalMonthPicker |
446 | (QWidget* parent, const char* name) | 446 | (QWidget* parent, const char* name) |
447 | : QGridView(parent, name), | 447 | : QGridView(parent, name), |
448 | result(0) // invalid | 448 | result(0) // invalid |
449 | { | 449 | { |
450 | QRect rect; | 450 | QRect rect; |
451 | QFont font; | 451 | QFont font; |
452 | // ----- | 452 | // ----- |
453 | activeCol = -1; | 453 | activeCol = -1; |
454 | activeRow = -1; | 454 | activeRow = -1; |
455 | font=KGlobalSettings::generalFont(); | 455 | font=KGlobalSettings::generalFont(); |
456 | int fontsize = 10; | 456 | int fontsize = 10; |
457 | int add = 2; | 457 | int add = 2; |
458 | if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) | 458 | if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) |
459 | add += 8; | 459 | add += 8; |
460 | if ( QApplication::desktop()->width() > 640 ) | ||
461 | add += 4; | ||
460 | font.setPointSize(fontsize+add); | 462 | font.setPointSize(fontsize+add); |
461 | setFont(font); | 463 | setFont(font); |
462 | setHScrollBarMode(AlwaysOff); | 464 | setHScrollBarMode(AlwaysOff); |
463 | setVScrollBarMode(AlwaysOff); | 465 | setVScrollBarMode(AlwaysOff); |
464 | setFrameStyle(QFrame::NoFrame); | 466 | setFrameStyle(QFrame::NoFrame); |
465 | setNumRows(4); | 467 | setNumRows(4); |
466 | setNumCols(3); | 468 | setNumCols(3); |
467 | // enable to find drawing failures: | 469 | // enable to find drawing failures: |
468 | // setTableFlags(Tbl_clipCellPainting); | 470 | // setTableFlags(Tbl_clipCellPainting); |
469 | #if 0 | 471 | #if 0 |
470 | viewport()->setEraseColor(lightGray); // for consistency with the datepicker | 472 | viewport()->setEraseColor(lightGray); // for consistency with the datepicker |
471 | #endif | 473 | #endif |
472 | // ----- find the preferred size | 474 | // ----- find the preferred size |
473 | // (this is slow, possibly, but unfortunatly it is needed here): | 475 | // (this is slow, possibly, but unfortunatly it is needed here): |
474 | QFontMetrics metrics(font); | 476 | QFontMetrics metrics(font); |
475 | for(int i=1; i <= 12; ++i) | 477 | for(int i=1; i <= 12; ++i) |
476 | { | 478 | { |
477 | rect=metrics.boundingRect(KGlobal::locale()->monthName(i, false)); | 479 | rect=metrics.boundingRect(KGlobal::locale()->monthName(i, false)); |
478 | if(max.width()<rect.width()) max.setWidth(rect.width()); | 480 | if(max.width()<rect.width()) max.setWidth(rect.width()); |
479 | if(max.height()<rect.height()) max.setHeight(rect.height()); | 481 | if(max.height()<rect.height()) max.setHeight(rect.height()); |
480 | } | 482 | } |
481 | 483 | ||
482 | } | 484 | } |
483 | 485 | ||
484 | QSize | 486 | QSize |
485 | KDateInternalMonthPicker::sizeHint() const | 487 | KDateInternalMonthPicker::sizeHint() const |
486 | { | 488 | { |
487 | return QSize((max.width()+6)*numCols()+2*frameWidth(), | 489 | return QSize((max.width()+6)*numCols()+2*frameWidth(), |
488 | (max.height()+6)*numRows()+2*frameWidth()); | 490 | (max.height()+6)*numRows()+2*frameWidth()); |
489 | } | 491 | } |
490 | 492 | ||
491 | int | 493 | int |
492 | KDateInternalMonthPicker::getResult() const | 494 | KDateInternalMonthPicker::getResult() const |
493 | { | 495 | { |
494 | return result; | 496 | return result; |
495 | } | 497 | } |
496 | 498 | ||
497 | void | 499 | void |
498 | KDateInternalMonthPicker::setupPainter(QPainter *p) | 500 | KDateInternalMonthPicker::setupPainter(QPainter *p) |
499 | { | 501 | { |
500 | p->setPen(black); | 502 | p->setPen(black); |
501 | } | 503 | } |
502 | 504 | ||
503 | void | 505 | void |
504 | KDateInternalMonthPicker::viewportResizeEvent(QResizeEvent*) | 506 | KDateInternalMonthPicker::viewportResizeEvent(QResizeEvent*) |
505 | { | 507 | { |
506 | setCellWidth(width()/3); | 508 | setCellWidth(width()/3); |
507 | setCellHeight(height()/4); | 509 | setCellHeight(height()/4); |
508 | } | 510 | } |
509 | 511 | ||
510 | void | 512 | void |
511 | KDateInternalMonthPicker::paintCell(QPainter* painter, int row, int col) | 513 | KDateInternalMonthPicker::paintCell(QPainter* painter, int row, int col) |
512 | { | 514 | { |
513 | int index; | 515 | int index; |
514 | QString text; | 516 | QString text; |
515 | // ----- find the number of the cell: | 517 | // ----- find the number of the cell: |
516 | index=3*row+col+1; | 518 | index=3*row+col+1; |
517 | text=KGlobal::locale()->monthName(index, false); | 519 | text=KGlobal::locale()->monthName(index, false); |
518 | painter->drawText(0, 0, cellWidth(), cellHeight(), AlignCenter, text); | 520 | painter->drawText(0, 0, cellWidth(), cellHeight(), AlignCenter, text); |
519 | if ( activeCol == col && activeRow == row ) | 521 | if ( activeCol == col && activeRow == row ) |
520 | painter->drawRect( 0, 0, cellWidth(), cellHeight() ); | 522 | painter->drawRect( 0, 0, cellWidth(), cellHeight() ); |
521 | } | 523 | } |
522 | 524 | ||
523 | void | 525 | void |
524 | KDateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e) | 526 | KDateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e) |
525 | { | 527 | { |
526 | if(!isEnabled() || e->button() != LeftButton) | 528 | if(!isEnabled() || e->button() != LeftButton) |
527 | { | 529 | { |
528 | KNotifyClient::beep(); | 530 | KNotifyClient::beep(); |
529 | return; | 531 | return; |
530 | } | 532 | } |
531 | // ----- | 533 | // ----- |
532 | int row, col; | 534 | int row, col; |
533 | QPoint mouseCoord; | 535 | QPoint mouseCoord; |
534 | // ----- | 536 | // ----- |
535 | mouseCoord = e->pos(); | 537 | mouseCoord = e->pos(); |
536 | row=rowAt(mouseCoord.y()); | 538 | row=rowAt(mouseCoord.y()); |
537 | col=columnAt(mouseCoord.x()); | 539 | col=columnAt(mouseCoord.x()); |
538 | 540 | ||
539 | if(row<0 || col<0) | 541 | if(row<0 || col<0) |
540 | { // the user clicked on the frame of the table | 542 | { // the user clicked on the frame of the table |
541 | activeCol = -1; | 543 | activeCol = -1; |
542 | activeRow = -1; | 544 | activeRow = -1; |
543 | } else { | 545 | } else { |
544 | activeCol = col; | 546 | activeCol = col; |
545 | activeRow = row; | 547 | activeRow = row; |
546 | updateCell( row, col /*, false */ ); | 548 | updateCell( row, col /*, false */ ); |
547 | } | 549 | } |
548 | } | 550 | } |
549 | 551 | ||
550 | void | 552 | void |
551 | KDateInternalMonthPicker::contentsMouseMoveEvent(QMouseEvent *e) | 553 | KDateInternalMonthPicker::contentsMouseMoveEvent(QMouseEvent *e) |
552 | { | 554 | { |
553 | if (e->state() & LeftButton) | 555 | if (e->state() & LeftButton) |
554 | { | 556 | { |
555 | int row, col; | 557 | int row, col; |