summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kofilterview.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index ea53043..ce2880a 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -191,132 +191,134 @@ void KOCalEditView::setColor( const QColor& c, int id )
191 KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; 191 KOPrefs::instance()->getCalendar( id )->mDefaultColor = c;
192 emit needsUpdate(); 192 emit needsUpdate();
193} 193}
194void KOCalEditView::deleteCal( int id ) 194void KOCalEditView::deleteCal( int id )
195{ 195{
196 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); 196 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id );
197 QString name = kkf->mName; 197 QString name = kkf->mName;
198 QString file = KGlobal::formatMessage ( kkf->mFileName ,0 ); 198 QString file = KGlobal::formatMessage ( kkf->mFileName ,0 );
199 if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)").arg(name).arg(file) ) != KMessageBox::Continue ) return; 199 if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)").arg(name).arg(file) ) != KMessageBox::Continue ) return;
200 if ( kkf->isStandard ) 200 if ( kkf->isStandard )
201 selectStdCal( 1, true ); 201 selectStdCal( 1, true );
202 emit removeCalendar ( id ); 202 emit removeCalendar ( id );
203 KOPrefs::instance()->mCalendars.remove ( kkf ); 203 KOPrefs::instance()->mCalendars.remove ( kkf );
204 emit needsUpdate(); 204 emit needsUpdate();
205 QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); 205 QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
206} 206}
207void KOCalEditView::infoCal( int id ) 207void KOCalEditView::infoCal( int id )
208{ 208{
209 QString name = KOPrefs::instance()->getCalendar( id )->mName; 209 QString name = KOPrefs::instance()->getCalendar( id )->mName;
210 QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 ); 210 QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 );
211 if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) { 211 if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) {
212 if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) { 212 if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) {
213 emit calendarAdded( id ); 213 emit calendarAdded( id );
214 emit needsUpdate(); 214 emit needsUpdate();
215 QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); 215 QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
216 } 216 }
217 } 217 }
218 else 218 else
219 KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) ); 219 KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) );
220} 220}
221void KOCalEditView::readConfig() 221void KOCalEditView::readConfig()
222{ 222{
223 223
224 mStdandardB.clear(); 224 mStdandardB.clear();
225 mEnabledB.clear(); 225 mEnabledB.clear();
226 mAlarmB.clear(); 226 mAlarmB.clear();
227 mROB.clear(); 227 mROB.clear();
228 228
229 if ( mw ) delete mw; 229 if ( mw ) delete mw;
230 mw = new QWidget ( viewport() ); 230 mw = new QWidget ( viewport() );
231 addChild(mw); 231 addChild(mw);
232 int ii = 0; 232 int ii = 0;
233 mainLayout = new QGridLayout ( mw , 2, 8 ); 233 mainLayout = new QGridLayout ( mw , 2, 8 );
234 mainLayout->setMargin( 2 ); 234 mainLayout->setMargin( 2 );
235 mainLayout->setSpacing( 2 ); 235 mainLayout->setSpacing( 2 );
236 QPushButton * addBut = new QPushButton ( mw ); 236 QPushButton * addBut = new QPushButton ( mw );
237 addBut->setFocusPolicy(NoFocus); 237 addBut->setFocusPolicy(NoFocus);
238 mainLayout->addWidget( addBut,0,0 ); 238 mainLayout->addWidget( addBut,0,0 );
239 addBut->setPixmap ( SmallIcon("plus")); 239 addBut->setPixmap ( SmallIcon("greenhook16"));
240 connect(addBut,SIGNAL(clicked()),SLOT(addCal()));
241 addBut->setMaximumWidth( addBut->sizeHint().height() ); 240 addBut->setMaximumWidth( addBut->sizeHint().height() );
242 int max = addBut->sizeHint().height(); 241 int max = addBut->sizeHint().height();
243 addBut = new QPushButton ( mw ); 242 addBut = new QPushButton ( mw );
244 addBut->setFocusPolicy(NoFocus); 243 addBut->setFocusPolicy(NoFocus);
245 mainLayout->addWidget( addBut,0,++ii ); 244 mainLayout->addWidget( addBut,0,++ii );
246 addBut->setPixmap ( SmallIcon("eye")); 245 addBut->setPixmap ( SmallIcon("eye"));
247 connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); 246 connect(addBut,SIGNAL(clicked()),SLOT(enableAll()));
248 addBut->setMaximumWidth( addBut->sizeHint().height() ); 247 addBut->setMaximumWidth( addBut->sizeHint().height() );
249 248
250 QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw ); 249 QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw );
251 mainLayout->addWidget( lab,0,++ii ); 250 mainLayout->addWidget( lab,0,++ii );
252 //lab = new QLabel ( i18n(" "), mw ); 251 //lab = new QLabel ( i18n(" "), mw );
253 //mainLayout->addWidget( lab,0,++ii ); 252 //mainLayout->addWidget( lab,0,++ii );
254 //lab->setFixedWidth( 1 ); 253 //lab->setFixedWidth( 1 );
255 addBut = new QPushButton ( mw ); 254 addBut = new QPushButton ( mw );
256 addBut->setFocusPolicy(NoFocus); 255 addBut->setFocusPolicy(NoFocus);
257 mainLayout->addWidget( addBut,0,++ii ); 256 mainLayout->addWidget( addBut,0,++ii );
258 addBut->setPixmap ( SmallIcon("bell")); 257 addBut->setPixmap ( SmallIcon("bell"));
259 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); 258 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm()));
260 addBut->setMaximumWidth( addBut->sizeHint().height() ); 259 addBut->setMaximumWidth( addBut->sizeHint().height() );
261 260
262 addBut = new QPushButton ( mw ); 261 addBut = new QPushButton ( mw );
263 addBut->setFocusPolicy(NoFocus); 262 addBut->setFocusPolicy(NoFocus);
264 mainLayout->addWidget( addBut,0,++ii ); 263 mainLayout->addWidget( addBut,0,++ii );
265 addBut->setPixmap ( SmallIcon("pencil")); 264 addBut->setPixmap ( SmallIcon("pencil"));
266 connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); 265 connect(addBut,SIGNAL(clicked()),SLOT(disableRO()));
267 addBut->setMaximumWidth( addBut->sizeHint().height() ); 266 addBut->setMaximumWidth( addBut->sizeHint().height() );
268
269 lab = new QLabel ( i18n(" Color "), mw );
270 mainLayout->addWidget( lab,0,++ii );
271 lab = new QLabel ( "", mw ); 267 lab = new QLabel ( "", mw );
272 mainLayout->addWidget( lab,0,++ii ); 268 mainLayout->addWidget( lab,0,++ii );
273 lab->setMaximumWidth( max+4 ); 269
274 lab = new QLabel ( "", mw ); 270 addBut = new QPushButton ( mw );
271 addBut->setFocusPolicy(NoFocus);
272 mainLayout->addWidget( addBut,0,++ii );
273 addBut->setPixmap ( SmallIcon("plus"));
274 connect(addBut,SIGNAL(clicked()),SLOT(addCal()));
275
276 lab = new QLabel ( " ", mw );
275 mainLayout->addWidget( lab,0,++ii ); 277 mainLayout->addWidget( lab,0,++ii );
276 278
277 279
278#if 0 280#if 0
279 addBut = new QPushButton ( mw ); 281 addBut = new QPushButton ( mw );
280 mainLayout->addWidget( addBut,0,6 ); 282 mainLayout->addWidget( addBut,0,6 );
281 addBut->setPixmap ( SmallIcon("minus")); 283 addBut->setPixmap ( SmallIcon("minus"));
282 connect(addBut,SIGNAL(clicked()),SLOT(deleteAll())); 284 connect(addBut,SIGNAL(clicked()),SLOT(deleteAll()));
283 addBut->setMaximumWidth( addBut->sizeHint().height() ); 285 addBut->setMaximumWidth( addBut->sizeHint().height() );
284#endif 286#endif
285 287
286 288
287 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 289 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
288 int row = 1; 290 int row = 1;
289 while ( kkf ) { 291 while ( kkf ) {
290 int iii = 0; 292 int iii = 0;
291 KOCalCheckButton* cb = new KOCalCheckButton( mw ); 293 KOCalCheckButton* cb = new KOCalCheckButton( mw );
292 mainLayout->addWidget( cb,row,0 );mStdandardB.append( cb ); 294 mainLayout->addWidget( cb,row,0 );mStdandardB.append( cb );
293 cb->setChecked( kkf->isStandard ); 295 cb->setChecked( kkf->isStandard );
294 cb->setNum( kkf->mCalNumber ); 296 cb->setNum( kkf->mCalNumber );
295 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectStdCal(int,bool) ) ); 297 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectStdCal(int,bool) ) );
296 if ( kkf->mErrorOnLoad || kkf->isReadOnly ) 298 if ( kkf->mErrorOnLoad || kkf->isReadOnly )
297 cb->setEnabled( false ); 299 cb->setEnabled( false );
298 cb = new KOCalCheckButton( mw ); 300 cb = new KOCalCheckButton( mw );
299 mainLayout->addWidget( cb,row,++iii );mEnabledB.append( cb ); 301 mainLayout->addWidget( cb,row,++iii );mEnabledB.append( cb );
300 cb->setChecked( kkf->isEnabled ); 302 cb->setChecked( kkf->isEnabled );
301 cb->setNum( kkf->mCalNumber ); 303 cb->setNum( kkf->mCalNumber );
302 if ( kkf->mErrorOnLoad ) 304 if ( kkf->mErrorOnLoad )
303 cb->setEnabled( false ); 305 cb->setEnabled( false );
304 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCal(int,bool) ) ); 306 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCal(int,bool) ) );
305 KOCalButton* name = new KOCalButton( mw ); 307 KOCalButton* name = new KOCalButton( mw );
306 name->setNum( kkf->mCalNumber ); 308 name->setNum( kkf->mCalNumber );
307 name->setText( kkf->mName ); 309 name->setText( kkf->mName );
308 mainLayout->addWidget( name,row,++iii ); 310 mainLayout->addWidget( name,row,++iii );
309 connect (name, SIGNAL (selectNum(int)), SLOT ( infoCal(int) ) ); 311 connect (name, SIGNAL (selectNum(int)), SLOT ( infoCal(int) ) );
310 //lab = new QLabel (" ", mw ); 312 //lab = new QLabel (" ", mw );
311 //mainLayout->addWidget( lab,row,++iii ); 313 //mainLayout->addWidget( lab,row,++iii );
312 cb = new KOCalCheckButton( mw ); 314 cb = new KOCalCheckButton( mw );
313 mainLayout->addWidget( cb,row,++iii );mAlarmB.append( cb ); 315 mainLayout->addWidget( cb,row,++iii );mAlarmB.append( cb );
314 cb->setChecked( kkf->isAlarmEnabled ); 316 cb->setChecked( kkf->isAlarmEnabled );
315 cb->setNum( kkf->mCalNumber ); 317 cb->setNum( kkf->mCalNumber );
316 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCalAlarm(int,bool) ) ); 318 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCalAlarm(int,bool) ) );
317 if ( kkf->mErrorOnLoad ) 319 if ( kkf->mErrorOnLoad )
318 cb->setEnabled( false ); 320 cb->setEnabled( false );
319 cb = new KOCalCheckButton( mw ); 321 cb = new KOCalCheckButton( mw );
320 mainLayout->addWidget( cb,row,++iii );mROB.append( cb ); 322 mainLayout->addWidget( cb,row,++iii );mROB.append( cb );
321 cb->setChecked( kkf->isReadOnly ); 323 cb->setChecked( kkf->isReadOnly );
322 cb->setNum( kkf->mCalNumber ); 324 cb->setNum( kkf->mCalNumber );