-rw-r--r-- | korganizer/calendarview.cpp | 2 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 6 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 7 | ||||
-rw-r--r-- | korganizer/navigatorbar.cpp | 32 | ||||
-rw-r--r-- | korganizer/navigatorbar.h | 2 |
5 files changed, 40 insertions, 9 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index be78057..e0380fa 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -360,2 +360,4 @@ void CalendarView::init() mNavigator, SLOT( selectNextMonth() ) ); + connect( mNavigatorBar, SIGNAL( selectWeek( int ) ), + mNavigator, SLOT( selectWeek( int ) ) ); diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index aed9bae..c018dc7 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -439,4 +439,8 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : int i; - for ( i = 1; i < 54; i++ ) + for ( i = 1; i < 53; i++ ) wpo->insertItem( QString::number( i ),i ); + //Qt bug - we must add some empty fields... + for ( i = 53; i < 54; ++i ) { + wpo->insertItem( "", 52 ); + } dummyAllDayRightB->setPopup( wpo ); diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index ab96786..9c1e4c3 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -811,7 +811,2 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) int row, col; - QPopupMenu * wpo = new QPopupMenu (this); - wpo->insertItem( i18n("W#"), 0 ); - for ( i = 1; i < 54; i++ ) - wpo->insertItem( i18n("%1").arg(i), i ); - mWeekLabels[mNumWeeks]->setPopup( wpo ); mCells.resize( mNumCells ); @@ -832,3 +827,2 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); - connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) ); mContextMenu = eventPopup(); @@ -836,2 +830,3 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) + mWeekLabels[mNumWeeks]->setText( i18n("W")); emit incidenceSelected( 0 ); diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index f339c67..2406bb5 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp @@ -30,2 +30,3 @@ #include <qlabel.h> +#include <qpopupmenu.h> #include <qapplication.h> @@ -73,3 +74,4 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam #endif - if ( QString ( name ) == QString("useBigPixmaps") && QApplication::desktop()->width() > 320 ) + bool insertWeek = (QString ( name ) == QString("useBigPixmaps")) ; + if ( insertWeek && QApplication::desktop()->width() > 320 ) isDesktop = true; @@ -89,2 +91,9 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam + QPushButton * selWeek = 0; + if ( insertWeek ) { + selWeek = new QPushButton( mCtrlFrame ); + QToolTip::add( selWeek, i18n("Select Week") ); + selWeek->setFocusPolicy(NoFocus); + } + mNextYear = new QPushButton( mCtrlFrame ); @@ -105,2 +114,4 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam mPrevMonth->setFlat( true); + if ( insertWeek ) + selWeek->setFlat( true); } @@ -125,2 +136,18 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam } + + if ( insertWeek ) { + //shit : bug in Qt. after inserting 53 item, only 51 are shown... + QPopupMenu * wpo = new QPopupMenu (this); + wpo->insertItem( i18n("W#"), 0 ); + for ( i = 1; i < 53; ++i ) { + wpo->insertItem( QString::number(i), i ); + } + for ( i = 53; i < 54; ++i ) { + wpo->insertItem( "", 52 ); + } + selWeek->setPopup( wpo ); + selWeek->setFixedWidth( (size/4)*3 ); + selWeek->setFixedHeight( size ); + connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeek ( int ) ) ); + } mSelectMonth->setFixedWidth( maxwidth ); @@ -143,2 +170,4 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam ctrlLayout->addWidget( mNextYear, 3 ); + if ( insertWeek ) + ctrlLayout->addWidget( selWeek ); @@ -154,2 +183,3 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam mSelectMonth->setFocusPolicy(NoFocus); + } diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h index 9c5c0cf..ee4c06d 100644 --- a/korganizer/navigatorbar.h +++ b/korganizer/navigatorbar.h @@ -51,3 +51,3 @@ class NavigatorBar: public QWidget void monthSelected( int ); - + void selectWeek( int ); |