summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp72
-rw-r--r--korganizer/calendarview.h6
-rw-r--r--korganizer/datenavigatorcontainer.cpp218
-rw-r--r--korganizer/datenavigatorcontainer.h90
-rw-r--r--korganizer/kdatenavigator.cpp38
-rw-r--r--korganizer/kdatenavigator.h8
-rw-r--r--korganizer/kodaymatrix.cpp49
-rw-r--r--korganizer/kodaymatrix.h8
-rw-r--r--korganizer/korganizerE.pro4
-rw-r--r--korganizer/navigatorbar.cpp22
-rw-r--r--korganizer/navigatorbar.h1
11 files changed, 464 insertions, 52 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 6eaac1c..00285a5 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -109,2 +109,3 @@
#include "incomingdialog.h"
+#include "datenavigatorcontainer.h"
#include "statusdialog.h"
@@ -269,4 +270,5 @@ void CalendarView::init()
- mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE,
- "CalendarView::DateNavigator", QDate::currentDate() );
+ mDateNavigator = new DateNavigatorContainer( mLeftSplitter,
+ "CalendarView::DateNavigator" );
+
mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize);
@@ -297,23 +299,31 @@ void CalendarView::init()
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 ) {
@@ -326,2 +336,3 @@ void CalendarView::init()
}
+#endif
mFilterView->hide();
@@ -333,12 +344,15 @@ void CalendarView::init()
- 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());
@@ -374,7 +388,7 @@ void CalendarView::init()
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()));
@@ -469,3 +483,3 @@ void CalendarView::init()
#endif
-
+ mDateNavigator->setCalendar( mCalendar );
}
@@ -3687,3 +3701,3 @@ QWidget *CalendarView::leftFrame()
{
- return mLeftFrame;
+ return ( QWidget *)mLeftFrame;
}
@@ -3697,3 +3711,3 @@ KDateNavigator* CalendarView::dateNavigatorWidget()
{
- return mDateNavigator;
+ return mDateNavigator->navigatorView();
}
@@ -3702,2 +3716,5 @@ 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 )
@@ -3706,2 +3723,3 @@ void CalendarView::toggleDateNavigatorWidget()
mDateNavigator->show();
+#endif
}
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 664d700..fac9a9e 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -41,2 +41,3 @@
#include <libkcal/resourcecalendar.h>
+#include <KDGanttMinimizeSplitter.h>
@@ -55,2 +56,3 @@ class KOTodoView;
class KDateNavigator;
+class DateNavigatorContainer;
class DateNavigator;
@@ -531,3 +533,3 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
QSplitter *mLeftSplitter;
- QWidget *mLeftFrame;
+ KDGanttMinimizeSplitter *mLeftFrame;
QWidgetStack *mRightFrame;
@@ -537,3 +539,3 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
- KDateNavigator *mDateNavigator; // widget showing small month view.
+ DateNavigatorContainer *mDateNavigator; // widget showing small month view.
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
new file mode 100644
index 0000000..cbfc5b2
--- a/dev/null
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -0,0 +1,218 @@
+/*
+ This file is part of KOrganizer.
+
+ Copyright (c) 2001,2002,2003 Cornelius Schumacher <schumacher@kde.org>
+ Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ As a special exception, permission is given to link this program
+ with any edition of Qt, and distribute the resulting executable,
+ without including the source code for Qt in the source distribution.
+*/
+
+#include <kdebug.h>
+#include <klocale.h>
+
+//#include "koglobals.h"
+#include "navigatorbar.h"
+#include "kdatenavigator.h"
+
+#include <kcalendarsystem.h>
+
+#include "datenavigatorcontainer.h"
+
+DateNavigatorContainer::DateNavigatorContainer( QWidget *parent,
+ const char *name )
+ : QWidget( parent, name ), mCalendar( 0 ),
+ mHorizontalCount( 1 ), mVerticalCount( 1 )
+{
+ mExtraViews.setAutoDelete( true );
+
+ mNavigatorView = new KDateNavigator( this, name );
+
+ connectNavigatorView( mNavigatorView );
+}
+
+DateNavigatorContainer::~DateNavigatorContainer()
+{
+}
+
+void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v )
+{
+ connect( v, SIGNAL( datesSelected( const KCal::DateList & ) ),
+ SIGNAL( datesSelected( const KCal::DateList & ) ) );
+#if 0
+ connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ),
+ SIGNAL( incidenceDropped( Incidence *, const QDate & ) ) );
+ connect( v, SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ),
+ SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ) );
+#endif
+ connect( v, SIGNAL( weekClicked( const QDate & ) ),
+ SIGNAL( weekClicked( const QDate & ) ) );
+
+ connect( v, SIGNAL( goPrevious() ), SIGNAL( goPrevious() ) );
+ connect( v, SIGNAL( goNext() ), SIGNAL( goNext() ) );
+
+ connect( v, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) );
+ connect( v, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) );
+ connect( v, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) );
+ connect( v, SIGNAL( goPrevYear() ), SIGNAL( goPrevYear() ) );
+
+ connect( v, SIGNAL( monthSelected( int ) ), SIGNAL( monthSelected( int ) ) );
+}
+
+void DateNavigatorContainer::setCalendar( Calendar *cal )
+{
+ mCalendar = cal;
+ mNavigatorView->setCalendar( cal );
+ KDateNavigator *n;
+ for( n = mExtraViews.first(); n; n = mExtraViews.next() ) {
+ n->setCalendar( cal );
+ }
+}
+
+void DateNavigatorContainer::updateDayMatrix()
+{
+ mNavigatorView->updateDayMatrix();
+ KDateNavigator *n;
+ for( n = mExtraViews.first(); n; n = mExtraViews.next() ) {
+ n->updateDayMatrix();
+ }
+}
+
+void DateNavigatorContainer::updateToday()
+{
+ qDebug("DateNavigatorContainer::updateToday() NOT IMPL ");
+#if 0
+ mNavigatorView->updateToday();
+ KDateNavigator *n;
+ for( n = mExtraViews.first(); n; n = mExtraViews.next() ) {
+ n->updateToday();
+ }
+#endif
+}
+
+void DateNavigatorContainer::updateView()
+{
+ mNavigatorView->updateView();
+ KDateNavigator *n;
+ for( n = mExtraViews.first(); n; n = mExtraViews.next() ) {
+ n->updateView();
+ }
+}
+
+void DateNavigatorContainer::updateConfig()
+{
+ mNavigatorView->updateConfig();
+ KDateNavigator *n;
+ for( n = mExtraViews.first(); n; n = mExtraViews.next() ) {
+ n->updateConfig();
+ }
+}
+
+void DateNavigatorContainer::selectDates( const DateList &dateList )
+{
+ mNavigatorView->selectDates( dateList );
+ setBaseDates();
+}
+
+void DateNavigatorContainer::setBaseDates()
+{
+ KCal::DateList dateList = mNavigatorView->selectedDates();
+ if ( dateList.isEmpty() ) {
+ kdError() << "DateNavigatorContainer::selectDates() empty list." << endl;
+ }
+ QDate baseDate = dateList.first();
+ KDateNavigator *n;
+ for( n = mExtraViews.first(); n; n = mExtraViews.next() ) {
+ baseDate = baseDate.addDays( baseDate.daysInMonth () );
+ n->setBaseDate( baseDate );
+ }
+}
+
+void DateNavigatorContainer::resizeEvent( QResizeEvent * )
+{
+#if 0
+ kdDebug(5850) << "DateNavigatorContainer::resizeEvent()" << endl;
+ kdDebug(5850) << " CURRENT SIZE: " << size() << endl;
+ kdDebug(5850) << " MINIMUM SIZEHINT: " << minimumSizeHint() << endl;
+ kdDebug(5850) << " SIZEHINT: " << sizeHint() << endl;
+ kdDebug(5850) << " MINIMUM SIZE: " << minimumSize() << endl;
+#endif
+
+ QSize minSize = mNavigatorView->minimumSizeHint();
+
+// kdDebug(5850) << " NAVIGATORVIEW minimumSizeHint: " << minSize << endl;
+
+ int verticalCount = size().height() / minSize.height();
+ int horizontalCount = size().width() / minSize.width();
+ //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount );
+ if ( horizontalCount != mHorizontalCount ||
+ verticalCount != mVerticalCount ) {
+ uint count = horizontalCount * verticalCount;
+ if ( count == 0 ) return;
+
+ while ( count > ( mExtraViews.count() + 1 ) ) {
+ KDateNavigator *n = new KDateNavigator( this );
+ mExtraViews.append( n );
+ n->setCalendar( mCalendar );
+ setBaseDates();
+ connectNavigatorView( n );
+ n->show();
+ }
+
+ while ( count < ( mExtraViews.count() + 1 ) ) {
+ mExtraViews.removeLast();
+ }
+
+ mHorizontalCount = horizontalCount;
+ mVerticalCount = verticalCount;
+ }
+
+ int height = size().height() / verticalCount;
+ int width = size().width() / horizontalCount;
+
+ NavigatorBar *bar = mNavigatorView->navigatorBar();
+ if ( horizontalCount > 1 ) bar->showButtons( true, false );
+ else bar->showButtons( true, true );
+
+ mNavigatorView->setGeometry(0,
+ 0, width, height );
+ for( uint i = 0; i < mExtraViews.count(); ++i ) {
+ int x = ( i + 1 ) % horizontalCount;
+ int y = ( i + 1 ) / horizontalCount;
+
+ KDateNavigator *view = mExtraViews.at( i );
+ bar = view->navigatorBar();
+ if ( y > 0 ) bar->showButtons( false, false );
+ else {
+ if ( x + 1 == horizontalCount ) bar->showButtons( false, true );
+ else bar->showButtons( false, false );
+ }
+ view->setGeometry( x * width,
+ y * height, width, height );
+ }
+}
+
+QSize DateNavigatorContainer::minimumSizeHint() const
+{
+ return mNavigatorView->minimumSizeHint();
+}
+
+QSize DateNavigatorContainer::sizeHint() const
+{
+ return mNavigatorView->sizeHint();
+}
diff --git a/korganizer/datenavigatorcontainer.h b/korganizer/datenavigatorcontainer.h
new file mode 100644
index 0000000..affa8e1
--- a/dev/null
+++ b/korganizer/datenavigatorcontainer.h
@@ -0,0 +1,90 @@
+/*
+ This file is part of KOrganizer.
+
+ Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
+ Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ As a special exception, permission is given to link this program
+ with any edition of Qt, and distribute the resulting executable,
+ without including the source code for Qt in the source distribution.
+*/
+#ifndef DATENAVIGATORCONTAINER_H
+#define DATENAVIGATORCONTAINER_H
+
+class KDateNavigator;
+
+#include <qwidget.h>
+#include <libkcal/calendar.h>
+using namespace KCal;
+
+class DateNavigatorContainer: public QWidget
+{
+ Q_OBJECT
+ public:
+ DateNavigatorContainer( QWidget *parent = 0, const char *name = 0 );
+ ~DateNavigatorContainer();
+
+ /**
+ Associate date navigator with a calendar. It is used by KODayMatrix.
+ */
+ void setCalendar( Calendar * );
+
+ QSize minimumSizeHint() const;
+ QSize sizeHint() const;
+ KDateNavigator * navigatorView() { return mNavigatorView;}
+
+ public slots:
+ void selectDates( const KCal::DateList & );
+ void updateView();
+ void updateConfig();
+ void updateDayMatrix();
+ void updateToday();
+
+ signals:
+ void datesSelected( const KCal::DateList & );
+ void incidenceDropped( Incidence *, const QDate & );
+ void incidenceDroppedMove( Incidence *, const QDate & );
+ void weekClicked( const QDate &);
+
+ void goPrevious();
+ void goNext();
+
+ void goNextMonth();
+ void goPrevMonth();
+ void goNextYear();
+ void goPrevYear();
+
+ void monthSelected( int month );
+
+ protected:
+ void resizeEvent( QResizeEvent * );
+
+ void setBaseDates();
+ void connectNavigatorView( KDateNavigator *v );
+
+ private:
+ KDateNavigator *mNavigatorView;
+
+ KCal::Calendar *mCalendar;
+
+ QPtrList<KDateNavigator> mExtraViews;
+
+ int mHorizontalCount;
+ int mVerticalCount;
+};
+
+#endif
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index c08f44f..e76a85a 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -47,5 +47,3 @@
-KDateNavigator::KDateNavigator( QWidget *parent, Calendar *calendar,
- bool show_week_nums, const char *name,
- QDate startDate )
+KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
: QFrame(parent, name),
@@ -53,6 +51,4 @@ KDateNavigator::KDateNavigator( QWidget *parent, Calendar *calendar,
{
- mCalendar = calendar;
-
- setFrameStyle(QFrame::NoFrame);
-
+ setFrameStyle(QFrame::NoFrame);
+ QDate startDate = QDate::currentDate();
QGridLayout *topLayout = new QGridLayout(this,8,8);
@@ -66,3 +62,3 @@ KDateNavigator::KDateNavigator( QWidget *parent, Calendar *calendar,
m_MthYr = startDate;
- m_bShowWeekNums = show_week_nums;
+ m_bShowWeekNums = true;
@@ -98,3 +94,3 @@ KDateNavigator::KDateNavigator( QWidget *parent, Calendar *calendar,
//weeknos[i]->setFont(QFont("Arial", 10));
- if(!show_week_nums) {
+ if(!m_bShowWeekNums) {
weeknos[i]->hide();
@@ -106,4 +102,3 @@ KDateNavigator::KDateNavigator( QWidget *parent, Calendar *calendar,
- daymatrix = new KODayMatrix( this, mCalendar, dayone,
- "KDateNavigator::DayMatrix");
+ daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix");
daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken);
@@ -122,3 +117,22 @@ KDateNavigator::KDateNavigator( QWidget *parent, Calendar *calendar,
enableRollover(FollowMonth);
- setFixedSize ( sizeHint() );
+ //setFixedSize ( sizeHint() );
+}
+void KDateNavigator::setCalendar( Calendar *cal )
+{
+ daymatrix->setCalendar( cal );
+}
+
+void KDateNavigator::setBaseDate( const QDate &date )
+{
+ m_MthYr = date;
+
+ updateDates();
+ updateView();
+
+ KCal::DateList dates;
+ dates.append( date );
+ mNavigatorBar->selectDates( dates );
+
+ daymatrix->clearSelection();
+ daymatrix->repaint();
}
diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h
index 3ae1648..0aeb77a 100644
--- a/korganizer/kdatenavigator.h
+++ b/korganizer/kdatenavigator.h
@@ -44,5 +44,3 @@ class KDateNavigator: public QFrame
public:
- KDateNavigator( QWidget *parent = 0, Calendar *calendar = 0,
- bool show_week_numbers = false, const char *name = 0,
- QDate date = QDate::currentDate() );
+ KDateNavigator( QWidget *parent = 0,const char *name = 0 );
~KDateNavigator();
@@ -63,2 +61,6 @@ class KDateNavigator: public QFrame
void setShowWeekNums( bool enabled );
+ void setCalendar( Calendar * );
+ void setBaseDate( const QDate & );
+ KCal::DateList selectedDates() const { return mSelectedDates; }
+ NavigatorBar *navigatorBar() const { return mNavigatorBar; }
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 989f758..a886f4a 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -89,6 +89,11 @@ const int KODayMatrix::NUMDAYS = 42;
+KODayMatrix::KODayMatrix( QWidget *parent, const char *name )
+ : QFrame( parent, name ), mCalendar( 0 )
+
+#if 0
KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const char *name) :
QFrame(parent, name)
+#endif
{
- mCalendar = calendar;
+
mPendingUpdateBeforeRepaint = false;
@@ -120,2 +125,10 @@ KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const
}
+void KODayMatrix::setCalendar( Calendar *cal )
+{
+ mCalendar = cal;
+
+ setAcceptDrops( mCalendar );
+
+ updateEvents();
+}
@@ -188,2 +201,6 @@ void KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end)
}
+void KODayMatrix::clearSelection()
+{
+ mSelEnd = mSelStart = NOSELECTION;
+}
@@ -219,4 +236,8 @@ void KODayMatrix::updateViewTimed()
{
-
mUpdateTimer->stop();
+ if ( !mCalendar ) {
+ qDebug("NOT CAL ");
+ return;
+ }
+ //qDebug("KODayMatrix::updateViewTimed ");
for(int i = 0; i < NUMDAYS; i++) {
@@ -296,2 +317,24 @@ void KODayMatrix::updateView(QDate actdate)
}
+void KODayMatrix::updateEvents()
+{
+ if ( !mCalendar ) return;
+
+ for( int i = 0; i < NUMDAYS; i++ ) {
+ // if events are set for the day then remember to draw it bold
+ QPtrList<Event> eventlist = mCalendar->events( days[ i ] );
+ int numEvents = eventlist.count();
+ Event *event;
+ for( event = eventlist.first(); event != 0;event=eventlist.next()) {
+ ushort recurType = event->doesRecur();
+
+ if ( ( recurType == Recurrence::rDaily &&
+ !KOPrefs::instance()->mDailyRecur ) ||
+ ( recurType == Recurrence::rWeekly &&
+ !KOPrefs::instance()->mWeeklyRecur ) ) {
+ numEvents--;
+ }
+ }
+ events[ i ] = numEvents;
+ }
+}
@@ -430,3 +473,3 @@ void KODayMatrix::dropEvent(QDropEvent *e)
- if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) ) {
+ if (!mCalendar || !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) ) {
e->ignore();
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h
index 2dd112a..ba4853f 100644
--- a/korganizer/kodaymatrix.h
+++ b/korganizer/kodaymatrix.h
@@ -119,3 +119,4 @@ public:
*/
- KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const char *name );
+ KODayMatrix( QWidget *parent, const char *name );
+ //KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const char *name );
@@ -133,2 +134,3 @@ public:
void updateView(QDate actdate);
+ void updateEvents();
@@ -138,3 +140,3 @@ public:
const QDate& getDate(int offset);
-
+ void setCalendar( Calendar * );
/** returns the official name of this holy day or 0 if there is no label
@@ -154,3 +156,3 @@ public:
void setSelectedDaysFrom(const QDate& start, const QDate& end);
-
+ void clearSelection();
diff --git a/korganizer/korganizerE.pro b/korganizer/korganizerE.pro
index e6c3f8d..91b5a01 100644
--- a/korganizer/korganizerE.pro
+++ b/korganizer/korganizerE.pro
@@ -30,3 +30,3 @@ INTERFACES = kofilterview_base.ui
-HEADERS = \
+HEADERS = datenavigatorcontainer.h \
wordsgerman.h \
@@ -94,3 +94,3 @@ HEADERS = \
-SOURCES = \
+SOURCES = datenavigatorcontainer.cpp \
filteredit_base.cpp \
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index 934e153..27d4d17 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -186,2 +186,24 @@ NavigatorBar::~NavigatorBar()
}
+void NavigatorBar::showButtons( bool left, bool right )
+{
+ if ( left ) {
+ mPrevYear->show();
+ mPrevMonth->show();
+ } else {
+ mPrevYear->hide();
+ mPrevMonth->hide();
+ }
+
+ if ( right ) {
+ mNextYear->show();
+ mNextMonth->show();
+ } else {
+ mNextYear->hide();
+ mNextMonth->hide();
+ }
+ if ( !left && !right ) {
+ mSelectMonth->setMaximumWidth( 1024 );
+ mSelectMonth->setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) );
+ }
+}
diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h
index 803c817..4442caa 100644
--- a/korganizer/navigatorbar.h
+++ b/korganizer/navigatorbar.h
@@ -40,2 +40,3 @@ class NavigatorBar: public QWidget
~NavigatorBar();
+ void showButtons( bool left, bool right );