author | zautrix <zautrix> | 2005-02-16 22:08:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-16 22:08:18 (UTC) |
commit | 451b4de59893b5c0801a7bbb2f8cbe8e0266b324 (patch) (side-by-side diff) | |
tree | ce3f535541583d37cfe951ddd8d7474770d9c374 | |
parent | b2cf8e9a08082539e0a5578a98766e5990783f9a (diff) | |
download | kdepimpi-451b4de59893b5c0801a7bbb2f8cbe8e0266b324.zip kdepimpi-451b4de59893b5c0801a7bbb2f8cbe8e0266b324.tar.gz kdepimpi-451b4de59893b5c0801a7bbb2f8cbe8e0266b324.tar.bz2 |
month view fixes
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 4 | ||||
-rw-r--r-- | korganizer/datenavigator.cpp | 15 | ||||
-rw-r--r-- | korganizer/datenavigator.h | 3 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 8 | ||||
-rw-r--r-- | korganizer/komonthview.h | 3 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 1 | ||||
-rw-r--r-- | korganizer/koprefs.h | 1 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 62 | ||||
-rw-r--r-- | korganizer/koviewmanager.h | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 12 | ||||
-rw-r--r-- | korganizer/navigatorbar.cpp | 26 | ||||
-rw-r--r-- | korganizer/navigatorbar.h | 4 |
13 files changed, 124 insertions, 19 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index a3ea5ee..3d8edfc 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -3,8 +3,10 @@ Info about the changes in new versions of KDE-Pim/Pi ********** VERSION 2.0.8 ************ Fixed a problem in dependency info in the ipk files for the Zaurus. +Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar. + ********** VERSION 2.0.7 ************ Added global application font settings diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 2d4cb74..5f1bee4 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -1270,10 +1270,10 @@ { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, { "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, -{ "","" }, -{ "","" }, +{ "List week view","Listenwochenansicht" }, +{ "List week","Listenwochenansicht" }, { "","" }, { "","" }, { "","" }, { "","" }, diff --git a/korganizer/datenavigator.cpp b/korganizer/datenavigator.cpp index 8b7c993..b0eac51 100644 --- a/korganizer/datenavigator.cpp +++ b/korganizer/datenavigator.cpp @@ -82,8 +82,14 @@ void DateNavigator::selectMonth() QDate date =mSelectedDates.first(); selectMonthByDate( date ); } +void DateNavigator::selectMonthFromMonthview() +{ + + QDate date =mSelectedDates.first().addDays( 7 ); + selectMonthByDate( date ); +} DateList DateNavigator::selectedDates() { return mSelectedDates; @@ -257,8 +263,17 @@ void DateNavigator::selectNextMonth() else selectWeekByDay( weekDay, firstSelected ); } +void DateNavigator::selectPreviousWeek() +{ + selectDates( mSelectedDates.first().addDays( -7 ), datesCount() ); +} + +void DateNavigator::selectNextWeek() +{ + selectDates( mSelectedDates.first().addDays( 7 ), datesCount() ); +} void DateNavigator::selectNextYear() { QDate firstSelected = mSelectedDates.first(); diff --git a/korganizer/datenavigator.h b/korganizer/datenavigator.h index 4265e84..9742d41 100644 --- a/korganizer/datenavigator.h +++ b/korganizer/datenavigator.h @@ -66,11 +66,14 @@ class DateNavigator : public QObject void selectPreviousYear(); void selectPreviousMonth(); void selectNextMonth(); + void selectPreviousWeek(); + void selectNextWeek(); void selectNextYear(); void selectMonth(); + void selectMonthFromMonthview(); void selectMonthByDate( const QDate & ); void selectPrevious(); void selectNext(); diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index d0380e3..f9bc1ca 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -948,10 +948,13 @@ KOMonthView::~KOMonthView() } void KOMonthView::selectInternalWeekNum ( int n ) { - switchView(); - emit selectWeekNum ( n ); + switchView(); + if ( !KOPrefs::instance()->mMonthViewWeek ) + emit selectMonth (); + else + emit selectWeekNum ( n ); } int KOMonthView::currentWeek() { @@ -960,9 +963,8 @@ int KOMonthView::currentWeek() return mWeekLabels[0]->getWeekNum(); } void KOMonthView::switchView() { - if ( selectedCell( ) ) selectedCell()->deselect(); mShowWeekView = !mShowWeekView; KOPrefs::instance()->mMonthViewWeek = mShowWeekView; diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 03f9dc6..2f6f5dc 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -242,17 +242,18 @@ class KOMonthView: public KOEventView void showContextMenu( Incidence * ); void setSelectedCell( MonthViewCell * ); + void switchView(); protected slots: void selectInternalWeekNum ( int ); - void switchView(); void processSelectionChange(); signals: void nextMonth(); void prevMonth(); void selectWeekNum ( int ); + void selectMonth (); void showDaySignal( QDate ); protected: void resizeEvent(QResizeEvent *); void viewChanged(); diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 7efb6a6..5efc247 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -74,8 +74,9 @@ KOPrefs::KOPrefs() : addItemBool("ShowIconSearch",&mShowIconSearch,true); addItemBool("ShowIconList",&mShowIconList,true); addItemBool("ShowIconDay1",&mShowIconDay1,true); addItemBool("ShowIconDay5",&mShowIconDay5,true); + addItemBool("ShowIconDay6",&mShowIconDay6,true); addItemBool("ShowIconDay7",&mShowIconDay7,true); addItemBool("ShowIconMonth",&mShowIconMonth,true); addItemBool("ShowIconTodoview",&mShowIconTodoview,true); addItemBool("ShowIconBackFast",&mShowIconBackFast,true); diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index fa69d52..e300067 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h @@ -170,8 +170,9 @@ class KOPrefs : public KPimPrefs bool mShowIconSearch; bool mShowIconList; bool mShowIconDay1; bool mShowIconDay5; + bool mShowIconDay6; bool mShowIconDay7; bool mShowIconMonth; bool mShowIconTodoview; bool mShowIconBackFast; diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index f8f6c1d..e22f096 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -87,9 +87,14 @@ void KOViewManager::readSettings(KConfig *config) { config->setGroup("General"); QString view = config->readEntry("Current View"); if (view == "WhatsNext") showWhatsNextView(); - else if (view == "Month") showMonthView(); + else if (view == "Month") { + if ( KOPrefs::instance()->mMonthViewWeek ) + showMonthView(); + else + showMonthViewWeek(); + } else if (view == "List") showListView(); else if (view == "Journal") showJournalView(); else if (view == "TimeSpan") showTimeSpanView(); else if (view == "Todo") showTodoView(); @@ -206,9 +211,10 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) bool full = fullScreen; if(view == mCurrentView && view != mWhatsNextView ) { if ( mCurrentAgendaView < 0 ) return; - full = mMainView->leftFrame()->isVisible(); + if ( view != mMonthView ) + full = mMainView->leftFrame()->isVisible(); } else { if ( view == mMonthView && mMonthView) ;//mMonthView->skipResize = true ; mCurrentView = view; @@ -485,11 +491,11 @@ void KOViewManager::showNextXView() bool KOViewManager::showsNextDays() { return mFlagShowNextxDays; } -void KOViewManager::showMonthView() - { - if (!mMonthView) { +void KOViewManager::createMonthView() +{ +if (!mMonthView) { mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); addView(mMonthView); // mMonthView->show(); @@ -516,8 +522,10 @@ void KOViewManager::showMonthView() connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), mMainView, SLOT ( beamIncidence( Incidence * ) ) ); connect( mMonthView, SIGNAL( selectWeekNum( int ) ), mMainView->dateNavigator(), SLOT ( selectWeekFromMonthView( int ) ) ); + connect( mMonthView, SIGNAL( selectMonth() ), + mMainView->dateNavigator(), SLOT ( selectMonthFromMonthview() ) ); connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), mMainView, SLOT ( showDay( QDate ) ) ); connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); connect( mMonthView, SIGNAL(nextMonth() ), @@ -531,8 +539,12 @@ void KOViewManager::showMonthView() connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ), mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) ); connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ), + mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) ); + connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ), + mMainView->dateNavigator(), SLOT( selectNextWeek() ) ); connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); @@ -540,18 +552,46 @@ void KOViewManager::showMonthView() connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ), mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); } +} +void KOViewManager::showMonthViewWeek() +{ + createMonthView(); + bool full = true; + if ( mCurrentView == mMonthView) + full = mMainView->leftFrame()->isVisible(); + if ( !KOPrefs::instance()->mMonthViewWeek ) { + mMonthView->switchView(); + if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) + full = false; + else + full = true; + } + mMainView->dateNavigator()->selectWeek(); + showView(mMonthView, full ); +} +void KOViewManager::showMonthView() + { + + createMonthView(); globalFlagBlockAgenda = 1; //mFlagShowNextxDays = false; - // if(mMonthView == mCurrentView) return; - if ( KOPrefs::instance()->mMonthViewWeek ) - mMainView->dateNavigator()->selectWeek(); - else - mMainView->dateNavigator()->selectMonth(); + bool full = true; + if ( mCurrentView == mMonthView) + full = mMainView->leftFrame()->isVisible(); + // if(mMonthView == mCurrentView) return; + if ( KOPrefs::instance()->mMonthViewWeek ) { + mMonthView->switchView(); + if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) + full = false; + else + full = true; + } + mMainView->dateNavigator()->selectMonth(); - showView(mMonthView, true ); + showView(mMonthView, full ); } void KOViewManager::showTodoView() diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h index 66ab138..8f0bf82 100644 --- a/korganizer/koviewmanager.h +++ b/korganizer/koviewmanager.h @@ -91,13 +91,15 @@ class KOViewManager : public QObject void showWorkWeekView(); void showWeekView(); void showNextXView(); void showMonthView(); + void showMonthViewWeek(); void showTodoView(); void showJournalView(); void showTimeSpanView(); private: + void createMonthView(); CalendarView *mMainView; int mCurrentAgendaView; KOAgendaView *mAgendaView; diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index ab0e4d6..16031b8 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -712,8 +712,15 @@ void MainWindow::initActions() month_action->addTo( viewMenu ); connect( month_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showMonthView() ) ); + icon = loadPixmap( pathString + "workweek2" ); + configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); + QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); + day6_action->addTo( viewMenu ); + connect( day6_action, SIGNAL( activated() ), + mView->viewManager(), SLOT( showMonthViewWeek() ) ); + icon = loadPixmap( pathString + "todo" ); configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); todoview_action->addTo( viewMenu ); @@ -994,8 +1001,10 @@ void MainWindow::initActions() if (p-> mShowIconDay7) day7_action->addTo( iconToolBar ); if (p-> mShowIconMonth) month_action->addTo( iconToolBar ); + if (p-> mShowIconDay6) + day6_action->addTo( iconToolBar ); if (p-> mShowIconTodoview) todoview_action->addTo( iconToolBar ); if (p-> mShowIconJournal) viewjournal_action->addTo( iconToolBar ); @@ -1050,8 +1059,10 @@ void MainWindow::initActions() if (p-> mShowIconDay1) configureToolBarMenu->setItemChecked( 40, true ); if (p-> mShowIconDay5) configureToolBarMenu->setItemChecked( 50, true ); + if (p-> mShowIconDay6) + configureToolBarMenu->setItemChecked( 75, true ); if (p-> mShowIconDay7) configureToolBarMenu->setItemChecked( 60, true ); if (p-> mShowIconMonth) configureToolBarMenu->setItemChecked( 70, true ); @@ -1798,8 +1809,9 @@ void MainWindow::configureToolBar( int item ) p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); + p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index b591232..934e153 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp @@ -88,8 +88,17 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam mNextMonth = new QPushButton( mCtrlFrame ); mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); QToolTip::add( mNextMonth, i18n("Next Month") ); + mPrevWeek = new QPushButton( mCtrlFrame ); + mPrevWeek->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") ); + QToolTip::add( mPrevWeek, i18n("Previous Week") ); + + // Create forward navigation buttons + mNextWeek = new QPushButton( mCtrlFrame ); + mNextWeek->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); + QToolTip::add( mNextWeek, i18n("Next Week") ); + mNextYear = new QPushButton( mCtrlFrame ); mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") ); QToolTip::add( mNextYear, i18n("Next Year") ); mSelectMonth = new QPushButton( mCtrlFrame ); @@ -100,12 +109,17 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam //mDateLabel->setFont( tfont ); //mDateLabel->setAlignment( AlignCenter ); if ( QString ( name ) == QString("useBigPixmaps") ) { mNextMonth->setFlat( true); + mNextWeek->setFlat( true); mNextYear->setFlat( true); mSelectMonth->setFlat( true); mPrevYear->setFlat( true); mPrevMonth->setFlat( true); + mPrevWeek->setFlat( true); + } else { + mPrevWeek->hide(); + mNextWeek->hide(); } mSelectMonth->setFont( tfont ); // Set minimum width to width of widest month name label int i; @@ -127,33 +141,41 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam } mSelectMonth->setFixedWidth( maxwidth ); mSelectMonth->setFixedHeight( size ); - mPrevYear->setFixedHeight( size ); + mPrevYear->setFixedHeight( size ); mPrevMonth->setFixedHeight( size ); - mNextMonth->setFixedHeight( size ); + mPrevWeek->setFixedHeight( size ); + mNextMonth->setFixedHeight( size ); + mNextWeek->setFixedHeight( size ); mNextYear->setFixedHeight ( size ); // set up control frame layout QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 ); ctrlLayout->addWidget( mPrevYear, 3 ); ctrlLayout->addWidget( mPrevMonth, 3 ); + ctrlLayout->addWidget( mPrevWeek, 3 ); //ctrlLayout->addStretch( 1 ); // ctrlLayout->addSpacing( 1 ); // ctrlLayout->addWidget( mDateLabel ); ctrlLayout->addWidget( mSelectMonth ); // ctrlLayout->addSpacing( 1 ); // ctrlLayout->addStretch( 1 ); + ctrlLayout->addWidget( mNextWeek, 3 ); ctrlLayout->addWidget( mNextMonth, 3 ); ctrlLayout->addWidget( mNextYear, 3 ); connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); + connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) ); + connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) ); connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); mPrevYear->setFocusPolicy(NoFocus); mPrevMonth->setFocusPolicy(NoFocus); mNextMonth->setFocusPolicy(NoFocus); + mPrevWeek->setFocusPolicy(NoFocus); + mNextWeek->setFocusPolicy(NoFocus); mNextYear->setFocusPolicy(NoFocus); mSelectMonth->setFocusPolicy(NoFocus); setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h index 93240a6..803c817 100644 --- a/korganizer/navigatorbar.h +++ b/korganizer/navigatorbar.h @@ -45,8 +45,10 @@ class NavigatorBar: public QWidget signals: void goNextMonth(); void goPrevMonth(); + void goNextWeek(); + void goPrevWeek(); void goNextYear(); void goPrevYear(); void monthSelected( int ); @@ -55,8 +57,10 @@ class NavigatorBar: public QWidget QPushButton *mPrevYear; QPushButton *mPrevMonth; QPushButton *mNextMonth; + QPushButton *mPrevWeek; + QPushButton *mNextWeek; QPushButton *mNextYear; QPushButton *mSelectMonth; //QLabel *mDateLabel; |