summaryrefslogtreecommitdiff
authordrw <drw>2005-06-15 19:45:55 (UTC)
committer drw <drw>2005-06-15 19:45:55 (UTC)
commitd2474c8e654d223b85b6200ce09fabd3a40af8e3 (patch) (side-by-side diff)
tree2c9781e5f0793a2d796b331dba2cd177affda648
parent1cc97c3b70f59b90dc4bf032a14198dc8bd07f2e (diff)
downloadopie-d2474c8e654d223b85b6200ce09fabd3a40af8e3.zip
opie-d2474c8e654d223b85b6200ce09fabd3a40af8e3.tar.gz
opie-d2474c8e654d223b85b6200ce09fabd3a40af8e3.tar.bz2
Remove unneeded include
Diffstat (more/less context) (show 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,221 +1,220 @@
/* 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 );
if ( col == 6 ) {
++row;
col = 0;
} else {
++col;
}
}
setCurrentCell( crow, ccol );
getEvents();
}
void ODateBookMonthTable::findDay( int day, int &row, int &col )
{
QDate dtBegin( year, month, 1 );
int skips = dtBegin.dayOfWeek();
int effective_day = day + skips - 1; // row/columns begin at 0
// make an extra adjustment if we start on Mondays.
if ( d->onMonday )
effective_day--;
row = effective_day / 7;
col = effective_day % 7;
}
void ODateBookMonthTable::dayClicked( int row, int col )
{
changeDaySelection( row, col );
emit dateClicked( selYear, selMonth, selDay );
}
void ODateBookMonthTable::dragDay( int row, int col )
{
changeDaySelection( row, col );
}
void ODateBookMonthTable::changeDaySelection( int row, int col )
{
DayItemMonth *i = (DayItemMonth*)item( row, col );
if ( !i )
return;
switch ( i->type() ) {
case Calendar::Day::ThisMonth:
selMonth = month;
break;
case Calendar::Day::PrevMonth:
selMonth = month-1;
break;
default:
selMonth = month+1;
}
selYear = year;
if ( selMonth <= 0 ) {
selMonth = 12;
selYear--;
} else if ( selMonth > 12 ) {
selMonth = 1;
selYear++;
}
selDay = i->day();
}
void ODateBookMonthTable::viewportMouseReleaseEvent( QMouseEvent * )
{
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