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) (side-by-side diff)
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
@@ -102,16 +102,17 @@
#include "publishdialog.h"
#include "kofilterview.h"
#include "koglobals.h"
#include "koviewmanager.h"
#include "koagendaview.h"
#include "kodialogmanager.h"
#include "outgoingdialog.h"
#include "incomingdialog.h"
+#include "datenavigatorcontainer.h"
#include "statusdialog.h"
#include "kdatenavigator.h"
#include "kotodoview.h"
#include "datenavigator.h"
#include "resourceview.h"
#include "navigatorbar.h"
#include "searchdialog.h"
#include "mainwindow.h"
@@ -262,18 +263,19 @@ void CalendarView::init()
// create the main layout frames.
mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner");
topLayout->addWidget(mPanner);
mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner,
"CalendarView::LeftFrame");
mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize);
- mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE,
- "CalendarView::DateNavigator", QDate::currentDate() );
+ mDateNavigator = new DateNavigatorContainer( mLeftSplitter,
+ "CalendarView::DateNavigator" );
+
mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize);
mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2");
mTodoList->setNavigator( mNavigator );
mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView");
#ifdef KORG_NORESOURCEVIEW
mResourceView = 0;
#else
@@ -290,62 +292,74 @@ void CalendarView::init()
QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
mRightFrame = new QWidgetStack( rightBox );
rightLayout->addWidget( mRightFrame, 1 );
mLeftFrame = mLeftSplitter;
#else
QWidget *mainBox = new QWidget( this );
- QWidget *leftFrame = new QWidget( mainBox );
-
+ //QWidget *leftFrame = new QWidget( mainBox );
QBoxLayout * mainBoxLayout;
- QBoxLayout * leftFrameLayout;
if ( KOPrefs::instance()->mVerticalScreen ) {
mainBoxLayout = new QVBoxLayout(mainBox);
- leftFrameLayout = new QHBoxLayout(leftFrame );
+ //leftFrameLayout = new QHBoxLayout(leftFrame );
+ mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mainBox);;
+ mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left );
} else {
mainBoxLayout = new QHBoxLayout(mainBox);
- leftFrameLayout = new QVBoxLayout(leftFrame );
+ //leftFrameLayout = new QVBoxLayout(leftFrame );
+ mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mainBox);;
+ mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
}
+ //QBoxLayout * leftFrameLayout;
topLayout->addWidget( mainBox );
- mainBoxLayout->addWidget (leftFrame);
- mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE,
+ mainBoxLayout->addWidget (mLeftFrame);
+ mDateNavigator = new DateNavigatorContainer( mLeftFrame,
+ "CalendarView::DateNavigator" );
+#if 0
+ // FIXME
+ mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
"CalendarView::DateNavigator", QDate::currentDate());
+#endif
// mDateNavigator->blockSignals( true );
- leftFrameLayout->addWidget( mDateNavigator );
- mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView");
- mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall");
+ //leftFrameLayout->addWidget( mDateNavigator );
+ mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
+ mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
mTodoList->setNavigator( mNavigator );
-
+#if 0
if ( QApplication::desktop()->width() < 480 ) {
leftFrameLayout->addWidget(mFilterView);
leftFrameLayout->addWidget(mTodoList, 2 );
} else {
leftFrameLayout->addWidget(mTodoList,2 );
leftFrameLayout->addWidget(mFilterView );
}
+#endif
mFilterView->hide();
QWidget *rightBox = new QWidget( mainBox );
mainBoxLayout->addWidget ( rightBox, 10 );
QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
mRightFrame = new QWidgetStack( rightBox );
rightLayout->addWidget( mRightFrame, 10 );
- mLeftFrame = leftFrame;
+ //mLeftFrame = (QWidget *)leftFrame;
if ( KOPrefs::instance()->mVerticalScreen ) {
- mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
- leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
+ mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
+ //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
+ //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
+ //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
} else {
- mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
- leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
+ mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
+ //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
+ //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
}
if ( !KOPrefs::instance()->mShowDateNavigator)
- mDateNavigator->hide();
+ mLeftFrame->toggle();
//qDebug("Calendarview Size %d %d ", width(), height());
#endif
connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
SLOT( showDates( const KCal::DateList & ) ) );
connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
@@ -367,21 +381,21 @@ void CalendarView::init()
mNavigator, SLOT( selectPrevious() ) );
connect( mDateNavigator, SIGNAL( goNext() ),
mNavigator, SLOT( selectNext() ) );
connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
mNavigator, SLOT( slotMonthSelect( int ) ) );
connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
-
- connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ),
- SLOT( eventAdded( Event *) ) );
-
- connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
+#if 0
+ connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ),
+ SLOT( incidenceAdded( Incidence *) ) );
+#endif
+ // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
connect( this, SIGNAL( configChanged() ),
mDateNavigator, SLOT( updateConfig() ) );
connect( mTodoList, SIGNAL( newTodoSignal() ),
SLOT( newTodo() ) );
connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ),
SLOT( newSubTodo( Todo * ) ) );
@@ -462,17 +476,17 @@ void CalendarView::init()
mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
#ifndef DESKTOP_VERSION
//US listen for arriving address resultsets
connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
#endif
-
+ mDateNavigator->setCalendar( mCalendar );
}
CalendarView::~CalendarView()
{
// kdDebug() << "~CalendarView()" << endl;
//qDebug("CalendarView::~CalendarView() ");
delete mDialogManager;
@@ -3680,35 +3694,39 @@ void CalendarView::showIntro()
QWidgetStack *CalendarView::viewStack()
{
return mRightFrame;
}
QWidget *CalendarView::leftFrame()
{
- return mLeftFrame;
+ return ( QWidget *)mLeftFrame;
}
DateNavigator *CalendarView::dateNavigator()
{
return mNavigator;
}
KDateNavigator* CalendarView::dateNavigatorWidget()
{
- return mDateNavigator;
+ return mDateNavigator->navigatorView();
}
void CalendarView::toggleDateNavigatorWidget()
{
KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ;
+ mLeftFrame->toggle();
+ // FIXME mShowDateNavigator is not the toggle state of mLeftFrame
+#if 0
if (!KOPrefs::instance()->mShowDateNavigator )
mDateNavigator->hide();
else
mDateNavigator->show();
+#endif
}
void CalendarView::addView(KOrg::BaseView *view)
{
mViewManager->addView(view);
}
void CalendarView::showView(KOrg::BaseView *view)
{