aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs/comp-editor.c
diff options
context:
space:
mode:
authorLarry Ewing <lewing@ximian.com>2001-10-14 12:02:13 +0800
committerLarry Ewing <lewing@src.gnome.org>2001-10-14 12:02:13 +0800
commita28d0468805da949037d3a64c0ebfda21be77a56 (patch)
tree2ee7e587172ab049d1b81dcd72bdf177d39f36f7 /calendar/gui/dialogs/comp-editor.c
parent063f8d21af2564bf6c627d791a33e892c413eb7e (diff)
downloadgsoc2013-evolution-a28d0468805da949037d3a64c0ebfda21be77a56.tar
gsoc2013-evolution-a28d0468805da949037d3a64c0ebfda21be77a56.tar.gz
gsoc2013-evolution-a28d0468805da949037d3a64c0ebfda21be77a56.tar.bz2
gsoc2013-evolution-a28d0468805da949037d3a64c0ebfda21be77a56.tar.lz
gsoc2013-evolution-a28d0468805da949037d3a64c0ebfda21be77a56.tar.xz
gsoc2013-evolution-a28d0468805da949037d3a64c0ebfda21be77a56.tar.zst
gsoc2013-evolution-a28d0468805da949037d3a64c0ebfda21be77a56.zip
call set_icon_from_comp. (set_icon_from_comp): set the window icon from
2001-10-13 Larry Ewing <lewing@ximian.com> * gui/dialogs/comp-editor.c (real_edit_comp): call set_icon_from_comp. (set_icon_from_comp): set the window icon from the comp. (make_icon_from_comp): get the icon path based on comp type. * gui/dialogs/Makefile.am (iconsdir): EVOLUTION_ICONSDIR bits. svn path=/trunk/; revision=13666
Diffstat (limited to 'calendar/gui/dialogs/comp-editor.c')
-rw-r--r--calendar/gui/dialogs/comp-editor.c34
1 files changed, 34 insertions, 0 deletions
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);
}