Diffstat (limited to 'core/pim/datebook/datebooksettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/datebook/datebooksettings.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/core/pim/datebook/datebooksettings.cpp b/core/pim/datebook/datebooksettings.cpp index 675b17f..a6d04ba 100644 --- a/core/pim/datebook/datebooksettings.cpp +++ b/core/pim/datebook/datebooksettings.cpp | |||
@@ -1,75 +1,74 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "datebooksettings.h" | 21 | #include "datebooksettings.h" |
22 | 22 | ||
23 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | 24 | ||
25 | #include <qspinbox.h> | 25 | #include <qspinbox.h> |
26 | #include <qcheckbox.h> | 26 | #include <qcheckbox.h> |
27 | #include <qcombobox.h> | ||
28 | 27 | ||
29 | DateBookSettings::DateBookSettings( bool whichClock, QWidget *parent, | 28 | DateBookSettings::DateBookSettings( bool whichClock, QWidget *parent, |
30 | const char *name, bool modal, WFlags fl ) | 29 | const char *name, bool modal, WFlags fl ) |
31 | : DateBookSettingsBase( parent, name, modal, fl ), | 30 | : DateBookSettingsBase( parent, name, modal, fl ), |
32 | ampm( whichClock ) | 31 | ampm( whichClock ) |
33 | { | 32 | { |
34 | init(); | 33 | init(); |
35 | QObject::connect( qApp, SIGNAL( clockChanged( bool ) ), this, SLOT( slotChangeClock( bool ) ) ); | 34 | QObject::connect( qApp, SIGNAL( clockChanged( bool ) ), this, SLOT( slotChangeClock( bool ) ) ); |
36 | QArray<int> categories; | 35 | QArray<int> categories; |
37 | comboCategory->setCategories( categories, "Calendar", tr("Calendar") ); | 36 | comboCategory->setCategories( categories, "Calendar", tr("Calendar") ); |
38 | } | 37 | } |
39 | 38 | ||
40 | DateBookSettings::~DateBookSettings() | 39 | DateBookSettings::~DateBookSettings() |
41 | { | 40 | { |
42 | } | 41 | } |
43 | 42 | ||
44 | void DateBookSettings::setStartTime( int newStartViewTime ) | 43 | void DateBookSettings::setStartTime( int newStartViewTime ) |
45 | { | 44 | { |
46 | if ( ampm ) { | 45 | if ( ampm ) { |
47 | if ( newStartViewTime >= 12 ) { | 46 | if ( newStartViewTime >= 12 ) { |
48 | newStartViewTime %= 12; | 47 | newStartViewTime %= 12; |
49 | if ( newStartViewTime == 0 ) | 48 | if ( newStartViewTime == 0 ) |
50 | newStartViewTime = 12; | 49 | newStartViewTime = 12; |
51 | spinStart->setSuffix( tr(":00 PM") ); | 50 | spinStart->setSuffix( tr(":00 PM") ); |
52 | } | 51 | } |
53 | else if ( newStartViewTime == 0 ) { | 52 | else if ( newStartViewTime == 0 ) { |
54 | newStartViewTime = 12; | 53 | newStartViewTime = 12; |
55 | spinStart->setSuffix( tr(":00 AM") ); | 54 | spinStart->setSuffix( tr(":00 AM") ); |
56 | } | 55 | } |
57 | oldtime = newStartViewTime; | 56 | oldtime = newStartViewTime; |
58 | } | 57 | } |
59 | spinStart->setValue( newStartViewTime ); | 58 | spinStart->setValue( newStartViewTime ); |
60 | } | 59 | } |
61 | 60 | ||
62 | int DateBookSettings::startTime() const | 61 | int DateBookSettings::startTime() const |
63 | { | 62 | { |
64 | int returnMe = spinStart->value(); | 63 | int returnMe = spinStart->value(); |
65 | if ( ampm ) { | 64 | if ( ampm ) { |
66 | if ( returnMe != 12 && spinStart->suffix().contains(tr("PM"), FALSE) ) | 65 | if ( returnMe != 12 && spinStart->suffix().contains(tr("PM"), FALSE) ) |
67 | returnMe += 12; | 66 | returnMe += 12; |
68 | else if (returnMe == 12 && spinStart->suffix().contains(tr("AM"), TRUE)) | 67 | else if (returnMe == 12 && spinStart->suffix().contains(tr("AM"), TRUE)) |
69 | returnMe = 0; | 68 | returnMe = 0; |
70 | } | 69 | } |
71 | return returnMe; | 70 | return returnMe; |
72 | } | 71 | } |
73 | 72 | ||
74 | 73 | ||
75 | void DateBookSettings::setAlarmPreset( bool bAlarm, int presetTime ) | 74 | void DateBookSettings::setAlarmPreset( bool bAlarm, int presetTime ) |