summaryrefslogtreecommitdiff
path: root/libopie/orecurrancewidget.cpp
Unidiff
Diffstat (limited to 'libopie/orecurrancewidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/orecurrancewidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie/orecurrancewidget.cpp b/libopie/orecurrancewidget.cpp
index 0484ab9..db86184 100644
--- a/libopie/orecurrancewidget.cpp
+++ b/libopie/orecurrancewidget.cpp
@@ -132,97 +132,97 @@ ORecur ORecurranceWidget::recurrence()const {
132 if ( (*it)->isOn() ) { 132 if ( (*it)->isOn() ) {
133 switch ( i ) { 133 switch ( i ) {
134 case None: 134 case None:
135 rpTmp.setType( ORecur::NoRepeat ); 135 rpTmp.setType( ORecur::NoRepeat );
136 break; 136 break;
137 case Day: 137 case Day:
138 rpTmp.setType( ORecur::Daily ); 138 rpTmp.setType( ORecur::Daily );
139 break; 139 break;
140 case Week:{ 140 case Week:{
141 rpTmp.setType( ORecur::Weekly ); 141 rpTmp.setType( ORecur::Weekly );
142 int day; 142 int day;
143 int day2 = 0; 143 int day2 = 0;
144 for ( day = 1; *itExtra; ++itExtra, day = day << 1 ) { 144 for ( day = 1; *itExtra; ++itExtra, day = day << 1 ) {
145 if ( (*itExtra)->isOn() ) { 145 if ( (*itExtra)->isOn() ) {
146 if ( startWeekOnMonday ) 146 if ( startWeekOnMonday )
147 day2 |= day; 147 day2 |= day;
148 else { 148 else {
149 if ( day == 1 ) 149 if ( day == 1 )
150 day2 |= Event::SUN; 150 day2 |= Event::SUN;
151 else 151 else
152 day2 |= day >> 1; 152 day2 |= day >> 1;
153 } 153 }
154 } 154 }
155 } 155 }
156 rpTmp.setDays( day2 ); 156 rpTmp.setDays( day2 );
157 } 157 }
158 break; 158 break;
159 case Month: 159 case Month:
160 if ( cmdExtra1->isOn() ) 160 if ( cmdExtra1->isOn() )
161 rpTmp.setType( ORecur::MonthlyDay ); 161 rpTmp.setType( ORecur::MonthlyDay );
162 else if ( cmdExtra2->isOn() ) 162 else if ( cmdExtra2->isOn() )
163 rpTmp.setType( ORecur::MonthlyDate ); 163 rpTmp.setType( ORecur::MonthlyDate );
164 // figure out the montly day... 164 // figure out the montly day...
165 rpTmp.setPosition( week( start ) ); 165 rpTmp.setPosition( week( start ) );
166 break; 166 break;
167 case Year: 167 case Year:
168 rpTmp.setType( ORecur::Yearly ); 168 rpTmp.setType( ORecur::Yearly );
169 break; 169 break;
170 } 170 }
171 break; // no need to keep looking! 171 break; // no need to keep looking!
172 } 172 }
173 } 173 }
174 rpTmp.setFrequency(spinFreq->value() ); 174 rpTmp.setFrequency(spinFreq->value() );
175 rpTmp.setHasEndDate( !chkNoEnd->isChecked() ); 175 rpTmp.setHasEndDate( !chkNoEnd->isChecked() );
176 if ( rpTmp.hasEndDate() ) { 176 if ( rpTmp.hasEndDate() ) {
177 rpTmp.setEndDate( end ); 177 rpTmp.setEndDate( end );
178 } 178 }
179 // timestamp it... 179 // timestamp it...
180 rpTmp.setCreateTime( time( NULL ) ); 180// rpTmp.setCreateTime( ); current DateTime is already set -zecke
181 return rpTmp; 181 return rpTmp;
182} 182}
183QDate ORecurranceWidget::endDate()const { 183QDate ORecurranceWidget::endDate()const {
184 return end; 184 return end;
185} 185}
186void ORecurranceWidget::slotSetRType(int rtype) { 186void ORecurranceWidget::slotSetRType(int rtype) {
187 // now call the right function based on the type... 187 // now call the right function based on the type...
188 currInterval = static_cast<repeatButtons>(rtype); 188 currInterval = static_cast<repeatButtons>(rtype);
189 switch ( currInterval ) { 189 switch ( currInterval ) {
190 case None: 190 case None:
191 setupNone(); 191 setupNone();
192 break; 192 break;
193 case Day: 193 case Day:
194 setupDaily(); 194 setupDaily();
195 break; 195 break;
196 case Week: 196 case Week:
197 setupWeekly(); 197 setupWeekly();
198 slotWeekLabel(); 198 slotWeekLabel();
199 break; 199 break;
200 case Month: 200 case Month:
201 setupMonthly(); 201 setupMonthly();
202 cmdExtra2->setOn( TRUE ); 202 cmdExtra2->setOn( TRUE );
203 slotMonthLabel( 1 ); 203 slotMonthLabel( 1 );
204 break; 204 break;
205 case Year: 205 case Year:
206 setupYearly(); 206 setupYearly();
207 break; 207 break;
208 } 208 }
209} 209}
210void ORecurranceWidget::endDateChanged(int y, int m, int d) { 210void ORecurranceWidget::endDateChanged(int y, int m, int d) {
211 end.setYMD( y, m, d ); 211 end.setYMD( y, m, d );
212 if ( end < start ) 212 if ( end < start )
213 end = start; 213 end = start;
214 cmdEnd->setText( TimeString::shortDate( end ) ); 214 cmdEnd->setText( TimeString::shortDate( end ) );
215 repeatPicker->setDate( end.year(), end.month(), end.day() ); 215 repeatPicker->setDate( end.year(), end.month(), end.day() );
216} 216}
217void ORecurranceWidget::slotNoEnd( bool unused) { 217void ORecurranceWidget::slotNoEnd( bool unused) {
218 // if the item was toggled, then go ahead and set it to the maximum date 218 // if the item was toggled, then go ahead and set it to the maximum date
219 if ( unused ) { 219 if ( unused ) {
220 end.setYMD( 3000, 12, 31 ); 220 end.setYMD( 3000, 12, 31 );
221 cmdEnd->setText( tr("No End Date") ); 221 cmdEnd->setText( tr("No End Date") );
222 } else { 222 } else {
223 end = start; 223 end = start;
224 cmdEnd->setText( TimeString::shortDate(end) ); 224 cmdEnd->setText( TimeString::shortDate(end) );
225 } 225 }
226} 226}
227void ORecurranceWidget::setupRepeatLabel( const QString& s) { 227void ORecurranceWidget::setupRepeatLabel( const QString& s) {
228 lblVar1->setText( s ); 228 lblVar1->setText( s );