author | drw <drw> | 2005-04-06 22:11:14 (UTC) |
---|---|---|
committer | drw <drw> | 2005-04-06 22:11:14 (UTC) |
commit | 678c792dd69e42a15d8ac5eaaa9228dfd413ed4c (patch) (unidiff) | |
tree | a7ab851cf76be078d145310d45663ffe4fbda4ec /core/pim/datebook/datebook.cpp | |
parent | 9ea956870ddf74ddc70b83ed529ebb3b36e9231e (diff) | |
download | opie-678c792dd69e42a15d8ac5eaaa9228dfd413ed4c.zip opie-678c792dd69e42a15d8ac5eaaa9228dfd413ed4c.tar.gz opie-678c792dd69e42a15d8ac5eaaa9228dfd413ed4c.tar.bz2 |
Use OResource for loading images, correct display of alarm and reoccurance icons for event and fix headers
Diffstat (limited to 'core/pim/datebook/datebook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebook.cpp | 78 |
1 files changed, 47 insertions, 31 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,25 +1,33 @@ | |||
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" |
@@ -33,17 +41,17 @@ | |||
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 | ||
@@ -85,9 +93,9 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) | |||
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 ); |
@@ -112,57 +120,65 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) | |||
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(); |