summaryrefslogtreecommitdiff
authordwmw2 <dwmw2>2002-04-02 14:02:44 (UTC)
committer dwmw2 <dwmw2>2002-04-02 14:02:44 (UTC)
commit108f15e0121aca57d5828cf0f22285989d920bd7 (patch) (unidiff)
tree253c9bca48bb864b02428c72d4baf2d085579d9c
parent623ce8225b7f75755146601e2c8d7f1e7e9a65d0 (diff)
downloadopie-108f15e0121aca57d5828cf0f22285989d920bd7.zip
opie-108f15e0121aca57d5828cf0f22285989d920bd7.tar.gz
opie-108f15e0121aca57d5828cf0f22285989d920bd7.tar.bz2
Remove #include <stdiostream.h>. It wasn't used, and isn't present in my gcc3
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/dateentryimpl.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp
index e563db0..403378e 100644
--- a/core/pim/datebook/dateentryimpl.cpp
+++ b/core/pim/datebook/dateentryimpl.cpp
@@ -1,143 +1,141 @@
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 "dateentryimpl.h" 21#include "dateentryimpl.h"
22#include "repeatentry.h" 22#include "repeatentry.h"
23 23
24#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
25#include <qpe/categoryselect.h> 25#include <qpe/categoryselect.h>
26#include <qpe/datebookmonth.h> 26#include <qpe/datebookmonth.h>
27#include <qpe/global.h> 27#include <qpe/global.h>
28#include <qpe/timeconversion.h> 28#include <qpe/timeconversion.h>
29#include <qpe/timestring.h> 29#include <qpe/timestring.h>
30#include <qpe/tzselect.h> 30#include <qpe/tzselect.h>
31 31
32#include <qcheckbox.h> 32#include <qcheckbox.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qlayout.h> 34#include <qlayout.h>
35#include <qlineedit.h> 35#include <qlineedit.h>
36#include <qmultilineedit.h> 36#include <qmultilineedit.h>
37#include <qpopupmenu.h> 37#include <qpopupmenu.h>
38#include <qscrollview.h> 38#include <qscrollview.h>
39#include <qspinbox.h> 39#include <qspinbox.h>
40#include <qtoolbutton.h> 40#include <qtoolbutton.h>
41 41
42#include "timepicker.h" 42#include "timepicker.h"
43 43
44#include <stdlib.h> 44#include <stdlib.h>
45 45
46#include <stdiostream.h>
47
48/* 46/*
49 * Constructs a DateEntry which is a child of 'parent', with the 47 * Constructs a DateEntry which is a child of 'parent', with the
50 * name 'name' and widget flags set to 'f' 48 * name 'name' and widget flags set to 'f'
51 * 49 *
52 * The dialog will by default be modeless, unless you set 'modal' to 50 * The dialog will by default be modeless, unless you set 'modal' to
53 * TRUE to construct a modal dialog. 51 * TRUE to construct a modal dialog.
54 */ 52 */
55 53
56DateEntry::DateEntry( bool startOnMonday, const QDateTime &start, 54DateEntry::DateEntry( bool startOnMonday, const QDateTime &start,
57 const QDateTime &end, bool whichClock, QWidget* parent, 55 const QDateTime &end, bool whichClock, QWidget* parent,
58 const char* name ) 56 const char* name )
59 : DateEntryBase( parent, name ), 57 : DateEntryBase( parent, name ),
60 ampm( whichClock ), 58 ampm( whichClock ),
61 startWeekOnMonday( startOnMonday ) 59 startWeekOnMonday( startOnMonday )
62{ 60{
63 init(); 61 init();
64 setDates(start,end); 62 setDates(start,end);
65 setFocusProxy(comboDescription); 63 setFocusProxy(comboDescription);
66} 64}
67 65
68static void addOrPick( QComboBox* combo, const QString& t ) 66static void addOrPick( QComboBox* combo, const QString& t )
69{ 67{
70 // Pick an item if one excists 68 // Pick an item if one excists
71 for (int i=0; i<combo->count(); i++) { 69 for (int i=0; i<combo->count(); i++) {
72 if ( combo->text(i) == t ) { 70 if ( combo->text(i) == t ) {
73 combo->setCurrentItem(i); 71 combo->setCurrentItem(i);
74 return; 72 return;
75 } 73 }
76 } 74 }
77 75
78 // Else add one 76 // Else add one
79 combo->insertItem(t); 77 combo->insertItem(t);
80 combo->setCurrentItem(combo->count()-1); 78 combo->setCurrentItem(combo->count()-1);
81} 79}
82 80
83DateEntry::DateEntry( bool startOnMonday, const Event &event, bool whichClock, 81DateEntry::DateEntry( bool startOnMonday, const Event &event, bool whichClock,
84 QWidget* parent, const char* name ) 82 QWidget* parent, const char* name )
85 : DateEntryBase( parent, name ), 83 : DateEntryBase( parent, name ),
86 ampm( whichClock ), 84 ampm( whichClock ),
87 startWeekOnMonday( startOnMonday ) 85 startWeekOnMonday( startOnMonday )
88{ 86{
89 init(); 87 init();
90 setDates(event.start(),event.end()); 88 setDates(event.start(),event.end());
91 comboCategory->setCategories( event.categories(), "Calendar", tr("Calendar") ); 89 comboCategory->setCategories( event.categories(), "Calendar", tr("Calendar") );
92 if(!event.description().isEmpty()) 90 if(!event.description().isEmpty())
93 addOrPick( comboDescription, event.description() ); 91 addOrPick( comboDescription, event.description() );
94 if(!event.location().isEmpty()) 92 if(!event.location().isEmpty())
95 addOrPick( comboLocation, event.location() ); 93 addOrPick( comboLocation, event.location() );
96 checkAlarm->setChecked( event.hasAlarm() ); 94 checkAlarm->setChecked( event.hasAlarm() );
97 checkAllDay->setChecked( event.type() == Event::AllDay ); 95 checkAllDay->setChecked( event.type() == Event::AllDay );
98 if(!event.notes().isEmpty()) 96 if(!event.notes().isEmpty())
99 editNote->setText(event.notes()); 97 editNote->setText(event.notes());
100 spinAlarm->setValue(event.alarmTime()); 98 spinAlarm->setValue(event.alarmTime());
101 if ( event.alarmSound() != Event::Silent ) 99 if ( event.alarmSound() != Event::Silent )
102 comboSound->setCurrentItem( 1 ); 100 comboSound->setCurrentItem( 1 );
103 if ( event.hasRepeat() ) { 101 if ( event.hasRepeat() ) {
104 rp = event.repeatPattern(); 102 rp = event.repeatPattern();
105 cmdRepeat->setText( tr("Repeat...") ); 103 cmdRepeat->setText( tr("Repeat...") );
106 } 104 }
107 setRepeatLabel(); 105 setRepeatLabel();
108} 106}
109 107
110void DateEntry::setDates( const QDateTime& s, const QDateTime& e ) 108void DateEntry::setDates( const QDateTime& s, const QDateTime& e )
111{ 109{
112 startDate = s.date(); 110 startDate = s.date();
113 endDate = e.date(); 111 endDate = e.date();
114 startTime = s.time(); 112 startTime = s.time();
115 endTime = e.time(); 113 endTime = e.time();
116 114
117 startDateChanged( s.date().year(), s.date().month(), s.date().day() ); 115 startDateChanged( s.date().year(), s.date().month(), s.date().day() );
118 endDateChanged( e.date().year(), e.date().month(), e.date().day() ); 116 endDateChanged( e.date().year(), e.date().month(), e.date().day() );
119 117
120 updateTimeEdit(true,true); 118 updateTimeEdit(true,true);
121} 119}
122 120
123void DateEntry::updateTimeEdit(bool s, bool e) { 121void DateEntry::updateTimeEdit(bool s, bool e) {
124 122
125 // Comboboxes 123 // Comboboxes
126 QString strStart, strEnd; 124 QString strStart, strEnd;
127 int shour, ehour; 125 int shour, ehour;
128 if ( ampm ) { 126 if ( ampm ) {
129 shour = startTime.hour(); 127 shour = startTime.hour();
130 ehour = endTime.hour(); 128 ehour = endTime.hour();
131 if ( shour >= 12 ) { 129 if ( shour >= 12 ) {
132 if ( shour > 12 ) 130 if ( shour > 12 )
133 shour -= 12; 131 shour -= 12;
134 strStart.sprintf( "%d:%02d PM", shour, startTime.minute() ); 132 strStart.sprintf( "%d:%02d PM", shour, startTime.minute() );
135 } else { 133 } else {
136 if ( shour == 0 ) 134 if ( shour == 0 )
137 shour = 12; 135 shour = 12;
138 strStart.sprintf( "%d:%02d AM", shour, startTime.minute() ); 136 strStart.sprintf( "%d:%02d AM", shour, startTime.minute() );
139 } 137 }
140 if ( ehour == 24 && endTime.minute() == 0 ) { 138 if ( ehour == 24 && endTime.minute() == 0 ) {
141 strEnd = "11:59 PM"; // or "midnight" 139 strEnd = "11:59 PM"; // or "midnight"
142 } else if ( ehour >= 12 ) { 140 } else if ( ehour >= 12 ) {
143 if ( ehour > 12 ) 141 if ( ehour > 12 )