summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
authorzautrix <zautrix>2005-03-19 19:11:16 (UTC)
committer zautrix <zautrix>2005-03-19 19:11:16 (UTC)
commit414b033f0c39b5122fd4899408a7045a6c29d7c9 (patch) (unidiff)
tree802d40e62d1b55e9b3a2daca2ba74fc47af15137 /korganizer/calendarview.cpp
parent0aa5a7dce6ac1224395f7cb3fae488ba566f0e38 (diff)
downloadkdepimpi-414b033f0c39b5122fd4899408a7045a6c29d7c9.zip
kdepimpi-414b033f0c39b5122fd4899408a7045a6c29d7c9.tar.gz
kdepimpi-414b033f0c39b5122fd4899408a7045a6c29d7c9.tar.bz2
dnc
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp72
1 files changed, 45 insertions, 27 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 6eaac1c..00285a5 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -107,6 +107,7 @@
107#include "kodialogmanager.h" 107#include "kodialogmanager.h"
108#include "outgoingdialog.h" 108#include "outgoingdialog.h"
109#include "incomingdialog.h" 109#include "incomingdialog.h"
110#include "datenavigatorcontainer.h"
110#include "statusdialog.h" 111#include "statusdialog.h"
111#include "kdatenavigator.h" 112#include "kdatenavigator.h"
112#include "kotodoview.h" 113#include "kotodoview.h"
@@ -267,8 +268,9 @@ void CalendarView::init()
267 "CalendarView::LeftFrame"); 268 "CalendarView::LeftFrame");
268 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); 269 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize);
269 270
270 mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE, 271 mDateNavigator = new DateNavigatorContainer( mLeftSplitter,
271 "CalendarView::DateNavigator", QDate::currentDate() ); 272 "CalendarView::DateNavigator" );
273
272 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); 274 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize);
273 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); 275 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2");
274 mTodoList->setNavigator( mNavigator ); 276 mTodoList->setNavigator( mNavigator );
@@ -295,27 +297,35 @@ void CalendarView::init()
295 mLeftFrame = mLeftSplitter; 297 mLeftFrame = mLeftSplitter;
296#else 298#else
297 QWidget *mainBox = new QWidget( this ); 299 QWidget *mainBox = new QWidget( this );
298 QWidget *leftFrame = new QWidget( mainBox ); 300 //QWidget *leftFrame = new QWidget( mainBox );
299
300 QBoxLayout * mainBoxLayout; 301 QBoxLayout * mainBoxLayout;
301 QBoxLayout * leftFrameLayout;
302 if ( KOPrefs::instance()->mVerticalScreen ) { 302 if ( KOPrefs::instance()->mVerticalScreen ) {
303 mainBoxLayout = new QVBoxLayout(mainBox); 303 mainBoxLayout = new QVBoxLayout(mainBox);
304 leftFrameLayout = new QHBoxLayout(leftFrame ); 304 //leftFrameLayout = new QHBoxLayout(leftFrame );
305 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mainBox);;
306 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left );
305 } else { 307 } else {
306 mainBoxLayout = new QHBoxLayout(mainBox); 308 mainBoxLayout = new QHBoxLayout(mainBox);
307 leftFrameLayout = new QVBoxLayout(leftFrame ); 309 //leftFrameLayout = new QVBoxLayout(leftFrame );
310 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mainBox);;
311 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
308 } 312 }
313 //QBoxLayout * leftFrameLayout;
309 topLayout->addWidget( mainBox ); 314 topLayout->addWidget( mainBox );
310 mainBoxLayout->addWidget (leftFrame); 315 mainBoxLayout->addWidget (mLeftFrame);
311 mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE, 316 mDateNavigator = new DateNavigatorContainer( mLeftFrame,
317 "CalendarView::DateNavigator" );
318#if 0
319 // FIXME
320 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
312 "CalendarView::DateNavigator", QDate::currentDate()); 321 "CalendarView::DateNavigator", QDate::currentDate());
322#endif
313 // mDateNavigator->blockSignals( true ); 323 // mDateNavigator->blockSignals( true );
314 leftFrameLayout->addWidget( mDateNavigator ); 324 //leftFrameLayout->addWidget( mDateNavigator );
315 mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); 325 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
316 mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall"); 326 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
317 mTodoList->setNavigator( mNavigator ); 327 mTodoList->setNavigator( mNavigator );
318 328#if 0
319 if ( QApplication::desktop()->width() < 480 ) { 329 if ( QApplication::desktop()->width() < 480 ) {
320 leftFrameLayout->addWidget(mFilterView); 330 leftFrameLayout->addWidget(mFilterView);
321 leftFrameLayout->addWidget(mTodoList, 2 ); 331 leftFrameLayout->addWidget(mTodoList, 2 );
@@ -324,6 +334,7 @@ void CalendarView::init()
324 leftFrameLayout->addWidget(mTodoList,2 ); 334 leftFrameLayout->addWidget(mTodoList,2 );
325 leftFrameLayout->addWidget(mFilterView ); 335 leftFrameLayout->addWidget(mFilterView );
326 } 336 }
337#endif
327 mFilterView->hide(); 338 mFilterView->hide();
328 QWidget *rightBox = new QWidget( mainBox ); 339 QWidget *rightBox = new QWidget( mainBox );
329 mainBoxLayout->addWidget ( rightBox, 10 ); 340 mainBoxLayout->addWidget ( rightBox, 10 );
@@ -331,16 +342,19 @@ void CalendarView::init()
331 mRightFrame = new QWidgetStack( rightBox ); 342 mRightFrame = new QWidgetStack( rightBox );
332 rightLayout->addWidget( mRightFrame, 10 ); 343 rightLayout->addWidget( mRightFrame, 10 );
333 344
334 mLeftFrame = leftFrame; 345 //mLeftFrame = (QWidget *)leftFrame;
335 if ( KOPrefs::instance()->mVerticalScreen ) { 346 if ( KOPrefs::instance()->mVerticalScreen ) {
336 mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 347 mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
337 leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 348 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
349 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
350 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
338 } else { 351 } else {
339 mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 352 mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
340 leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 353 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
354 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
341 } 355 }
342 if ( !KOPrefs::instance()->mShowDateNavigator) 356 if ( !KOPrefs::instance()->mShowDateNavigator)
343 mDateNavigator->hide(); 357 mLeftFrame->toggle();
344 //qDebug("Calendarview Size %d %d ", width(), height()); 358 //qDebug("Calendarview Size %d %d ", width(), height());
345#endif 359#endif
346 360
@@ -372,11 +386,11 @@ void CalendarView::init()
372 386
373 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 387 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
374 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 388 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
375 389#if 0
376 connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ), 390 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ),
377 SLOT( eventAdded( Event *) ) ); 391 SLOT( incidenceAdded( Incidence *) ) );
378 392#endif
379 connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); 393 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
380 394
381 connect( this, SIGNAL( configChanged() ), 395 connect( this, SIGNAL( configChanged() ),
382 mDateNavigator, SLOT( updateConfig() ) ); 396 mDateNavigator, SLOT( updateConfig() ) );
@@ -467,7 +481,7 @@ void CalendarView::init()
467 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 481 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
468 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 482 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
469#endif 483#endif
470 484 mDateNavigator->setCalendar( mCalendar );
471} 485}
472 486
473 487
@@ -3685,7 +3699,7 @@ QWidgetStack *CalendarView::viewStack()
3685 3699
3686QWidget *CalendarView::leftFrame() 3700QWidget *CalendarView::leftFrame()
3687{ 3701{
3688 return mLeftFrame; 3702 return ( QWidget *)mLeftFrame;
3689} 3703}
3690 3704
3691DateNavigator *CalendarView::dateNavigator() 3705DateNavigator *CalendarView::dateNavigator()
@@ -3695,15 +3709,19 @@ DateNavigator *CalendarView::dateNavigator()
3695 3709
3696KDateNavigator* CalendarView::dateNavigatorWidget() 3710KDateNavigator* CalendarView::dateNavigatorWidget()
3697{ 3711{
3698 return mDateNavigator; 3712 return mDateNavigator->navigatorView();
3699} 3713}
3700void CalendarView::toggleDateNavigatorWidget() 3714void CalendarView::toggleDateNavigatorWidget()
3701{ 3715{
3702 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ; 3716 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ;
3717 mLeftFrame->toggle();
3718 // FIXME mShowDateNavigator is not the toggle state of mLeftFrame
3719#if 0
3703 if (!KOPrefs::instance()->mShowDateNavigator ) 3720 if (!KOPrefs::instance()->mShowDateNavigator )
3704 mDateNavigator->hide(); 3721 mDateNavigator->hide();
3705 else 3722 else
3706 mDateNavigator->show(); 3723 mDateNavigator->show();
3724#endif
3707} 3725}
3708void CalendarView::addView(KOrg::BaseView *view) 3726void CalendarView::addView(KOrg::BaseView *view)
3709{ 3727{