diff options
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/dialogs/Makefile.am | 3 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 34 |
2 files changed, 37 insertions, 0 deletions
diff --git a/calendar/gui/dialogs/Makefile.am b/calendar/gui/dialogs/Makefile.am index c0c410a565..2784a36004 100644 --- a/calendar/gui/dialogs/Makefile.am +++ b/calendar/gui/dialogs/Makefile.am @@ -31,6 +31,7 @@ INCLUDES = \ $(EXTRA_GNOME_CFLAGS) \ -DEVOLUTION_DATADIR=\""$(datadir)"\" \ -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ + -DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \ -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \ $(BONOBO_VFS_GNOME_CFLAGS) \ -DGNOMELOCALEDIR=\""$(localedir)"\" @@ -80,6 +81,8 @@ libcal_dialogs_a_SOURCES = \ task-page.c \ task-page.h +iconsdir = $(datadir)/images/evolution + gladedir = $(datadir)/evolution/glade glade_DATA = \ alarm-options.glade \ diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index b6d6e233db..2ae92ac9c3 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -657,6 +657,28 @@ make_title_from_comp (CalComponent *comp) return title; } +static const char * +make_icon_from_comp (CalComponent *comp) +{ + CalComponentVType type; + const char *icon_path; + + if (!comp) + return EVOLUTION_ICONSDIR "/evolution-calendar-mini.png"; + + type = cal_component_get_vtype (comp); + switch (type) { + case CAL_COMPONENT_EVENT: + return EVOLUTION_ICONSDIR "/buttons/new_appointment.png"; + break; + case CAL_COMPONENT_TODO: + return EVOLUTION_ICONSDIR "/buttons/new_task.png"; + break; + default: + return EVOLUTION_ICONSDIR "/evolution-calendar-mini.png"; + } +} + /* Sets the event editor's window title from a calendar component */ static void set_title_from_comp (CompEditor *editor) @@ -671,6 +693,17 @@ set_title_from_comp (CompEditor *editor) } static void +set_icon_from_comp (CompEditor *editor) +{ + CompEditorPrivate *priv; + char *file; + + priv = editor->priv; + file = make_icon_from_comp (priv->comp); + gnome_window_icon_set_from_file (GTK_WINDOW (priv->window), file); +} + +static void fill_widgets (CompEditor *editor) { CompEditorPrivate *priv; @@ -741,6 +774,7 @@ real_edit_comp (CompEditor *editor, CalComponent *comp) priv->comp = cal_component_clone (comp); set_title_from_comp (editor); + set_icon_from_comp (editor); fill_widgets (editor); } |