-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,112 +1,112 @@ | |||
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 |
diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp index 521781e..751ba57 100644 --- a/kalarmd/alarmdialog.cpp +++ b/kalarmd/alarmdialog.cpp | |||
@@ -25,99 +25,102 @@ | |||
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 | } |
diff --git a/kmicromail/koprefs.cpp b/kmicromail/koprefs.cpp index 7b1e169..e4b61dc 100644 --- a/kmicromail/koprefs.cpp +++ b/kmicromail/koprefs.cpp | |||
@@ -1,123 +1,120 @@ | |||
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 | ||
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 5bfe2a1..7efb6a6 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -18,107 +18,97 @@ | |||
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 ); |
diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp index a9924ba..1024796 100644 --- a/microkde/kdatetbl.cpp +++ b/microkde/kdatetbl.cpp | |||
@@ -412,96 +412,98 @@ KDateTable::setDate(const QDate& 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); |