diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2003-06-24 19:37:12 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2003-06-24 19:37:12 +0800 |
commit | 0c1f55e5e62a0a1552fd4e15330caa47ae02eb5a (patch) | |
tree | 37d47a04c59c6ed4035aa8a4d2f1da5bf26965c1 /calendar/gui/dialogs | |
parent | 25abba93c70acc187f81ed04514ff4bec1068aed (diff) | |
download | gsoc2013-evolution-0c1f55e5e62a0a1552fd4e15330caa47ae02eb5a.tar.gz gsoc2013-evolution-0c1f55e5e62a0a1552fd4e15330caa47ae02eb5a.tar.zst gsoc2013-evolution-0c1f55e5e62a0a1552fd4e15330caa47ae02eb5a.zip |
new functions. (page_summary_changed_cb): change the window title when the
2003-06-23 Rodrigo Moya <rodrigo@ximian.com>
* gui/dialogs/comp-editor.c (make_title_from_string, set_title_from_string):
new functions.
(page_summary_changed_cb): change the window title when the object's
summary changes.
svn path=/trunk/; revision=21523
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 57ba30bf6d..d1712eca03 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -818,6 +818,42 @@ make_title_from_comp (CalComponent *comp) return title; } +/* Creates an appropriate title for the event editor dialog */ +static char * +make_title_from_string (CalComponent *comp, const char *str) +{ + char *title; + const char *type_string; + CalComponentVType type; + + if (!comp) + return g_strdup (_("Edit Appointment")); + + type = cal_component_get_vtype (comp); + switch (type) { + case CAL_COMPONENT_EVENT: + type_string = _("Appointment - %s"); + break; + case CAL_COMPONENT_TODO: + type_string = _("Task - %s"); + break; + case CAL_COMPONENT_JOURNAL: + type_string = _("Journal entry - %s"); + break; + default: + g_message ("make_title_from_string(): Cannot handle object of type %d", type); + return NULL; + } + + if (str) { + title = g_strdup_printf (type_string, str); + } else { + title = g_strdup_printf (type_string, _("No summary")); + } + + return title; +} + static const char * make_icon_from_comp (CalComponent *comp) { @@ -853,6 +889,18 @@ set_title_from_comp (CompEditor *editor) } static void +set_title_from_string (CompEditor *editor, const char *str) +{ + CompEditorPrivate *priv; + char *title; + + priv = editor->priv; + title = make_title_from_string (priv->comp, str); + gtk_window_set_title (GTK_WINDOW (editor), title); + g_free (title); +} + +static void set_icon_from_comp (CompEditor *editor) { CompEditorPrivate *priv; @@ -1358,6 +1406,8 @@ page_summary_changed_cb (GtkObject *obj, const char *summary, gpointer data) _("Changes made to this item may be discarded if an update arrives")); priv->warned = TRUE; } + + set_title_from_string (editor, summary); } static void |