summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp2
-rw-r--r--korganizer/koagendaview.cpp6
-rw-r--r--korganizer/komonthview.cpp7
-rw-r--r--korganizer/navigatorbar.cpp34
-rw-r--r--korganizer/navigatorbar.h2
5 files changed, 41 insertions, 10 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index be78057..e0380fa 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -358,6 +358,8 @@ void CalendarView::init()
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 & ) ) );
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index aed9bae..c018dc7 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -437,8 +437,12 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
QPopupMenu * wpo = new QPopupMenu (this);
wpo->insertItem( i18n("W#"), 0 );
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 );
connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) );
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index ab96786..9c1e4c3 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -809,11 +809,6 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
mWeekLabels[mNumWeeks]->setText( i18n(""));
QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number"));
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 );
for( row = 0; row < mNumWeeks; ++row ) {
for( col = 0; col < mDaysPerWeek; ++col ) {
@@ -830,10 +825,10 @@ 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();
// updateConfig(); //useless here
+ 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
@@ -28,6 +28,7 @@
#include <qlayout.h>
#include <qframe.h>
#include <qlabel.h>
+#include <qpopupmenu.h>
#include <qapplication.h>
#include <kdebug.h>
@@ -71,7 +72,8 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
#else
bool isDesktop = true;
#endif
- if ( QString ( name ) == QString("useBigPixmaps") && QApplication::desktop()->width() > 320 )
+ bool insertWeek = (QString ( name ) == QString("useBigPixmaps")) ;
+ if ( insertWeek && QApplication::desktop()->width() > 320 )
isDesktop = true;
// Create backward navigation buttons
mPrevYear = new QPushButton( mCtrlFrame );
@@ -87,6 +89,13 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") );
QToolTip::add( mNextMonth, i18n("Next Month") );
+ QPushButton * selWeek = 0;
+ if ( insertWeek ) {
+ selWeek = new QPushButton( mCtrlFrame );
+ QToolTip::add( selWeek, i18n("Select Week") );
+ selWeek->setFocusPolicy(NoFocus);
+ }
+
mNextYear = new QPushButton( mCtrlFrame );
mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") );
QToolTip::add( mNextYear, i18n("Next Year") );
@@ -102,7 +111,9 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
mNextYear->setFlat( true);
mSelectMonth->setFlat( true);
mPrevYear->setFlat( true);
- mPrevMonth->setFlat( true);
+ mPrevMonth->setFlat( true);
+ if ( insertWeek )
+ selWeek->setFlat( true);
}
mSelectMonth->setFont( tfont );
// Set minimum width to width of widest month name label
@@ -123,6 +134,22 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
size += 6;
maxwidth+= 6;
}
+
+ 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 );
mSelectMonth->setFixedHeight( size );
mPrevYear->setFixedHeight( size );
@@ -141,6 +168,8 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
// ctrlLayout->addStretch( 1 );
ctrlLayout->addWidget( mNextMonth, 3 );
ctrlLayout->addWidget( mNextYear, 3 );
+ if ( insertWeek )
+ ctrlLayout->addWidget( selWeek );
connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) );
connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) );
@@ -152,6 +181,7 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
mNextMonth->setFocusPolicy(NoFocus);
mNextYear->setFocusPolicy(NoFocus);
mSelectMonth->setFocusPolicy(NoFocus);
+
}
NavigatorBar::~NavigatorBar()
diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h
index 9c5c0cf..ee4c06d 100644
--- a/korganizer/navigatorbar.h
+++ b/korganizer/navigatorbar.h
@@ -49,7 +49,7 @@ class NavigatorBar: public QWidget
void goNextYear();
void goPrevYear();
void monthSelected( int );
-
+ void selectWeek( int );
private:
QFrame *mCtrlFrame;