author | zautrix <zautrix> | 2005-01-26 23:05:26 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-26 23:05:26 (UTC) |
commit | 15351333eff09beadb6e691e9f0aab2aaf0a95a0 (patch) (unidiff) | |
tree | 443fba1e36ef3a2549b531fe600567d9e1232d7c /korganizer | |
parent | 96fc3903cf690957d0242d7aa2894bd64800edcc (diff) | |
download | kdepimpi-15351333eff09beadb6e691e9f0aab2aaf0a95a0.zip kdepimpi-15351333eff09beadb6e691e9f0aab2aaf0a95a0.tar.gz kdepimpi-15351333eff09beadb6e691e9f0aab2aaf0a95a0.tar.bz2 |
fixes
-rw-r--r-- | korganizer/calendarview.cpp | 4 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 37 | ||||
-rw-r--r-- | korganizer/koagendaview.h | 7 | ||||
-rw-r--r-- | korganizer/kodialogmanager.cpp | 7 |
4 files changed, 51 insertions, 4 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 06454c2..1d5a57e 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2510,30 +2510,30 @@ void CalendarView::showEventEditor() | |||
2510 | #else | 2510 | #else |
2511 | if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { | 2511 | if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { |
2512 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 2512 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
2513 | qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); | 2513 | qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); |
2514 | delete mEventEditor; | 2514 | delete mEventEditor; |
2515 | mEventEditor = mDialogManager->getEventEditor(); | 2515 | mEventEditor = mDialogManager->getEventEditor(); |
2516 | topLevelWidget()->setCaption( i18n("") ); | ||
2516 | } | 2517 | } |
2517 | mEventEditor->showMaximized(); | 2518 | mEventEditor->showMaximized(); |
2518 | topLevelWidget()->setCaption( i18n("") ); | ||
2519 | #endif | 2519 | #endif |
2520 | } | 2520 | } |
2521 | void CalendarView::showTodoEditor() | 2521 | void CalendarView::showTodoEditor() |
2522 | { | 2522 | { |
2523 | #ifdef DESKTOP_VERSION | 2523 | #ifdef DESKTOP_VERSION |
2524 | mTodoEditor->show(); | 2524 | mTodoEditor->show(); |
2525 | #else | 2525 | #else |
2526 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { | 2526 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { |
2527 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 2527 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
2528 | qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); | 2528 | qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); |
2529 | delete mTodoEditor; | 2529 | delete mTodoEditor; |
2530 | mTodoEditor = mDialogManager->getTodoEditor(); | 2530 | mTodoEditor = mDialogManager->getTodoEditor(); |
2531 | topLevelWidget()->setCaption( i18n("") ); | ||
2531 | } | 2532 | } |
2532 | mTodoEditor->showMaximized(); | 2533 | mTodoEditor->showMaximized(); |
2533 | topLevelWidget()->setCaption( i18n("") ); | ||
2534 | #endif | 2534 | #endif |
2535 | } | 2535 | } |
2536 | 2536 | ||
2537 | void CalendarView::cloneIncidence() | 2537 | void CalendarView::cloneIncidence() |
2538 | { | 2538 | { |
2539 | Incidence *incidence = currentSelection(); | 2539 | Incidence *incidence = currentSelection(); |
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 6428757..b5596d9 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -198,13 +198,48 @@ void TimeLabels::positionChanged() | |||
198 | 198 | ||
199 | /** */ | 199 | /** */ |
200 | void TimeLabels::setAgenda(KOAgenda* agenda) | 200 | void TimeLabels::setAgenda(KOAgenda* agenda) |
201 | { | 201 | { |
202 | mAgenda = agenda; | 202 | mAgenda = agenda; |
203 | } | 203 | } |
204 | |||
205 | void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) | ||
206 | { | ||
207 | mMouseDownY = e->pos().y(); | ||
208 | } | ||
209 | |||
210 | void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e ) | ||
211 | { | ||
212 | int diff = mMouseDownY - e->pos().y(); | ||
213 | if ( diff < 10 && diff > -10 ) | ||
214 | return; | ||
215 | int tSize = KOPrefs::instance()->mHourSize + (diff/10) ; | ||
216 | if ( tSize < 4 ) | ||
217 | tSize = 4; | ||
218 | if ( tSize > 18 ) | ||
219 | tSize = 18; | ||
220 | tSize = (tSize-2)/2; | ||
221 | topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize)); | ||
204 | 222 | ||
223 | } | ||
224 | void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e ) | ||
225 | { | ||
226 | int diff = mMouseDownY - e->pos().y(); | ||
227 | if ( diff < 10 && diff > -10 ) | ||
228 | return; | ||
229 | int tSize = KOPrefs::instance()->mHourSize + (diff/10); | ||
230 | if ( tSize < 4 ) | ||
231 | tSize = 4; | ||
232 | if ( tSize > 18 ) | ||
233 | tSize = 18; | ||
234 | tSize = (tSize/2)*2; | ||
235 | if ( tSize == KOPrefs::instance()->mHourSize ) | ||
236 | return; | ||
237 | KOPrefs::instance()->mHourSize = tSize; | ||
238 | emit scaleChanged(); | ||
239 | } | ||
205 | 240 | ||
206 | /** This is called in response to repaint() */ | 241 | /** This is called in response to repaint() */ |
207 | void TimeLabels::paintEvent(QPaintEvent*) | 242 | void TimeLabels::paintEvent(QPaintEvent*) |
208 | { | 243 | { |
209 | 244 | ||
210 | // kdDebug() << "paintevent..." << endl; | 245 | // kdDebug() << "paintevent..." << endl; |
@@ -407,12 +442,14 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : | |||
407 | QWidget *dummyAgendaRight = new QWidget(agendaFrame); | 442 | QWidget *dummyAgendaRight = new QWidget(agendaFrame); |
408 | agendaLayout->addWidget(dummyAgendaRight,0,2); | 443 | agendaLayout->addWidget(dummyAgendaRight,0,2); |
409 | 444 | ||
410 | // Create time labels | 445 | // Create time labels |
411 | mTimeLabels = new TimeLabels(24,agendaFrame); | 446 | mTimeLabels = new TimeLabels(24,agendaFrame); |
412 | agendaLayout->addWidget(mTimeLabels,1,0); | 447 | agendaLayout->addWidget(mTimeLabels,1,0); |
448 | connect(mTimeLabels,SIGNAL( scaleChanged()), | ||
449 | this,SLOT(updateConfig())); | ||
413 | 450 | ||
414 | // Create agenda | 451 | // Create agenda |
415 | mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); | 452 | mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); |
416 | agendaLayout->addMultiCellWidget(mAgenda,1,1,1,2); | 453 | agendaLayout->addMultiCellWidget(mAgenda,1,1,1,2); |
417 | agendaLayout->setColStretch(1,1); | 454 | agendaLayout->setColStretch(1,1); |
418 | mAgenda->setFocusPolicy(NoFocus); | 455 | mAgenda->setFocusPolicy(NoFocus); |
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index 0079253..221b0ea 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h | |||
@@ -60,21 +60,26 @@ class TimeLabels : public QScrollView { | |||
60 | 60 | ||
61 | /** */ | 61 | /** */ |
62 | void setAgenda(KOAgenda* agenda); | 62 | void setAgenda(KOAgenda* agenda); |
63 | 63 | ||
64 | /** */ | 64 | /** */ |
65 | virtual void paintEvent(QPaintEvent* e); | 65 | virtual void paintEvent(QPaintEvent* e); |
66 | void contentsMousePressEvent ( QMouseEvent * ) ; | ||
67 | void contentsMouseReleaseEvent ( QMouseEvent * ); | ||
68 | void contentsMouseMoveEvent ( QMouseEvent * ); | ||
66 | 69 | ||
67 | public slots: | 70 | public slots: |
68 | /** update time label positions */ | 71 | /** update time label positions */ |
69 | void positionChanged(); | 72 | void positionChanged(); |
70 | 73 | signals: | |
74 | void scaleChanged(); | ||
71 | protected: | 75 | protected: |
72 | void drawContents(QPainter *p,int cx, int cy, int cw, int ch); | 76 | void drawContents(QPainter *p,int cx, int cy, int cw, int ch); |
73 | 77 | ||
74 | private: | 78 | private: |
79 | int mMouseDownY; | ||
75 | int mRows; | 80 | int mRows; |
76 | int mCellHeight; | 81 | int mCellHeight; |
77 | 82 | ||
78 | /** */ | 83 | /** */ |
79 | KOAgenda* mAgenda; | 84 | KOAgenda* mAgenda; |
80 | }; | 85 | }; |
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index c99c0cb..41a4dc1 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp | |||
@@ -290,12 +290,15 @@ KOEventEditor *KODialogManager::getEventEditor() | |||
290 | // mCategoryEditDialog,SLOT(show())); | 290 | // mCategoryEditDialog,SLOT(show())); |
291 | connect(eventEditor,SIGNAL(dialogClose(Incidence*)), | 291 | connect(eventEditor,SIGNAL(dialogClose(Incidence*)), |
292 | mMainView,SLOT(dialogClosing(Incidence*))); | 292 | mMainView,SLOT(dialogClosing(Incidence*))); |
293 | 293 | ||
294 | //connect(mMainView,SIGNAL(closingDown()),eventEditor,SLOT(reject())); | 294 | //connect(mMainView,SIGNAL(closingDown()),eventEditor,SLOT(reject())); |
295 | 295 | ||
296 | #ifndef DESKTOP_VERSION | ||
297 | eventEditor->resize( QApplication::desktop()->width() -20, 100 ); | ||
298 | #endif | ||
296 | return eventEditor; | 299 | return eventEditor; |
297 | } | 300 | } |
298 | 301 | ||
299 | KOTodoEditor *KODialogManager::getTodoEditor() | 302 | KOTodoEditor *KODialogManager::getTodoEditor() |
300 | { | 303 | { |
301 | KOTodoEditor *todoEditor = new KOTodoEditor( mMainView->calendar(), | 304 | KOTodoEditor *todoEditor = new KOTodoEditor( mMainView->calendar(), |
@@ -317,13 +320,15 @@ KOTodoEditor *KODialogManager::getTodoEditor() | |||
317 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 320 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
318 | connect( todoEditor, SIGNAL( showAgendaView( bool)), | 321 | connect( todoEditor, SIGNAL( showAgendaView( bool)), |
319 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); | 322 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); |
320 | // connect(todoEditor,SIGNAL(deleteAttendee(Incidence *)), | 323 | // connect(todoEditor,SIGNAL(deleteAttendee(Incidence *)), |
321 | // mMainView,SLOT(schedule_cancel(Incidence *))); | 324 | // mMainView,SLOT(schedule_cancel(Incidence *))); |
322 | //connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject())); | 325 | //connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject())); |
323 | 326 | #ifndef DESKTOP_VERSION | |
327 | todoEditor->resize( QApplication::desktop()->width() -20, 100 ); | ||
328 | #endif | ||
324 | return todoEditor; | 329 | return todoEditor; |
325 | } | 330 | } |
326 | 331 | ||
327 | void KODialogManager::updateSearchDialog() | 332 | void KODialogManager::updateSearchDialog() |
328 | { | 333 | { |
329 | if (mSearchDialog) mSearchDialog->updateView(); | 334 | if (mSearchDialog) mSearchDialog->updateView(); |