summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp33
-rw-r--r--korganizer/komonthview.h6
-rw-r--r--korganizer/koviewmanager.cpp4
3 files changed, 30 insertions, 13 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 00b1e92..f2cfb75 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -797,19 +797,24 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
mWeekLabels.resize( mNumWeeks+1 );
for( i = 0; i < mNumWeeks+1; i++ ) {
KOWeekButton *label = new KOWeekButton( this );
label->setFont(bfont);
- connect( label, SIGNAL( selectWeekNum ( int )),this, SIGNAL( selectWeekNum ( int )) );
+ connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
label->setFlat(true);
- QWhatsThis::add(label,i18n("Click on the week number to\nshow week in agenda view"));
+ QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
//label->setFrameStyle(QFrame::Panel|QFrame::Raised);
//label->setLineWidth(1);
//label->setAlignment(AlignCenter);
mWeekLabels.insert( i, label );
}
- mWeekLabels[mNumWeeks]->setText( i18n("W"));
- QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nswitch to week mode view"));
+ 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 ) {
MonthViewCell *cell = new MonthViewCell( this );
@@ -823,10 +828,10 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
SIGNAL( showDaySignal( QDate ) ) );
}
}
- connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ),
- SLOT( switchView() ) );
+ //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) );
+ connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) );
mContextMenu = eventPopup();
// updateConfig(); //useless here
emit incidenceSelected( 0 );
@@ -835,15 +840,25 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
KOMonthView::~KOMonthView()
{
delete mContextMenu;
}
+void KOMonthView::selectDateWeekNum ( int )
+{
+
+}
+void KOMonthView::selectInternalWeekNum ( int n )
+{
+ emit selectWeekNum ( n );
+ switchView();
+}
+
void KOMonthView::switchView()
{
if ( selectedCell( ) )
selectedCell()->deselect();
mShowWeekView = !mShowWeekView;
KOPrefs::instance()->mMonthViewWeek = mShowWeekView;
- emit showNavigator( !mShowWeekView );
+ //emit showNavigator( !mShowWeekView );
computeLayout();
updateConfig();
}
@@ -1221,9 +1236,9 @@ void KOMonthView::computeLayoutWeek()
mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ;
updateDayLabels();
bool forceUpdate = !updatePossible;
updatePossible = true;
- mWeekLabels[mNumWeeks]->setText( i18n("M"));
+ //mWeekLabels[mNumWeeks]->setText( i18n("M"));
if ( forceUpdate )
updateView();
}
void KOMonthView::computeLayout()
@@ -1330,9 +1345,9 @@ void KOMonthView::computeLayout()
mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ;
updateDayLabels();
bool forceUpdate = !updatePossible;
updatePossible = true;
- mWeekLabels[mNumWeeks]->setText( i18n("W"));
+ //mWeekLabels[mNumWeeks]->setText( i18n("W"));
if ( forceUpdate )
updateView();
}
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 0bc3743..1ed200b 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -239,16 +239,18 @@ class KOMonthView: public KOEventView
void setSelectedCell( MonthViewCell * );
protected slots:
+ void selectDateWeekNum ( int );
+ void selectInternalWeekNum ( int );
void switchView();
void processSelectionChange();
signals:
void nextMonth();
void prevMonth();
void showNavigator( bool );
- void selectWeekNum ( int );
- void showDaySignal( QDate );
+ void selectWeekNum ( int );
+ void showDaySignal( QDate );
protected:
void resizeEvent(QResizeEvent *);
void viewChanged();
void updateDayLabels();
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 8aa0697..ca3de59 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -221,9 +221,9 @@ void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
mCurrentAgendaView = 0;
int wid = mMainView->width() ;
int hei = mMainView->height();
if ( mCurrentView == mMonthView ) {
- if ( !KOPrefs::instance()->mMonthViewWeek ) {
+ if ( true /* !KOPrefs::instance()->mMonthViewWeek*/ ) {
mMainView->navigatorBar()->show();
hei -= mMainView->navigatorBar()->sizeHint().height();
}
//mMainView->navigatorBar()->hide();
@@ -517,9 +517,9 @@ void KOViewManager::showMonthView()
mMainView, SLOT ( moveIncidence( Incidence * ) ) );
connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
mMainView, SLOT ( beamIncidence( Incidence * ) ) );
connect( mMonthView, SIGNAL( selectWeekNum( int ) ),
- mMainView, SLOT ( selectWeekNum( int ) ) );
+ mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) );
connect( mMonthView, SIGNAL( showDaySignal( QDate ) ),
mMainView, SLOT ( showDay( QDate ) ) );
connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig()));
connect( mMonthView, SIGNAL(nextMonth() ),