27 files changed, 795 insertions, 371 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp index cc7bf4b..68ab07a 100644 --- a/core/pim/datebook/datebook.cpp +++ b/core/pim/datebook/datebook.cpp | |||
@@ -1,196 +1,212 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | ** $Id$ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ** | 20 | ..}^=.= = ; Library General Public License for more |
21 | **********************************************************************/ | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
22 | 30 | ||
23 | #define QTOPIA_INTERNAL_FD | 31 | #define QTOPIA_INTERNAL_FD |
24 | 32 | ||
25 | #include "datebook.h" | 33 | #include "datebook.h" |
26 | #include "datebookday.h" | 34 | #include "datebookday.h" |
27 | #include "datebooksettings.h" | 35 | #include "datebooksettings.h" |
28 | #include "datebookweek.h" | 36 | #include "datebookweek.h" |
29 | #include "modules/weeklst/datebookweeklst.h" | 37 | #include "modules/weeklst/datebookweeklst.h" |
30 | #include "modules/monthview/odatebookmonth.h" | 38 | #include "modules/monthview/odatebookmonth.h" |
31 | #include "dateentryimpl.h" | 39 | #include "dateentryimpl.h" |
32 | 40 | ||
33 | #include <opie2/odebug.h> | 41 | #include <opie2/odebug.h> |
34 | #include <opie2/oholidaypluginif.h> | 42 | #include <opie2/oholidaypluginif.h> |
35 | #include <opie2/oholidayplugin.h> | 43 | #include <opie2/oholidayplugin.h> |
36 | #include <opie2/opluginloader.h> | 44 | #include <opie2/opluginloader.h> |
45 | #include <opie2/oresource.h> | ||
37 | #include <opie2/todayplugininterface.h> | 46 | #include <opie2/todayplugininterface.h> |
38 | 47 | ||
39 | //#include <qpe/datebookmonth.h> | 48 | //#include <qpe/datebookmonth.h> |
40 | #include <qpe/qpeapplication.h> | 49 | #include <qpe/qpeapplication.h> |
41 | #include <qpe/config.h> | 50 | #include <qpe/config.h> |
42 | #include <qpe/finddialog.h> | 51 | #include <qpe/finddialog.h> |
43 | #include <qpe/ir.h> | 52 | #include <qpe/ir.h> |
44 | #include <qpe/qpemessagebox.h> | 53 | #include <qpe/qpemessagebox.h> |
45 | #include <qpe/resource.h> | ||
46 | #include <qpe/sound.h> | 54 | #include <qpe/sound.h> |
47 | #include <qpe/tzselect.h> | 55 | #include <qpe/tzselect.h> |
48 | #include <qtopia/qlibrary.h> | 56 | #include <qtopia/qlibrary.h> |
49 | 57 | ||
50 | #include <qaction.h> | 58 | #include <qaction.h> |
51 | #include <qcopchannel_qws.h> | 59 | #include <qcopchannel_qws.h> |
52 | #include <qlayout.h> | 60 | #include <qlayout.h> |
53 | #include <qmessagebox.h> | 61 | #include <qmessagebox.h> |
54 | #include <qtimer.h> | 62 | #include <qtimer.h> |
55 | #include <qtl.h> | 63 | #include <qtl.h> |
56 | #include <qtoolbar.h> | 64 | #include <qtoolbar.h> |
57 | #include <qwidgetstack.h> | 65 | #include <qwidgetstack.h> |
58 | #include <qdir.h> | 66 | #include <qdir.h> |
59 | #include <qlabel.h> | 67 | #include <qlabel.h> |
60 | 68 | ||
61 | #include <sys/stat.h> | 69 | #include <sys/stat.h> |
62 | #include <sys/types.h> | 70 | #include <sys/types.h> |
63 | #include <fcntl.h> | 71 | #include <fcntl.h> |
64 | #include <unistd.h> | 72 | #include <unistd.h> |
65 | 73 | ||
66 | #include <stdlib.h> | 74 | #include <stdlib.h> |
67 | 75 | ||
68 | DateBook::DateBook( QWidget *parent, const char *, WFlags f ) | 76 | DateBook::DateBook( QWidget *parent, const char *, WFlags f ) |
69 | : QMainWindow( parent, "datebook", f ), | 77 | : QMainWindow( parent, "datebook", f ), |
70 | aPreset( FALSE ), | 78 | aPreset( FALSE ), |
71 | presetTime( -1 ), | 79 | presetTime( -1 ), |
72 | startTime( 8 ), // an acceptable default | 80 | startTime( 8 ), // an acceptable default |
73 | rowStyle( 0 ), | 81 | rowStyle( 0 ), |
74 | bJumpToCurTime(FALSE), | 82 | bJumpToCurTime(FALSE), |
75 | syncing(FALSE), | 83 | syncing(FALSE), |
76 | inSearch(FALSE), | 84 | inSearch(FALSE), |
77 | alarmCounter(0) | 85 | alarmCounter(0) |
78 | { | 86 | { |
79 | bool needEvilHack= false; // if we need an Evil Hack | 87 | bool needEvilHack= false; // if we need an Evil Hack |
80 | QTime t; | 88 | QTime t; |
81 | t.start(); | 89 | t.start(); |
82 | db = new DateBookDBHoliday; | 90 | db = new DateBookDBHoliday; |
83 | odebug << "loading db t=" << t.elapsed() << oendl; | 91 | odebug << "loading db t=" << t.elapsed() << oendl; |
84 | db_holiday = new DateBookHoliday(); | 92 | db_holiday = new DateBookHoliday(); |
85 | db->db_holiday=db_holiday; | 93 | db->db_holiday=db_holiday; |
86 | 94 | ||
87 | loadSettings(); | 95 | loadSettings(); |
88 | setCaption( tr("Calendar") ); | 96 | setCaption( tr("Calendar") ); |
89 | setIcon( Resource::loadPixmap( "datebook_icon" ) ); | 97 | setIcon( Opie::Core::OResource::loadPixmap( "datebook_icon" ) ); |
90 | 98 | ||
91 | setToolBarsMovable( FALSE ); | 99 | setToolBarsMovable( FALSE ); |
92 | 100 | ||
93 | views = new QWidgetStack( this ); | 101 | views = new QWidgetStack( this ); |
94 | setCentralWidget( views ); | 102 | setCentralWidget( views ); |
95 | 103 | ||
96 | dayView = 0; | 104 | dayView = 0; |
97 | weekView = 0; | 105 | weekView = 0; |
98 | weekLstView = 0; | 106 | weekLstView = 0; |
99 | monthView = 0; | 107 | monthView = 0; |
100 | 108 | ||
101 | // QToolBar *bar = new QToolBar( this ); | 109 | // QToolBar *bar = new QToolBar( this ); |
102 | // bar->setHorizontalStretchable( TRUE ); | 110 | // bar->setHorizontalStretchable( TRUE ); |
103 | 111 | ||
104 | // QMenuBar *mb = new QMenuBar( bar ); | 112 | // QMenuBar *mb = new QMenuBar( bar ); |
105 | // mb->setMargin( 0 ); | 113 | // mb->setMargin( 0 ); |
106 | 114 | ||
107 | // QPopupMenu *view = new QPopupMenu( this ); | 115 | // QPopupMenu *view = new QPopupMenu( this ); |
108 | // mb->insertItem( tr( "View" ), view ); | 116 | // mb->insertItem( tr( "View" ), view ); |
109 | 117 | ||
110 | QToolBar *sub_bar = new QToolBar(this); | 118 | QToolBar *sub_bar = new QToolBar(this); |
111 | sub_bar->setHorizontalStretchable(TRUE); | 119 | sub_bar->setHorizontalStretchable(TRUE); |
112 | 120 | ||
113 | QActionGroup *g = new QActionGroup( this ); | 121 | QActionGroup *g = new QActionGroup( this ); |
114 | g->setExclusive( TRUE ); | 122 | g->setExclusive( TRUE ); |
115 | 123 | ||
116 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); | 124 | QAction *a = new QAction( tr( "New" ), Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ), |
125 | QString::null, 0, this, 0 ); | ||
117 | connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); | 126 | connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); |
118 | a->addTo( sub_bar ); | 127 | a->addTo( sub_bar ); |
119 | 128 | ||
120 | sub_bar->addSeparator(); | 129 | sub_bar->addSeparator(); |
121 | 130 | ||
122 | a = new QAction( tr( "Today" ), Resource::loadPixmap( "datebook/to_day" ), QString::null, 0, g, 0 ); | 131 | a = new QAction( tr( "Today" ), Opie::Core::OResource::loadPixmap( "datebook/to_day", Opie::Core::OResource::SmallIcon ), |
132 | QString::null, 0, g, 0 ); | ||
123 | connect( a, SIGNAL( activated() ), this, SLOT( slotToday() ) ); | 133 | connect( a, SIGNAL( activated() ), this, SLOT( slotToday() ) ); |
124 | a->addTo( sub_bar ); | 134 | a->addTo( sub_bar ); |
125 | // a->addTo( view ); | 135 | // a->addTo( view ); |
126 | 136 | ||
127 | sub_bar->addSeparator(); | 137 | sub_bar->addSeparator(); |
128 | 138 | ||
129 | a = new QAction( tr( "Day" ), Resource::loadPixmap( "day" ), QString::null, 0, g, 0 ); | 139 | a = new QAction( tr( "Day" ), Opie::Core::OResource::loadPixmap( "day", Opie::Core::OResource::SmallIcon ), |
140 | QString::null, 0, g, 0 ); | ||
130 | connect( a, SIGNAL( activated() ), this, SLOT( viewDay() ) ); | 141 | connect( a, SIGNAL( activated() ), this, SLOT( viewDay() ) ); |
131 | a->addTo( sub_bar ); | 142 | a->addTo( sub_bar ); |
132 | // a->addTo( view ); | 143 | // a->addTo( view ); |
133 | a->setToggleAction( TRUE ); | 144 | a->setToggleAction( TRUE ); |
134 | a->setOn( TRUE ); | 145 | a->setOn( TRUE ); |
135 | dayAction = a; | 146 | dayAction = a; |
136 | 147 | ||
137 | a = new QAction( tr( "Week" ), Resource::loadPixmap( "week" ), QString::null, 0, g, 0 ); | 148 | a = new QAction( tr( "Week" ), Opie::Core::OResource::loadPixmap( "week", Opie::Core::OResource::SmallIcon ), |
149 | QString::null, 0, g, 0 ); | ||
138 | connect( a, SIGNAL( activated() ), this, SLOT( viewWeek() ) ); | 150 | connect( a, SIGNAL( activated() ), this, SLOT( viewWeek() ) ); |
139 | a->addTo( sub_bar ); | 151 | a->addTo( sub_bar ); |
140 | // a->addTo( view ); | 152 | // a->addTo( view ); |
141 | a->setToggleAction( TRUE ); | 153 | a->setToggleAction( TRUE ); |
142 | weekAction = a; | 154 | weekAction = a; |
143 | 155 | ||
144 | a = new QAction( tr( "WeekLst" ), Resource::loadPixmap( "datebook/weeklst" ), QString::null, 0, g, 0 ); | 156 | a = new QAction( tr( "WeekLst" ), Opie::Core::OResource::loadPixmap( "datebook/weeklst", Opie::Core::OResource::SmallIcon ), |
157 | QString::null, 0, g, 0 ); | ||
145 | connect( a, SIGNAL( activated() ), this, SLOT( viewWeekLst() ) ); | 158 | connect( a, SIGNAL( activated() ), this, SLOT( viewWeekLst() ) ); |
146 | a->addTo( sub_bar ); | 159 | a->addTo( sub_bar ); |
147 | // a->addTo( view ); | 160 | // a->addTo( view ); |
148 | a->setToggleAction( TRUE ); | 161 | a->setToggleAction( TRUE ); |
149 | weekLstAction = a; | 162 | weekLstAction = a; |
150 | 163 | ||
151 | a = new QAction( tr( "Month" ), Resource::loadPixmap( "month" ), QString::null, 0, g, 0 ); | 164 | a = new QAction( tr( "Month" ), Opie::Core::OResource::loadPixmap( "month", Opie::Core::OResource::SmallIcon ), |
165 | QString::null, 0, g, 0 ); | ||
152 | connect( a, SIGNAL( activated() ), this, SLOT( viewMonth() ) ); | 166 | connect( a, SIGNAL( activated() ), this, SLOT( viewMonth() ) ); |
153 | a->addTo( sub_bar ); | 167 | a->addTo( sub_bar ); |
154 | // a->addTo( view ); | 168 | // a->addTo( view ); |
155 | a->setToggleAction( TRUE ); | 169 | a->setToggleAction( TRUE ); |
156 | monthAction = a; | 170 | monthAction = a; |
157 | 171 | ||
158 | sub_bar->addSeparator(); | 172 | sub_bar->addSeparator(); |
159 | 173 | ||
160 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), QString::null, 0, this, 0 ); | 174 | a = new QAction( tr( "Find" ), Opie::Core::OResource::loadPixmap( "mag", Opie::Core::OResource::SmallIcon ), |
175 | QString::null, 0, this, 0 ); | ||
161 | connect( a, SIGNAL(activated()), this, SLOT(slotFind()) ); | 176 | connect( a, SIGNAL(activated()), this, SLOT(slotFind()) ); |
162 | a->addTo( sub_bar ); | 177 | a->addTo( sub_bar ); |
163 | 178 | ||
164 | a = new QAction( tr( "Edit..." ), Resource::loadPixmap("SettingsIcon"), QString::null, 0, this, 0 ); | 179 | a = new QAction( tr( "Edit..." ), Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon ), |
180 | QString::null, 0, this, 0 ); | ||
165 | connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); | 181 | connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); |
166 | a->addTo( sub_bar ); | 182 | a->addTo( sub_bar ); |
167 | 183 | ||
168 | if(defaultView==DAY) viewDay(); | 184 | if(defaultView==DAY) viewDay(); |
169 | if(defaultView==WEEK) needEvilHack=true; // viewWeek(); | 185 | if(defaultView==WEEK) needEvilHack=true; // viewWeek(); |
170 | if(defaultView==WEEKLST) viewWeekLst(); | 186 | if(defaultView==WEEKLST) viewWeekLst(); |
171 | if(defaultView==MONTH) viewMonth(); | 187 | if(defaultView==MONTH) viewMonth(); |
172 | 188 | ||
173 | connect( qApp, SIGNAL(clockChanged(bool)), this, SLOT(changeClock(bool)) ); | 189 | connect( qApp, SIGNAL(clockChanged(bool)), this, SLOT(changeClock(bool)) ); |
174 | connect( qApp, SIGNAL(weekChanged(bool)), this, SLOT(changeWeek(bool)) ); | 190 | connect( qApp, SIGNAL(weekChanged(bool)), this, SLOT(changeWeek(bool)) ); |
175 | 191 | ||
176 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 192 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
177 | connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)), this, SLOT(appMessage(const QCString&,const QByteArray&)) ); | 193 | connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)), this, SLOT(appMessage(const QCString&,const QByteArray&)) ); |
178 | #endif | 194 | #endif |
179 | 195 | ||
180 | // listen on QPE/System | 196 | // listen on QPE/System |
181 | #if defined(Q_WS_QWS) | 197 | #if defined(Q_WS_QWS) |
182 | #if !defined(QT_NO_COP) | 198 | #if !defined(QT_NO_COP) |
183 | QCopChannel *channel = new QCopChannel( "QPE/System", this ); | 199 | QCopChannel *channel = new QCopChannel( "QPE/System", this ); |
184 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(receive(const QCString&,const QByteArray&)) ); | 200 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(receive(const QCString&,const QByteArray&)) ); |
185 | channel = new QCopChannel( "QPE/Datebook", this ); | 201 | channel = new QCopChannel( "QPE/Datebook", this ); |
186 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(receive(const QCString&,const QByteArray&)) ); | 202 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(receive(const QCString&,const QByteArray&)) ); |
187 | #endif | 203 | #endif |
188 | #endif | 204 | #endif |
189 | 205 | ||
190 | odebug << "done t=" << t.elapsed() << oendl; | 206 | odebug << "done t=" << t.elapsed() << oendl; |
191 | 207 | ||
192 | connect( qApp, SIGNAL( flush() ), this, SLOT( flush() ) ); | 208 | connect( qApp, SIGNAL( flush() ), this, SLOT( flush() ) ); |
193 | connect( qApp, SIGNAL( reload()), this, SLOT( reload() ) ); | 209 | connect( qApp, SIGNAL( reload()), this, SLOT( reload() ) ); |
194 | /* | 210 | /* |
195 | * Here is a problem description: | 211 | * Here is a problem description: |
196 | * When Weekview is the default view | 212 | * When Weekview is the default view |
diff --git a/core/pim/datebook/datebook.h b/core/pim/datebook/datebook.h index 05ab781..c12f5c4 100644 --- a/core/pim/datebook/datebook.h +++ b/core/pim/datebook/datebook.h | |||
@@ -1,51 +1,62 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | **********************************************************************/ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
30 | |||
20 | #ifndef DATEBOOK_H | 31 | #ifndef DATEBOOK_H |
21 | #define DATEBOOK_H | 32 | #define DATEBOOK_H |
22 | 33 | ||
23 | #include "datebooktypes.h" | 34 | #include "datebooktypes.h" |
24 | 35 | ||
25 | #include <qpe/datebookdb.h> | 36 | #include <qpe/datebookdb.h> |
26 | 37 | ||
27 | #include <qmainwindow.h> | 38 | #include <qmainwindow.h> |
28 | 39 | ||
29 | class QAction; | 40 | class QAction; |
30 | class QWidgetStack; | 41 | class QWidgetStack; |
31 | class DateBookDay; | 42 | class DateBookDay; |
32 | class DateBookWeek; | 43 | class DateBookWeek; |
33 | class DateBookWeekLst; | 44 | class DateBookWeekLst; |
34 | class ODateBookMonth; | 45 | class ODateBookMonth; |
35 | class Event; | 46 | class Event; |
36 | class QDate; | 47 | class QDate; |
37 | class Ir; | 48 | class Ir; |
38 | 49 | ||
39 | class DateBook : public QMainWindow | 50 | class DateBook : public QMainWindow |
40 | { | 51 | { |
41 | Q_OBJECT | 52 | Q_OBJECT |
42 | 53 | ||
43 | public: | 54 | public: |
44 | static QString appName() { return QString::fromLatin1("datebook"); } | 55 | static QString appName() { return QString::fromLatin1("datebook"); } |
45 | DateBook( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 56 | DateBook( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); |
46 | ~DateBook(); | 57 | ~DateBook(); |
47 | 58 | ||
48 | signals: | 59 | signals: |
49 | void newEvent(); | 60 | void newEvent(); |
50 | void signalNotFound(); | 61 | void signalNotFound(); |
51 | void signalWrapAround(); | 62 | void signalWrapAround(); |
diff --git a/core/pim/datebook/datebookday.cpp b/core/pim/datebook/datebookday.cpp index 26f0303..b8385aa 100644 --- a/core/pim/datebook/datebookday.cpp +++ b/core/pim/datebook/datebookday.cpp | |||
@@ -1,61 +1,73 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | **********************************************************************/ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
20 | 30 | ||
21 | #include "datebookday.h" | 31 | #include "datebookday.h" |
22 | #include "datebooktypes.h" | 32 | #include "datebooktypes.h" |
23 | #include "datebookdayheaderimpl.h" | 33 | #include "datebookdayheaderimpl.h" |
24 | #include "datebookdayallday.h" | 34 | #include "datebookdayallday.h" |
25 | 35 | ||
26 | #include <opie2/oholidayplugin.h> | 36 | #include <opie2/oholidayplugin.h> |
27 | #include <qpe/resource.h> | 37 | #include <opie2/oresource.h> |
28 | #include <qpe/qpeapplication.h> | 38 | |
39 | #include <qpe/applnk.h> | ||
29 | #include <qpe/ir.h> | 40 | #include <qpe/ir.h> |
41 | #include <qpe/qpeapplication.h> | ||
30 | 42 | ||
31 | #include <qsimplerichtext.h> | 43 | #include <qsimplerichtext.h> |
32 | #include <qpopupmenu.h> | 44 | #include <qpopupmenu.h> |
33 | 45 | ||
34 | 46 | ||
35 | #include <qtimer.h> | 47 | #include <qtimer.h> |
36 | 48 | ||
37 | DateBookDayView::DateBookDayView( bool whichClock, QWidget *parent, const char *name ) | 49 | DateBookDayView::DateBookDayView( bool whichClock, QWidget *parent, const char *name ) |
38 | : QTable( 24, 1, parent, name ), ampm( whichClock ), currDate( QDate::currentDate() ) | 50 | : QTable( 24, 1, parent, name ), ampm( whichClock ), currDate( QDate::currentDate() ) |
39 | { | 51 | { |
40 | enableClipper(TRUE); | 52 | enableClipper(TRUE); |
41 | setTopMargin( 0 ); | 53 | setTopMargin( 0 ); |
42 | horizontalHeader()->hide(); | 54 | horizontalHeader()->hide(); |
43 | setLeftMargin(38); | 55 | setLeftMargin(38); |
44 | setColumnStretchable( 0, TRUE ); | 56 | setColumnStretchable( 0, TRUE ); |
45 | setHScrollBarMode( QScrollView::AlwaysOff ); | 57 | setHScrollBarMode( QScrollView::AlwaysOff ); |
46 | verticalHeader()->setPalette(white); | 58 | verticalHeader()->setPalette(white); |
47 | verticalHeader()->setResizeEnabled(FALSE); | 59 | verticalHeader()->setResizeEnabled(FALSE); |
48 | setSelectionMode( Single ); | 60 | setSelectionMode( Single ); |
49 | 61 | ||
50 | // get rid of being able to edit things... | 62 | // get rid of being able to edit things... |
51 | QTableItem *tmp; | 63 | QTableItem *tmp; |
52 | int row; | 64 | int row; |
53 | for ( row = 0; row < numRows(); row++ ) { | 65 | for ( row = 0; row < numRows(); row++ ) { |
54 | tmp = new QTableItem( this, QTableItem::Never, QString::null); | 66 | tmp = new QTableItem( this, QTableItem::Never, QString::null); |
55 | setItem( row, 0, tmp ); | 67 | setItem( row, 0, tmp ); |
56 | //setRowHeight( row, 40); | 68 | //setRowHeight( row, 40); |
57 | } | 69 | } |
58 | 70 | ||
59 | initHeader(); | 71 | initHeader(); |
60 | QObject::connect( qApp, SIGNAL(clockChanged(bool)), this, SLOT(slotChangeClock(bool)) ); | 72 | QObject::connect( qApp, SIGNAL(clockChanged(bool)), this, SLOT(slotChangeClock(bool)) ); |
61 | } | 73 | } |
@@ -728,73 +740,75 @@ void DateBookDayWidget::paintEvent( QPaintEvent *e ) | |||
728 | { | 740 | { |
729 | QPainter p( this ); | 741 | QPainter p( this ); |
730 | 742 | ||
731 | if (dateBook->getSelectedWidget() == this) { | 743 | if (dateBook->getSelectedWidget() == this) { |
732 | p.setBrush( QColor( 155, 240, 230 ) ); // selected item | 744 | p.setBrush( QColor( 155, 240, 230 ) ); // selected item |
733 | } else { | 745 | } else { |
734 | if (dateBook->date() == QDate::currentDate()) { | 746 | if (dateBook->date() == QDate::currentDate()) { |
735 | QTime curTime = QTime::currentTime(); | 747 | QTime curTime = QTime::currentTime(); |
736 | if (ev.end() < curTime) { | 748 | if (ev.end() < curTime) { |
737 | p.setBrush( QColor( 180, 180, 180 ) ); // grey, inactive | 749 | p.setBrush( QColor( 180, 180, 180 ) ); // grey, inactive |
738 | } else { | 750 | } else { |
739 | //change color in dependence of the time till the event starts | 751 | //change color in dependence of the time till the event starts |
740 | int duration = curTime.secsTo(ev.start()); | 752 | int duration = curTime.secsTo(ev.start()); |
741 | if (duration < 0) duration = 0; | 753 | if (duration < 0) duration = 0; |
742 | int colChange = duration*160/86400; //86400: secs per day, 160: max color shift | 754 | int colChange = duration*160/86400; //86400: secs per day, 160: max color shift |
743 | p.setBrush( QColor( 200-colChange, 200-colChange, 255 ) ); //blue | 755 | p.setBrush( QColor( 200-colChange, 200-colChange, 255 ) ); //blue |
744 | } | 756 | } |
745 | } else { | 757 | } else { |
746 | p.setBrush( QColor( 220, 220, 220 ) ); //light grey, inactive (not current date) | 758 | p.setBrush( QColor( 220, 220, 220 ) ); //light grey, inactive (not current date) |
747 | //perhaps make a distinction between future/past dates | 759 | //perhaps make a distinction between future/past dates |
748 | } | 760 | } |
749 | } | 761 | } |
750 | 762 | ||
751 | p.setPen( QColor(100, 100, 100) ); | 763 | p.setPen( QColor(100, 100, 100) ); |
752 | p.drawRect(rect()); | 764 | p.drawRect(rect()); |
753 | 765 | ||
754 | // p.drawRect(0,0, 5, height()); | 766 | // p.drawRect(0,0, 5, height()); |
755 | 767 | ||
756 | int y = 0; | 768 | int y = 0; |
757 | int d = 0; | 769 | int d = 0; |
758 | 770 | ||
759 | if ( ev.event().hasAlarm() ) { | 771 | if ( ev.event().hasAlarm() ) { |
760 | p.drawPixmap( width() - 16, 0, Resource::loadPixmap( "bell" ) ); | 772 | p.drawPixmap( width() - AppLnk::smallIconSize(), 0, |
761 | y = 20; | 773 | Opie::Core::OResource::loadPixmap( "bell", Opie::Core::OResource::SmallIcon ) ); |
774 | y = AppLnk::smallIconSize() + 2; | ||
762 | d = 20; | 775 | d = 20; |
763 | } | 776 | } |
764 | 777 | ||
765 | if ( ev.event().hasRepeat() ) { | 778 | if ( ev.event().hasRepeat() ) { |
766 | p.drawPixmap( width() - 16, y, Resource::loadPixmap( "repeat" ) ); | 779 | p.drawPixmap( width() - AppLnk::smallIconSize(), y, |
780 | Opie::Core::OResource::loadPixmap( "repeat", Opie::Core::OResource::SmallIcon ) ); | ||
767 | d = 20; | 781 | d = 20; |
768 | y += 20; | 782 | y += AppLnk::smallIconSize() + 2; |
769 | } | 783 | } |
770 | 784 | ||
771 | QSimpleRichText rt( text, font() ); | 785 | QSimpleRichText rt( text, font() ); |
772 | rt.setWidth( geom.width() - d - 6 ); | 786 | rt.setWidth( geom.width() - d - 6 ); |
773 | rt.draw( &p, 7, 0, e->region(), colorGroup() ); | 787 | rt.draw( &p, 7, 0, e->region(), colorGroup() ); |
774 | } | 788 | } |
775 | 789 | ||
776 | /* | 790 | /* |
777 | * we need to find the real start date for a uid | 791 | * we need to find the real start date for a uid |
778 | * we need to check from one day to another... | 792 | * we need to check from one day to another... |
779 | */ | 793 | */ |
780 | QDate DateBookDay::findRealStart( int uid, const QDate& isIncluded , DateBookDB* db) { | 794 | QDate DateBookDay::findRealStart( int uid, const QDate& isIncluded , DateBookDB* db) { |
781 | QDate dt( isIncluded ); | 795 | QDate dt( isIncluded ); |
782 | QDate fnd = dt; | 796 | QDate fnd = dt; |
783 | 797 | ||
784 | bool doAgain = true; | 798 | bool doAgain = true; |
785 | do{ | 799 | do{ |
786 | dt = dt.addDays( -1 ); | 800 | dt = dt.addDays( -1 ); |
787 | QValueList<EffectiveEvent> events = db->getEffectiveEvents( dt, dt ); | 801 | QValueList<EffectiveEvent> events = db->getEffectiveEvents( dt, dt ); |
788 | for (QValueList<EffectiveEvent>::Iterator it = events.begin(); it != events.end(); ++it ) { | 802 | for (QValueList<EffectiveEvent>::Iterator it = events.begin(); it != events.end(); ++it ) { |
789 | EffectiveEvent ev = (*it); | 803 | EffectiveEvent ev = (*it); |
790 | if ( uid == ev.event().uid() && ev.start() != QTime(0, 0, 0 ) ) | 804 | if ( uid == ev.event().uid() && ev.start() != QTime(0, 0, 0 ) ) |
791 | return ev.date(); | 805 | return ev.date(); |
792 | } | 806 | } |
793 | }while (doAgain ); | 807 | }while (doAgain ); |
794 | 808 | ||
795 | return fnd; | 809 | return fnd; |
796 | } | 810 | } |
797 | 811 | ||
798 | void DateBookDayWidget::mousePressEvent( QMouseEvent *e ) | 812 | void DateBookDayWidget::mousePressEvent( QMouseEvent *e ) |
799 | { | 813 | { |
800 | DateBookDayWidget *item; | 814 | DateBookDayWidget *item; |
diff --git a/core/pim/datebook/datebookday.h b/core/pim/datebook/datebookday.h index 3b75eba..82021af 100644 --- a/core/pim/datebook/datebookday.h +++ b/core/pim/datebook/datebookday.h | |||
@@ -1,51 +1,62 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | **********************************************************************/ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
30 | |||
20 | #ifndef DATEBOOKDAY_H | 31 | #ifndef DATEBOOKDAY_H |
21 | #define DATEBOOKDAY_H | 32 | #define DATEBOOKDAY_H |
22 | 33 | ||
23 | #include <qpe/event.h> | 34 | #include <qpe/event.h> |
24 | 35 | ||
25 | #include <qdatetime.h> | 36 | #include <qdatetime.h> |
26 | #include <qtable.h> | 37 | #include <qtable.h> |
27 | #include <qvbox.h> | 38 | #include <qvbox.h> |
28 | #include <qlist.h> | 39 | #include <qlist.h> |
29 | 40 | ||
30 | #include "datebook.h" | 41 | #include "datebook.h" |
31 | #include "datebooktypes.h" | 42 | #include "datebooktypes.h" |
32 | #include <qlineedit.h> | 43 | #include <qlineedit.h> |
33 | 44 | ||
34 | class DateBookDayHeader; | 45 | class DateBookDayHeader; |
35 | class DateBookDB; | 46 | class DateBookDB; |
36 | class DateBookDBHoliday; | 47 | class DateBookDBHoliday; |
37 | class DatebookdayAllday; | 48 | class DatebookdayAllday; |
38 | class QDateTime; | 49 | class QDateTime; |
39 | class QMouseEvent; | 50 | class QMouseEvent; |
40 | class QPaintEvent; | 51 | class QPaintEvent; |
41 | class QResizeEvent; | 52 | class QResizeEvent; |
42 | 53 | ||
43 | class DateBookDayViewQuickLineEdit : public QLineEdit | 54 | class DateBookDayViewQuickLineEdit : public QLineEdit |
44 | { | 55 | { |
45 | Q_OBJECT | 56 | Q_OBJECT |
46 | public: | 57 | public: |
47 | DateBookDayViewQuickLineEdit(const QDateTime &start, const QDateTime &end,QWidget * parent, const char *name=0); | 58 | DateBookDayViewQuickLineEdit(const QDateTime &start, const QDateTime &end,QWidget * parent, const char *name=0); |
48 | protected: | 59 | protected: |
49 | Event quickEvent; | 60 | Event quickEvent; |
50 | int active; | 61 | int active; |
51 | void focusOutEvent( QFocusEvent *e ); | 62 | void focusOutEvent( QFocusEvent *e ); |
diff --git a/core/pim/datebook/datebookdayallday.cpp b/core/pim/datebook/datebookdayallday.cpp index 27fce44..3807542 100644 --- a/core/pim/datebook/datebookdayallday.cpp +++ b/core/pim/datebook/datebookdayallday.cpp | |||
@@ -1,40 +1,63 @@ | |||
1 | /**************************************************************************** | 1 | /* |
2 | ** GPL by Rajko Albrecht | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** | 4 | Copyright (C) Rajko Albrecht <> |
5 | ** | 5 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
6 | ** | 6 | =. |
7 | ** | 7 | .=l. |
8 | ****************************************************************************/ | 8 | .>+-= |
9 | _;:, .> :=|. This program is free software; you can | ||
10 | .> <`_, > . <= redistribute it and/or modify it under | ||
11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
12 | .="- .-=="i, .._ License as published by the Free Software | ||
13 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
14 | ._= =} : or (at your option) any later version. | ||
15 | .%`+i> _;_. | ||
16 | .i_,=:_. -<s. This program is distributed in the hope that | ||
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
18 | : .. .:, . . . without even the implied warranty of | ||
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
21 | ..}^=.= = ; Library General Public License for more | ||
22 | ++= -. .` .: details. | ||
23 | : = ...= . :.=- | ||
24 | -. .:....=;==+<; You should have received a copy of the GNU | ||
25 | -_. . . )=. = Library General Public License along with | ||
26 | -- :-=` this library; see the file COPYING.LIB. | ||
27 | If not, write to the Free Software Foundation, | ||
28 | Inc., 59 Temple Place - Suite 330, | ||
29 | Boston, MA 02111-1307, USA. | ||
30 | */ | ||
31 | |||
9 | #include "datebookdayallday.h" | 32 | #include "datebookdayallday.h" |
10 | 33 | ||
11 | #include <qlayout.h> | 34 | #include <qlayout.h> |
12 | #include <qpe/ir.h> | 35 | #include <qpe/ir.h> |
13 | #include <qpopupmenu.h> | 36 | #include <qpopupmenu.h> |
14 | #include <qtimer.h> | 37 | #include <qtimer.h> |
15 | 38 | ||
16 | #include "datebookday.h" | 39 | #include "datebookday.h" |
17 | 40 | ||
18 | /* | 41 | /* |
19 | * Constructs a DatebookdayAllday which is a child of 'parent', with the | 42 | * Constructs a DatebookdayAllday which is a child of 'parent', with the |
20 | * name 'name' and widget flags set to 'f' | 43 | * name 'name' and widget flags set to 'f' |
21 | */ | 44 | */ |
22 | DatebookdayAllday::DatebookdayAllday(DateBookDB* db, QWidget* parent, const char* name, WFlags ) | 45 | DatebookdayAllday::DatebookdayAllday(DateBookDB* db, QWidget* parent, const char* name, WFlags ) |
23 | : QScrollView( parent, name ),item_count(0),dateBook(db) | 46 | : QScrollView( parent, name ),item_count(0),dateBook(db) |
24 | { | 47 | { |
25 | if ( !name ) | 48 | if ( !name ) |
26 | setName( "DatebookdayAllday" ); | 49 | setName( "DatebookdayAllday" ); |
27 | setMinimumSize( QSize( 0, 0 ) ); | 50 | setMinimumSize( QSize( 0, 0 ) ); |
28 | setMaximumHeight(3* (QFontMetrics(font()).height()+4) ); | 51 | setMaximumHeight(3* (QFontMetrics(font()).height()+4) ); |
29 | 52 | ||
30 | m_MainFrame = new QFrame(viewport()); | 53 | m_MainFrame = new QFrame(viewport()); |
31 | m_MainFrame->setFrameStyle(QFrame::NoFrame|QFrame::Plain); | 54 | m_MainFrame->setFrameStyle(QFrame::NoFrame|QFrame::Plain); |
32 | setFrameStyle(QFrame::NoFrame|QFrame::Plain); | 55 | setFrameStyle(QFrame::NoFrame|QFrame::Plain); |
33 | //setResizePolicy( QScrollView::Default ); | 56 | //setResizePolicy( QScrollView::Default ); |
34 | setResizePolicy(QScrollView::AutoOneFit); | 57 | setResizePolicy(QScrollView::AutoOneFit); |
35 | setHScrollBarMode( AlwaysOff ); | 58 | setHScrollBarMode( AlwaysOff ); |
36 | addChild(m_MainFrame); | 59 | addChild(m_MainFrame); |
37 | 60 | ||
38 | datebookdayalldayLayout = new QVBoxLayout( m_MainFrame ); | 61 | datebookdayalldayLayout = new QVBoxLayout( m_MainFrame ); |
39 | datebookdayalldayLayout->setSpacing( 0 ); | 62 | datebookdayalldayLayout->setSpacing( 0 ); |
40 | datebookdayalldayLayout->setMargin( 0 ); | 63 | datebookdayalldayLayout->setMargin( 0 ); |
diff --git a/core/pim/datebook/datebookdayallday.h b/core/pim/datebook/datebookdayallday.h index 4f5cffa..5395dcf 100644 --- a/core/pim/datebook/datebookdayallday.h +++ b/core/pim/datebook/datebookdayallday.h | |||
@@ -1,32 +1,63 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (C) Rajko Albrecht <> | ||
5 | Copyright (C) Opie Team <opie-devel@handhelds.org> | ||
6 | =. | ||
7 | .=l. | ||
8 | .>+-= | ||
9 | _;:, .> :=|. This program is free software; you can | ||
10 | .> <`_, > . <= redistribute it and/or modify it under | ||
11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
12 | .="- .-=="i, .._ License as published by the Free Software | ||
13 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
14 | ._= =} : or (at your option) any later version. | ||
15 | .%`+i> _;_. | ||
16 | .i_,=:_. -<s. This program is distributed in the hope that | ||
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
18 | : .. .:, . . . without even the implied warranty of | ||
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
21 | ..}^=.= = ; Library General Public License for more | ||
22 | ++= -. .` .: details. | ||
23 | : = ...= . :.=- | ||
24 | -. .:....=;==+<; You should have received a copy of the GNU | ||
25 | -_. . . )=. = Library General Public License along with | ||
26 | -- :-=` this library; see the file COPYING.LIB. | ||
27 | If not, write to the Free Software Foundation, | ||
28 | Inc., 59 Temple Place - Suite 330, | ||
29 | Boston, MA 02111-1307, USA. | ||
30 | */ | ||
31 | |||
1 | #ifndef DATEBOOKDAYALLDAYBASE_H | 32 | #ifndef DATEBOOKDAYALLDAYBASE_H |
2 | #define DATEBOOKDAYALLDAYBASE_H | 33 | #define DATEBOOKDAYALLDAYBASE_H |
3 | 34 | ||
4 | #include <qvariant.h> | 35 | #include <qvariant.h> |
5 | #include <qframe.h> | 36 | #include <qframe.h> |
6 | #include <qscrollview.h> | 37 | #include <qscrollview.h> |
7 | #include <qlabel.h> | 38 | #include <qlabel.h> |
8 | #include <qlist.h> | 39 | #include <qlist.h> |
9 | #include <qpe/event.h> | 40 | #include <qpe/event.h> |
10 | 41 | ||
11 | class QVBoxLayout; | 42 | class QVBoxLayout; |
12 | class QHBoxLayout; | 43 | class QHBoxLayout; |
13 | class QGridLayout; | 44 | class QGridLayout; |
14 | class DatebookAlldayDisp; | 45 | class DatebookAlldayDisp; |
15 | class DatebookEventDesc; | 46 | class DatebookEventDesc; |
16 | class DateBookDB; | 47 | class DateBookDB; |
17 | 48 | ||
18 | class DatebookdayAllday : public QScrollView | 49 | class DatebookdayAllday : public QScrollView |
19 | { | 50 | { |
20 | Q_OBJECT | 51 | Q_OBJECT |
21 | 52 | ||
22 | public: | 53 | public: |
23 | DatebookdayAllday(DateBookDB* db, | 54 | DatebookdayAllday(DateBookDB* db, |
24 | QWidget* parent = 0, const char* name = 0, WFlags fl = 0); | 55 | QWidget* parent = 0, const char* name = 0, WFlags fl = 0); |
25 | ~DatebookdayAllday(); | 56 | ~DatebookdayAllday(); |
26 | DatebookAlldayDisp* addEvent(const EffectiveEvent&e); | 57 | DatebookAlldayDisp* addEvent(const EffectiveEvent&e); |
27 | DatebookAlldayDisp* addHoliday(const QString&e); | 58 | DatebookAlldayDisp* addHoliday(const QString&e); |
28 | const unsigned int items()const{return item_count;} | 59 | const unsigned int items()const{return item_count;} |
29 | 60 | ||
30 | public slots: | 61 | public slots: |
31 | void removeAllEvents(); | 62 | void removeAllEvents(); |
32 | 63 | ||
diff --git a/core/pim/datebook/datebookdayheaderimpl.cpp b/core/pim/datebook/datebookdayheaderimpl.cpp index 51b78ca..0df1bfe 100644 --- a/core/pim/datebook/datebookdayheaderimpl.cpp +++ b/core/pim/datebook/datebookdayheaderimpl.cpp | |||
@@ -1,80 +1,92 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | **********************************************************************/ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
30 | |||
20 | #include "datebookdayheaderimpl.h" | 31 | #include "datebookdayheaderimpl.h" |
21 | 32 | ||
33 | #include <opie2/oresource.h> | ||
34 | |||
22 | #include <qpe/datebookmonth.h> | 35 | #include <qpe/datebookmonth.h> |
23 | #include <qpe/resource.h> | ||
24 | 36 | ||
25 | #include <qbuttongroup.h> | 37 | #include <qbuttongroup.h> |
26 | #include <qtoolbutton.h> | 38 | #include <qtoolbutton.h> |
27 | 39 | ||
28 | 40 | ||
29 | /* | 41 | /* |
30 | * Constructs a DateBookDayHeader which is a child of 'parent', with the | 42 | * Constructs a DateBookDayHeader which is a child of 'parent', with the |
31 | * name 'name' and widget flags set to 'f' | 43 | * name 'name' and widget flags set to 'f' |
32 | * | 44 | * |
33 | * The dialog will by default be modeless, unless you set 'modal' to | 45 | * The dialog will by default be modeless, unless you set 'modal' to |
34 | * TRUE to construct a modal dialog. | 46 | * TRUE to construct a modal dialog. |
35 | */ | 47 | */ |
36 | DateBookDayHeader::DateBookDayHeader( bool useMonday, | 48 | DateBookDayHeader::DateBookDayHeader( bool useMonday, |
37 | QWidget* parent, const char* name ) | 49 | QWidget* parent, const char* name ) |
38 | : DateBookDayHeaderBase( parent, name ), | 50 | : DateBookDayHeaderBase( parent, name ), |
39 | bUseMonday( useMonday ) | 51 | bUseMonday( useMonday ) |
40 | { | 52 | { |
41 | connect(date,SIGNAL(pressed()),this,SLOT(pickDate())); | 53 | connect(date,SIGNAL(pressed()),this,SLOT(pickDate())); |
42 | 54 | ||
43 | setupNames(); | 55 | setupNames(); |
44 | 56 | ||
45 | forward->setPixmap( Resource::loadPixmap( "forward" ) ); | 57 | forward->setPixmap( Opie::Core::OResource::loadPixmap( "forward" ) ); |
46 | back->setPixmap( Resource::loadPixmap( "back" ) ); | 58 | back->setPixmap( Opie::Core::OResource::loadPixmap( "back" ) ); |
47 | forwardweek->setPixmap( Resource::loadPixmap( "fastforward" ) ); | 59 | forwardweek->setPixmap( Opie::Core::OResource::loadPixmap( "fastforward" ) ); |
48 | backweek->setPixmap( Resource::loadPixmap( "fastback" ) ); | 60 | backweek->setPixmap( Opie::Core::OResource::loadPixmap( "fastback" ) ); |
49 | 61 | ||
50 | setBackgroundMode( PaletteButton ); | 62 | setBackgroundMode( PaletteButton ); |
51 | grpDays->setBackgroundMode( PaletteButton ); | 63 | grpDays->setBackgroundMode( PaletteButton ); |
52 | } | 64 | } |
53 | 65 | ||
54 | /* | 66 | /* |
55 | * Destroys the object and frees any allocated resources | 67 | * Destroys the object and frees any allocated resources |
56 | */ | 68 | */ |
57 | DateBookDayHeader::~DateBookDayHeader() | 69 | DateBookDayHeader::~DateBookDayHeader() |
58 | { | 70 | { |
59 | // no need to delete child widgets, Qt does it all for us | 71 | // no need to delete child widgets, Qt does it all for us |
60 | } | 72 | } |
61 | 73 | ||
62 | void DateBookDayHeader::setStartOfWeek( bool onMonday ) | 74 | void DateBookDayHeader::setStartOfWeek( bool onMonday ) |
63 | { | 75 | { |
64 | bUseMonday = onMonday; | 76 | bUseMonday = onMonday; |
65 | setupNames(); | 77 | setupNames(); |
66 | setDate( currDate.year(), currDate.month(), currDate.day() ); | 78 | setDate( currDate.year(), currDate.month(), currDate.day() ); |
67 | } | 79 | } |
68 | 80 | ||
69 | void DateBookDayHeader::setupNames() | 81 | void DateBookDayHeader::setupNames() |
70 | { | 82 | { |
71 | if ( bUseMonday ) { | 83 | if ( bUseMonday ) { |
72 | cmdDay1->setText( DateBookDayHeaderBase::tr("Monday").left(1) ); | 84 | cmdDay1->setText( DateBookDayHeaderBase::tr("Monday").left(1) ); |
73 | cmdDay2->setText( DateBookDayHeaderBase::tr("Tuesday").left(1) ); | 85 | cmdDay2->setText( DateBookDayHeaderBase::tr("Tuesday").left(1) ); |
74 | cmdDay3->setText( DateBookDayHeaderBase::tr("Wednesday").left(1) ); | 86 | cmdDay3->setText( DateBookDayHeaderBase::tr("Wednesday").left(1) ); |
75 | cmdDay4->setText( DateBookDayHeaderBase::tr("Thursday").left(1) ); | 87 | cmdDay4->setText( DateBookDayHeaderBase::tr("Thursday").left(1) ); |
76 | cmdDay5->setText( DateBookDayHeaderBase::tr("Friday").left(1) ); | 88 | cmdDay5->setText( DateBookDayHeaderBase::tr("Friday").left(1) ); |
77 | cmdDay6->setText( DateBookDayHeaderBase::tr("Saturday").left(1) ); | 89 | cmdDay6->setText( DateBookDayHeaderBase::tr("Saturday").left(1) ); |
78 | cmdDay7->setText( DateBookDayHeaderBase::tr("Sunday").left(1) ); | 90 | cmdDay7->setText( DateBookDayHeaderBase::tr("Sunday").left(1) ); |
79 | } else { | 91 | } else { |
80 | cmdDay1->setText( DateBookDayHeaderBase::tr("Sunday").left(1) ); | 92 | cmdDay1->setText( DateBookDayHeaderBase::tr("Sunday").left(1) ); |
diff --git a/core/pim/datebook/datebookdayheaderimpl.h b/core/pim/datebook/datebookdayheaderimpl.h index a07bd67..ea9f917 100644 --- a/core/pim/datebook/datebookdayheaderimpl.h +++ b/core/pim/datebook/datebookdayheaderimpl.h | |||
@@ -1,51 +1,62 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | **********************************************************************/ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
30 | |||
20 | #ifndef DATEBOOKDAYHEADER_H | 31 | #ifndef DATEBOOKDAYHEADER_H |
21 | #define DATEBOOKDAYHEADER_H | 32 | #define DATEBOOKDAYHEADER_H |
22 | #include "datebookdayheader.h" | 33 | #include "datebookdayheader.h" |
23 | 34 | ||
24 | #include <qdatetime.h> | 35 | #include <qdatetime.h> |
25 | 36 | ||
26 | class DateBookDayHeader : public DateBookDayHeaderBase | 37 | class DateBookDayHeader : public DateBookDayHeaderBase |
27 | { | 38 | { |
28 | Q_OBJECT | 39 | Q_OBJECT |
29 | 40 | ||
30 | public: | 41 | public: |
31 | DateBookDayHeader( bool bUseMonday, QWidget* parent = 0, | 42 | DateBookDayHeader( bool bUseMonday, QWidget* parent = 0, |
32 | const char* name = 0 ); | 43 | const char* name = 0 ); |
33 | ~DateBookDayHeader(); | 44 | ~DateBookDayHeader(); |
34 | void setStartOfWeek( bool onMonday ); | 45 | void setStartOfWeek( bool onMonday ); |
35 | 46 | ||
36 | public slots: | 47 | public slots: |
37 | void goBack(); | 48 | void goBack(); |
38 | void goForward(); | 49 | void goForward(); |
39 | void goBackWeek(); | 50 | void goBackWeek(); |
40 | void goForwardWeek(); | 51 | void goForwardWeek(); |
41 | void setDate( int, int, int ); | 52 | void setDate( int, int, int ); |
42 | void setDay( int ); | 53 | void setDay( int ); |
43 | void gotHide(); | 54 | void gotHide(); |
44 | 55 | ||
45 | signals: | 56 | signals: |
46 | void dateChanged( int y, int m, int d ); | 57 | void dateChanged( int y, int m, int d ); |
47 | 58 | ||
48 | private slots: | 59 | private slots: |
49 | void pickDate(); | 60 | void pickDate(); |
50 | 61 | ||
51 | 62 | ||
diff --git a/core/pim/datebook/datebooksettings.cpp b/core/pim/datebook/datebooksettings.cpp index 561dc38..c72cd59 100644 --- a/core/pim/datebook/datebooksettings.cpp +++ b/core/pim/datebook/datebooksettings.cpp | |||
@@ -1,51 +1,61 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | **********************************************************************/ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
20 | 30 | ||
21 | #include "datebooksettings.h" | 31 | #include "datebooksettings.h" |
22 | 32 | ||
23 | #include <opie2/opluginloader.h> | 33 | #include <opie2/opluginloader.h> |
24 | #include <opie2/odebug.h> | 34 | #include <opie2/odebug.h> |
25 | #include <opie2/oholidaypluginif.h> | 35 | #include <opie2/oholidaypluginif.h> |
26 | #include <opie2/oholidayplugin.h> | 36 | #include <opie2/oholidayplugin.h> |
27 | #include <opie2/oholidayplugincfgwidget.h> | 37 | #include <opie2/oholidayplugincfgwidget.h> |
28 | 38 | ||
29 | #include <qpe/qpeapplication.h> | 39 | #include <qpe/qpeapplication.h> |
30 | 40 | ||
31 | #include <qspinbox.h> | 41 | #include <qspinbox.h> |
32 | #include <qcheckbox.h> | 42 | #include <qcheckbox.h> |
33 | #include <qlistview.h> | 43 | #include <qlistview.h> |
34 | #include <qheader.h> | 44 | #include <qheader.h> |
35 | #include <qtabwidget.h> | 45 | #include <qtabwidget.h> |
36 | #include <qlayout.h> | 46 | #include <qlayout.h> |
37 | 47 | ||
38 | DateBookSettings::DateBookSettings( bool whichClock, QWidget *parent, | 48 | DateBookSettings::DateBookSettings( bool whichClock, QWidget *parent, |
39 | const char *name, bool modal, WFlags fl ) | 49 | const char *name, bool modal, WFlags fl ) |
40 | : DateBookSettingsBase( parent, name, modal, fl ), | 50 | : DateBookSettingsBase( parent, name, modal, fl ), |
41 | ampm( whichClock ) | 51 | ampm( whichClock ) |
42 | { | 52 | { |
43 | init(); | 53 | init(); |
44 | QObject::connect( qApp, SIGNAL( clockChanged(bool) ), this, SLOT( slotChangeClock(bool) ) ); | 54 | QObject::connect( qApp, SIGNAL( clockChanged(bool) ), this, SLOT( slotChangeClock(bool) ) ); |
45 | QArray<int> categories; | 55 | QArray<int> categories; |
46 | comboCategory->setCategories( categories, "Calendar", tr("Calendar") ); | 56 | comboCategory->setCategories( categories, "Calendar", tr("Calendar") ); |
47 | m_loader = 0; | 57 | m_loader = 0; |
48 | m_manager = 0; | 58 | m_manager = 0; |
49 | m_PluginListView->header()->hide(); | 59 | m_PluginListView->header()->hide(); |
50 | m_PluginListView->setSorting(-1); | 60 | m_PluginListView->setSorting(-1); |
51 | } | 61 | } |
diff --git a/core/pim/datebook/datebooksettings.h b/core/pim/datebook/datebooksettings.h index 912088f..d3aca85 100644 --- a/core/pim/datebook/datebooksettings.h +++ b/core/pim/datebook/datebooksettings.h | |||
@@ -1,51 +1,61 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | **********************************************************************/ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
20 | 30 | ||
21 | #ifndef DATEBOOKSETTINGS_H | 31 | #ifndef DATEBOOKSETTINGS_H |
22 | #define DATEBOOKSETTINGS_H | 32 | #define DATEBOOKSETTINGS_H |
23 | #include "datebooksettingsbase.h" | 33 | #include "datebooksettingsbase.h" |
24 | #include <qpe/categoryselect.h> | 34 | #include <qpe/categoryselect.h> |
25 | #include <qvaluelist.h> | 35 | #include <qvaluelist.h> |
26 | 36 | ||
27 | namespace Opie { | 37 | namespace Opie { |
28 | namespace Core { | 38 | namespace Core { |
29 | class OPluginManager; | 39 | class OPluginManager; |
30 | class OGenericPluginLoader; | 40 | class OGenericPluginLoader; |
31 | class OPluginLoader; | 41 | class OPluginLoader; |
32 | } | 42 | } |
33 | namespace Ui { | 43 | namespace Ui { |
34 | class OPluginConfigWidget; | 44 | class OPluginConfigWidget; |
35 | } | 45 | } |
36 | namespace Datebook { | 46 | namespace Datebook { |
37 | class HolidayPluginConfigWidget; | 47 | class HolidayPluginConfigWidget; |
38 | } | 48 | } |
39 | } | 49 | } |
40 | 50 | ||
41 | class DateBookSettings : public DateBookSettingsBase | 51 | class DateBookSettings : public DateBookSettingsBase |
42 | { | 52 | { |
43 | Q_OBJECT | 53 | Q_OBJECT |
44 | public: | 54 | public: |
45 | DateBookSettings( bool whichClock, QWidget *parent = 0, | 55 | DateBookSettings( bool whichClock, QWidget *parent = 0, |
46 | const char *name = 0, bool modal = TRUE, WFlags = 0 ); | 56 | const char *name = 0, bool modal = TRUE, WFlags = 0 ); |
47 | ~DateBookSettings(); | 57 | ~DateBookSettings(); |
48 | void setStartTime( int newStartViewTime ); | 58 | void setStartTime( int newStartViewTime ); |
49 | int startTime() const; | 59 | int startTime() const; |
50 | void setAlarmPreset( bool bAlarm, int presetTime ); | 60 | void setAlarmPreset( bool bAlarm, int presetTime ); |
51 | bool alarmPreset() const; | 61 | bool alarmPreset() const; |
diff --git a/core/pim/datebook/datebooktypes.h b/core/pim/datebook/datebooktypes.h index 9453be8..bc94561 100644 --- a/core/pim/datebook/datebooktypes.h +++ b/core/pim/datebook/datebooktypes.h | |||
@@ -1,32 +1,62 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (C) Opie Team <opie-devel@handhelds.org> | ||
5 | =. | ||
6 | .=l. | ||
7 | .>+-= | ||
8 | _;:, .> :=|. This program is free software; you can | ||
9 | .> <`_, > . <= redistribute it and/or modify it under | ||
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
11 | .="- .-=="i, .._ License as published by the Free Software | ||
12 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
13 | ._= =} : or (at your option) any later version. | ||
14 | .%`+i> _;_. | ||
15 | .i_,=:_. -<s. This program is distributed in the hope that | ||
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
17 | : .. .:, . . . without even the implied warranty of | ||
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
30 | |||
1 | #ifndef _DATEBOOK_TYPES_H | 31 | #ifndef _DATEBOOK_TYPES_H |
2 | #define _DATEBOOK_TYPES_H | 32 | #define _DATEBOOK_TYPES_H |
3 | 33 | ||
4 | #include <qpe/datebookdb.h> | 34 | #include <qpe/datebookdb.h> |
5 | 35 | ||
6 | #include <qvaluelist.h> | 36 | #include <qvaluelist.h> |
7 | #include <qstringlist.h> | 37 | #include <qstringlist.h> |
8 | 38 | ||
9 | namespace Opie { | 39 | namespace Opie { |
10 | namespace Datebook { | 40 | namespace Datebook { |
11 | class HolidayPlugin; | 41 | class HolidayPlugin; |
12 | class HolidayPluginIf; | 42 | class HolidayPluginIf; |
13 | } | 43 | } |
14 | namespace Core { | 44 | namespace Core { |
15 | class OPluginLoader; | 45 | class OPluginLoader; |
16 | class OPluginManager; | 46 | class OPluginManager; |
17 | } | 47 | } |
18 | } | 48 | } |
19 | 49 | ||
20 | class QLibrary; | 50 | class QLibrary; |
21 | 51 | ||
22 | enum { DAY=1,WEEK,WEEKLST,MONTH }; // defaultView values | 52 | enum { DAY=1,WEEK,WEEKLST,MONTH }; // defaultView values |
23 | enum { NONE=0,NORMAL,EXTENDED }; // WeekLstView's modes. | 53 | enum { NONE=0,NORMAL,EXTENDED }; // WeekLstView's modes. |
24 | 54 | ||
25 | class DateBookDBHack : virtual public DateBookDB { | 55 | class DateBookDBHack : virtual public DateBookDB { |
26 | public: | 56 | public: |
27 | virtual ~DateBookDBHack(){} | 57 | virtual ~DateBookDBHack(){} |
28 | Event eventByUID(int id); | 58 | Event eventByUID(int id); |
29 | }; | 59 | }; |
30 | 60 | ||
31 | class DateBookHoliday | 61 | class DateBookHoliday |
32 | { | 62 | { |
diff --git a/core/pim/datebook/datebookweek.cpp b/core/pim/datebook/datebookweek.cpp index a509d89..ce0b10b 100644 --- a/core/pim/datebook/datebookweek.cpp +++ b/core/pim/datebook/datebookweek.cpp | |||
@@ -1,51 +1,62 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | **********************************************************************/ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
30 | |||
20 | #include "datebookweek.h" | 31 | #include "datebookweek.h" |
21 | #include "datebookweekheaderimpl.h" | 32 | #include "datebookweekheaderimpl.h" |
22 | #include "datebooktypes.h" | 33 | #include "datebooktypes.h" |
23 | 34 | ||
24 | #include <qpe/datebookdb.h> | 35 | #include <qpe/datebookdb.h> |
25 | #include <qpe/qpeapplication.h> | 36 | #include <qpe/qpeapplication.h> |
26 | #include <qpe/calendar.h> | 37 | #include <qpe/calendar.h> |
27 | 38 | ||
28 | #include <qheader.h> | 39 | #include <qheader.h> |
29 | #include <qlabel.h> | 40 | #include <qlabel.h> |
30 | #include <qlayout.h> | 41 | #include <qlayout.h> |
31 | #include <qtimer.h> | 42 | #include <qtimer.h> |
32 | 43 | ||
33 | //----------------------------------------------------------------- | 44 | //----------------------------------------------------------------- |
34 | 45 | ||
35 | 46 | ||
36 | DateBookWeekItem::DateBookWeekItem( const EffectiveEvent e ) | 47 | DateBookWeekItem::DateBookWeekItem( const EffectiveEvent e ) |
37 | : ev( e ) | 48 | : ev( e ) |
38 | { | 49 | { |
39 | // with the current implementation change the color for all day events | 50 | // with the current implementation change the color for all day events |
40 | if ( ev.event().type() == Event::AllDay && !ev.event().hasAlarm() ) { | 51 | if ( ev.event().type() == Event::AllDay && !ev.event().hasAlarm() ) { |
41 | c = Qt::green; | 52 | c = Qt::green; |
42 | } else { | 53 | } else { |
43 | c = ev.event().hasAlarm() ? Qt::red : Qt::blue; | 54 | c = ev.event().hasAlarm() ? Qt::red : Qt::blue; |
44 | } | 55 | } |
45 | } | 56 | } |
46 | 57 | ||
47 | void DateBookWeekItem::setGeometry( int x, int y, int w, int h ) | 58 | void DateBookWeekItem::setGeometry( int x, int y, int w, int h ) |
48 | { | 59 | { |
49 | r.setRect( x, y, w, h ); | 60 | r.setRect( x, y, w, h ); |
50 | } | 61 | } |
51 | 62 | ||
diff --git a/core/pim/datebook/datebookweek.h b/core/pim/datebook/datebookweek.h index ddf54ed..2d25f10 100644 --- a/core/pim/datebook/datebookweek.h +++ b/core/pim/datebook/datebookweek.h | |||
@@ -1,51 +1,62 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | **********************************************************************/ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
30 | |||
20 | #ifndef DATEBOOKWEEK | 31 | #ifndef DATEBOOKWEEK |
21 | #define DATEBOOKWEEK | 32 | #define DATEBOOKWEEK |
22 | 33 | ||
23 | #include <qpe/event.h> | 34 | #include <qpe/event.h> |
24 | 35 | ||
25 | #include <qlist.h> | 36 | #include <qlist.h> |
26 | #include <qscrollview.h> | 37 | #include <qscrollview.h> |
27 | #include <qstring.h> | 38 | #include <qstring.h> |
28 | #include <qvaluelist.h> | 39 | #include <qvaluelist.h> |
29 | 40 | ||
30 | class DateBookDB; | 41 | class DateBookDB; |
31 | class DateBookDBHoliday; | 42 | class DateBookDBHoliday; |
32 | class DateBookWeekHeader; | 43 | class DateBookWeekHeader; |
33 | class QDate; | 44 | class QDate; |
34 | class QLabel; | 45 | class QLabel; |
35 | class QResizeEvent; | 46 | class QResizeEvent; |
36 | class QSpinBox; | 47 | class QSpinBox; |
37 | class QTimer; | 48 | class QTimer; |
38 | class QHeader; | 49 | class QHeader; |
39 | 50 | ||
40 | class DateBookWeekItem | 51 | class DateBookWeekItem |
41 | { | 52 | { |
42 | public: | 53 | public: |
43 | DateBookWeekItem( const EffectiveEvent e ); | 54 | DateBookWeekItem( const EffectiveEvent e ); |
44 | 55 | ||
45 | void setGeometry( int x, int y, int w, int h ); | 56 | void setGeometry( int x, int y, int w, int h ); |
46 | QRect geometry() const { return r; } | 57 | QRect geometry() const { return r; } |
47 | 58 | ||
48 | const QColor &color() const { return c; } | 59 | const QColor &color() const { return c; } |
49 | const EffectiveEvent event() const { return ev; } | 60 | const EffectiveEvent event() const { return ev; } |
50 | 61 | ||
51 | private: | 62 | private: |
diff --git a/core/pim/datebook/datebookweekheaderimpl.cpp b/core/pim/datebook/datebookweekheaderimpl.cpp index 7462de7..9922778 100644 --- a/core/pim/datebook/datebookweekheaderimpl.cpp +++ b/core/pim/datebook/datebookweekheaderimpl.cpp | |||
@@ -1,75 +1,86 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | **********************************************************************/ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
30 | |||
20 | #include "datebookweekheaderimpl.h" | 31 | #include "datebookweekheaderimpl.h" |
21 | #include "datebookweek.h" | 32 | #include "datebookweek.h" |
22 | 33 | ||
23 | #include <opie2/odebug.h> | 34 | #include <opie2/odebug.h> |
35 | #include <opie2/oresource.h> | ||
24 | 36 | ||
25 | #include <qpe/resource.h> | ||
26 | #include <qpe/datebookmonth.h> | 37 | #include <qpe/datebookmonth.h> |
27 | 38 | ||
28 | #include <qtoolbutton.h> | 39 | #include <qtoolbutton.h> |
29 | 40 | ||
30 | /* | 41 | /* |
31 | * Constructs a DateBookWeekHeader which is a child of 'parent', with the | 42 | * Constructs a DateBookWeekHeader which is a child of 'parent', with the |
32 | * name 'name' and widget flags set to 'f' | 43 | * name 'name' and widget flags set to 'f' |
33 | */ | 44 | */ |
34 | DateBookWeekHeader::DateBookWeekHeader( bool startOnMonday, QWidget* parent, const char* name, WFlags fl ) | 45 | DateBookWeekHeader::DateBookWeekHeader( bool startOnMonday, QWidget* parent, const char* name, WFlags fl ) |
35 | : DateBookWeekHeaderBase( parent, name, fl ), | 46 | : DateBookWeekHeaderBase( parent, name, fl ), |
36 | bStartOnMonday( startOnMonday ) | 47 | bStartOnMonday( startOnMonday ) |
37 | { | 48 | { |
38 | setBackgroundMode( PaletteButton ); | 49 | setBackgroundMode( PaletteButton ); |
39 | labelDate->setBackgroundMode( PaletteButton ); | 50 | labelDate->setBackgroundMode( PaletteButton ); |
40 | backmonth->setPixmap( Resource::loadPixmap("fastback") ); | 51 | backmonth->setPixmap( Opie::Core::OResource::loadPixmap( "fastback", Opie::Core::OResource::SmallIcon ) ); |
41 | backweek->setPixmap( Resource::loadPixmap("back") ); | 52 | backweek->setPixmap( Opie::Core::OResource::loadPixmap( "back", Opie::Core::OResource::SmallIcon ) ); |
42 | forwardweek->setPixmap( Resource::loadPixmap("forward") ); | 53 | forwardweek->setPixmap( Opie::Core::OResource::loadPixmap( "forward", Opie::Core::OResource::SmallIcon ) ); |
43 | forwardmonth->setPixmap( Resource::loadPixmap("fastforward") ); | 54 | forwardmonth->setPixmap( Opie::Core::OResource::loadPixmap( "fastforward", Opie::Core::OResource::SmallIcon ) ); |
44 | } | 55 | } |
45 | 56 | ||
46 | /* | 57 | /* |
47 | * Destroys the object and frees any allocated resources | 58 | * Destroys the object and frees any allocated resources |
48 | */ | 59 | */ |
49 | DateBookWeekHeader::~DateBookWeekHeader() | 60 | DateBookWeekHeader::~DateBookWeekHeader() |
50 | { | 61 | { |
51 | // no need to delete child widgets, Qt does it all for us | 62 | // no need to delete child widgets, Qt does it all for us |
52 | } | 63 | } |
53 | 64 | ||
54 | void DateBookWeekHeader::pickDate() | 65 | void DateBookWeekHeader::pickDate() |
55 | { | 66 | { |
56 | static QPopupMenu *m1 = 0; | 67 | static QPopupMenu *m1 = 0; |
57 | static DateBookMonth *picker = 0; | 68 | static DateBookMonth *picker = 0; |
58 | if ( !m1 ) { | 69 | if ( !m1 ) { |
59 | m1 = new QPopupMenu( this ); | 70 | m1 = new QPopupMenu( this ); |
60 | picker = new DateBookMonth( m1, 0, TRUE ); | 71 | picker = new DateBookMonth( m1, 0, TRUE ); |
61 | m1->insertItem( picker ); | 72 | m1->insertItem( picker ); |
62 | connect( picker, SIGNAL( dateClicked(int,int,int) ), this, SLOT( setDate(int,int,int) ) ); | 73 | connect( picker, SIGNAL( dateClicked(int,int,int) ), this, SLOT( setDate(int,int,int) ) ); |
63 | // connect( m1, SIGNAL( aboutToHide() ), this, SLOT( gotHide() ) ); | 74 | // connect( m1, SIGNAL( aboutToHide() ), this, SLOT( gotHide() ) ); |
64 | } | 75 | } |
65 | picker->setDate( date.year(), date.month(), date.day() ); | 76 | picker->setDate( date.year(), date.month(), date.day() ); |
66 | m1->popup(mapToGlobal(labelDate->pos()+QPoint(0,labelDate->height()))); | 77 | m1->popup(mapToGlobal(labelDate->pos()+QPoint(0,labelDate->height()))); |
67 | picker->setFocus(); | 78 | picker->setFocus(); |
68 | } | 79 | } |
69 | 80 | ||
70 | void DateBookWeekHeader::nextMonth() | 81 | void DateBookWeekHeader::nextMonth() |
71 | { | 82 | { |
72 | owarn << "nextMonth()" << oendl; | 83 | owarn << "nextMonth()" << oendl; |
73 | setDate(date.addDays(28)); | 84 | setDate(date.addDays(28)); |
74 | } | 85 | } |
75 | void DateBookWeekHeader::prevMonth() | 86 | void DateBookWeekHeader::prevMonth() |
diff --git a/core/pim/datebook/datebookweekheaderimpl.h b/core/pim/datebook/datebookweekheaderimpl.h index d8dce90..0b388b4 100644 --- a/core/pim/datebook/datebookweekheaderimpl.h +++ b/core/pim/datebook/datebookweekheaderimpl.h | |||
@@ -1,51 +1,62 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | **********************************************************************/ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
30 | |||
20 | #ifndef DATEBOOKDAYHEADER_H | 31 | #ifndef DATEBOOKDAYHEADER_H |
21 | #define DATEBOOKDAYHEADER_H | 32 | #define DATEBOOKDAYHEADER_H |
22 | #include <qdatetime.h> | 33 | #include <qdatetime.h> |
23 | #include "datebookweekheader.h" | 34 | #include "datebookweekheader.h" |
24 | 35 | ||
25 | 36 | ||
26 | class DateBookWeekHeader : public DateBookWeekHeaderBase | 37 | class DateBookWeekHeader : public DateBookWeekHeaderBase |
27 | { | 38 | { |
28 | Q_OBJECT | 39 | Q_OBJECT |
29 | 40 | ||
30 | public: | 41 | public: |
31 | DateBookWeekHeader( bool startOnMonday, QWidget* parent = 0, | 42 | DateBookWeekHeader( bool startOnMonday, QWidget* parent = 0, |
32 | const char* name = 0, WFlags fl = 0 ); | 43 | const char* name = 0, WFlags fl = 0 ); |
33 | ~DateBookWeekHeader(); | 44 | ~DateBookWeekHeader(); |
34 | 45 | ||
35 | void setDate(const QDate &d); | 46 | void setDate(const QDate &d); |
36 | void setStartOfWeek( bool onMonday ); | 47 | void setStartOfWeek( bool onMonday ); |
37 | 48 | ||
38 | signals: | 49 | signals: |
39 | void dateChanged( QDate &date ); | 50 | void dateChanged( QDate &date ); |
40 | 51 | ||
41 | public slots: | 52 | public slots: |
42 | void pickDate(); | 53 | void pickDate(); |
43 | void nextMonth(); | 54 | void nextMonth(); |
44 | void prevMonth(); | 55 | void prevMonth(); |
45 | void nextWeek(); | 56 | void nextWeek(); |
46 | void prevWeek(); | 57 | void prevWeek(); |
47 | void setDate( int y, int m, int d); | 58 | void setDate( int y, int m, int d); |
48 | 59 | ||
49 | protected slots: | 60 | protected slots: |
50 | void keyPressEvent(QKeyEvent *e) { e->ignore(); } | 61 | void keyPressEvent(QKeyEvent *e) { e->ignore(); } |
51 | 62 | ||
diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp index 297da94..adfa33f 100644 --- a/core/pim/datebook/dateentryimpl.cpp +++ b/core/pim/datebook/dateentryimpl.cpp | |||
@@ -1,51 +1,61 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | **********************************************************************/ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
20 | 30 | ||
21 | #include "namespace_hack.h" | 31 | #include "namespace_hack.h" |
22 | #include "dateentryimpl.h" | 32 | #include "dateentryimpl.h" |
23 | #include "repeatentry.h" | 33 | #include "repeatentry.h" |
24 | 34 | ||
25 | #include <opie2/odebug.h> | 35 | #include <opie2/odebug.h> |
26 | #include <opie2/otimepicker.h> | 36 | #include <opie2/otimepicker.h> |
27 | 37 | ||
28 | #include <qpe/qpeapplication.h> | 38 | #include <qpe/qpeapplication.h> |
29 | #include <qpe/categoryselect.h> | 39 | #include <qpe/categoryselect.h> |
30 | #include <qpe/datebookmonth.h> | 40 | #include <qpe/datebookmonth.h> |
31 | #include <qpe/tzselect.h> | 41 | #include <qpe/tzselect.h> |
32 | 42 | ||
33 | #include <qlineedit.h> | 43 | #include <qlineedit.h> |
34 | #include <qspinbox.h> | 44 | #include <qspinbox.h> |
35 | 45 | ||
36 | #include "onoteedit.h" | 46 | #include "onoteedit.h" |
37 | 47 | ||
38 | #include <stdlib.h> | 48 | #include <stdlib.h> |
39 | #include <stdio.h> | 49 | #include <stdio.h> |
40 | 50 | ||
41 | /* | 51 | /* |
42 | * Constructs a DateEntry which is a child of 'parent', with the | 52 | * Constructs a DateEntry which is a child of 'parent', with the |
43 | * name 'name' and widget flags set to 'f' | 53 | * name 'name' and widget flags set to 'f' |
44 | * | 54 | * |
45 | * The dialog will by default be modeless, unless you set 'modal' to | 55 | * The dialog will by default be modeless, unless you set 'modal' to |
46 | * TRUE to construct a modal dialog. | 56 | * TRUE to construct a modal dialog. |
47 | */ | 57 | */ |
48 | 58 | ||
49 | DateEntry::DateEntry( bool startOnMonday, const QDateTime &start, | 59 | DateEntry::DateEntry( bool startOnMonday, const QDateTime &start, |
50 | const QDateTime &end, bool whichClock, QWidget* parent, | 60 | const QDateTime &end, bool whichClock, QWidget* parent, |
51 | const char* name ) | 61 | const char* name ) |
diff --git a/core/pim/datebook/dateentryimpl.h b/core/pim/datebook/dateentryimpl.h index a3c4668..2d23ed1 100644 --- a/core/pim/datebook/dateentryimpl.h +++ b/core/pim/datebook/dateentryimpl.h | |||
@@ -1,51 +1,62 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | **********************************************************************/ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
30 | |||
20 | #ifndef DATEENTRY_H | 31 | #ifndef DATEENTRY_H |
21 | #define DATEENTRY_H | 32 | #define DATEENTRY_H |
22 | 33 | ||
23 | #include "dateentry.h" | 34 | #include "dateentry.h" |
24 | #include "noteentryimpl.h" | 35 | #include "noteentryimpl.h" |
25 | 36 | ||
26 | #include <qpe/event.h> | 37 | #include <qpe/event.h> |
27 | 38 | ||
28 | #include <qdatetime.h> | 39 | #include <qdatetime.h> |
29 | 40 | ||
30 | class DateBookMonth; | 41 | class DateBookMonth; |
31 | 42 | ||
32 | class DateEntry : public DateEntryBase | 43 | class DateEntry : public DateEntryBase |
33 | { | 44 | { |
34 | Q_OBJECT | 45 | Q_OBJECT |
35 | 46 | ||
36 | public: | 47 | public: |
37 | DateEntry( bool startOnMonday, const QDateTime &start, | 48 | DateEntry( bool startOnMonday, const QDateTime &start, |
38 | const QDateTime &end, bool whichClock = FALSE, | 49 | const QDateTime &end, bool whichClock = FALSE, |
39 | QWidget* parent = 0, const char* name = 0 ); | 50 | QWidget* parent = 0, const char* name = 0 ); |
40 | DateEntry( bool startOnMonday, const Event &event, bool whichCLock = FALSE, | 51 | DateEntry( bool startOnMonday, const Event &event, bool whichCLock = FALSE, |
41 | QWidget* parent = 0, const char* name = 0 ); | 52 | QWidget* parent = 0, const char* name = 0 ); |
42 | ~DateEntry(); | 53 | ~DateEntry(); |
43 | 54 | ||
44 | Event event(); | 55 | Event event(); |
45 | void setAlarmEnabled( bool alarmPreset, int presetTime, Event::SoundTypeChoice ); | 56 | void setAlarmEnabled( bool alarmPreset, int presetTime, Event::SoundTypeChoice ); |
46 | virtual bool eventFilter( QObject *, QEvent * ); | 57 | virtual bool eventFilter( QObject *, QEvent * ); |
47 | public slots: | 58 | public slots: |
48 | void endDateChanged( int, int, int ); | 59 | void endDateChanged( int, int, int ); |
49 | void endTimeChanged( const QString & ); | 60 | void endTimeChanged( const QString & ); |
50 | void endTimeChanged( const QTime & ); | 61 | void endTimeChanged( const QTime & ); |
51 | void startDateChanged(int, int, int); | 62 | void startDateChanged(int, int, int); |
diff --git a/core/pim/datebook/main.cpp b/core/pim/datebook/main.cpp index 3cb60af..e96e769 100644 --- a/core/pim/datebook/main.cpp +++ b/core/pim/datebook/main.cpp | |||
@@ -1,25 +1,35 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | **********************************************************************/ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
20 | 30 | ||
21 | #include "datebook.h" | 31 | #include "datebook.h" |
22 | #include <opie2/oapplicationfactory.h> | 32 | #include <opie2/oapplicationfactory.h> |
23 | 33 | ||
24 | using namespace Opie::Core; | 34 | using namespace Opie::Core; |
25 | OPIE_EXPORT_APP( OApplicationFactory<DateBook> ) | 35 | OPIE_EXPORT_APP( OApplicationFactory<DateBook> ) |
diff --git a/core/pim/datebook/modules/weeklst/datebookweeklst.cpp b/core/pim/datebook/modules/weeklst/datebookweeklst.cpp index 6556373..b36bf6d 100644 --- a/core/pim/datebook/modules/weeklst/datebookweeklst.cpp +++ b/core/pim/datebook/modules/weeklst/datebookweeklst.cpp | |||
@@ -1,45 +1,44 @@ | |||
1 | #include "namespace_hack.h" | 1 | #include "namespace_hack.h" |
2 | #include "datebookweeklst.h" | 2 | #include "datebookweeklst.h" |
3 | #include "datebookweeklstheader.h" | 3 | #include "datebookweeklstheader.h" |
4 | #include "datebookweeklstview.h" | 4 | #include "datebookweeklstview.h" |
5 | #include "datebookweeklstdblview.h" | 5 | #include "datebookweeklstdblview.h" |
6 | 6 | ||
7 | #include "datebook.h" | 7 | #include "datebook.h" |
8 | 8 | ||
9 | #include <opie2/odebug.h> | 9 | #include <opie2/odebug.h> |
10 | 10 | ||
11 | #include <qpe/datebookmonth.h> | 11 | #include <qpe/datebookmonth.h> |
12 | #include <qpe/config.h> | 12 | #include <qpe/config.h> |
13 | #include <qpe/resource.h> | ||
14 | 13 | ||
15 | #include <qlayout.h> | 14 | #include <qlayout.h> |
16 | #include <qtoolbutton.h> | 15 | #include <qtoolbutton.h> |
17 | 16 | ||
18 | using namespace Opie::Ui; | 17 | using namespace Opie::Ui; |
19 | 18 | ||
20 | DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDBHoliday *newDB, | 19 | DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDBHoliday *newDB, |
21 | QWidget *parent, | 20 | QWidget *parent, |
22 | const char *name ) | 21 | const char *name ) |
23 | : QWidget( parent, name ), | 22 | : QWidget( parent, name ), |
24 | db( newDB ), | 23 | db( newDB ), |
25 | startTime( 0 ), | 24 | startTime( 0 ), |
26 | ampm( ap ), | 25 | ampm( ap ), |
27 | bStartOnMonday(onM) | 26 | bStartOnMonday(onM) |
28 | { | 27 | { |
29 | setFocusPolicy(StrongFocus); | 28 | setFocusPolicy(StrongFocus); |
30 | dateset = false; | 29 | dateset = false; |
31 | layout = new QVBoxLayout( this ); | 30 | layout = new QVBoxLayout( this ); |
32 | layout->setMargin(0); | 31 | layout->setMargin(0); |
33 | 32 | ||
34 | header=new DateBookWeekLstHeader(onM, this); | 33 | header=new DateBookWeekLstHeader(onM, this); |
35 | layout->addWidget( header ); | 34 | layout->addWidget( header ); |
36 | connect(header, SIGNAL(dateChanged(QDate&)), this, SLOT(dateChanged(QDate&))); | 35 | connect(header, SIGNAL(dateChanged(QDate&)), this, SLOT(dateChanged(QDate&))); |
37 | connect(header, SIGNAL(setDbl(bool)), this, SLOT(setDbl(bool))); | 36 | connect(header, SIGNAL(setDbl(bool)), this, SLOT(setDbl(bool))); |
38 | 37 | ||
39 | scroll=new QScrollView(this); | 38 | scroll=new QScrollView(this); |
40 | scroll->setResizePolicy(QScrollView::AutoOneFit); | 39 | scroll->setResizePolicy(QScrollView::AutoOneFit); |
41 | layout->addWidget(scroll); | 40 | layout->addWidget(scroll); |
42 | 41 | ||
43 | m_CurrentView=NULL; | 42 | m_CurrentView=NULL; |
44 | Config config("DateBook"); | 43 | Config config("DateBook"); |
45 | config.setGroup("Main"); | 44 | config.setGroup("Main"); |
diff --git a/core/pim/datebook/modules/weeklst/datebookweeklstheader.cpp b/core/pim/datebook/modules/weeklst/datebookweeklstheader.cpp index 81e0c31..2da9c22 100644 --- a/core/pim/datebook/modules/weeklst/datebookweeklstheader.cpp +++ b/core/pim/datebook/modules/weeklst/datebookweeklstheader.cpp | |||
@@ -1,56 +1,57 @@ | |||
1 | #include "datebookweeklstheader.h" | 1 | #include "datebookweeklstheader.h" |
2 | 2 | ||
3 | #include <qpe/resource.h> | 3 | #include <opie2/oresource.h> |
4 | |||
4 | #include <qpe/datebookmonth.h> | 5 | #include <qpe/datebookmonth.h> |
5 | 6 | ||
6 | #include <qtoolbutton.h> | 7 | #include <qtoolbutton.h> |
7 | #include <qlayout.h> | 8 | #include <qlayout.h> |
8 | 9 | ||
9 | /* implenented in datebookweek.cpp - HELL */ | 10 | /* implenented in datebookweek.cpp - HELL */ |
10 | bool calcWeek(const QDate &d, int &week, int &year,bool startOnMonday = false); | 11 | bool calcWeek(const QDate &d, int &week, int &year,bool startOnMonday = false); |
11 | 12 | ||
12 | DateBookWeekLstHeader::DateBookWeekLstHeader(bool onM, QWidget* parent, const char* name, WFlags fl) | 13 | DateBookWeekLstHeader::DateBookWeekLstHeader(bool onM, QWidget* parent, const char* name, WFlags fl) |
13 | : DateBookWeekLstHeaderBase(parent, name, fl) | 14 | : DateBookWeekLstHeaderBase(parent, name, fl) |
14 | { | 15 | { |
15 | setBackgroundMode( PaletteButton ); | 16 | setBackgroundMode( PaletteButton ); |
16 | labelDate->setBackgroundMode( PaletteButton ); | 17 | labelDate->setBackgroundMode( PaletteButton ); |
17 | forwardweek->setBackgroundMode( PaletteButton ); | 18 | forwardweek->setBackgroundMode( PaletteButton ); |
18 | forwardweek->setPixmap( Resource::loadPixmap("forward") ); | 19 | forwardweek->setPixmap( Opie::Core::OResource::loadPixmap( "forward", Opie::Core::OResource::SmallIcon ) ); |
19 | forwardmonth->setBackgroundMode( PaletteButton ); | 20 | forwardmonth->setBackgroundMode( PaletteButton ); |
20 | forwardmonth->setPixmap( Resource::loadPixmap("fastforward") ); | 21 | forwardmonth->setPixmap( Opie::Core::OResource::loadPixmap( "fastforward", Opie::Core::OResource::SmallIcon ) ); |
21 | backweek->setBackgroundMode( PaletteButton ); | 22 | backweek->setBackgroundMode( PaletteButton ); |
22 | backweek->setPixmap( Resource::loadPixmap("back") ); | 23 | backweek->setPixmap( Opie::Core::OResource::loadPixmap( "back", Opie::Core::OResource::SmallIcon ) ); |
23 | backmonth->setBackgroundMode( PaletteButton ); | 24 | backmonth->setBackgroundMode( PaletteButton ); |
24 | backmonth->setPixmap( Resource::loadPixmap("fastback") ); | 25 | backmonth->setPixmap( Opie::Core::OResource::loadPixmap( "fastback", Opie::Core::OResource::SmallIcon ) ); |
25 | DateBookWeekLstHeaderBaseLayout->setSpacing(0); | 26 | DateBookWeekLstHeaderBaseLayout->setSpacing(0); |
26 | DateBookWeekLstHeaderBaseLayout->setMargin(0); | 27 | DateBookWeekLstHeaderBaseLayout->setMargin(0); |
27 | //setSizePolicy(QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding)); | 28 | //setSizePolicy(QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding)); |
28 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); | 29 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); |
29 | 30 | ||
30 | connect(backmonth, SIGNAL(clicked()), this, SLOT(prevMonth())); | 31 | connect(backmonth, SIGNAL(clicked()), this, SLOT(prevMonth())); |
31 | connect(backweek, SIGNAL(clicked()), this, SLOT(prevWeek())); | 32 | connect(backweek, SIGNAL(clicked()), this, SLOT(prevWeek())); |
32 | connect(forwardweek, SIGNAL(clicked()), this, SLOT(nextWeek())); | 33 | connect(forwardweek, SIGNAL(clicked()), this, SLOT(nextWeek())); |
33 | connect(forwardmonth, SIGNAL(clicked()), this, SLOT(nextMonth())); | 34 | connect(forwardmonth, SIGNAL(clicked()), this, SLOT(nextMonth())); |
34 | connect(labelDate, SIGNAL(clicked()), this, SLOT(pickDate())); | 35 | connect(labelDate, SIGNAL(clicked()), this, SLOT(pickDate())); |
35 | connect(dbl, SIGNAL(toggled(bool)), this, SIGNAL(setDbl(bool))); | 36 | connect(dbl, SIGNAL(toggled(bool)), this, SIGNAL(setDbl(bool))); |
36 | bStartOnMonday=onM; | 37 | bStartOnMonday=onM; |
37 | } | 38 | } |
38 | DateBookWeekLstHeader::~DateBookWeekLstHeader(){} | 39 | DateBookWeekLstHeader::~DateBookWeekLstHeader(){} |
39 | 40 | ||
40 | void DateBookWeekLstHeader::setDate(const QDate &d) { | 41 | void DateBookWeekLstHeader::setDate(const QDate &d) { |
41 | int year,week,dayofweek; | 42 | int year,week,dayofweek; |
42 | date=d; | 43 | date=d; |
43 | dayofweek=d.dayOfWeek(); | 44 | dayofweek=d.dayOfWeek(); |
44 | if(bStartOnMonday) | 45 | if(bStartOnMonday) |
45 | dayofweek--; | 46 | dayofweek--; |
46 | else if( dayofweek == 7 ) | 47 | else if( dayofweek == 7 ) |
47 | /* we already have the right day -7 would lead to the same week */ | 48 | /* we already have the right day -7 would lead to the same week */ |
48 | dayofweek = 0; | 49 | dayofweek = 0; |
49 | 50 | ||
50 | date=date.addDays(-dayofweek); | 51 | date=date.addDays(-dayofweek); |
51 | 52 | ||
52 | calcWeek(date,week,year,bStartOnMonday); | 53 | calcWeek(date,week,year,bStartOnMonday); |
53 | QDate start=date; | 54 | QDate start=date; |
54 | QDate stop=start.addDays(6); | 55 | QDate stop=start.addDays(6); |
55 | labelDate->setText( QString::number(start.day()) + "." + | 56 | labelDate->setText( QString::number(start.day()) + "." + |
56 | Calendar::nameOfMonth( start.month() ) + "-" + | 57 | Calendar::nameOfMonth( start.month() ) + "-" + |
diff --git a/core/pim/datebook/namespace_hack.h b/core/pim/datebook/namespace_hack.h index c15b5ed..2ed674c 100644 --- a/core/pim/datebook/namespace_hack.h +++ b/core/pim/datebook/namespace_hack.h | |||
@@ -1,20 +1,50 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (C) Opie Team <opie-devel@handhelds.org> | ||
5 | =. | ||
6 | .=l. | ||
7 | .>+-= | ||
8 | _;:, .> :=|. This program is free software; you can | ||
9 | .> <`_, > . <= redistribute it and/or modify it under | ||
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
11 | .="- .-=="i, .._ License as published by the Free Software | ||
12 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
13 | ._= =} : or (at your option) any later version. | ||
14 | .%`+i> _;_. | ||
15 | .i_,=:_. -<s. This program is distributed in the hope that | ||
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
17 | : .. .:, . . . without even the implied warranty of | ||
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
30 | |||
1 | #ifndef NAME_SPACE_HACK_H | 31 | #ifndef NAME_SPACE_HACK_H |
2 | #define NAME_SPACE_HACK_H | 32 | #define NAME_SPACE_HACK_H |
3 | 33 | ||
4 | #include <opie2/otimepicker.h> | 34 | #include <opie2/otimepicker.h> |
5 | #include <opie2/oclickablelabel.h> | 35 | #include <opie2/oclickablelabel.h> |
6 | 36 | ||
7 | class TimePicker : public Opie::Ui::OTimePicker { | 37 | class TimePicker : public Opie::Ui::OTimePicker { |
8 | public: | 38 | public: |
9 | TimePicker( QWidget* p = 0, const char* name = 0, WFlags fl = 0 ) | 39 | TimePicker( QWidget* p = 0, const char* name = 0, WFlags fl = 0 ) |
10 | : Opie::Ui::OTimePicker(p,name,fl){} | 40 | : Opie::Ui::OTimePicker(p,name,fl){} |
11 | 41 | ||
12 | }; | 42 | }; |
13 | class ClickableLabel : public Opie::Ui::OClickableLabel { | 43 | class ClickableLabel : public Opie::Ui::OClickableLabel { |
14 | public: | 44 | public: |
15 | ClickableLabel(QWidget *p=0,const char* name=0, WFlags fl = 0 ) | 45 | ClickableLabel(QWidget *p=0,const char* name=0, WFlags fl = 0 ) |
16 | : Opie::Ui::OClickableLabel(p,name,fl){} | 46 | : Opie::Ui::OClickableLabel(p,name,fl){} |
17 | }; | 47 | }; |
18 | 48 | ||
19 | 49 | ||
20 | #endif | 50 | #endif |
diff --git a/core/pim/datebook/noteentryimpl.cpp b/core/pim/datebook/noteentryimpl.cpp index 14fe98e..f967ab2 100644 --- a/core/pim/datebook/noteentryimpl.cpp +++ b/core/pim/datebook/noteentryimpl.cpp | |||
@@ -1,15 +1,45 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (C) Opie Team <opie-devel@handhelds.org> | ||
5 | =. | ||
6 | .=l. | ||
7 | .>+-= | ||
8 | _;:, .> :=|. This program is free software; you can | ||
9 | .> <`_, > . <= redistribute it and/or modify it under | ||
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
11 | .="- .-=="i, .._ License as published by the Free Software | ||
12 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
13 | ._= =} : or (at your option) any later version. | ||
14 | .%`+i> _;_. | ||
15 | .i_,=:_. -<s. This program is distributed in the hope that | ||
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
17 | : .. .:, . . . without even the implied warranty of | ||
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
30 | |||
1 | #include "noteentryimpl.h" | 31 | #include "noteentryimpl.h" |
2 | #include "qlabel.h" | 32 | #include "qlabel.h" |
3 | #include "onoteedit.h" | 33 | #include "onoteedit.h" |
4 | 34 | ||
5 | NoteEntry::NoteEntry(const QString &title, const QString ¬eStr, | 35 | NoteEntry::NoteEntry(const QString &title, const QString ¬eStr, |
6 | QWidget* parent, const char* name, bool modal, | 36 | QWidget* parent, const char* name, bool modal, |
7 | WFlags fl) : | 37 | WFlags fl) : |
8 | NoteEntryBase(parent, name, modal, fl) { | 38 | NoteEntryBase(parent, name, modal, fl) { |
9 | 39 | ||
10 | 40 | ||
11 | eventLabel->setText(title); | 41 | eventLabel->setText(title); |
12 | note->setText(noteStr); | 42 | note->setText(noteStr); |
13 | int l=note->length(); | 43 | int l=note->length(); |
14 | note->setCursorPosition(l,l,false); | 44 | note->setCursorPosition(l,l,false); |
15 | } | 45 | } |
diff --git a/core/pim/datebook/noteentryimpl.h b/core/pim/datebook/noteentryimpl.h index f3adfa6..86ea0ee 100644 --- a/core/pim/datebook/noteentryimpl.h +++ b/core/pim/datebook/noteentryimpl.h | |||
@@ -1,18 +1,48 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (C) Opie Team <opie-devel@handhelds.org> | ||
5 | =. | ||
6 | .=l. | ||
7 | .>+-= | ||
8 | _;:, .> :=|. This program is free software; you can | ||
9 | .> <`_, > . <= redistribute it and/or modify it under | ||
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
11 | .="- .-=="i, .._ License as published by the Free Software | ||
12 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
13 | ._= =} : or (at your option) any later version. | ||
14 | .%`+i> _;_. | ||
15 | .i_,=:_. -<s. This program is distributed in the hope that | ||
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
17 | : .. .:, . . . without even the implied warranty of | ||
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
30 | |||
1 | #ifndef noteentryimpl_h | 31 | #ifndef noteentryimpl_h |
2 | #define noteentryimpl_h | 32 | #define noteentryimpl_h |
3 | 33 | ||
4 | #include "noteentry.h" | 34 | #include "noteentry.h" |
5 | 35 | ||
6 | class QString; | 36 | class QString; |
7 | 37 | ||
8 | class NoteEntry : public NoteEntryBase | 38 | class NoteEntry : public NoteEntryBase |
9 | { | 39 | { |
10 | Q_OBJECT | 40 | Q_OBJECT |
11 | 41 | ||
12 | public: | 42 | public: |
13 | NoteEntry(const QString &title, const QString ¬eStr, | 43 | NoteEntry(const QString &title, const QString ¬eStr, |
14 | QWidget* parent = 0, const char* name = 0, | 44 | QWidget* parent = 0, const char* name = 0, |
15 | bool modal=TRUE, WFlags fl=0); | 45 | bool modal=TRUE, WFlags fl=0); |
16 | }; | 46 | }; |
17 | 47 | ||
18 | #endif | 48 | #endif |
diff --git a/core/pim/datebook/onoteedit.cpp b/core/pim/datebook/onoteedit.cpp index d66ad86..a5f468d 100644 --- a/core/pim/datebook/onoteedit.cpp +++ b/core/pim/datebook/onoteedit.cpp | |||
@@ -1,19 +1,49 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (C) Opie Team <opie-devel@handhelds.org> | ||
5 | =. | ||
6 | .=l. | ||
7 | .>+-= | ||
8 | _;:, .> :=|. This program is free software; you can | ||
9 | .> <`_, > . <= redistribute it and/or modify it under | ||
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
11 | .="- .-=="i, .._ License as published by the Free Software | ||
12 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
13 | ._= =} : or (at your option) any later version. | ||
14 | .%`+i> _;_. | ||
15 | .i_,=:_. -<s. This program is distributed in the hope that | ||
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
17 | : .. .:, . . . without even the implied warranty of | ||
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
30 | |||
1 | #include "onoteedit.h" | 31 | #include "onoteedit.h" |
2 | 32 | ||
3 | ONoteEdit::ONoteEdit (QWidget * parent, const char * name) : | 33 | ONoteEdit::ONoteEdit (QWidget * parent, const char * name) : |
4 | QMultiLineEdit(parent,name) { | 34 | QMultiLineEdit(parent,name) { |
5 | setDefaultTabStop(2); | 35 | setDefaultTabStop(2); |
6 | setWordWrap(WidgetWidth); | 36 | setWordWrap(WidgetWidth); |
7 | } | 37 | } |
8 | 38 | ||
9 | // Copy indentation from previous line | 39 | // Copy indentation from previous line |
10 | void ONoteEdit::newLine() { | 40 | void ONoteEdit::newLine() { |
11 | int l,c; | 41 | int l,c; |
12 | getCursorPosition(&l,&c); | 42 | getCursorPosition(&l,&c); |
13 | QString s=textLine(l); | 43 | QString s=textLine(l); |
14 | 44 | ||
15 | insert("\n"); | 45 | insert("\n"); |
16 | 46 | ||
17 | int i=0; | 47 | int i=0; |
18 | while (s[i]==' ' || s[i]=='\t') insert(QString(s[i])), i++; | 48 | while (s[i]==' ' || s[i]=='\t') insert(QString(s[i])), i++; |
19 | } | 49 | } |
diff --git a/core/pim/datebook/onoteedit.h b/core/pim/datebook/onoteedit.h index 2f71d0d..390b837 100644 --- a/core/pim/datebook/onoteedit.h +++ b/core/pim/datebook/onoteedit.h | |||
@@ -1,19 +1,49 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (C) Opie Team <opie-devel@handhelds.org> | ||
5 | =. | ||
6 | .=l. | ||
7 | .>+-= | ||
8 | _;:, .> :=|. This program is free software; you can | ||
9 | .> <`_, > . <= redistribute it and/or modify it under | ||
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
11 | .="- .-=="i, .._ License as published by the Free Software | ||
12 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
13 | ._= =} : or (at your option) any later version. | ||
14 | .%`+i> _;_. | ||
15 | .i_,=:_. -<s. This program is distributed in the hope that | ||
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
17 | : .. .:, . . . without even the implied warranty of | ||
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
30 | |||
1 | #ifndef ONOTEEDIT_H | 31 | #ifndef ONOTEEDIT_H |
2 | #define ONOTEEDIT_H | 32 | #define ONOTEEDIT_H |
3 | 33 | ||
4 | #include <qmultilineedit.h> | 34 | #include <qmultilineedit.h> |
5 | 35 | ||
6 | class ONoteEdit: public QMultiLineEdit { | 36 | class ONoteEdit: public QMultiLineEdit { |
7 | 37 | ||
8 | Q_OBJECT | 38 | Q_OBJECT |
9 | 39 | ||
10 | public: | 40 | public: |
11 | 41 | ||
12 | ONoteEdit (QWidget * parent=0, const char * name=0); | 42 | ONoteEdit (QWidget * parent=0, const char * name=0); |
13 | 43 | ||
14 | protected: | 44 | protected: |
15 | 45 | ||
16 | virtual void newLine (); | 46 | virtual void newLine (); |
17 | }; | 47 | }; |
18 | 48 | ||
19 | #endif | 49 | #endif |
diff --git a/core/pim/datebook/repeatentry.cpp b/core/pim/datebook/repeatentry.cpp index 04c3cf3..30e296c 100644 --- a/core/pim/datebook/repeatentry.cpp +++ b/core/pim/datebook/repeatentry.cpp | |||
@@ -1,51 +1,61 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | **********************************************************************/ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
20 | 30 | ||
21 | #include "repeatentry.h" | 31 | #include "repeatentry.h" |
22 | 32 | ||
23 | #include <qpe/datebookmonth.h> | 33 | #include <qpe/datebookmonth.h> |
24 | #include <qpe/qpeapplication.h> | 34 | #include <qpe/qpeapplication.h> |
25 | 35 | ||
26 | #include <qlabel.h> | 36 | #include <qlabel.h> |
27 | #include <qspinbox.h> | 37 | #include <qspinbox.h> |
28 | 38 | ||
29 | #include <time.h> | 39 | #include <time.h> |
30 | 40 | ||
31 | // Global Templates for use in setting up the repeat label... | 41 | // Global Templates for use in setting up the repeat label... |
32 | // the problem is these strings get initialized before QPEApplication can install the translator -zecke | 42 | // the problem is these strings get initialized before QPEApplication can install the translator -zecke |
33 | namespace { | 43 | namespace { |
34 | QString strDayTemplate; | 44 | QString strDayTemplate; |
35 | QString strYearTemplate; | 45 | QString strYearTemplate; |
36 | QString strMonthDateTemplate; | 46 | QString strMonthDateTemplate; |
37 | QString strMonthDayTemplate; | 47 | QString strMonthDayTemplate; |
38 | QString strWeekTemplate; | 48 | QString strWeekTemplate; |
39 | QString dayLabel[7]; | 49 | QString dayLabel[7]; |
40 | } | 50 | } |
41 | 51 | ||
42 | /* | 52 | /* |
43 | * static linkage to not polute the symbol table... | 53 | * static linkage to not polute the symbol table... |
44 | * The problem is that const and static linkage are resolved prior to installing a translator | 54 | * The problem is that const and static linkage are resolved prior to installing a translator |
45 | * leading to that the above strings are translted but to the original we delay the init of these strings... | 55 | * leading to that the above strings are translted but to the original we delay the init of these strings... |
46 | * -zecke | 56 | * -zecke |
47 | */ | 57 | */ |
48 | static void fillStrings() { | 58 | static void fillStrings() { |
49 | strDayTemplate = QObject::tr("Every"); | 59 | strDayTemplate = QObject::tr("Every"); |
50 | strYearTemplate = QObject::tr("%1 %2 every "); | 60 | strYearTemplate = QObject::tr("%1 %2 every "); |
51 | strMonthDateTemplate = QObject::tr("The %1 every "); | 61 | strMonthDateTemplate = QObject::tr("The %1 every "); |
diff --git a/core/pim/datebook/repeatentry.h b/core/pim/datebook/repeatentry.h index 949fecd..d75af3c 100644 --- a/core/pim/datebook/repeatentry.h +++ b/core/pim/datebook/repeatentry.h | |||
@@ -1,51 +1,61 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | |
4 | ** This file is part of Qtopia Environment. | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | =. |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | .=l. |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .>+-= |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | _;:, .> :=|. This program is free software; you can |
9 | ** packaging of this file. | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | ** | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ** | 13 | ._= =} : or (at your option) any later version. |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | .%`+i> _;_. |
15 | ** | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | ** not clear to you. | 17 | : .. .:, . . . without even the implied warranty of |
18 | ** | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | **********************************************************************/ | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | */ | ||
20 | 30 | ||
21 | #ifndef REPEATENTRY_H | 31 | #ifndef REPEATENTRY_H |
22 | #define REPEATENTRY_H | 32 | #define REPEATENTRY_H |
23 | 33 | ||
24 | #include "repeatentrybase.h" | 34 | #include "repeatentrybase.h" |
25 | 35 | ||
26 | #include <qpe/event.h> | 36 | #include <qpe/event.h> |
27 | 37 | ||
28 | #include <qcheckbox.h> | 38 | #include <qcheckbox.h> |
29 | #include <qbuttongroup.h> | 39 | #include <qbuttongroup.h> |
30 | #include <qdatetime.h> | 40 | #include <qdatetime.h> |
31 | #include <qlist.h> | 41 | #include <qlist.h> |
32 | #include <qtoolbutton.h> | 42 | #include <qtoolbutton.h> |
33 | 43 | ||
34 | class DateBookMonth; | 44 | class DateBookMonth; |
35 | 45 | ||
36 | class RepeatEntry : public RepeatEntryBase | 46 | class RepeatEntry : public RepeatEntryBase |
37 | { | 47 | { |
38 | Q_OBJECT | 48 | Q_OBJECT |
39 | public: | 49 | public: |
40 | RepeatEntry( bool startOnMonday, | 50 | RepeatEntry( bool startOnMonday, |
41 | const QDate &start, QWidget *parent = 0, const char *name = 0, | 51 | const QDate &start, QWidget *parent = 0, const char *name = 0, |
42 | bool modal = TRUE, WFlags fl = 0 ); | 52 | bool modal = TRUE, WFlags fl = 0 ); |
43 | RepeatEntry( bool startOnMonday, | 53 | RepeatEntry( bool startOnMonday, |
44 | const Event::RepeatPattern &rp, const QDate &start, | 54 | const Event::RepeatPattern &rp, const QDate &start, |
45 | QWidget *parent = 0, const char *name = 0, bool modal = TRUE, | 55 | QWidget *parent = 0, const char *name = 0, bool modal = TRUE, |
46 | WFlags fl = 0 ); | 56 | WFlags fl = 0 ); |
47 | ~RepeatEntry(); | 57 | ~RepeatEntry(); |
48 | 58 | ||
49 | Event::RepeatPattern repeatPattern(); | 59 | Event::RepeatPattern repeatPattern(); |
50 | QDate endDate() { return end; }; | 60 | QDate endDate() { return end; }; |
51 | 61 | ||