summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-25 14:48:56 (UTC)
committer zautrix <zautrix>2005-06-25 14:48:56 (UTC)
commit490736d9f921a4cf2b094ae76971b31a6b145544 (patch) (unidiff)
tree880406a06bfcf8b5042a7e04b402e577839619cc
parent70e025b560e0060804610c182d3b04a6e6a63b70 (diff)
downloadkdepimpi-490736d9f921a4cf2b094ae76971b31a6b145544.zip
kdepimpi-490736d9f921a4cf2b094ae76971b31a6b145544.tar.gz
kdepimpi-490736d9f921a4cf2b094ae76971b31a6b145544.tar.bz2
fixxxxx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kofilterview.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index 9709324..a8a3052 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -159,52 +159,54 @@ void KOCalEditView::selectStdCal( int id, bool b )
159 it = mStdandardB.next(); 159 it = mStdandardB.next();
160 } 160 }
161 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 161 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
162 while ( kkf ) { 162 while ( kkf ) {
163 kkf->isStandard = false; 163 kkf->isStandard = false;
164 kkf = KOPrefs::instance()->mCalendars.next(); 164 kkf = KOPrefs::instance()->mCalendars.next();
165 } 165 }
166 KOPrefs::instance()->getCalendar( id )->isStandard = true; 166 KOPrefs::instance()->getCalendar( id )->isStandard = true;
167 emit setCalendarDefault ( id ); 167 emit setCalendarDefault ( id );
168} 168}
169 169
170void KOCalEditView::selectCalAlarm(int id ,bool b ) 170void KOCalEditView::selectCalAlarm(int id ,bool b )
171{ 171{
172 KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b; 172 KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b;
173 emit alarmEnabled ( id , b ); 173 emit alarmEnabled ( id , b );
174 emit needsUpdate(); 174 emit needsUpdate();
175} 175}
176void KOCalEditView::selectReadOnly(int id ,bool b ) 176void KOCalEditView::selectReadOnly(int id ,bool b )
177{ 177{
178 KOPrefs::instance()->getCalendar( id )->isReadOnly = b; 178 KOPrefs::instance()->getCalendar( id )->isReadOnly = b;
179 emit calendarReadonly ( id , b ); 179 emit calendarReadonly ( id , b );
180 if ( KOPrefs::instance()->getCalendar( id )->isStandard && b && id > 1 ) { 180 if ( KOPrefs::instance()->getCalendar( id )->isStandard && b && id > 1 ) {
181 KOPrefs::instance()->getCalendar( id )->isStandard = false; 181 KOPrefs::instance()->getCalendar( id )->isStandard = false;
182 KOPrefs::instance()->getCalendar( 1 )->isStandard = true; 182 KOPrefs::instance()->getCalendar( 1 )->isStandard = true;
183 mStdandardB.at(0)->setChecked( true );
184 mStdandardB.at(id-1)->setChecked( false );
183 emit setCalendarDefault ( 1 ); 185 emit setCalendarDefault ( 1 );
184 } 186 }
187 mStdandardB.at(id-1)->setEnabled( !b );
185 emit needsUpdate(); 188 emit needsUpdate();
186 QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
187 189
188} 190}
189void KOCalEditView::setColor( const QColor& c, int id ) 191void KOCalEditView::setColor( const QColor& c, int id )
190{ 192{
191 KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; 193 KOPrefs::instance()->getCalendar( id )->mDefaultColor = c;
192 emit needsUpdate(); 194 emit needsUpdate();
193} 195}
194void KOCalEditView::deleteCal( int id ) 196void KOCalEditView::deleteCal( int id )
195{ 197{
196 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); 198 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id );
197 QString name = kkf->mName; 199 QString name = kkf->mName;
198 QString file = KGlobal::formatMessage ( kkf->mFileName ,0 ); 200 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; 201 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 ) 202 if ( kkf->isStandard )
201 selectStdCal( 1, true ); 203 selectStdCal( 1, true );
202 emit removeCalendar ( id ); 204 emit removeCalendar ( id );
203 KOPrefs::instance()->mCalendars.remove ( kkf ); 205 KOPrefs::instance()->mCalendars.remove ( kkf );
204 emit needsUpdate(); 206 emit needsUpdate();
205 QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); 207 QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
206} 208}
207void KOCalEditView::infoCal( int id ) 209void KOCalEditView::infoCal( int id )
208{ 210{
209 QString name = KOPrefs::instance()->getCalendar( id )->mName; 211 QString name = KOPrefs::instance()->getCalendar( id )->mName;
210 QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 ); 212 QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 );
@@ -258,57 +260,48 @@ void KOCalEditView::readConfig()
258 mainLayout->addWidget( addBut,0,++ii ); 260 mainLayout->addWidget( addBut,0,++ii );
259 addBut->setPixmap ( SmallIcon("bell")); 261 addBut->setPixmap ( SmallIcon("bell"));
260 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); 262 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm()));
261 addBut->setMaximumWidth( addBut->sizeHint().height() ); 263 addBut->setMaximumWidth( addBut->sizeHint().height() );
262 264
263 addBut = new QPushButton ( mw ); 265 addBut = new QPushButton ( mw );
264 addBut->setFocusPolicy(NoFocus); 266 addBut->setFocusPolicy(NoFocus);
265 mainLayout->addWidget( addBut,0,++ii ); 267 mainLayout->addWidget( addBut,0,++ii );
266 addBut->setPixmap ( SmallIcon("pencil")); 268 addBut->setPixmap ( SmallIcon("pencil"));
267 connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); 269 connect(addBut,SIGNAL(clicked()),SLOT(disableRO()));
268 addBut->setMaximumWidth( addBut->sizeHint().height() ); 270 addBut->setMaximumWidth( addBut->sizeHint().height() );
269 lab = new QLabel ( "", mw ); 271 lab = new QLabel ( "", mw );
270 mainLayout->addWidget( lab,0,++ii ); 272 mainLayout->addWidget( lab,0,++ii );
271 273
272 addBut = new QPushButton ( mw ); 274 addBut = new QPushButton ( mw );
273 addBut->setFocusPolicy(NoFocus); 275 addBut->setFocusPolicy(NoFocus);
274 mainLayout->addWidget( addBut,0,++ii ); 276 mainLayout->addWidget( addBut,0,++ii );
275 addBut->setPixmap ( SmallIcon("plus")); 277 addBut->setPixmap ( SmallIcon("plus"));
276 connect(addBut,SIGNAL(clicked()),SLOT(addCal())); 278 connect(addBut,SIGNAL(clicked()),SLOT(addCal()));
277 279
278 lab = new QLabel ( " ", mw ); 280 lab = new QLabel ( " ", mw );
279 mainLayout->addWidget( lab,0,++ii ); 281 mainLayout->addWidget( lab,0,++ii );
280 282
281 283
282#if 0
283 addBut = new QPushButton ( mw );
284 mainLayout->addWidget( addBut,0,6 );
285 addBut->setPixmap ( SmallIcon("minus"));
286 connect(addBut,SIGNAL(clicked()),SLOT(deleteAll()));
287 addBut->setMaximumWidth( addBut->sizeHint().height() );
288#endif
289
290
291 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 284 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
292 int row = 1; 285 int row = 1;
293 while ( kkf ) { 286 while ( kkf ) {
294 int iii = 0; 287 int iii = 0;
295 KOCalRadioButton* rb = new KOCalRadioButton( mw ); 288 KOCalRadioButton* rb = new KOCalRadioButton( mw );
296 mainLayout->addWidget( rb,row,0 );mStdandardB.append( rb ); 289 mainLayout->addWidget( rb,row,0 );mStdandardB.append( rb );
297 rb->setChecked( kkf->isStandard ); 290 rb->setChecked( kkf->isStandard );
298 rb->setNum( kkf->mCalNumber ); 291 rb->setNum( kkf->mCalNumber );
299 connect (rb, SIGNAL (selectNum(int,bool)), SLOT ( selectStdCal(int,bool) ) ); 292 connect (rb, SIGNAL (selectNum(int,bool)), SLOT ( selectStdCal(int,bool) ) );
300 if ( kkf->mErrorOnLoad || kkf->isReadOnly ) 293 if ( kkf->mErrorOnLoad || kkf->isReadOnly )
301 rb->setEnabled( false ); 294 rb->setEnabled( false );
302 KOCalCheckButton* cb = new KOCalCheckButton( mw ); 295 KOCalCheckButton* cb = new KOCalCheckButton( mw );
303 mainLayout->addWidget( cb,row,++iii );mEnabledB.append( cb ); 296 mainLayout->addWidget( cb,row,++iii );mEnabledB.append( cb );
304 cb->setChecked( kkf->isEnabled ); 297 cb->setChecked( kkf->isEnabled );
305 cb->setNum( kkf->mCalNumber ); 298 cb->setNum( kkf->mCalNumber );
306 if ( kkf->mErrorOnLoad ) 299 if ( kkf->mErrorOnLoad )
307 cb->setEnabled( false ); 300 cb->setEnabled( false );
308 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCal(int,bool) ) ); 301 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCal(int,bool) ) );
309 KOCalButton* name = new KOCalButton( mw ); 302 KOCalButton* name = new KOCalButton( mw );
310 name->setNum( kkf->mCalNumber ); 303 name->setNum( kkf->mCalNumber );
311 name->setText( kkf->mName ); 304 name->setText( kkf->mName );
312 mainLayout->addWidget( name,row,++iii ); 305 mainLayout->addWidget( name,row,++iii );
313 connect (name, SIGNAL (selectNum(int)), SLOT ( infoCal(int) ) ); 306 connect (name, SIGNAL (selectNum(int)), SLOT ( infoCal(int) ) );
314 //lab = new QLabel (" ", mw ); 307 //lab = new QLabel (" ", mw );