diff options
author | Kidd Wang <kidd.wang@sun.com> | 2004-01-06 14:04:11 +0800 |
---|---|---|
committer | Harry Lu <haip@src.gnome.org> | 2004-01-06 14:04:11 +0800 |
commit | 6f2710f8e6ffd7e354da7262d63f6f234dee70e9 (patch) | |
tree | 8fd49cb07c551df84c9ec7df9dbe5e45fcadd00f /calendar | |
parent | e409aaa013689b2fc165b63dc2a237deafebc279 (diff) | |
download | gsoc2013-evolution-6f2710f8e6ffd7e354da7262d63f6f234dee70e9.tar.gz gsoc2013-evolution-6f2710f8e6ffd7e354da7262d63f6f234dee70e9.tar.zst gsoc2013-evolution-6f2710f8e6ffd7e354da7262d63f6f234dee70e9.zip |
open a dialog for the selected task. ditto. add a menu item for "Open
2004-01-06 Kidd Wang <kidd.wang@sun.com>
* gui/e-calendar-table.[ch] (e_calendar_table_open_selected):
open a dialog for the selected task.
* gui/e-tasks.[ch] (e_tasks_open_task): ditto.
* gui/tasks-control.c (tasks_control_sensitize_commands),
(tasks_control_open_task_cmd): add a menu item for "Open Task".
svn path=/trunk/; revision=24064
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/gui/calendar-commands.c | 2 | ||||
-rw-r--r-- | calendar/gui/e-cal-view.h | 7 | ||||
-rw-r--r-- | calendar/gui/e-calendar-table.c | 10 | ||||
-rw-r--r-- | calendar/gui/e-calendar-table.h | 1 | ||||
-rw-r--r-- | calendar/gui/e-calendar-view.h | 7 | ||||
-rw-r--r-- | calendar/gui/e-tasks.c | 9 | ||||
-rw-r--r-- | calendar/gui/e-tasks.h | 1 | ||||
-rw-r--r-- | calendar/gui/tasks-control.c | 16 |
9 files changed, 60 insertions, 1 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 26262ec5f9..0d23c49db7 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2004-01-06 Kidd Wang <kidd.wang@sun.com> + + * gui/e-calendar-table.[ch] (e_calendar_table_open_selected): + open a dialog for the selected task. + * gui/e-tasks.[ch] (e_tasks_open_task): ditto. + * gui/tasks-control.c (tasks_control_sensitize_commands), + (tasks_control_open_task_cmd): add a menu item for "Open Task". + 2004-01-05 Rodrigo Moya <rodrigo@ximian.com> * gui/gnome-cal.c (open_ecal): new function to open ECal's, get any diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c index 9127ab8d84..ce6c5651b3 100644 --- a/calendar/gui/calendar-commands.c +++ b/calendar/gui/calendar-commands.c @@ -544,7 +544,7 @@ calendar_control_sensitize_calendar_commands (BonoboControl *control, GnomeCalen } bonobo_ui_component_set_prop (uic, "/commands/EventOpen", "sensitive", - n_selected == 0 || read_only ? "0" : "1", + n_selected != 1 ? "0" : "1", NULL); bonobo_ui_component_set_prop (uic, "/commands/Cut", "sensitive", n_selected == 0 || read_only ? "0" : "1", diff --git a/calendar/gui/e-cal-view.h b/calendar/gui/e-cal-view.h index c224098554..8f1f1ba285 100644 --- a/calendar/gui/e-cal-view.h +++ b/calendar/gui/e-cal-view.h @@ -48,6 +48,13 @@ typedef enum { E_CALENDAR_VIEW_POS_BOTTOM_EDGE } ECalendarViewPosition; +typedef enum { + E_CAL_VIEW_MOVE_UP, + E_CAL_VIEW_MOVE_DOWN, + E_CAL_VIEW_MOVE_LEFT, + E_CAL_VIEW_MOVE_RIGHT +} ECalViewMoveDirection; + #define E_CALENDAR_VIEW_EVENT_FIELDS \ GnomeCanvasItem *canvas_item; \ ECalModelComponent *comp_data; \ diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index 4200f2421b..1fa9b9c0b2 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -589,6 +589,16 @@ e_calendar_table_get_table (ECalendarTable *cal_table) return e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable)); } +void +e_calendar_table_open_selected (ECalendarTable *cal_table) +{ + ECalModelComponent *comp_data; + + comp_data = get_selected_comp (cal_table); + if (comp_data != NULL) + open_task (cal_table, comp_data, FALSE); +} + /** * e_calendar_table_complete_selected: * @cal_table: A calendar table diff --git a/calendar/gui/e-calendar-table.h b/calendar/gui/e-calendar-table.h index 2cff1bead3..1aebd430b8 100644 --- a/calendar/gui/e-calendar-table.h +++ b/calendar/gui/e-calendar-table.h @@ -76,6 +76,7 @@ ECalModel *e_calendar_table_get_model (ECalendarTable *cal_table); ETable *e_calendar_table_get_table (ECalendarTable *cal_table); +void e_calendar_table_open_selected (ECalendarTable *cal_table); void e_calendar_table_complete_selected (ECalendarTable *cal_table); void e_calendar_table_delete_selected (ECalendarTable *cal_table); diff --git a/calendar/gui/e-calendar-view.h b/calendar/gui/e-calendar-view.h index c224098554..8f1f1ba285 100644 --- a/calendar/gui/e-calendar-view.h +++ b/calendar/gui/e-calendar-view.h @@ -48,6 +48,13 @@ typedef enum { E_CALENDAR_VIEW_POS_BOTTOM_EDGE } ECalendarViewPosition; +typedef enum { + E_CAL_VIEW_MOVE_UP, + E_CAL_VIEW_MOVE_DOWN, + E_CAL_VIEW_MOVE_LEFT, + E_CAL_VIEW_MOVE_RIGHT +} ECalViewMoveDirection; + #define E_CALENDAR_VIEW_EVENT_FIELDS \ GnomeCanvasItem *canvas_item; \ ECalModelComponent *comp_data; \ diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index 10d180ef77..b092fc5cfe 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -804,6 +804,15 @@ backend_error_cb (ECal *client, const char *message, gpointer data) } void +e_tasks_open_task (ETasks *tasks) +{ + ECalendarTable *cal_table; + + cal_table = e_tasks_get_calendar_table (tasks); + e_calendar_table_open_selected (cal_table); +} + +void e_tasks_new_task (ETasks *tasks) { ETasksPrivate *priv; diff --git a/calendar/gui/e-tasks.h b/calendar/gui/e-tasks.h index 10e79ef8c3..4b6f3a6b75 100644 --- a/calendar/gui/e-tasks.h +++ b/calendar/gui/e-tasks.h @@ -69,6 +69,7 @@ gboolean e_tasks_remove_todo_uri (ETasks *tasks, const char *str_uri); gboolean e_tasks_set_default_uri (ETasks *tasks, const char *str_uri); ECal *e_tasks_get_default_client (ETasks *tasks); +void e_tasks_open_task (ETasks *tasks); void e_tasks_new_task (ETasks *tasks); void e_tasks_complete_selected (ETasks *tasks); void e_tasks_delete_selected (ETasks *tasks); diff --git a/calendar/gui/tasks-control.c b/calendar/gui/tasks-control.c index fc4b560f76..aa63f91519 100644 --- a/calendar/gui/tasks-control.c +++ b/calendar/gui/tasks-control.c @@ -71,6 +71,9 @@ static void tasks_control_set_property (BonoboPropertyBag *bag, static void tasks_control_activate_cb (BonoboControl *control, gboolean activate, gpointer user_data); +static void tasks_control_open_task_cmd (BonoboUIComponent *uic, + gpointer data, + const char *path); static void tasks_control_new_task_cmd (BonoboUIComponent *uic, gpointer data, const char *path); @@ -246,6 +249,9 @@ tasks_control_sensitize_commands (BonoboControl *control, ETasks *tasks, int n_s model = e_calendar_table_get_model (e_tasks_get_calendar_table (tasks)); e_cal_is_read_only (e_cal_model_get_default_client (model), &read_only, NULL); + bonobo_ui_component_set_prop (uic, "/commands/TasksOpenTask", "sensitive", + n_selected != 1 ? "0" : "1", + NULL); bonobo_ui_component_set_prop (uic, "/commands/TasksCut", "sensitive", n_selected == 0 || read_only ? "0" : "1", NULL); @@ -278,6 +284,7 @@ selection_changed_cb (ETasks *tasks, int n_selected, gpointer data) } static BonoboUIVerb verbs [] = { + BONOBO_UI_VERB ("TasksOpenTask", tasks_control_open_task_cmd), BONOBO_UI_VERB ("TasksNewTask", tasks_control_new_task_cmd), BONOBO_UI_VERB ("TasksCut", tasks_control_cut_cmd), BONOBO_UI_VERB ("TasksCopy", tasks_control_copy_cmd), @@ -359,6 +366,15 @@ tasks_control_deactivate (BonoboControl *control, ETasks *tasks) bonobo_ui_component_unset_container (uic, NULL); } +static void tasks_control_open_task_cmd (BonoboUIComponent *uic, + gpointer data, + const char *path) +{ + ETasks *tasks; + + tasks = E_TASKS (data); + e_tasks_open_task (tasks); +} static void tasks_control_new_task_cmd (BonoboUIComponent *uic, |