summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp31
-rw-r--r--korganizer/calendarview.h4
-rw-r--r--korganizer/komonthview.cpp47
-rw-r--r--korganizer/komonthview.h4
-rw-r--r--korganizer/koviewmanager.cpp41
-rw-r--r--korganizer/navigatorbar.cpp1
6 files changed, 49 insertions, 79 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 77de94f..0fbaa9a 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -284,11 +284,8 @@ void CalendarView::init()
#endif
QWidget *rightBox = new QWidget( mPanner );
QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
- mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" );
- rightLayout->addWidget( mNavigatorBar );
-
mRightFrame = new QWidgetStack( rightBox );
rightLayout->addWidget( mRightFrame, 1 );
mLeftFrame = mLeftSplitter;
@@ -326,11 +323,9 @@ void CalendarView::init()
mFilterView->hide();
QWidget *rightBox = new QWidget( mainBox );
mainBoxLayout->addWidget ( rightBox, 10 );
QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
- mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" );
mRightFrame = new QWidgetStack( rightBox );
- rightLayout->addWidget( mNavigatorBar );
rightLayout->addWidget( mRightFrame, 10 );
mLeftFrame = leftFrame;
if ( KOPrefs::instance()->mVerticalScreen ) {
@@ -349,21 +344,9 @@ void CalendarView::init()
SLOT( showDates( const KCal::DateList & ) ) );
connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
- connect( mNavigatorBar, SIGNAL( goPrevYear() ),
- mNavigator, SLOT( selectPreviousYear() ) );
- connect( mNavigatorBar, SIGNAL( goNextYear() ),
- mNavigator, SLOT( selectNextYear() ) );
- connect( mNavigatorBar, SIGNAL( goPrevMonth() ),
- mNavigator, SLOT( selectPreviousMonth() ) );
- connect( mNavigatorBar, SIGNAL( goNextMonth() ),
- mNavigator, SLOT( selectNextMonth() ) );
- connect( mNavigatorBar, SIGNAL( selectWeek( int ) ),
- mNavigator, SLOT( selectWeek( int ) ) );
- connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
- mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) );
connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
mNavigator, SLOT( selectWeek( const QDate & ) ) );
@@ -381,10 +364,8 @@ void CalendarView::init()
connect( mDateNavigator, SIGNAL( goNext() ),
mNavigator, SLOT( selectNext() ) );
connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
mNavigator, SLOT( slotMonthSelect( int ) ) );
- connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ),
- mNavigator, SLOT( slotMonthSelect( int ) ) );
connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
@@ -3867,20 +3848,8 @@ void CalendarView::slotCalendarChanged()
{
;
}
-NavigatorBar *CalendarView::navigatorBar()
-{
- return mNavigatorBar;
-}
-void CalendarView::showNavigatorBar( bool b)
-{
- if ( b ) mNavigatorBar->show();
- else mNavigatorBar->hide();
-}
-
-
-
void CalendarView::keyPressEvent ( QKeyEvent *e)
{
//qDebug(" alendarView::keyPressEvent ");
e->ignore();
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 8d7ff36..731298d 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -56,9 +56,8 @@ class KDateNavigator;
class DateNavigator;
class KOIncidenceEditor;
class KDatePicker;
class ResourceView;
-class NavigatorBar;
class KOEventEditor;
class KOTodoEditor ;
class KOEventViewerDialog;
class KOBeamPrefs;
@@ -105,9 +104,8 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
QDate endDate();
QWidgetStack *viewStack();
QWidget *leftFrame();
- NavigatorBar *navigatorBar();
DateNavigator *dateNavigator();
KDateNavigator *dateNavigatorWidget();
@@ -175,9 +173,8 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
void updateSearchDialog();
public slots:
- void showNavigatorBar(bool);
void showOpenError();
void watchSavedFile();
void recheckTimerAlarm();
void checkNextTimerAlarm();
@@ -532,9 +529,8 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
QWidgetStack *mRightFrame;
KDatePicker* mDatePicker;
QVBox* mDateFrame;
- NavigatorBar *mNavigatorBar;
KDateNavigator *mDateNavigator; // widget showing small month view.
KOFilterView *mFilterView;
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 234375b..7ba0b2f 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -792,10 +792,11 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 )
{
skipResize = false;
clPending = true;
+ mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" );
mWidStack = new QWidgetStack( this );
- QHBoxLayout* hb = new QHBoxLayout( this );
+ QVBoxLayout* hb = new QVBoxLayout( this );
mMonthView = new QWidget( mWidStack );
mWeekView = new QWidget( mWidStack );
#if QT_VERSION >= 0x030000
mWidStack->addWidget(mMonthView );
@@ -803,14 +804,16 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
#else
mWidStack->addWidget( mMonthView, 1 );
mWidStack->addWidget( mWeekView , 1 );
#endif
+ hb->addWidget( mNavigatorBar );
hb->addWidget( mWidStack );
mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
mShowWeekView = KOPrefs::instance()->mMonthViewWeek;
if ( mShowWeekView )
mWeekStartsMonday = true;
updatePossible = false;
+ //updatePossible = true;
mCells.setAutoDelete( true );
mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
mDayLabels.resize( mDaysPerWeek );
mDayLabelsW.resize( mDaysPerWeek );
@@ -916,8 +919,12 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
else
mWidStack->raiseWidget( mMonthView );
emit incidenceSelected( 0 );
+#ifndef DESKTOP_VERSION
+ resize( QApplication::desktop()->size() );
+ computeLayout();
+#endif
}
KOMonthView::~KOMonthView()
{
@@ -942,9 +949,8 @@ void KOMonthView::switchView()
if ( selectedCell( ) )
selectedCell()->deselect();
mShowWeekView = !mShowWeekView;
KOPrefs::instance()->mMonthViewWeek = mShowWeekView;
- //emit showNavigator( !mShowWeekView );
if ( clPending ) {
computeLayout();
updateConfig();
}
@@ -1259,14 +1265,9 @@ void KOMonthView::updateView()
}
void KOMonthView::resizeEvent(QResizeEvent * e)
{
- qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height());
- if ( skipResize ) {
- skipResize = false;
- qDebug("skipResize ");
- return;
- }
+ //qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height());
computeLayout();
clPending = true;
if ( mShowWeekView )
mCellsW[0]->setFocus();
@@ -1285,15 +1286,14 @@ void KOMonthView::computeLayoutWeek()
}
int tWid = topLevelWidget()->size().width();
int tHei = topLevelWidget()->size().height();
- int wid = size().width();//e
- int hei = size().height()-1;
+ int wid = width();//e
+ int hei = height()-1-mNavigatorBar->height();
if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei )
return;
-
if ( lastWid == width() && lastHei ==height() )
return;
lastWid =width();
lastHei = height();
@@ -1305,9 +1305,9 @@ void KOMonthView::computeLayoutWeek()
daysToShow = 3;
mShowSatSunComp = true;
combinedSatSun = true;
- qDebug("KOMonthView::computeLayout() WWW ------------------------------------ ");
+ //qDebug("KOMonthView::computeLayout() WWW ------------------------------------ ");
QFontMetrics fm ( mWeekLabels[0]->font() );
int weeklabelwid = fm.width( "888" );
wid -= weeklabelwid;
@@ -1386,13 +1386,13 @@ void KOMonthView::computeLayoutWeek()
// qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height());
//qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height());
mShortDayLabels = mDayLabelsW[0]->width() < mWidthLongDayLabel ;
updateDayLabels();
- bool forceUpdate = !updatePossible;
+ //bool forceUpdate = !updatePossible;
updatePossible = true;
//mWeekLabels[mNumWeeks]->setText( i18n("M"));
- if ( forceUpdate )
- updateView();
+ //if ( forceUpdate )
+ // updateView();
}
void KOMonthView::computeLayout()
{
@@ -1412,18 +1412,21 @@ void KOMonthView::computeLayout()
}
int tWid = topLevelWidget()->size().width();
int tHei = topLevelWidget()->size().height();
- int wid = size().width();//e
- int hei = size().height()-1;
+ int wid = width();//e
+ int hei = height()-1-mNavigatorBar->height();
- if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei )
+ if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) {
return;
- if ( lastWid == width() && lastHei ==height() )
+ }
+ if ( lastWid == width() && lastHei == height() ){
return;
+ }
+
lastWid =width();
lastHei = height();
- qDebug("KOMonthView::computeLayout() MMM ------------------------------------ ");
+ //qDebug("KOMonthView::computeLayout() MMM ------------------------------------ ");
QFontMetrics fm ( mWeekLabels[0]->font() );
int weeklabelwid = fm.width( "888" );
wid -= weeklabelwid;
@@ -1499,13 +1502,11 @@ void KOMonthView::computeLayout()
// qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height());
//qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height());
mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ;
updateDayLabels();
- bool forceUpdate = !updatePossible;
+ //bool forceUpdate = !updatePossible;
updatePossible = true;
//mWeekLabels[mNumWeeks]->setText( i18n("W"));
- if ( forceUpdate )
- updateView();
}
void KOMonthView::showContextMenu( Incidence *incidence )
{
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index a29a1a8..bf861ef 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -35,8 +35,9 @@
#include <libkcal/calendar.h>
#include <libkcal/event.h>
#include "koeventview.h"
+#include "navigatorbar.h"
#ifdef DESKTOP_VERSION
class QToolTipGroup;
#endif
@@ -227,8 +228,9 @@ class KOMonthView: public KOEventView
bool isUpdatePossible() { return updatePossible; }
MonthViewCell * selectedCell();
bool skipResize;
+ NavigatorBar* navigatorBar() { return mNavigatorBar ;}
public slots:
virtual void updateView();
virtual void updateConfig();
virtual void showDates(const QDate &start, const QDate &end);
@@ -248,17 +250,17 @@ class KOMonthView: public KOEventView
void processSelectionChange();
signals:
void nextMonth();
void prevMonth();
- void showNavigator( bool );
void selectWeekNum ( int );
void showDaySignal( QDate );
protected:
void resizeEvent(QResizeEvent *);
void viewChanged();
void updateDayLabels();
private:
+ NavigatorBar* mNavigatorBar;
int currentWeek();
bool clPending;
QWidgetStack * mWidStack;
QWidget* mMonthView;
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index ba15f7f..b551e2a 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -200,9 +200,9 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
return;
full = mMainView->leftFrame()->isVisible();
} else {
if ( view == mMonthView && mMonthView)
- mMonthView->skipResize = true ;
+ ;//mMonthView->skipResize = true ;
mCurrentView = view;
// bool full = fullScreen;
bool isFull = !mMainView->leftFrame()->isVisible();
if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen )
@@ -220,27 +220,12 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
{
mCurrentAgendaView = 0;
- int wid = mMainView->width() ;
- int hei = mMainView->height();
- if ( mCurrentView == mMonthView ) {
- if ( true /* !KOPrefs::instance()->mMonthViewWeek*/ ) {
- mMainView->navigatorBar()->show();
- hei -= mMainView->navigatorBar()->sizeHint().height();
- }
- //mMainView->navigatorBar()->hide();
- } else {
- mMainView->navigatorBar()->hide();
- }
if ( fullScreen ) {
mMainView->leftFrame()->hide();
} else {
mMainView->leftFrame()->show();
- if ( KOPrefs::instance()->mVerticalScreen )
- hei -= mMainView->leftFrame()->height();
- else
- wid -= mMainView->leftFrame()->width();
}
emit signalFullScreen( !fullScreen );
if ( callUpdateView )
mMainView->updateView();
@@ -526,13 +511,29 @@ void KOViewManager::showMonthView()
connect( mMonthView, SIGNAL( showDaySignal( QDate ) ),
mMainView, SLOT ( showDay( QDate ) ) );
connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig()));
connect( mMonthView, SIGNAL(nextMonth() ),
- mMainView->navigatorBar(), SIGNAL(goNextMonth() ) );
+ mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) );
connect( mMonthView, SIGNAL(prevMonth() ),
- mMainView->navigatorBar(), SIGNAL(goPrevMonth() ) );
- connect( mMonthView, SIGNAL( showNavigator(bool) ),
- mMainView, SLOT ( showNavigatorBar(bool) ) );
+ mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) );
+ connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ),
+ mMainView->dateNavigator(), SLOT( selectPreviousYear() ) );
+ connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ),
+ mMainView->dateNavigator(), SLOT( selectNextYear() ) );
+ connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ),
+ mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) );
+ connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ),
+ mMainView->dateNavigator(), SLOT( selectNextMonth() ) );
+ connect( mMonthView->navigatorBar(), SIGNAL( selectWeek( int ) ),
+ mMainView->dateNavigator(), SLOT( selectWeek( int ) ) );
+
+ connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
+ mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) );
+
+
+ connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ),
+ mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) );
+
}
globalFlagBlockAgenda = 1;
//mFlagShowNextxDays = false;
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index 657f98d..f05e6f6 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -153,8 +153,9 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
mPrevMonth->setFocusPolicy(NoFocus);
mNextMonth->setFocusPolicy(NoFocus);
mNextYear->setFocusPolicy(NoFocus);
mSelectMonth->setFocusPolicy(NoFocus);
+ setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) );
}
NavigatorBar::~NavigatorBar()