Diffstat (limited to 'core/pim/datebook/datebookdayheaderimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebookdayheaderimpl.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/pim/datebook/datebookdayheaderimpl.cpp b/core/pim/datebook/datebookdayheaderimpl.cpp index 7d77153..3e965f5 100644 --- a/core/pim/datebook/datebookdayheaderimpl.cpp +++ b/core/pim/datebook/datebookdayheaderimpl.cpp | |||
@@ -39,24 +39,26 @@ | |||
39 | */ | 39 | */ |
40 | DateBookDayHeader::DateBookDayHeader( bool useMonday, | 40 | DateBookDayHeader::DateBookDayHeader( bool useMonday, |
41 | QWidget* parent, const char* name ) | 41 | QWidget* parent, const char* name ) |
42 | : DateBookDayHeaderBase( parent, name ), | 42 | : DateBookDayHeaderBase( parent, name ), |
43 | bUseMonday( useMonday ) | 43 | bUseMonday( useMonday ) |
44 | { | 44 | { |
45 | connect(date,SIGNAL(pressed()),this,SLOT(pickDate())); | 45 | connect(date,SIGNAL(pressed()),this,SLOT(pickDate())); |
46 | 46 | ||
47 | setupNames(); | 47 | setupNames(); |
48 | 48 | ||
49 | forward->setPixmap( Resource::loadPixmap( "forward" ) ); | 49 | forward->setPixmap( Resource::loadPixmap( "forward" ) ); |
50 | back->setPixmap( Resource::loadPixmap( "back" ) ); | 50 | back->setPixmap( Resource::loadPixmap( "back" ) ); |
51 | forwardweek->setPixmap( Resource::loadPixmap( "fastforward" ) ); | ||
52 | backweek->setPixmap( Resource::loadPixmap( "fastback" ) ); | ||
51 | 53 | ||
52 | setBackgroundMode( PaletteButton ); | 54 | setBackgroundMode( PaletteButton ); |
53 | grpDays->setBackgroundMode( PaletteButton ); | 55 | grpDays->setBackgroundMode( PaletteButton ); |
54 | } | 56 | } |
55 | 57 | ||
56 | /* | 58 | /* |
57 | * Destroys the object and frees any allocated resources | 59 | * Destroys the object and frees any allocated resources |
58 | */ | 60 | */ |
59 | DateBookDayHeader::~DateBookDayHeader() | 61 | DateBookDayHeader::~DateBookDayHeader() |
60 | { | 62 | { |
61 | // no need to delete child widgets, Qt does it all for us | 63 | // no need to delete child widgets, Qt does it all for us |
62 | } | 64 | } |
@@ -121,24 +123,40 @@ void DateBookDayHeader::goBack() | |||
121 | { | 123 | { |
122 | currDate = currDate.addDays( -1 ); | 124 | currDate = currDate.addDays( -1 ); |
123 | setDate( currDate.year(), currDate.month(), currDate.day() ); | 125 | setDate( currDate.year(), currDate.month(), currDate.day() ); |
124 | } | 126 | } |
125 | /* | 127 | /* |
126 | * public slot | 128 | * public slot |
127 | */ | 129 | */ |
128 | void DateBookDayHeader::goForward() | 130 | void DateBookDayHeader::goForward() |
129 | { | 131 | { |
130 | currDate = currDate.addDays( 1 ); | 132 | currDate = currDate.addDays( 1 ); |
131 | setDate( currDate.year(), currDate.month(), currDate.day() ); | 133 | setDate( currDate.year(), currDate.month(), currDate.day() ); |
132 | } | 134 | } |
135 | /* | ||
136 | * public slot | ||
137 | */ | ||
138 | void DateBookDayHeader::goBackWeek() | ||
139 | { | ||
140 | currDate = currDate.addDays( -7 ); | ||
141 | setDate( currDate.year(), currDate.month(), currDate.day() ); | ||
142 | } | ||
143 | /* | ||
144 | * public slot | ||
145 | */ | ||
146 | void DateBookDayHeader::goForwardWeek() | ||
147 | { | ||
148 | currDate = currDate.addDays( 7 ); | ||
149 | setDate( currDate.year(), currDate.month(), currDate.day() ); | ||
150 | } | ||
133 | 151 | ||
134 | 152 | ||
135 | /* | 153 | /* |
136 | * public slot | 154 | * public slot |
137 | */ | 155 | */ |
138 | void DateBookDayHeader::setDate( int y, int m, int d ) | 156 | void DateBookDayHeader::setDate( int y, int m, int d ) |
139 | { | 157 | { |
140 | currDate.setYMD( y, m, d ); | 158 | currDate.setYMD( y, m, d ); |
141 | date->setText( TimeString::shortDate( currDate ) ); | 159 | date->setText( TimeString::shortDate( currDate ) ); |
142 | 160 | ||
143 | int iDayOfWeek = currDate.dayOfWeek(); | 161 | int iDayOfWeek = currDate.dayOfWeek(); |
144 | // cleverly adjust the day depending on how we start the week | 162 | // cleverly adjust the day depending on how we start the week |