-rw-r--r-- | library/datebookmonth.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/datebookmonth.cpp b/library/datebookmonth.cpp index b2074e6..f4b3e6b 100644 --- a/library/datebookmonth.cpp +++ b/library/datebookmonth.cpp @@ -1,153 +1,153 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of 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 "config.h" #include "datebookmonth.h" #include "datebookdb.h" #include <qpe/event.h> #include "resource.h" #include "qpeapplication.h" #include "timestring.h" #include <qtoolbutton.h> #include <qspinbox.h> #include <qcombobox.h> #include <qdatetime.h> #include <qpainter.h> #include <qpopupmenu.h> DateBookMonthHeader::DateBookMonthHeader( QWidget *parent, const char *name ) : QHBox( parent, name ) { setBackgroundMode( PaletteButton ); begin = new QToolButton( this ); begin->setFocusPolicy(NoFocus); begin->setPixmap( Resource::loadPixmap( "start" ) ); begin->setAutoRaise( TRUE ); begin->setFixedSize( begin->sizeHint() ); back = new QToolButton( this ); back->setFocusPolicy(NoFocus); back->setPixmap( Resource::loadPixmap( "back" ) ); back->setAutoRaise( TRUE ); back->setFixedSize( back->sizeHint() ); month = new QComboBox( FALSE, this ); for ( int i = 0; i < 12; ++i ) month->insertItem( Calendar::nameOfMonth( i + 1 ) ); - year = new QSpinBox( 1970, 2037, 1, this ); + year = new QSpinBox( 1752, 8000, 1, this ); next = new QToolButton( this ); next->setFocusPolicy(NoFocus); next->setPixmap( Resource::loadPixmap( "forward" ) ); next->setAutoRaise( TRUE ); next->setFixedSize( next->sizeHint() ); end = new QToolButton( this ); end->setFocusPolicy(NoFocus); end->setPixmap( Resource::loadPixmap( "finish" ) ); end->setAutoRaise( TRUE ); end->setFixedSize( end->sizeHint() ); connect( month, SIGNAL( activated( int ) ), this, SLOT( updateDate() ) ); connect( year, SIGNAL( valueChanged( int ) ), this, SLOT( updateDate() ) ); connect( begin, SIGNAL( clicked() ), this, SLOT( firstMonth() ) ); connect( end, SIGNAL( clicked() ), this, SLOT( lastMonth() ) ); connect( back, SIGNAL( clicked() ), this, SLOT( monthBack() ) ); connect( next, SIGNAL( clicked() ), this, SLOT( monthForward() ) ); back->setAutoRepeat( TRUE ); next->setAutoRepeat( TRUE ); } DateBookMonthHeader::~DateBookMonthHeader() { } void DateBookMonthHeader::updateDate() { emit dateChanged( year->value(), month->currentItem() + 1 ); } void DateBookMonthHeader::firstMonth() { emit dateChanged( year->value(), 1 ); month->setCurrentItem( 0 ); } void DateBookMonthHeader::lastMonth() { emit dateChanged( year->value(), 12 ); month->setCurrentItem( 11 ); } void DateBookMonthHeader::monthBack() { if ( month->currentItem() > 0 ) { emit dateChanged( year->value(), month->currentItem() ); month->setCurrentItem( month->currentItem() - 1 ); } else { emit dateChanged( year->value() - 1, 12 ); // we have a signal set to a changed value in year so we only need to change // year to get the result... month->setCurrentItem( 11 ); year->setValue( year->value() - 1 ); } } void DateBookMonthHeader::monthForward() { if ( month->currentItem() < 11 ) { emit dateChanged( year->value(), month->currentItem() + 2 ); month->setCurrentItem( month->currentItem() + 1 ); } else { // we have a signal set to a changed value in year so we only need to change // year to get the result... month->setCurrentItem( 0 ); year->setValue( year->value() + 1 ); } } void DateBookMonthHeader::setDate( int y, int m ) { year->setValue( y ); month->setCurrentItem( m - 1 ); } //--------------------------------------------------------------------------- class DateBookMonthTablePrivate { public: DateBookMonthTablePrivate() {}; ~DateBookMonthTablePrivate() { mMonthEvents.clear(); }; QValueList<EffectiveEvent> mMonthEvents; bool onMonday; }; |