aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKidd Wang <kidd.wang@sun.com>2003-12-29 17:58:32 +0800
committerHarry Lu <haip@src.gnome.org>2003-12-29 17:58:32 +0800
commit68a053e3d3626de202240e9f9344e4d3afe78246 (patch)
treead5aedc23ff1eb4f9a97ae0c1c785886d4495bb1
parent4d52f684219df276a621cf7a40fea3f3112c578b (diff)
downloadgsoc2013-evolution-68a053e3d3626de202240e9f9344e4d3afe78246.tar
gsoc2013-evolution-68a053e3d3626de202240e9f9344e4d3afe78246.tar.gz
gsoc2013-evolution-68a053e3d3626de202240e9f9344e4d3afe78246.tar.bz2
gsoc2013-evolution-68a053e3d3626de202240e9f9344e4d3afe78246.tar.lz
gsoc2013-evolution-68a053e3d3626de202240e9f9344e4d3afe78246.tar.xz
gsoc2013-evolution-68a053e3d3626de202240e9f9344e4d3afe78246.tar.zst
gsoc2013-evolution-68a053e3d3626de202240e9f9344e4d3afe78246.zip
add a menu item for "open appointment".
2003-12-29 Kidd Wang <kidd.wang@sun.com> * gui/calendar-commands.c (file_open_event_cb): add a menu item for "open appointment". * gui/e-cal-view.[ch] (e_calendar_view_open_event): add a signal "open_event" and bind it to "ctrl+o". When the signal is delivered, a dialog will be opened to edit the selected event. * gui/e-calendar-table.c (e_calendar_table_on_key_press): press "ctrl-o" to open a dialog. svn path=/trunk/; revision=24012
-rw-r--r--calendar/ChangeLog12
-rw-r--r--calendar/gui/calendar-commands.c15
-rw-r--r--calendar/gui/e-cal-view.c43
-rw-r--r--calendar/gui/e-cal-view.h3
-rw-r--r--calendar/gui/e-calendar-table.c4
-rw-r--r--calendar/gui/e-calendar-view.c43
-rw-r--r--calendar/gui/e-calendar-view.h3
-rw-r--r--calendar/gui/e-day-view.c5
8 files changed, 127 insertions, 1 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 6829698209..b721b38270 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,15 @@
+2003-12-29 Kidd Wang <kidd.wang@sun.com>
+
+ * gui/calendar-commands.c (file_open_event_cb): add a menu item
+ for "open appointment".
+
+ * gui/e-cal-view.[ch] (e_calendar_view_open_event): add a signal
+ "open_event" and bind it to "ctrl+o". When the signal is delivered,
+ a dialog will be opened to edit the selected event.
+
+ * gui/e-calendar-table.c (e_calendar_table_on_key_press): press "ctrl-o"
+ to open a dialog.
+
2003-12-24 JP Rosevear <jpr@ximian.com>
* gui/e-select-names-renderer.c (esnr_start_editing): fix the
diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c
index c03b722de9..9127ab8d84 100644
--- a/calendar/gui/calendar-commands.c
+++ b/calendar/gui/calendar-commands.c
@@ -71,6 +71,17 @@ typedef struct {
guint taskpad_focused : 1;
} FocusData;
+static void
+file_open_event_cb (BonoboUIComponent *uic, gpointer data, const char *path)
+{
+ GnomeCalendar *gcal;
+
+ gcal = GNOME_CALENDAR (data);
+
+ e_calendar_view_open_event (gnome_calendar_get_current_view_widget (gcal));
+}
+
+
/* Prints the calendar at its current view and time range */
static void
print (GnomeCalendar *gcal, gboolean preview)
@@ -532,6 +543,9 @@ calendar_control_sensitize_calendar_commands (BonoboControl *control, GnomeCalen
read_only = TRUE;
}
+ bonobo_ui_component_set_prop (uic, "/commands/EventOpen", "sensitive",
+ n_selected == 0 || read_only ? "0" : "1",
+ NULL);
bonobo_ui_component_set_prop (uic, "/commands/Cut", "sensitive",
n_selected == 0 || read_only ? "0" : "1",
NULL);
@@ -685,6 +699,7 @@ gcal_taskpad_focus_change_cb (GnomeCalendar *gcal, gboolean in, gpointer data)
static BonoboUIVerb verbs [] = {
+ BONOBO_UI_VERB ("EventOpen", file_open_event_cb),
BONOBO_UI_VERB ("CalendarPrint", file_print_cb),
BONOBO_UI_VERB ("CalendarPrintPreview", file_print_preview_cb),
diff --git a/calendar/gui/e-cal-view.c b/calendar/gui/e-cal-view.c
index ffaca9bedb..1f65723d2b 100644
--- a/calendar/gui/e-cal-view.c
+++ b/calendar/gui/e-cal-view.c
@@ -25,6 +25,8 @@
#include <string.h>
#include <gtk/gtkimage.h>
#include <gtk/gtkstock.h>
+#include <gdk/gdkkeysyms.h>
+#include <gtk/gtkbindings.h>
#include <libgnome/gnome-i18n.h>
#include <gal/util/e-util.h>
#include "e-util/e-dialog-utils.h"
@@ -94,6 +96,7 @@ enum {
TIMEZONE_CHANGED,
EVENT_CHANGED,
EVENT_ADDED,
+ OPEN_EVENT,
LAST_SIGNAL
};
@@ -143,6 +146,8 @@ e_calendar_view_class_init (ECalendarViewClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkBindingSet *binding_set;
+
parent_class = g_type_class_peek_parent (klass);
/* Method override */
@@ -160,6 +165,7 @@ e_calendar_view_class_init (ECalendarViewClass *klass)
klass->set_selected_time_range = NULL;
klass->get_visible_time_range = NULL;
klass->update_query = NULL;
+ klass->open_event = e_calendar_view_open_event;
g_object_class_install_property (gobject_class, PROP_MODEL,
g_param_spec_object ("model", NULL, NULL, E_TYPE_CAL_MODEL,
@@ -202,6 +208,15 @@ e_calendar_view_class_init (ECalendarViewClass *klass)
G_TYPE_NONE, 1,
G_TYPE_POINTER);
+ e_calendar_view_signals[OPEN_EVENT] =
+ g_signal_new ("open_event",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (ECalendarViewClass, open_event),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
e_calendar_view_signals[EVENT_ADDED] =
g_signal_new ("event_added",
G_TYPE_FROM_CLASS (object_class),
@@ -216,6 +231,17 @@ e_calendar_view_class_init (ECalendarViewClass *klass)
if (!clipboard_atom)
clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
+
+ /*
+ * Key bindings
+ */
+
+ binding_set = gtk_binding_set_by_class (klass);
+
+ gtk_binding_entry_add_signal (binding_set, GDK_o,
+ GDK_CONTROL_MASK,
+ "open_event", 0);
+
/* init the accessibility support for e_day_view */
e_cal_view_a11y_init ();
}
@@ -1333,6 +1359,23 @@ e_calendar_view_create_popup_menu (ECalendarView *cal_view)
return popup;
}
+void
+e_calendar_view_open_event (ECalendarView *cal_view)
+{
+ GList *selected;
+
+ selected = e_calendar_view_get_selected_events (cal_view);
+ if (selected) {
+ ECalendarViewEvent *event = (ECalendarViewEvent *) selected->data;
+
+ if (event)
+ e_calendar_view_edit_appointment (cal_view, event->comp_data->client,
+ event->comp_data->icalcomp, FALSE);
+
+ g_list_free (selected);
+ }
+}
+
/**
* e_calendar_view_new_appointment_for
* @cal_view: A calendar view.
diff --git a/calendar/gui/e-cal-view.h b/calendar/gui/e-cal-view.h
index a1b11023b3..c224098554 100644
--- a/calendar/gui/e-cal-view.h
+++ b/calendar/gui/e-cal-view.h
@@ -87,6 +87,7 @@ struct _ECalendarViewClass {
void (* set_selected_time_range) (ECalendarView *cal_view, time_t start_time, time_t end_time);
gboolean (* get_visible_time_range) (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
void (* update_query) (ECalendarView *cal_view);
+ void (* open_event) (ECalendarView *cal_view);
};
GType e_calendar_view_get_type (void);
@@ -131,6 +132,8 @@ void e_calendar_view_edit_appointment (ECalendarView *cal_view,
ECal *client,
icalcomponent *icalcomp,
gboolean meeting);
+void e_calendar_view_open_event (ECalendarView *cal_view);
+
G_END_DECLS
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index d04315799d..4200f2421b 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -1283,6 +1283,10 @@ e_calendar_table_on_key_press (ETable *table,
if (event->keyval == GDK_Delete) {
delete_cb (NULL, cal_table);
return TRUE;
+ } else if ((event->keyval == GDK_o)
+ &&(event->state & GDK_CONTROL_MASK)) {
+ open_task_by_row (cal_table, row);
+ return TRUE;
}
return FALSE;
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index ffaca9bedb..1f65723d2b 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -25,6 +25,8 @@
#include <string.h>
#include <gtk/gtkimage.h>
#include <gtk/gtkstock.h>
+#include <gdk/gdkkeysyms.h>
+#include <gtk/gtkbindings.h>
#include <libgnome/gnome-i18n.h>
#include <gal/util/e-util.h>
#include "e-util/e-dialog-utils.h"
@@ -94,6 +96,7 @@ enum {
TIMEZONE_CHANGED,
EVENT_CHANGED,
EVENT_ADDED,
+ OPEN_EVENT,
LAST_SIGNAL
};
@@ -143,6 +146,8 @@ e_calendar_view_class_init (ECalendarViewClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkBindingSet *binding_set;
+
parent_class = g_type_class_peek_parent (klass);
/* Method override */
@@ -160,6 +165,7 @@ e_calendar_view_class_init (ECalendarViewClass *klass)
klass->set_selected_time_range = NULL;
klass->get_visible_time_range = NULL;
klass->update_query = NULL;
+ klass->open_event = e_calendar_view_open_event;
g_object_class_install_property (gobject_class, PROP_MODEL,
g_param_spec_object ("model", NULL, NULL, E_TYPE_CAL_MODEL,
@@ -202,6 +208,15 @@ e_calendar_view_class_init (ECalendarViewClass *klass)
G_TYPE_NONE, 1,
G_TYPE_POINTER);
+ e_calendar_view_signals[OPEN_EVENT] =
+ g_signal_new ("open_event",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (ECalendarViewClass, open_event),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
e_calendar_view_signals[EVENT_ADDED] =
g_signal_new ("event_added",
G_TYPE_FROM_CLASS (object_class),
@@ -216,6 +231,17 @@ e_calendar_view_class_init (ECalendarViewClass *klass)
if (!clipboard_atom)
clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
+
+ /*
+ * Key bindings
+ */
+
+ binding_set = gtk_binding_set_by_class (klass);
+
+ gtk_binding_entry_add_signal (binding_set, GDK_o,
+ GDK_CONTROL_MASK,
+ "open_event", 0);
+
/* init the accessibility support for e_day_view */
e_cal_view_a11y_init ();
}
@@ -1333,6 +1359,23 @@ e_calendar_view_create_popup_menu (ECalendarView *cal_view)
return popup;
}
+void
+e_calendar_view_open_event (ECalendarView *cal_view)
+{
+ GList *selected;
+
+ selected = e_calendar_view_get_selected_events (cal_view);
+ if (selected) {
+ ECalendarViewEvent *event = (ECalendarViewEvent *) selected->data;
+
+ if (event)
+ e_calendar_view_edit_appointment (cal_view, event->comp_data->client,
+ event->comp_data->icalcomp, FALSE);
+
+ g_list_free (selected);
+ }
+}
+
/**
* e_calendar_view_new_appointment_for
* @cal_view: A calendar view.
diff --git a/calendar/gui/e-calendar-view.h b/calendar/gui/e-calendar-view.h
index a1b11023b3..c224098554 100644
--- a/calendar/gui/e-calendar-view.h
+++ b/calendar/gui/e-calendar-view.h
@@ -87,6 +87,7 @@ struct _ECalendarViewClass {
void (* set_selected_time_range) (ECalendarView *cal_view, time_t start_time, time_t end_time);
gboolean (* get_visible_time_range) (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
void (* update_query) (ECalendarView *cal_view);
+ void (* open_event) (ECalendarView *cal_view);
};
GType e_calendar_view_get_type (void);
@@ -131,6 +132,8 @@ void e_calendar_view_edit_appointment (ECalendarView *cal_view,
ECal *client,
icalcomponent *icalcomp,
gboolean meeting);
+void e_calendar_view_open_event (ECalendarView *cal_view);
+
G_END_DECLS
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 0c08468a7d..d4e436dc6d 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -2101,7 +2101,7 @@ e_day_view_recalc_day_starts (EDayView *day_view,
day_view->lower = start_time;
day_view->upper = day_view->day_starts[day_view->days_shown];
- e_day_view_update_query (day_view);
+ e_day_view_update_query ((ECalendarView *) day_view);
}
@@ -3906,6 +3906,9 @@ e_day_view_free_events (EDayView *day_view)
day_view->resize_event_day = -1;
day_view->pressed_event_day = -1;
day_view->drag_event_day = -1;
+ day_view->editing_event_num = -1;
+ day_view->popup_event_num = -1;
+
e_day_view_free_event_array (day_view, day_view->long_events);