-rw-r--r-- | core/pim/datebook/modules/monthview/odatebookmonth.cpp | 1 | ||||
-rw-r--r-- | noncore/settings/usermanager/userdialog.h | 3 |
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,157 +1,156 @@ /* this is a straight copy of datemonthview. We can not make child of * it 'cause the origin view isn't virtual in any form. */ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "odatebookmonth.h" #include "datebooktypes.h" #include <qpe/config.h> #include <qpe/datebookmonth.h> -#include <qpe/resource.h> #include <qpe/qpeapplication.h> #include <qtoolbutton.h> #include <qspinbox.h> #include <qcombobox.h> #include <qvaluestack.h> #include <qwhatsthis.h> //--------------------------------------------------------------------------- class ODateBookMonthTablePrivate { public: ODateBookMonthTablePrivate() {}; ~ODateBookMonthTablePrivate() { mMonthEvents.clear(); }; QValueList<EffectiveEvent> mMonthEvents; bool onMonday; }; ODateBookMonthTable::ODateBookMonthTable( QWidget *parent, const char *name, DateBookDBHoliday *newDb ) : QTable( 6, 7, parent, name ), db( newDb ) { d = new ODateBookMonthTablePrivate(); selYear = -1; selMonth = -1; selDay = -1; /* init these as well make valgrind happy and be consistent with Qtopia1.6 -zecke */ year = -1; month = -1; day = -1; Config cfg( "qpe" ); cfg.setGroup( "Time" ); d->onMonday = cfg.readBoolEntry( "MONDAY" ); horizontalHeader()->setResizeEnabled( FALSE ); // we have to do this here... or suffer the consequences later... for ( int i = 0; i < 7; i++ ){ horizontalHeader()->resizeSection( i, 30 ); setColumnStretchable( i, TRUE ); } setupLabels(); verticalHeader()->hide(); setLeftMargin( 0 ); for ( int i = 0; i < 6; ++i ) setRowStretchable( i, TRUE ); setSelectionMode( NoSelection ); connect( this, SIGNAL( clicked(int,int,int,const QPoint&) ), this, SLOT( dayClicked(int,int) ) ); connect( this, SIGNAL( currentChanged(int,int) ), this, SLOT( dragDay(int,int) ) ); setVScrollBarMode( AlwaysOff ); setHScrollBarMode( AlwaysOff ); } ODateBookMonthTable::~ODateBookMonthTable() { monthsEvents.clear(); delete d; } void ODateBookMonthTable::setDate(int y, int m, int d) { if (month == m && year == y) { if ( selYear == -1 ) year = selYear; if ( selMonth == -1 ) month = selMonth; int r1, c1, r2, c2; findDay(selDay, r1, c1); selDay = day = d; findDay(selDay, r2, c2); setCurrentCell( r2, c2 ); //updateCell(r1,c1); //updateCell(r2,c2); } else { selYear = year = y; selMonth = month = m; selDay = day = d; setupTable(); } } void ODateBookMonthTable::redraw() { setupLabels(); setupTable(); } void ODateBookMonthTable::setWeekStart( bool onMonday ) { d->onMonday = onMonday; setupLabels(); setupTable(); } void ODateBookMonthTable::setupTable() { QValueList<Calendar::Day> days = Calendar::daysOfMonth( year, month, d->onMonday ); QValueList<Calendar::Day>::Iterator it = days.begin(); int row = 0, col = 0; int crow = 0; int ccol = 0; for ( ; it != days.end(); ++it ) { DayItemMonth *i = (DayItemMonth *)item( row, col ); if ( !i ) { i = new DayItemMonth( this, QTableItem::Never, "" ); setItem( row, col, i ); } Calendar::Day calDay = *it; i->clearEffEvents(); i->setDay( calDay.date ); i->setType( calDay.type ); if ( i->day() == day && calDay.type == Calendar::Day::ThisMonth ) { crow = row; ccol = col; } updateCell( row, col ); 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 @@ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef USERDIALOG_H #define USERDIALOG_H #include <qdialog.h> +#include <qimage.h> #include <qlineedit.h> #include <qcombobox.h> #include <qlistview.h> #include <qtabwidget.h> #include <qpushbutton.h> #include <qcheckbox.h> #include <qlabel.h> -#include <qpe/resource.h> - #include <opie2/ofiledialog.h> class UserDialog : public QDialog { Q_OBJECT private: QTabWidget *myTabWidget; QPushButton *picturePushButton; QLineEdit *loginLineEdit; QLineEdit *uidLineEdit; QLineEdit *gecosLineEdit; QLineEdit *passwordLineEdit; QComboBox *shellComboBox; QComboBox *groupComboBox; QLabel *skelLabel; QCheckBox *skelCheckBox; QListView *groupsListView; QStringList groupMembers; QString pictureLocation; QImage userImage; int groupID; int userID; int vm; enum VIEWMODE { VIEWMODE_NEW, VIEWMODE_EDIT }; void setupTab1(void); void setupTab2(void); void accept(void); private slots: void clickedPicture(void); public: UserDialog( int viewmode=VIEWMODE_NEW, QWidget* parent = 0, const char* name = 0, bool modal=true, WFlags fl = 0 ); ~UserDialog(); static bool addUser(int uid, int gid); static bool editUser(const char *username); static bool delUser(const char *username); }; #endif |