summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/modules/monthview/odatebookmonth.cpp1
-rw-r--r--noncore/settings/usermanager/userdialog.h3
2 files changed, 1 insertions, 3 deletions
diff --git a/core/pim/datebook/modules/monthview/odatebookmonth.cpp b/core/pim/datebook/modules/monthview/odatebookmonth.cpp
index 5e2f1bb..d52a092 100644
--- a/core/pim/datebook/modules/monthview/odatebookmonth.cpp
+++ b/core/pim/datebook/modules/monthview/odatebookmonth.cpp
@@ -1,392 +1,391 @@
1/* this is a straight copy of datemonthview. We can not make child of 1/* this is a straight copy of datemonthview. We can not make child of
2 * it 'cause the origin view isn't virtual in any form. 2 * it 'cause the origin view isn't virtual in any form.
3 */ 3 */
4/********************************************************************** 4/**********************************************************************
5** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 5** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
6** 6**
7** This file is part of the Qtopia Environment. 7** This file is part of the Qtopia Environment.
8** 8**
9** This file may be distributed and/or modified under the terms of the 9** This file may be distributed and/or modified under the terms of the
10** GNU General Public License version 2 as published by the Free Software 10** GNU General Public License version 2 as published by the Free Software
11** Foundation and appearing in the file LICENSE.GPL included in the 11** Foundation and appearing in the file LICENSE.GPL included in the
12** packaging of this file. 12** packaging of this file.
13** 13**
14** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 14** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
15** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 15** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16** 16**
17** See http://www.trolltech.com/gpl/ for GPL licensing information. 17** See http://www.trolltech.com/gpl/ for GPL licensing information.
18** 18**
19** Contact info@trolltech.com if any conditions of this licensing are 19** Contact info@trolltech.com if any conditions of this licensing are
20** not clear to you. 20** not clear to you.
21** 21**
22**********************************************************************/ 22**********************************************************************/
23#include "odatebookmonth.h" 23#include "odatebookmonth.h"
24#include "datebooktypes.h" 24#include "datebooktypes.h"
25 25
26#include <qpe/config.h> 26#include <qpe/config.h>
27#include <qpe/datebookmonth.h> 27#include <qpe/datebookmonth.h>
28 28
29#include <qpe/resource.h>
30#include <qpe/qpeapplication.h> 29#include <qpe/qpeapplication.h>
31 30
32#include <qtoolbutton.h> 31#include <qtoolbutton.h>
33#include <qspinbox.h> 32#include <qspinbox.h>
34#include <qcombobox.h> 33#include <qcombobox.h>
35#include <qvaluestack.h> 34#include <qvaluestack.h>
36#include <qwhatsthis.h> 35#include <qwhatsthis.h>
37 36
38 37
39//--------------------------------------------------------------------------- 38//---------------------------------------------------------------------------
40 39
41class ODateBookMonthTablePrivate 40class ODateBookMonthTablePrivate
42{ 41{
43public: 42public:
44 ODateBookMonthTablePrivate() {}; 43 ODateBookMonthTablePrivate() {};
45 ~ODateBookMonthTablePrivate() { mMonthEvents.clear(); }; 44 ~ODateBookMonthTablePrivate() { mMonthEvents.clear(); };
46 45
47 QValueList<EffectiveEvent> mMonthEvents; 46 QValueList<EffectiveEvent> mMonthEvents;
48 bool onMonday; 47 bool onMonday;
49}; 48};
50 49
51ODateBookMonthTable::ODateBookMonthTable( QWidget *parent, const char *name, 50ODateBookMonthTable::ODateBookMonthTable( QWidget *parent, const char *name,
52 DateBookDBHoliday *newDb ) 51 DateBookDBHoliday *newDb )
53 : QTable( 6, 7, parent, name ), 52 : QTable( 6, 7, parent, name ),
54 db( newDb ) 53 db( newDb )
55{ 54{
56 d = new ODateBookMonthTablePrivate(); 55 d = new ODateBookMonthTablePrivate();
57 selYear = -1; 56 selYear = -1;
58 selMonth = -1; 57 selMonth = -1;
59 selDay = -1; 58 selDay = -1;
60 59
61 /* init these as well make valgrind happy and be consistent with Qtopia1.6 -zecke */ 60 /* init these as well make valgrind happy and be consistent with Qtopia1.6 -zecke */
62 year = -1; 61 year = -1;
63 month = -1; 62 month = -1;
64 day = -1; 63 day = -1;
65 64
66 Config cfg( "qpe" ); 65 Config cfg( "qpe" );
67 cfg.setGroup( "Time" ); 66 cfg.setGroup( "Time" );
68 d->onMonday = cfg.readBoolEntry( "MONDAY" ); 67 d->onMonday = cfg.readBoolEntry( "MONDAY" );
69 68
70 horizontalHeader()->setResizeEnabled( FALSE ); 69 horizontalHeader()->setResizeEnabled( FALSE );
71 // we have to do this here... or suffer the consequences later... 70 // we have to do this here... or suffer the consequences later...
72 for ( int i = 0; i < 7; i++ ){ 71 for ( int i = 0; i < 7; i++ ){
73 horizontalHeader()->resizeSection( i, 30 ); 72 horizontalHeader()->resizeSection( i, 30 );
74 setColumnStretchable( i, TRUE ); 73 setColumnStretchable( i, TRUE );
75 } 74 }
76 setupLabels(); 75 setupLabels();
77 76
78 verticalHeader()->hide(); 77 verticalHeader()->hide();
79 setLeftMargin( 0 ); 78 setLeftMargin( 0 );
80 for ( int i = 0; i < 6; ++i ) 79 for ( int i = 0; i < 6; ++i )
81 setRowStretchable( i, TRUE ); 80 setRowStretchable( i, TRUE );
82 81
83 setSelectionMode( NoSelection ); 82 setSelectionMode( NoSelection );
84 83
85 connect( this, SIGNAL( clicked(int,int,int,const QPoint&) ), 84 connect( this, SIGNAL( clicked(int,int,int,const QPoint&) ),
86 this, SLOT( dayClicked(int,int) ) ); 85 this, SLOT( dayClicked(int,int) ) );
87 connect( this, SIGNAL( currentChanged(int,int) ), 86 connect( this, SIGNAL( currentChanged(int,int) ),
88 this, SLOT( dragDay(int,int) ) ); 87 this, SLOT( dragDay(int,int) ) );
89 setVScrollBarMode( AlwaysOff ); 88 setVScrollBarMode( AlwaysOff );
90 setHScrollBarMode( AlwaysOff ); 89 setHScrollBarMode( AlwaysOff );
91} 90}
92 91
93ODateBookMonthTable::~ODateBookMonthTable() 92ODateBookMonthTable::~ODateBookMonthTable()
94{ 93{
95 monthsEvents.clear(); 94 monthsEvents.clear();
96 delete d; 95 delete d;
97} 96}
98 97
99void ODateBookMonthTable::setDate(int y, int m, int d) 98void ODateBookMonthTable::setDate(int y, int m, int d)
100{ 99{
101 if (month == m && year == y) { 100 if (month == m && year == y) {
102 if ( selYear == -1 ) 101 if ( selYear == -1 )
103 year = selYear; 102 year = selYear;
104 if ( selMonth == -1 ) 103 if ( selMonth == -1 )
105 month = selMonth; 104 month = selMonth;
106 int r1, c1, r2, c2; 105 int r1, c1, r2, c2;
107 findDay(selDay, r1, c1); 106 findDay(selDay, r1, c1);
108 selDay = day = d; 107 selDay = day = d;
109 findDay(selDay, r2, c2); 108 findDay(selDay, r2, c2);
110 setCurrentCell( r2, c2 ); 109 setCurrentCell( r2, c2 );
111 //updateCell(r1,c1); 110 //updateCell(r1,c1);
112 //updateCell(r2,c2); 111 //updateCell(r2,c2);
113 } else { 112 } else {
114 selYear = year = y; 113 selYear = year = y;
115 selMonth = month = m; 114 selMonth = month = m;
116 selDay = day = d; 115 selDay = day = d;
117 setupTable(); 116 setupTable();
118 } 117 }
119} 118}
120 119
121void ODateBookMonthTable::redraw() 120void ODateBookMonthTable::redraw()
122{ 121{
123 setupLabels(); 122 setupLabels();
124 setupTable(); 123 setupTable();
125} 124}
126 125
127void ODateBookMonthTable::setWeekStart( bool onMonday ) 126void ODateBookMonthTable::setWeekStart( bool onMonday )
128{ 127{
129 d->onMonday = onMonday; 128 d->onMonday = onMonday;
130 setupLabels(); 129 setupLabels();
131 setupTable(); 130 setupTable();
132} 131}
133 132
134void ODateBookMonthTable::setupTable() 133void ODateBookMonthTable::setupTable()
135{ 134{
136 QValueList<Calendar::Day> days = Calendar::daysOfMonth( year, month, d->onMonday ); 135 QValueList<Calendar::Day> days = Calendar::daysOfMonth( year, month, d->onMonday );
137 QValueList<Calendar::Day>::Iterator it = days.begin(); 136 QValueList<Calendar::Day>::Iterator it = days.begin();
138 int row = 0, col = 0; 137 int row = 0, col = 0;
139 int crow = 0; 138 int crow = 0;
140 int ccol = 0; 139 int ccol = 0;
141 for ( ; it != days.end(); ++it ) { 140 for ( ; it != days.end(); ++it ) {
142 DayItemMonth *i = (DayItemMonth *)item( row, col ); 141 DayItemMonth *i = (DayItemMonth *)item( row, col );
143 if ( !i ) { 142 if ( !i ) {
144 i = new DayItemMonth( this, QTableItem::Never, "" ); 143 i = new DayItemMonth( this, QTableItem::Never, "" );
145 setItem( row, col, i ); 144 setItem( row, col, i );
146 } 145 }
147 Calendar::Day calDay = *it; 146 Calendar::Day calDay = *it;
148 i->clearEffEvents(); 147 i->clearEffEvents();
149 i->setDay( calDay.date ); 148 i->setDay( calDay.date );
150 i->setType( calDay.type ); 149 i->setType( calDay.type );
151 if ( i->day() == day && calDay.type == Calendar::Day::ThisMonth ) { 150 if ( i->day() == day && calDay.type == Calendar::Day::ThisMonth ) {
152 crow = row; 151 crow = row;
153 ccol = col; 152 ccol = col;
154 } 153 }
155 154
156 updateCell( row, col ); 155 updateCell( row, col );
157 156
158 if ( col == 6 ) { 157 if ( col == 6 ) {
159 ++row; 158 ++row;
160 col = 0; 159 col = 0;
161 } else { 160 } else {
162 ++col; 161 ++col;
163 } 162 }
164 } 163 }
165 setCurrentCell( crow, ccol ); 164 setCurrentCell( crow, ccol );
166 getEvents(); 165 getEvents();
167} 166}
168 167
169void ODateBookMonthTable::findDay( int day, int &row, int &col ) 168void ODateBookMonthTable::findDay( int day, int &row, int &col )
170{ 169{
171 QDate dtBegin( year, month, 1 ); 170 QDate dtBegin( year, month, 1 );
172 int skips = dtBegin.dayOfWeek(); 171 int skips = dtBegin.dayOfWeek();
173 int effective_day = day + skips - 1; // row/columns begin at 0 172 int effective_day = day + skips - 1; // row/columns begin at 0
174 // make an extra adjustment if we start on Mondays. 173 // make an extra adjustment if we start on Mondays.
175 if ( d->onMonday ) 174 if ( d->onMonday )
176 effective_day--; 175 effective_day--;
177 row = effective_day / 7; 176 row = effective_day / 7;
178 col = effective_day % 7; 177 col = effective_day % 7;
179} 178}
180 179
181void ODateBookMonthTable::dayClicked( int row, int col ) 180void ODateBookMonthTable::dayClicked( int row, int col )
182{ 181{
183 changeDaySelection( row, col ); 182 changeDaySelection( row, col );
184 emit dateClicked( selYear, selMonth, selDay ); 183 emit dateClicked( selYear, selMonth, selDay );
185} 184}
186 185
187void ODateBookMonthTable::dragDay( int row, int col ) 186void ODateBookMonthTable::dragDay( int row, int col )
188{ 187{
189 changeDaySelection( row, col ); 188 changeDaySelection( row, col );
190} 189}
191 190
192void ODateBookMonthTable::changeDaySelection( int row, int col ) 191void ODateBookMonthTable::changeDaySelection( int row, int col )
193{ 192{
194 DayItemMonth *i = (DayItemMonth*)item( row, col ); 193 DayItemMonth *i = (DayItemMonth*)item( row, col );
195 if ( !i ) 194 if ( !i )
196 return; 195 return;
197 switch ( i->type() ) { 196 switch ( i->type() ) {
198 case Calendar::Day::ThisMonth: 197 case Calendar::Day::ThisMonth:
199 selMonth = month; 198 selMonth = month;
200 break; 199 break;
201 case Calendar::Day::PrevMonth: 200 case Calendar::Day::PrevMonth:
202 selMonth = month-1; 201 selMonth = month-1;
203 break; 202 break;
204 default: 203 default:
205 selMonth = month+1; 204 selMonth = month+1;
206 } 205 }
207 206
208 selYear = year; 207 selYear = year;
209 if ( selMonth <= 0 ) { 208 if ( selMonth <= 0 ) {
210 selMonth = 12; 209 selMonth = 12;
211 selYear--; 210 selYear--;
212 } else if ( selMonth > 12 ) { 211 } else if ( selMonth > 12 ) {
213 selMonth = 1; 212 selMonth = 1;
214 selYear++; 213 selYear++;
215 } 214 }
216 selDay = i->day(); 215 selDay = i->day();
217} 216}
218 217
219 218
220void ODateBookMonthTable::viewportMouseReleaseEvent( QMouseEvent * ) 219void ODateBookMonthTable::viewportMouseReleaseEvent( QMouseEvent * )
221{ 220{
222 dayClicked( currentRow(), currentColumn() ); 221 dayClicked( currentRow(), currentColumn() );
223} 222}
224 223
225void ODateBookMonthTable::getEvents() 224void ODateBookMonthTable::getEvents()
226{ 225{
227 if ( !db ) 226 if ( !db )
228 return; 227 return;
229 228
230 QDate dtStart( year, month, 1 ); 229 QDate dtStart( year, month, 1 );
231 d->mMonthEvents = db->getEffectiveEvents( dtStart, 230 d->mMonthEvents = db->getEffectiveEvents( dtStart,
232 QDate( year, month, 231 QDate( year, month,
233 dtStart.daysInMonth() ) ); 232 dtStart.daysInMonth() ) );
234 QValueListIterator<EffectiveEvent> it = d->mMonthEvents.begin(); 233 QValueListIterator<EffectiveEvent> it = d->mMonthEvents.begin();
235 // now that the events are sorted, basically go through the list, make 234 // now that the events are sorted, basically go through the list, make
236 // a small list for every day and set it for each item... 235 // a small list for every day and set it for each item...
237 // clear all the items... 236 // clear all the items...
238 while ( it != d->mMonthEvents.end() ) { 237 while ( it != d->mMonthEvents.end() ) {
239 QValueList<EffectiveEvent> dayEvent; 238 QValueList<EffectiveEvent> dayEvent;
240 EffectiveEvent e = *it; 239 EffectiveEvent e = *it;
241 ++it; 240 ++it;
242 dayEvent.append( e ); 241 dayEvent.append( e );
243 while ( it != d->mMonthEvents.end() 242 while ( it != d->mMonthEvents.end()
244 && e.date() == (*it).date() ) { 243 && e.date() == (*it).date() ) {
245 dayEvent.append( *it ); 244 dayEvent.append( *it );
246 ++it; 245 ++it;
247 } 246 }
248 int row, col; 247 int row, col;
249 findDay( e.date().day(), row, col ); 248 findDay( e.date().day(), row, col );
250 DayItemMonth* w = static_cast<DayItemMonth*>( item( row, col ) ); 249 DayItemMonth* w = static_cast<DayItemMonth*>( item( row, col ) );
251 w->setEvents( dayEvent ); 250 w->setEvents( dayEvent );
252 updateCell( row, col ); 251 updateCell( row, col );
253 dayEvent.clear(); 252 dayEvent.clear();
254 } 253 }
255} 254}
256 255
257 256
258void ODateBookMonthTable::setupLabels() 257void ODateBookMonthTable::setupLabels()
259{ 258{
260 for ( int i = 0; i < 7; ++i ) { 259 for ( int i = 0; i < 7; ++i ) {
261// horizontalHeader()->resizeSection( i, 30 ); 260// horizontalHeader()->resizeSection( i, 30 );
262// setColumnStretchable( i, TRUE ); 261// setColumnStretchable( i, TRUE );
263 if ( d->onMonday ) 262 if ( d->onMonday )
264 horizontalHeader()->setLabel( i, Calendar::nameOfDay( i + 1 ) ); 263 horizontalHeader()->setLabel( i, Calendar::nameOfDay( i + 1 ) );
265 else { 264 else {
266 if ( i == 0 ) 265 if ( i == 0 )
267 horizontalHeader()->setLabel( i, Calendar::nameOfDay( 7 ) ); 266 horizontalHeader()->setLabel( i, Calendar::nameOfDay( 7 ) );
268 else 267 else
269 horizontalHeader()->setLabel( i, Calendar::nameOfDay( i ) ); 268 horizontalHeader()->setLabel( i, Calendar::nameOfDay( i ) );
270 } 269 }
271 } 270 }
272} 271}
273 272
274 273
275//--------------------------------------------------------------------------- 274//---------------------------------------------------------------------------
276 275
277ODateBookMonth::ODateBookMonth( QWidget *parent, const char *name, bool ac, 276ODateBookMonth::ODateBookMonth( QWidget *parent, const char *name, bool ac,
278 DateBookDBHoliday *data ) 277 DateBookDBHoliday *data )
279 : QVBox( parent, name ), 278 : QVBox( parent, name ),
280 autoClose( ac ) 279 autoClose( ac )
281{ 280{
282 setFocusPolicy(StrongFocus); 281 setFocusPolicy(StrongFocus);
283 year = QDate::currentDate().year(); 282 year = QDate::currentDate().year();
284 month = QDate::currentDate().month(); 283 month = QDate::currentDate().month();
285 day = QDate::currentDate().day(); 284 day = QDate::currentDate().day();
286 header = new DateBookMonthHeader( this, "DateBookMonthHeader" ); 285 header = new DateBookMonthHeader( this, "DateBookMonthHeader" );
287 table = new ODateBookMonthTable( this, "DateBookMonthTable", data ); 286 table = new ODateBookMonthTable( this, "DateBookMonthTable", data );
288 header->setDate( year, month ); 287 header->setDate( year, month );
289 table->setDate( year, month, QDate::currentDate().day() ); 288 table->setDate( year, month, QDate::currentDate().day() );
290 header->setFocusPolicy(NoFocus); 289 header->setFocusPolicy(NoFocus);
291 table->setFocusPolicy(NoFocus); 290 table->setFocusPolicy(NoFocus);
292 connect( header, SIGNAL( dateChanged(int,int) ), 291 connect( header, SIGNAL( dateChanged(int,int) ),
293 this, SLOT( setDate(int,int) ) ); 292 this, SLOT( setDate(int,int) ) );
294 connect( table, SIGNAL( dateClicked(int,int,int) ), 293 connect( table, SIGNAL( dateClicked(int,int,int) ),
295 this, SLOT( finalDate(int,int,int) ) ); 294 this, SLOT( finalDate(int,int,int) ) );
296 connect( qApp, SIGNAL(weekChanged(bool)), this, 295 connect( qApp, SIGNAL(weekChanged(bool)), this,
297 SLOT(slotWeekChange(bool)) ); 296 SLOT(slotWeekChange(bool)) );
298 table->setFocus(); 297 table->setFocus();
299} 298}
300 299
301ODateBookMonth::~ODateBookMonth() 300ODateBookMonth::~ODateBookMonth()
302{ 301{
303 302
304} 303}
305 304
306void ODateBookMonth::setDate( int y, int m ) 305void ODateBookMonth::setDate( int y, int m )
307{ 306{
308 /* only change the date if this is a different date, 307 /* only change the date if this is a different date,
309 * other wise we may mistakenly overide the day */ 308 * other wise we may mistakenly overide the day */
310 if ( (y != year) || (m != month) ) { 309 if ( (y != year) || (m != month) ) {
311 year = y; 310 year = y;
312 month = m; 311 month = m;
313 QDate nd( y, m, 1 ); 312 QDate nd( y, m, 1 );
314 if ( nd.daysInMonth() < day ) 313 if ( nd.daysInMonth() < day )
315 day = nd.daysInMonth(); 314 day = nd.daysInMonth();
316 table->setDate( year, month, day ); 315 table->setDate( year, month, day );
317 } 316 }
318} 317}
319 318
320void ODateBookMonth::setDate( int y, int m, int d ) 319void ODateBookMonth::setDate( int y, int m, int d )
321{ 320{
322 header->setDate( y, m); 321 header->setDate( y, m);
323 table->setDate( y, m, d); 322 table->setDate( y, m, d);
324 year = y; 323 year = y;
325 month = m; 324 month = m;
326 day = d; 325 day = d;
327} 326}
328 327
329/* called when we wish to close or pass back the date */ 328/* called when we wish to close or pass back the date */
330void ODateBookMonth::finalDate(int y, int m, int d) 329void ODateBookMonth::finalDate(int y, int m, int d)
331{ 330{
332 setDate( y, m, d ); 331 setDate( y, m, d );
333 332
334 emit dateClicked(y, m, d); 333 emit dateClicked(y, m, d);
335 // emit dateClicked(QDate(y, m, d).toString()); 334 // emit dateClicked(QDate(y, m, d).toString());
336 335
337 if ( autoClose && parentWidget() ) 336 if ( autoClose && parentWidget() )
338 parentWidget()->close(); 337 parentWidget()->close();
339} 338}
340 339
341void ODateBookMonth::setDate( QDate d) 340void ODateBookMonth::setDate( QDate d)
342{ 341{
343 setDate(d.year(), d.month(), d.day()); 342 setDate(d.year(), d.month(), d.day());
344} 343}
345 344
346void ODateBookMonth::redraw() 345void ODateBookMonth::redraw()
347{ 346{
348 table->setDate( year, month, day ); 347 table->setDate( year, month, day );
349 table->redraw(); 348 table->redraw();
350} 349}
351 350
352QDate ODateBookMonth::selectedDate() const 351QDate ODateBookMonth::selectedDate() const
353{ 352{
354 if ( !table ) 353 if ( !table )
355 return QDate::currentDate(); 354 return QDate::currentDate();
356 int y, m, d; 355 int y, m, d;
357 table->getDate( y, m, d ); 356 table->getDate( y, m, d );
358 return QDate( y, m, d ); 357 return QDate( y, m, d );
359} 358}
360 359
361void ODateBookMonth::slotWeekChange( bool startOnMonday ) 360void ODateBookMonth::slotWeekChange( bool startOnMonday )
362{ 361{
363 table->setWeekStart( startOnMonday ); 362 table->setWeekStart( startOnMonday );
364} 363}
365 364
366void ODateBookMonth::keyPressEvent( QKeyEvent *e ) 365void ODateBookMonth::keyPressEvent( QKeyEvent *e )
367{ 366{
368 switch(e->key()) { 367 switch(e->key()) {
369 case Key_Up: 368 case Key_Up:
370 setDate(QDate(year, month, day).addDays(-7)); 369 setDate(QDate(year, month, day).addDays(-7));
371 break; 370 break;
372 case Key_Down: 371 case Key_Down:
373 setDate(QDate(year, month, day).addDays(7)); 372 setDate(QDate(year, month, day).addDays(7));
374 break; 373 break;
375 case Key_Left: 374 case Key_Left:
376 setDate(QDate(year, month, day).addDays(-1)); 375 setDate(QDate(year, month, day).addDays(-1));
377 break; 376 break;
378 case Key_Right: 377 case Key_Right:
379 setDate(QDate(year, month, day).addDays(1)); 378 setDate(QDate(year, month, day).addDays(1));
380 break; 379 break;
381 case Key_Space: 380 case Key_Space:
382 qWarning("space"); 381 qWarning("space");
383 emit dateClicked(year, month, day); 382 emit dateClicked(year, month, day);
384 if ( autoClose && parentWidget() ) 383 if ( autoClose && parentWidget() )
385 parentWidget()->close(); 384 parentWidget()->close();
386 break; 385 break;
387 default: 386 default:
388 qWarning("ignore"); 387 qWarning("ignore");
389 e->ignore(); 388 e->ignore();
390 break; 389 break;
391 } 390 }
392} 391}
diff --git a/noncore/settings/usermanager/userdialog.h b/noncore/settings/usermanager/userdialog.h
index a94e49b..78cd608 100644
--- a/noncore/settings/usermanager/userdialog.h
+++ b/noncore/settings/usermanager/userdialog.h
@@ -1,67 +1,66 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9#ifndef USERDIALOG_H 9#ifndef USERDIALOG_H
10#define USERDIALOG_H 10#define USERDIALOG_H
11 11
12#include <qdialog.h> 12#include <qdialog.h>
13#include <qimage.h>
13#include <qlineedit.h> 14#include <qlineedit.h>
14#include <qcombobox.h> 15#include <qcombobox.h>
15#include <qlistview.h> 16#include <qlistview.h>
16#include <qtabwidget.h> 17#include <qtabwidget.h>
17#include <qpushbutton.h> 18#include <qpushbutton.h>
18#include <qcheckbox.h> 19#include <qcheckbox.h>
19#include <qlabel.h> 20#include <qlabel.h>
20 21
21#include <qpe/resource.h>
22
23#include <opie2/ofiledialog.h> 22#include <opie2/ofiledialog.h>
24 23
25class UserDialog : public QDialog 24class UserDialog : public QDialog
26{ 25{
27 Q_OBJECT 26 Q_OBJECT
28private: 27private:
29 QTabWidget *myTabWidget; 28 QTabWidget *myTabWidget;
30 QPushButton *picturePushButton; 29 QPushButton *picturePushButton;
31 QLineEdit *loginLineEdit; 30 QLineEdit *loginLineEdit;
32 QLineEdit *uidLineEdit; 31 QLineEdit *uidLineEdit;
33 QLineEdit *gecosLineEdit; 32 QLineEdit *gecosLineEdit;
34 QLineEdit *passwordLineEdit; 33 QLineEdit *passwordLineEdit;
35 QComboBox *shellComboBox; 34 QComboBox *shellComboBox;
36 QComboBox *groupComboBox; 35 QComboBox *groupComboBox;
37 QLabel *skelLabel; 36 QLabel *skelLabel;
38 QCheckBox *skelCheckBox; 37 QCheckBox *skelCheckBox;
39 QListView *groupsListView; 38 QListView *groupsListView;
40 39
41 QStringList groupMembers; 40 QStringList groupMembers;
42 QString pictureLocation; 41 QString pictureLocation;
43 QImage userImage; 42 QImage userImage;
44 int groupID; 43 int groupID;
45 int userID; 44 int userID;
46 int vm; 45 int vm;
47 enum VIEWMODE { 46 enum VIEWMODE {
48 VIEWMODE_NEW, 47 VIEWMODE_NEW,
49 VIEWMODE_EDIT 48 VIEWMODE_EDIT
50 }; 49 };
51 50
52 void setupTab1(void); 51 void setupTab1(void);
53 void setupTab2(void); 52 void setupTab2(void);
54 void accept(void); 53 void accept(void);
55 54
56private slots: 55private slots:
57 void clickedPicture(void); 56 void clickedPicture(void);
58 57
59public: 58public:
60 UserDialog( int viewmode=VIEWMODE_NEW, QWidget* parent = 0, const char* name = 0, bool modal=true, WFlags fl = 0 ); 59 UserDialog( int viewmode=VIEWMODE_NEW, QWidget* parent = 0, const char* name = 0, bool modal=true, WFlags fl = 0 );
61 ~UserDialog(); 60 ~UserDialog();
62 static bool addUser(int uid, int gid); 61 static bool addUser(int uid, int gid);
63 static bool editUser(const char *username); 62 static bool editUser(const char *username);
64 static bool delUser(const char *username); 63 static bool delUser(const char *username);
65}; 64};
66 65
67#endif 66#endif