[Kde-pim] branches/work/akonadi-ports/kdepim/korganizer

Frank Osterfeld frank.osterfeld at kdemail.net
Mon Nov 2 17:25:06 GMT 2009


SVN commit 1043925 by osterfeld:

UI overhaul: separate date range selection from the view type: View types are Agenda view, month view, timeline view, etc.
week, work week, day, next x days etc. goes to date range selection, without switching views.
The calendar is the primary interface for range selection now, with the day, week, work week, next n days actions as shortcuts.
The latter only change the date selection now, instead of forcing a switch to the agenda view.
That way the range selection also works better for other view types, such as the timeline, what's next, etc. views. 
Comments welcome.

CCMAIL:kde-pim at kde.org


 M  +26 -19    actionmanager.cpp  
 M  +7 -8      korganizer_part.rc  
 M  +17 -15    korganizerui.rc  
 M  +8 -11     koviewmanager.cpp  
 M  +5 -5      koviewmanager.h  


--- branches/work/akonadi-ports/kdepim/korganizer/actionmanager.cpp #1043924:1043925
@@ -489,31 +489,16 @@
   connect( action, SIGNAL(triggered(bool)), mCalendarView->viewManager(),
            SLOT(showWhatsNextView()) );
 
-  action = new KAction( KIcon( "view-calendar-day" ), i18n( "&Day" ), this );
-  mACollection->addAction( "view_day", action );
-  connect( action, SIGNAL(triggered(bool)), mCalendarView->viewManager(),
-           SLOT(showDayView()) );
-
-  mNextXDays = new KAction( KIcon( "view-calendar-upcoming-days" ), QString(), this );
-  mACollection->addAction( "view_nextx", mNextXDays );
-  connect( mNextXDays, SIGNAL(triggered(bool)), mCalendarView->viewManager(),
-           SLOT(showNextXView()) );
-  mNextXDays->setText( i18np( "&Next Day", "&Next %1 Days", KOPrefs::instance()->mNextXDays ) );
   action = new KAction( KIcon( "view-calendar-month" ), i18n( "&Month" ), this );
   mACollection->addAction( "view_month", action );
   connect( action, SIGNAL(triggered(bool)),
            mCalendarView->viewManager(), SLOT(showMonthView()) );
 
-  action = new KAction( KIcon( "view-calendar-workweek" ), i18n( "W&ork Week" ), this );
-  mACollection->addAction( "view_workweek", action );
-  connect( action, SIGNAL(triggered(bool)), mCalendarView->viewManager(),
-           SLOT(showWorkWeekView()) );
+  action = new KAction( KIcon( "view-calendar-week" ), i18n( "&Agenda" ), this );
+  mACollection->addAction( "view_agenda", action );
+  connect( action, SIGNAL(triggered(bool)),
+           mCalendarView->viewManager(), SLOT(showAgendaView()) );
 
-  action = new KAction( KIcon( "view-calendar-week" ), i18n( "&Week" ), this );
-  mACollection->addAction( "view_week", action );
-  connect( action, SIGNAL(triggered(bool)), mCalendarView->viewManager(),
-           SLOT(showWeekView()) );
-
   action = new KAction( KIcon( "view-calendar-list" ), i18n( "&Event List" ), this );
   mACollection->addAction( "view_list", action );
   connect( action, SIGNAL(triggered(bool)), mCalendarView->viewManager(),
@@ -581,6 +566,7 @@
   connect( action, SIGNAL(triggered(bool)), mCalendarView->viewManager(),
            SLOT(zoomOutVertically()) );
 
+
   /************************** Actions MENU *********************************/
   bool isRTL = QApplication::isRightToLeft();
 
@@ -617,6 +603,27 @@
            action,SLOT(setText(const QString &)) );
   */
 
+  action = new KAction( KIcon( "view-calendar-day" ), i18n( "Select &Day" ), this );
+  mACollection->addAction( "select_day", action );
+  connect( action, SIGNAL(triggered(bool)), mCalendarView->viewManager(),
+           SLOT(selectDay()) );
+
+  mNextXDays = new KAction( KIcon( "view-calendar-upcoming-days" ), QString(), this );
+  mACollection->addAction( "select_nextx", mNextXDays );
+  connect( mNextXDays, SIGNAL(triggered(bool)), mCalendarView->viewManager(),
+           SLOT(selectNextX()) );
+  mNextXDays->setText( i18np( "Select &Next Day", "Select &Next %1 Days", KOPrefs::instance()->mNextXDays ) );
+
+  action = new KAction( KIcon( "view-calendar-workweek" ), i18n( "Select W&ork Week" ), this );
+  mACollection->addAction( "select_workweek", action );
+  connect( action, SIGNAL(triggered(bool)), mCalendarView->viewManager(),
+           SLOT(selectWorkWeek()) );
+
+  action = new KAction( KIcon( "view-calendar-week" ), i18n( "Select &Week" ), this );
+  mACollection->addAction( "select_week", action );
+  connect( action, SIGNAL(triggered(bool)), mCalendarView->viewManager(),
+           SLOT(selectWeek()) );
+
   /************************** Actions MENU *********************************/
   mNewEventAction = new KAction( KIcon( "appointment-new" ), i18n( "New E&vent..." ), this );
   mNewEventAction->setIconText( i18nc( "@action:intoolbar create a new event", "Event" ) );
--- branches/work/akonadi-ports/kdepim/korganizer/korganizer_part.rc #1043924:1043925
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui>
-<kpartgui name="korganizer" version="414">
+<kpartgui name="korganizer" version="415">
 
   <MenuBar>
     <Menu name="file"><text>&File</text>
@@ -47,12 +47,6 @@
       <Action name="view_timespent"/>
       <Action name="view_timeline"/>
       <Separator/>
-      <Action name="view_day"/>
-      <Action name="view_nextx"/>
-      <Action name="view_workweek"/>
-      <Action name="view_week"/>
-      <Action name="view_month"/>
-      <Separator/>
       <Action name="view_list"/>
       <Action name="view_todo"/>
       <Action name="view_journal"/>
@@ -72,11 +66,16 @@
         <Action name="zoom_out_vertically"/>
       </Menu>
     </Menu>
-    <Menu name="go"><text>&Go</text>
+    <Menu name="dates"><text>&Dates</text>
       <Action name="go_previous"/>
       <Action name="go_next"/>
       <Separator/>
       <Action name="go_today"/>
+      <Separator/>
+      <Action name="select_day"/>
+      <Action name="select_nextx"/>
+      <Action name="select_workweek"/>
+      <Action name="select_week"/>
     </Menu>
     <Menu name="actions"><text>&Actions</text>
       <Action name="new_event"/>
--- branches/work/akonadi-ports/kdepim/korganizer/korganizerui.rc #1043924:1043925
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui>
-<kpartgui name="korganizer" version="415">
+<kpartgui name="korganizer" version="416">
 
   <MenuBar>
     <Menu name="file"><text>&File</text>
@@ -29,19 +29,13 @@
       <Action name="edit_delete" append="edit_paste_merge"/>
     </Menu>
     <Menu name="view"><text>&View</text>
+      <Action name="view_agenda"/>
+      <Action name="view_month"/>
+      <Action name="view_timeline"/>
+      <Action name="view_todo"/>      
+      <Action name="view_list"/>
       <Action name="view_whatsnext"/>
       <Action name="view_timespent"/>
-      <Action name="view_timeline"/>
-      <Separator/>
-      <Action name="view_day"/>
-      <Action name="view_nextx"/>
-      <Action name="view_workweek"/>
-      <Action name="view_week"/>
-      <Action name="view_month"/>
-      <Action name="view_newmonth"/>
-      <Separator/>
-      <Action name="view_list"/>
-      <Action name="view_todo"/>
       <Action name="view_journal"/>
       <Merge/>
       <Separator/>
@@ -59,11 +53,18 @@
         <Action name="zoom_out_vertically"/>
       </Menu>
     </Menu>
-    <Menu name="go"><text>&Go</text>
+    <Menu name="dates"><text>&Dates</text>
       <Action name="go_previous"/>
       <Action name="go_next"/>
       <Separator/>
       <Action name="go_today"/>
+      <Separator/>
+      <Action name="select_day"/>
+      <Action name="select_nextx"/>
+      <Action name="select_workweek"/>
+      <Action name="select_week"/>
+      <Action name="select_newmonth"/>
+      <Merge/>
     </Menu>
     <Menu name="actions"><text>&Actions</text>
       <Action name="new_event"/>
@@ -128,10 +129,11 @@
     <Action name="go_today"/>
   </ToolBar>
 
+  
   <ToolBar noMerge="1" name="korganizer_toolbar"><text>Views</text>
-    <Action name="view_day"/>
-    <Action name="view_week"/>
+    <Action name="view_agenda"/>
     <Action name="view_month"/>
+    <Action name="view_timeline"/>
     <Action name="view_todo"/>
     <Action name="view_journal"/>
     <Merge/>
--- branches/work/akonadi-ports/kdepim/korganizer/koviewmanager.cpp #1043924:1043925
@@ -462,37 +462,33 @@
   }
 }
 
-void KOViewManager::showDayView()
+void KOViewManager::selectDay()
 {
-  QDate date = mMainView->activeDate();
-  showAgendaView();
+  const QDate date = mMainView->activeDate();
   mMainView->dateNavigator()->selectDate( date );
 }
 
-void KOViewManager::showWorkWeekView()
+void KOViewManager::selectWorkWeek()
 {
   if ( KOGlobals::self()->getWorkWeekMask() != 0 ) {
     QDate date = mMainView->activeDate();
-    showAgendaView();
     mMainView->dateNavigator()->selectWorkWeek( date );
   } else {
     KMessageBox::sorry(
       mMainView,
-      i18n( "Unable to display the work week view since there are no work days configured. "
+      i18n( "Unable to display the work week since there are no work days configured. "
             "Please properly configure at least 1 work day in the Time and Date preferences." ) );
   }
 }
 
-void KOViewManager::showWeekView()
+void KOViewManager::selectWeek()
 {
   QDate date = mMainView->activeDate();
-  showAgendaView();
   mMainView->dateNavigator()->selectWeek( date );
 }
 
-void KOViewManager::showNextXView()
+void KOViewManager::selectNextX()
 {
-  showAgendaView();
   mMainView->dateNavigator()->selectDates( QDate::currentDate(),
                                            KOPrefs::instance()->mNextXDays );
 }
@@ -544,7 +540,8 @@
     goMenu( true );
     showView( mLastEventView );
   } else {
-    showWeekView();
+    showAgendaView();
+    selectWeek();
   }
 }
 
--- branches/work/akonadi-ports/kdepim/korganizer/koviewmanager.h #1043924:1043925
@@ -111,18 +111,18 @@
     void showWhatsNextView();
     void showListView();
     void showAgendaView();
-    void showDayView();
-    void showWorkWeekView();
-    void showWeekView();
-    void showNextXView();
     void showTodoView();
     void showTimeLineView();
     void showTimeSpentView();
     void showMonthView();
     void showJournalView();
-
     void showEventView();
 
+    void selectDay();
+    void selectWorkWeek();
+    void selectWeek();
+    void selectNextX();
+
     void connectTodoView( KOTodoView *todoView );
 
     void zoomInHorizontally();
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list