summaryrefslogtreecommitdiff
path: root/library/datebookmonth.cpp
Side-by-side diff
Diffstat (limited to 'library/datebookmonth.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/datebookmonth.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/library/datebookmonth.cpp b/library/datebookmonth.cpp
index 76e022f..421559e 100644
--- a/library/datebookmonth.cpp
+++ b/library/datebookmonth.cpp
@@ -48,51 +48,51 @@ DateBookMonthHeader::DateBookMonthHeader( QWidget *parent, const char *name )
back->setAutoRaise( TRUE );
back->setFixedSize( back->sizeHint() );
QWhatsThis::add( back, tr("Show the previous month") );
month = new QComboBox( FALSE, this );
for ( int i = 0; i < 12; ++i )
month->insertItem( Calendar::nameOfMonth( i + 1 ) );
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() );
QWhatsThis::add( next, tr("Show the next month") );
end = new QToolButton( this );
end->setFocusPolicy(NoFocus);
end->setPixmap( Resource::loadPixmap( "finish" ) );
end->setAutoRaise( TRUE );
end->setFixedSize( end->sizeHint() );
QWhatsThis::add( end, tr("Show December in the selected year") );
- connect( month, SIGNAL( activated( int ) ),
+ connect( month, SIGNAL( activated(int) ),
this, SLOT( updateDate() ) );
- connect( year, SIGNAL( valueChanged( int ) ),
+ 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 );
}
@@ -166,52 +166,52 @@ DateBookMonthTable::DateBookMonthTable( QWidget *parent, const char *name,
/* 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 ) ) );
+ 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 );
}
DateBookMonthTable::~DateBookMonthTable()
{
monthsEvents.clear();
delete d;
}
void DateBookMonthTable::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);
@@ -373,52 +373,52 @@ void DateBookMonthTable::setupLabels()
else
horizontalHeader()->setLabel( i, Calendar::nameOfDay( i ) );
}
}
}
//---------------------------------------------------------------------------
DateBookMonth::DateBookMonth( QWidget *parent, const char *name, bool ac,
DateBookDB *data )
: QVBox( parent, name ),
autoClose( ac )
{
setFocusPolicy(StrongFocus);
year = QDate::currentDate().year();
month = QDate::currentDate().month();
day = QDate::currentDate().day();
header = new DateBookMonthHeader( this, "DateBookMonthHeader" );
table = new DateBookMonthTable( this, "DateBookMonthTable", data );
header->setDate( year, month );
table->setDate( year, month, QDate::currentDate().day() );
header->setFocusPolicy(NoFocus);
table->setFocusPolicy(NoFocus);
- connect( header, SIGNAL( dateChanged( int, int ) ),
- this, SLOT( setDate( int, int ) ) );
- connect( table, SIGNAL( dateClicked( int, int, int ) ),
- this, SLOT( finalDate(int, int, int) ) );
+ connect( header, SIGNAL( dateChanged(int,int) ),
+ this, SLOT( setDate(int,int) ) );
+ connect( table, SIGNAL( dateClicked(int,int,int) ),
+ this, SLOT( finalDate(int,int,int) ) );
connect( qApp, SIGNAL(weekChanged(bool)), this,
SLOT(slotWeekChange(bool)) );
table->setFocus();
}
DateBookMonth::~DateBookMonth()
{
}
void DateBookMonth::setDate( int y, int m )
{
/* only change the date if this is a different date,
* other wise we may mistakenly overide the day */
if ( (y != year) || (m != month) ) {
year = y;
month = m;
QDate nd( y, m, 1 );
if ( nd.daysInMonth() < day )
day = nd.daysInMonth();
table->setDate( year, month, day );
}
}
@@ -675,52 +675,52 @@ void DayItemMonth::setType( Calendar::Day::Type t )
DateButton::DateButton( bool longDate, QWidget *parent, const char * name )
:QPushButton( parent, name )
{
longFormat = longDate;
df = DateFormat('/', DateFormat::MonthDayYear, DateFormat::MonthDayYear);
setDate( QDate::currentDate() );
connect(this,SIGNAL(pressed()),this,SLOT(pickDate()));
}
void DateButton::pickDate()
{
static QPopupMenu *m1 = 0;
static DateBookMonth *picker = 0;
if ( !m1 ) {
m1 = new QPopupMenu( this );
picker = new DateBookMonth( m1, 0, TRUE );
m1->insertItem( picker );
- connect( picker, SIGNAL( dateClicked( int, int, int ) ),
- this, SLOT( setDate( int, int, int ) ) );
- connect( picker, SIGNAL( dateClicked( int, int, int ) ),
- this, SIGNAL( dateSelected( int, int, int ) ) );
+ connect( picker, SIGNAL( dateClicked(int,int,int) ),
+ this, SLOT( setDate(int,int,int) ) );
+ connect( picker, SIGNAL( dateClicked(int,int,int) ),
+ this, SIGNAL( dateSelected(int,int,int) ) );
connect( m1, SIGNAL( aboutToHide() ),
this, SLOT( gotHide() ) );
}
picker->slotWeekChange( weekStartsMonday );
picker->setDate( currDate.year(), currDate.month(), currDate.day() );
m1->popup(mapToGlobal(QPoint(0,height())));
picker->setFocus();
}
void DateButton::gotHide()
{
// we have to redo the button...
setDown( false );
}
// void dateSelected( int year, int month, int day );
void DateButton::setWeekStartsMonday( int b )
{
weekStartsMonday = b;
}