-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 | |||
@@ -358,6 +358,8 @@ void CalendarView::init() | |||
358 | mNavigator, SLOT( selectPreviousMonth() ) ); | 358 | mNavigator, SLOT( selectPreviousMonth() ) ); |
359 | connect( mNavigatorBar, SIGNAL( goNextMonth() ), | 359 | connect( mNavigatorBar, SIGNAL( goNextMonth() ), |
360 | mNavigator, SLOT( selectNextMonth() ) ); | 360 | mNavigator, SLOT( selectNextMonth() ) ); |
361 | connect( mNavigatorBar, SIGNAL( selectWeek( int ) ), | ||
362 | mNavigator, SLOT( selectWeek( int ) ) ); | ||
361 | 363 | ||
362 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 364 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
363 | mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) ); | 365 | 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) : | |||
437 | QPopupMenu * wpo = new QPopupMenu (this); | 437 | QPopupMenu * wpo = new QPopupMenu (this); |
438 | wpo->insertItem( i18n("W#"), 0 ); | 438 | wpo->insertItem( i18n("W#"), 0 ); |
439 | int i; | 439 | int i; |
440 | for ( i = 1; i < 54; i++ ) | 440 | for ( i = 1; i < 53; i++ ) |
441 | wpo->insertItem( QString::number( i ),i ); | 441 | wpo->insertItem( QString::number( i ),i ); |
442 | //Qt bug - we must add some empty fields... | ||
443 | for ( i = 53; i < 54; ++i ) { | ||
444 | wpo->insertItem( "", 52 ); | ||
445 | } | ||
442 | dummyAllDayRightB->setPopup( wpo ); | 446 | dummyAllDayRightB->setPopup( wpo ); |
443 | 447 | ||
444 | connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) ); | 448 | 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) | |||
809 | mWeekLabels[mNumWeeks]->setText( i18n("")); | 809 | mWeekLabels[mNumWeeks]->setText( i18n("")); |
810 | QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); | 810 | QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); |
811 | int row, col; | 811 | int row, col; |
812 | QPopupMenu * wpo = new QPopupMenu (this); | ||
813 | wpo->insertItem( i18n("W#"), 0 ); | ||
814 | for ( i = 1; i < 54; i++ ) | ||
815 | wpo->insertItem( i18n("%1").arg(i), i ); | ||
816 | mWeekLabels[mNumWeeks]->setPopup( wpo ); | ||
817 | mCells.resize( mNumCells ); | 812 | mCells.resize( mNumCells ); |
818 | for( row = 0; row < mNumWeeks; ++row ) { | 813 | for( row = 0; row < mNumWeeks; ++row ) { |
819 | for( col = 0; col < mDaysPerWeek; ++col ) { | 814 | for( col = 0; col < mDaysPerWeek; ++col ) { |
@@ -830,10 +825,10 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | |||
830 | } | 825 | } |
831 | 826 | ||
832 | //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); | 827 | //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); |
833 | connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) ); | ||
834 | mContextMenu = eventPopup(); | 828 | mContextMenu = eventPopup(); |
835 | // updateConfig(); //useless here | 829 | // updateConfig(); //useless here |
836 | 830 | ||
831 | mWeekLabels[mNumWeeks]->setText( i18n("W")); | ||
837 | emit incidenceSelected( 0 ); | 832 | emit incidenceSelected( 0 ); |
838 | } | 833 | } |
839 | 834 | ||
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 @@ | |||
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qframe.h> | 29 | #include <qframe.h> |
30 | #include <qlabel.h> | 30 | #include <qlabel.h> |
31 | #include <qpopupmenu.h> | ||
31 | #include <qapplication.h> | 32 | #include <qapplication.h> |
32 | 33 | ||
33 | #include <kdebug.h> | 34 | #include <kdebug.h> |
@@ -71,7 +72,8 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam | |||
71 | #else | 72 | #else |
72 | bool isDesktop = true; | 73 | bool isDesktop = true; |
73 | #endif | 74 | #endif |
74 | if ( QString ( name ) == QString("useBigPixmaps") && QApplication::desktop()->width() > 320 ) | 75 | bool insertWeek = (QString ( name ) == QString("useBigPixmaps")) ; |
76 | if ( insertWeek && QApplication::desktop()->width() > 320 ) | ||
75 | isDesktop = true; | 77 | isDesktop = true; |
76 | // Create backward navigation buttons | 78 | // Create backward navigation buttons |
77 | mPrevYear = new QPushButton( mCtrlFrame ); | 79 | mPrevYear = new QPushButton( mCtrlFrame ); |
@@ -87,6 +89,13 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam | |||
87 | mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); | 89 | mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); |
88 | QToolTip::add( mNextMonth, i18n("Next Month") ); | 90 | QToolTip::add( mNextMonth, i18n("Next Month") ); |
89 | 91 | ||
92 | QPushButton * selWeek = 0; | ||
93 | if ( insertWeek ) { | ||
94 | selWeek = new QPushButton( mCtrlFrame ); | ||
95 | QToolTip::add( selWeek, i18n("Select Week") ); | ||
96 | selWeek->setFocusPolicy(NoFocus); | ||
97 | } | ||
98 | |||
90 | mNextYear = new QPushButton( mCtrlFrame ); | 99 | mNextYear = new QPushButton( mCtrlFrame ); |
91 | mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") ); | 100 | mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") ); |
92 | QToolTip::add( mNextYear, i18n("Next Year") ); | 101 | QToolTip::add( mNextYear, i18n("Next Year") ); |
@@ -103,6 +112,8 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam | |||
103 | mSelectMonth->setFlat( true); | 112 | mSelectMonth->setFlat( true); |
104 | mPrevYear->setFlat( true); | 113 | mPrevYear->setFlat( true); |
105 | mPrevMonth->setFlat( true); | 114 | mPrevMonth->setFlat( true); |
115 | if ( insertWeek ) | ||
116 | selWeek->setFlat( true); | ||
106 | } | 117 | } |
107 | mSelectMonth->setFont( tfont ); | 118 | mSelectMonth->setFont( tfont ); |
108 | // Set minimum width to width of widest month name label | 119 | // Set minimum width to width of widest month name label |
@@ -123,6 +134,22 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam | |||
123 | size += 6; | 134 | size += 6; |
124 | maxwidth+= 6; | 135 | maxwidth+= 6; |
125 | } | 136 | } |
137 | |||
138 | if ( insertWeek ) { | ||
139 | //shit : bug in Qt. after inserting 53 item, only 51 are shown... | ||
140 | QPopupMenu * wpo = new QPopupMenu (this); | ||
141 | wpo->insertItem( i18n("W#"), 0 ); | ||
142 | for ( i = 1; i < 53; ++i ) { | ||
143 | wpo->insertItem( QString::number(i), i ); | ||
144 | } | ||
145 | for ( i = 53; i < 54; ++i ) { | ||
146 | wpo->insertItem( "", 52 ); | ||
147 | } | ||
148 | selWeek->setPopup( wpo ); | ||
149 | selWeek->setFixedWidth( (size/4)*3 ); | ||
150 | selWeek->setFixedHeight( size ); | ||
151 | connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeek ( int ) ) ); | ||
152 | } | ||
126 | mSelectMonth->setFixedWidth( maxwidth ); | 153 | mSelectMonth->setFixedWidth( maxwidth ); |
127 | mSelectMonth->setFixedHeight( size ); | 154 | mSelectMonth->setFixedHeight( size ); |
128 | mPrevYear->setFixedHeight( size ); | 155 | mPrevYear->setFixedHeight( size ); |
@@ -141,6 +168,8 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam | |||
141 | // ctrlLayout->addStretch( 1 ); | 168 | // ctrlLayout->addStretch( 1 ); |
142 | ctrlLayout->addWidget( mNextMonth, 3 ); | 169 | ctrlLayout->addWidget( mNextMonth, 3 ); |
143 | ctrlLayout->addWidget( mNextYear, 3 ); | 170 | ctrlLayout->addWidget( mNextYear, 3 ); |
171 | if ( insertWeek ) | ||
172 | ctrlLayout->addWidget( selWeek ); | ||
144 | 173 | ||
145 | connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); | 174 | connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); |
146 | connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); | 175 | connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); |
@@ -152,6 +181,7 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam | |||
152 | mNextMonth->setFocusPolicy(NoFocus); | 181 | mNextMonth->setFocusPolicy(NoFocus); |
153 | mNextYear->setFocusPolicy(NoFocus); | 182 | mNextYear->setFocusPolicy(NoFocus); |
154 | mSelectMonth->setFocusPolicy(NoFocus); | 183 | mSelectMonth->setFocusPolicy(NoFocus); |
184 | |||
155 | } | 185 | } |
156 | 186 | ||
157 | NavigatorBar::~NavigatorBar() | 187 | 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 | |||
49 | void goNextYear(); | 49 | void goNextYear(); |
50 | void goPrevYear(); | 50 | void goPrevYear(); |
51 | void monthSelected( int ); | 51 | void monthSelected( int ); |
52 | 52 | void selectWeek( int ); | |
53 | 53 | ||
54 | private: | 54 | private: |
55 | QFrame *mCtrlFrame; | 55 | QFrame *mCtrlFrame; |