-rw-r--r-- | korganizer/kofilterview.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index ef25fd0..ee9c9f6 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp | |||
@@ -185,98 +185,100 @@ void KOCalEditView::findNewStandard() | |||
185 | { | 185 | { |
186 | bool found = false; | 186 | bool found = false; |
187 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | 187 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); |
188 | while ( kkf ) { | 188 | while ( kkf ) { |
189 | if (!kkf->isReadOnly && !kkf->mErrorOnLoad ) { | 189 | if (!kkf->isReadOnly && !kkf->mErrorOnLoad ) { |
190 | found = true; | 190 | found = true; |
191 | selectStdCal( kkf->mCalNumber ); | 191 | selectStdCal( kkf->mCalNumber ); |
192 | break; | 192 | break; |
193 | } | 193 | } |
194 | kkf = KOPrefs::instance()->mCalendars.next(); | 194 | kkf = KOPrefs::instance()->mCalendars.next(); |
195 | } | 195 | } |
196 | if ( !found ) { | 196 | if ( !found ) { |
197 | KMessageBox::error( this,i18n("\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n"), | 197 | KMessageBox::error( this,i18n("\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n"), |
198 | i18n("Houston, we have a problem!") ); | 198 | i18n("Houston, we have a problem!") ); |
199 | 199 | ||
200 | } | 200 | } |
201 | } | 201 | } |
202 | 202 | ||
203 | void KOCalEditView::setColor( const QColor& c, int id ) | 203 | void KOCalEditView::setColor( const QColor& c, int id ) |
204 | { | 204 | { |
205 | KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; | 205 | KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; |
206 | emit needsUpdate(); | 206 | emit needsUpdate(); |
207 | } | 207 | } |
208 | void KOCalEditView::deleteCal( int id ) | 208 | void KOCalEditView::deleteCal( int id ) |
209 | { | 209 | { |
210 | KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); | 210 | KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); |
211 | QString name = kkf->mName; | 211 | QString name = kkf->mName; |
212 | QString file = KGlobal::formatMessage ( kkf->mFileName ,0 ); | 212 | QString file = KGlobal::formatMessage ( kkf->mFileName ,0 ); |
213 | 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; | 213 | 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; |
214 | bool findnewstd = kkf->isStandard; | 214 | bool findnewstd = kkf->isStandard; |
215 | emit removeCalendar ( id ); | 215 | emit removeCalendar ( id ); |
216 | KOPrefs::instance()->mCalendars.remove ( kkf ); | 216 | KOPrefs::instance()->mCalendars.remove ( kkf ); |
217 | if ( findnewstd ) findNewStandard(); | 217 | if ( findnewstd ) findNewStandard(); |
218 | emit needsUpdate(); | 218 | emit needsUpdate(); |
219 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); | 219 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); |
220 | } | 220 | } |
221 | void KOCalEditView::infoCal( int id ) | 221 | void KOCalEditView::infoCal( int id ) |
222 | { | 222 | { |
223 | QString name = KOPrefs::instance()->getCalendar( id )->mName; | 223 | QString name = KOPrefs::instance()->getCalendar( id )->mName; |
224 | QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 ); | 224 | QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 ); |
225 | if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) { | 225 | if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) { |
226 | 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) ) ) { | 226 | 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) ) ) { |
227 | emit calendarAdded( id ); | 227 | emit calendarAdded( id ); |
228 | emit needsUpdate(); | 228 | emit needsUpdate(); |
229 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); | 229 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); |
230 | QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) ); | 230 | QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) ); |
231 | } | 231 | } |
232 | } | 232 | } |
233 | else | 233 | else { |
234 | KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) ); | 234 | emit requestCalendarInfo( id ); |
235 | |||
236 | } | ||
235 | } | 237 | } |
236 | void KOCalEditView::readConfig() | 238 | void KOCalEditView::readConfig() |
237 | { | 239 | { |
238 | 240 | ||
239 | mStdandardB.clear(); | 241 | mStdandardB.clear(); |
240 | mEnabledB.clear(); | 242 | mEnabledB.clear(); |
241 | mAlarmB.clear(); | 243 | mAlarmB.clear(); |
242 | mROB.clear(); | 244 | mROB.clear(); |
243 | 245 | ||
244 | if ( mw ) delete mw; | 246 | if ( mw ) delete mw; |
245 | mw = new QWidget ( viewport() ); | 247 | mw = new QWidget ( viewport() ); |
246 | addChild(mw); | 248 | addChild(mw); |
247 | int ii = 0; | 249 | int ii = 0; |
248 | mainLayout = new QGridLayout ( mw , 2, 8 ); | 250 | mainLayout = new QGridLayout ( mw , 2, 8 ); |
249 | mainLayout->setMargin( 2 ); | 251 | mainLayout->setMargin( 2 ); |
250 | mainLayout->setSpacing( 2 ); | 252 | mainLayout->setSpacing( 2 ); |
251 | QPushButton * addButT = new QPushButton ( mw ); | 253 | QPushButton * addButT = new QPushButton ( mw ); |
252 | addButT->setFocusPolicy(NoFocus); | 254 | addButT->setFocusPolicy(NoFocus); |
253 | mainLayout->addWidget( addButT,0,0 ); | 255 | mainLayout->addWidget( addButT,0,0 ); |
254 | addButT->setText( "D"); | 256 | addButT->setText( "D"); |
255 | connect(addButT,SIGNAL(clicked()),SLOT(defaultInfo())); | 257 | connect(addButT,SIGNAL(clicked()),SLOT(defaultInfo())); |
256 | QWhatsThis::add( addButT, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") ); | 258 | QWhatsThis::add( addButT, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") ); |
257 | //addBut->setPixmap ( SmallIcon("greenhook16")); | 259 | //addBut->setPixmap ( SmallIcon("greenhook16")); |
258 | QPushButton *addBut = new QPushButton ( mw ); | 260 | QPushButton *addBut = new QPushButton ( mw ); |
259 | addBut->setFocusPolicy(NoFocus); | 261 | addBut->setFocusPolicy(NoFocus); |
260 | mainLayout->addWidget( addBut,0,++ii ); | 262 | mainLayout->addWidget( addBut,0,++ii ); |
261 | addBut->setPixmap ( SmallIcon("eye")); | 263 | addBut->setPixmap ( SmallIcon("eye")); |
262 | QWhatsThis::add( addBut, i18n("In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.") ); | 264 | QWhatsThis::add( addBut, i18n("In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.") ); |
263 | connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); | 265 | connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); |
264 | int max = addBut->sizeHint().height(); | 266 | int max = addBut->sizeHint().height(); |
265 | addBut->setMaximumWidth( max ); | 267 | addBut->setMaximumWidth( max ); |
266 | addButT->setFixedSize( QSize( max, max ) ); | 268 | addButT->setFixedSize( QSize( max, max ) ); |
267 | QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw ); | 269 | QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw ); |
268 | mainLayout->addWidget( lab,0,++ii ); | 270 | mainLayout->addWidget( lab,0,++ii ); |
269 | QWhatsThis::add( lab, i18n("In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.") ); | 271 | QWhatsThis::add( lab, i18n("In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.") ); |
270 | //lab = new QLabel ( i18n(" "), mw ); | 272 | //lab = new QLabel ( i18n(" "), mw ); |
271 | //mainLayout->addWidget( lab,0,++ii ); | 273 | //mainLayout->addWidget( lab,0,++ii ); |
272 | //lab->setFixedWidth( 1 ); | 274 | //lab->setFixedWidth( 1 ); |
273 | addBut = new QPushButton ( mw ); | 275 | addBut = new QPushButton ( mw ); |
274 | addBut->setFocusPolicy(NoFocus); | 276 | addBut->setFocusPolicy(NoFocus); |
275 | mainLayout->addWidget( addBut,0,++ii ); | 277 | mainLayout->addWidget( addBut,0,++ii ); |
276 | addBut->setPixmap ( SmallIcon("bell")); | 278 | addBut->setPixmap ( SmallIcon("bell")); |
277 | QWhatsThis::add( addBut, i18n("In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as \"do not use\". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.") ); | 279 | QWhatsThis::add( addBut, i18n("In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as \"do not use\". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.") ); |
278 | connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); | 280 | connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); |
279 | addBut->setMaximumWidth( addBut->sizeHint().height() ); | 281 | addBut->setMaximumWidth( addBut->sizeHint().height() ); |
280 | 282 | ||
281 | addBut = new QPushButton ( mw ); | 283 | addBut = new QPushButton ( mw ); |
282 | addBut->setFocusPolicy(NoFocus); | 284 | addBut->setFocusPolicy(NoFocus); |