summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp16
-rw-r--r--korganizer/calendarview.h1
-rw-r--r--korganizer/kofilterview.cpp6
-rw-r--r--korganizer/kofilterview.h1
4 files changed, 22 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index e31a6e1..28b17a5 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -456,48 +456,50 @@ void CalendarView::init()
456#endif 456#endif
457 //mainBoxLayout->addWidget (mLeftFrame); 457 //mainBoxLayout->addWidget (mLeftFrame);
458 mDateNavigator = new DateNavigatorContainer( mLeftFrame, 458 mDateNavigator = new DateNavigatorContainer( mLeftFrame,
459 "CalendarView::DateNavigator" ); 459 "CalendarView::DateNavigator" );
460#if 0 460#if 0
461 // FIXME 461 // FIXME
462 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, 462 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
463 "CalendarView::DateNavigator", QDate::currentDate()); 463 "CalendarView::DateNavigator", QDate::currentDate());
464#endif 464#endif
465 // mDateNavigator->blockSignals( true ); 465 // mDateNavigator->blockSignals( true );
466 //leftFrameLayout->addWidget( mDateNavigator ); 466 //leftFrameLayout->addWidget( mDateNavigator );
467 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); 467 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
468 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); 468 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
469 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); 469 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
470 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); 470 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) );
471 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); 471 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) );
472 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) ); 472 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) );
473 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); 473 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) );
474 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); 474 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) );
475 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); 475 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) );
476 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); 476 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) );
477 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); 477 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) );
478 connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); 478 connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() ));
479 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); 479 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) );
480 connect( mCalEditView, SIGNAL( requestCalendarInfo( int ) ),this, SLOT( displayCalendarInfo( int ) ) );
481
480 482
481 mTodoList->setNavigator( mNavigator ); 483 mTodoList->setNavigator( mNavigator );
482#if 0 484#if 0
483 if ( QApplication::desktop()->width() < 480 ) { 485 if ( QApplication::desktop()->width() < 480 ) {
484 leftFrameLayout->addWidget(mFilterView); 486 leftFrameLayout->addWidget(mFilterView);
485 leftFrameLayout->addWidget(mTodoList, 2 ); 487 leftFrameLayout->addWidget(mTodoList, 2 );
486 488
487 } else { 489 } else {
488 leftFrameLayout->addWidget(mTodoList,2 ); 490 leftFrameLayout->addWidget(mTodoList,2 );
489 leftFrameLayout->addWidget(mFilterView ); 491 leftFrameLayout->addWidget(mFilterView );
490 } 492 }
491#endif 493#endif
492 mFilterView->hide(); 494 mFilterView->hide();
493 mCalEditView->hide(); 495 mCalEditView->hide();
494 QWidget *rightBox = new QWidget( mMainFrame ); 496 QWidget *rightBox = new QWidget( mMainFrame );
495 //mainBoxLayout->addWidget ( rightBox, 10 ); 497 //mainBoxLayout->addWidget ( rightBox, 10 );
496 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 498 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
497 mRightFrame = new QWidgetStack( rightBox ); 499 mRightFrame = new QWidgetStack( rightBox );
498 rightLayout->addWidget( mRightFrame, 10 ); 500 rightLayout->addWidget( mRightFrame, 10 );
499 501
500 //mLeftFrame = (QWidget *)leftFrame; 502 //mLeftFrame = (QWidget *)leftFrame;
501 if ( KOPrefs::instance()->mVerticalScreen ) { 503 if ( KOPrefs::instance()->mVerticalScreen ) {
502 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); 504 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
503 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); 505 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
@@ -5137,24 +5139,38 @@ void CalendarView::showNextAlarms()
5137 else if ( hours == 1 ) 5139 else if ( hours == 1 )
5138 message += i18n("1 hour\n"); 5140 message += i18n("1 hour\n");
5139 if ( min > 1 ) 5141 if ( min > 1 )
5140 message += i18n("%1 minutes\n").arg( min ); 5142 message += i18n("%1 minutes\n").arg( min );
5141 else if ( min == 1 ) 5143 else if ( min == 1 )
5142 message += i18n("1 minute\n"); 5144 message += i18n("1 minute\n");
5143 if ( message.isEmpty() ) 5145 if ( message.isEmpty() )
5144 message = i18n("The next alarm is in\nless than one minute!"); 5146 message = i18n("The next alarm is in\nless than one minute!");
5145 else 5147 else
5146 message = i18n("The next alarm is in:\n") + message; 5148 message = i18n("The next alarm is in:\n") + message;
5147 message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; 5149 message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ;
5148 } else { 5150 } else {
5149 message = i18n("There is no next alarm."); 5151 message = i18n("There is no next alarm.");
5150 5152
5151 } 5153 }
5152#ifdef DESKTOP_VERSION 5154#ifdef DESKTOP_VERSION
5153 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 5155 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
5154 message += i18n("\nThe internal alarm notification is disabled!\n"); 5156 message += i18n("\nThe internal alarm notification is disabled!\n");
5155 message += i18n("Enable it in the settings menu, TAB alarm."); 5157 message += i18n("Enable it in the settings menu, TAB alarm.");
5156 } 5158 }
5157 5159
5158#endif 5160#endif
5159 KMessageBox::information( this, message); 5161 KMessageBox::information( this, message);
5160} 5162}
5163
5164void CalendarView::displayCalendarInfo( int id )
5165{
5166 int e, t,j;
5167 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id );
5168 QString name = kkf->mName;
5169 mCalendar->getIncidenceCount( id, e, t, j );
5170 QString file = KGlobal::formatMessage ( kkf->mFileName ,0 );
5171 QString mess = i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file);
5172 mess += i18n("<br>The calendar contains<br><b>%1 events<br>%2 todos<br>%3 journals</b>").arg( e ).arg( t ).arg( j );
5173 KMessageBox::information( this, mess );
5174
5175
5176}
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 8670832..0924f07 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -180,48 +180,49 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
180 /** Emitted, when a todoitem is selected or deselected. */ 180 /** Emitted, when a todoitem is selected or deselected. */
181 void todoSelected( bool ); 181 void todoSelected( bool );
182 182
183 /** 183 /**
184 Emitted, when clipboard content changes. Parameter indicates if paste 184 Emitted, when clipboard content changes. Parameter indicates if paste
185 is possible or not. 185 is possible or not.
186 */ 186 */
187 void pasteEnabled(bool); 187 void pasteEnabled(bool);
188 188
189 /** Emitted, when the number of incoming messages has changed. */ 189 /** Emitted, when the number of incoming messages has changed. */
190 void numIncomingChanged(int); 190 void numIncomingChanged(int);
191 191
192 /** Emitted, when the number of outgoing messages has changed. */ 192 /** Emitted, when the number of outgoing messages has changed. */
193 void numOutgoingChanged(int); 193 void numOutgoingChanged(int);
194 194
195 /** Send status message, which can e.g. be displayed in the status bar. */ 195 /** Send status message, which can e.g. be displayed in the status bar. */
196 void statusMessage(const QString &); 196 void statusMessage(const QString &);
197 197
198 void calendarViewExpanded( bool ); 198 void calendarViewExpanded( bool );
199 void updateSearchDialog(); 199 void updateSearchDialog();
200 void filtersUpdated(); 200 void filtersUpdated();
201 201
202 202
203 public slots: 203 public slots:
204 void displayCalendarInfo( int id );
204 void nextConflict( bool all, bool allday ); 205 void nextConflict( bool all, bool allday );
205 void conflictAll(); 206 void conflictAll();
206 void conflictAllday(); 207 void conflictAllday();
207 void conflictNotAll(); 208 void conflictNotAll();
208 void setCalReadOnly( int id, bool readO ); 209 void setCalReadOnly( int id, bool readO );
209 void checkAlarms(); 210 void checkAlarms();
210 void checkFiles(); 211 void checkFiles();
211 void slotprintSelInc(); 212 void slotprintSelInc();
212 void showNextAlarms(); 213 void showNextAlarms();
213 void showOpenError(); 214 void showOpenError();
214 void watchSavedFile(); 215 void watchSavedFile();
215 void recheckTimerAlarm(); 216 void recheckTimerAlarm();
216 void checkNextTimerAlarm(); 217 void checkNextTimerAlarm();
217 void addAlarm(const QDateTime &qdt, const QString &noti ); 218 void addAlarm(const QDateTime &qdt, const QString &noti );
218 void addSuspendAlarm(const QDateTime &qdt, const QString &noti ); 219 void addSuspendAlarm(const QDateTime &qdt, const QString &noti );
219 void removeAlarm(const QDateTime &qdt, const QString &noti ); 220 void removeAlarm(const QDateTime &qdt, const QString &noti );
220 221
221 /** options dialog made a changed to the configuration. we catch this 222 /** options dialog made a changed to the configuration. we catch this
222 * and notify all widgets which need to update their configuration. */ 223 * and notify all widgets which need to update their configuration. */
223 void updateConfig(); 224 void updateConfig();
224 225
225 void insertBirthdays(const QString& uid, const QStringList& birthdayList, 226 void insertBirthdays(const QString& uid, const QStringList& birthdayList,
226 const QStringList& anniversaryList, const QStringList& realNameList, 227 const QStringList& anniversaryList, const QStringList& realNameList,
227 const QStringList& emailList, const QStringList& assembledNameList, 228 const QStringList& emailList, const QStringList& assembledNameList,
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index ef25fd0..ee9c9f6 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -209,50 +209,52 @@ 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}
221void KOCalEditView::infoCal( int id ) 221void 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}
236void KOCalEditView::readConfig() 238void 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 );
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h
index d534dbf..0dd423a 100644
--- a/korganizer/kofilterview.h
+++ b/korganizer/kofilterview.h
@@ -219,38 +219,39 @@ class KOCalEditView : public QScrollView
219 void addCal(); 219 void addCal();
220 void enableAll(); 220 void enableAll();
221 void enableAlarm(); 221 void enableAlarm();
222 void disableRO(); 222 void disableRO();
223 void deleteAll(); 223 void deleteAll();
224 void selectStdCal(int); 224 void selectStdCal(int);
225 void selectCal(int,bool ); 225 void selectCal(int,bool );
226 void selectCalAlarm(int,bool ); 226 void selectCalAlarm(int,bool );
227 void selectReadOnly(int,bool ); 227 void selectReadOnly(int,bool );
228 void setColor(const QColor &,int) ; 228 void setColor(const QColor &,int) ;
229 void deleteCal(int) ; 229 void deleteCal(int) ;
230 void infoCal(int) ; 230 void infoCal(int) ;
231 void readConfig(); 231 void readConfig();
232 void defaultInfo(); 232 void defaultInfo();
233 void findNewStandard(); 233 void findNewStandard();
234 signals: 234 signals:
235 void alarmEnabled ( int cal, bool enable ); 235 void alarmEnabled ( int cal, bool enable );
236 void calendarEnabled ( int cal, bool enable ); 236 void calendarEnabled ( int cal, bool enable );
237 void calendarReadonly ( int cal, bool readonly ); 237 void calendarReadonly ( int cal, bool readonly );
238 void setCalendarDefault ( int cal ); 238 void setCalendarDefault ( int cal );
239 void removeCalendar ( int cal ); 239 void removeCalendar ( int cal );
240 void calendarAdded( int ); 240 void calendarAdded( int );
241 void needsUpdate(); 241 void needsUpdate();
242 void checkCalendar(); 242 void checkCalendar();
243 void requestCalendarInfo( int id );
243 244
244 private: 245 private:
245 QWidget *mw; 246 QWidget *mw;
246 void toggleList ( QPtrList<KOCalCheckButton> , bool b = true ); 247 void toggleList ( QPtrList<KOCalCheckButton> , bool b = true );
247 QPtrList<KOCalRadioButton> mStdandardB; 248 QPtrList<KOCalRadioButton> mStdandardB;
248 QPtrList<KOCalCheckButton> mEnabledB; 249 QPtrList<KOCalCheckButton> mEnabledB;
249 QPtrList<KOCalCheckButton> mAlarmB; 250 QPtrList<KOCalCheckButton> mAlarmB;
250 QPtrList<KOCalCheckButton> mROB; 251 QPtrList<KOCalCheckButton> mROB;
251 QGridLayout* mainLayout; 252 QGridLayout* mainLayout;
252}; 253};
253 254
254 255
255 256
256#endif // KOFILTERVIEW_H 257#endif // KOFILTERVIEW_H