aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-12-02 04:45:32 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2000-12-02 04:45:32 +0800
commitccb0fc275449ff705c328502140576717e72076a (patch)
treef682bf2bd5732ddeab3c5212a4b16b21e38c5b1f
parent7c69d2523a8b4760065b1596c1837292e9dfff53 (diff)
downloadgsoc2013-evolution-ccb0fc275449ff705c328502140576717e72076a.tar
gsoc2013-evolution-ccb0fc275449ff705c328502140576717e72076a.tar.gz
gsoc2013-evolution-ccb0fc275449ff705c328502140576717e72076a.tar.bz2
gsoc2013-evolution-ccb0fc275449ff705c328502140576717e72076a.tar.lz
gsoc2013-evolution-ccb0fc275449ff705c328502140576717e72076a.tar.xz
gsoc2013-evolution-ccb0fc275449ff705c328502140576717e72076a.tar.zst
gsoc2013-evolution-ccb0fc275449ff705c328502140576717e72076a.zip
New function to generate a title and convert it from UTF8 before setting
2000-12-01 Federico Mena Quintero <federico@helixcode.com> * gui/event-editor.c (set_title_from_comp): New function to generate a title and convert it from UTF8 before setting it on the window. (save_event_object): Uset set_title_from_comp(). (event_editor_set_event_object): Likewise. svn path=/trunk/; revision=6761
-rw-r--r--calendar/ChangeLog8
-rw-r--r--calendar/gui/event-editor.c34
2 files changed, 32 insertions, 10 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index bc12ba6550..f619de8909 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,11 @@
+2000-12-01 Federico Mena Quintero <federico@helixcode.com>
+
+ * gui/event-editor.c (set_title_from_comp): New function to
+ generate a title and convert it from UTF8 before setting it on the
+ window.
+ (save_event_object): Uset set_title_from_comp().
+ (event_editor_set_event_object): Likewise.
+
2000-11-30 JP Rosevear <jpr@helixcode.com>
* conduits/todo/todo-conduit.c: Debug message cleanups
diff --git a/calendar/gui/event-editor.c b/calendar/gui/event-editor.c
index 6e481c3103..c33f5b720d 100644
--- a/calendar/gui/event-editor.c
+++ b/calendar/gui/event-editor.c
@@ -336,6 +336,28 @@ make_title_from_comp (CalComponent *comp)
}
}
+/* Sets the event editor's window title from a calendar component */
+static void
+set_title_from_comp (EventEditor *ee, CalComponent *comp)
+{
+ EventEditorPrivate *priv;
+ char *title, *tmp;
+
+ priv = ee->priv;
+
+ title = make_title_from_comp (comp);
+ tmp = e_utf8_to_gtk_string (priv->app, title);
+ g_free (title);
+
+ if (tmp) {
+ gtk_window_set_title (GTK_WINDOW (priv->app), tmp);
+ g_free (tmp);
+ } else {
+ g_message ("set_title_from_comp(): Could not convert the title from UTF8");
+ gtk_window_set_title (GTK_WINDOW (priv->app), "");
+ }
+}
+
/* Callback used when the recurrence weekday picker changes */
static void
recur_weekday_picker_changed_cb (WeekdayPicker *wp, gpointer data)
@@ -2173,7 +2195,6 @@ static void
save_event_object (EventEditor *ee)
{
EventEditorPrivate *priv;
- char *title;
priv = ee->priv;
@@ -2181,10 +2202,7 @@ save_event_object (EventEditor *ee)
return;
dialog_to_comp_object (ee, priv->comp);
-
- title = make_title_from_comp (priv->comp);
- gtk_window_set_title (GTK_WINDOW (priv->app), title);
- g_free (title);
+ set_title_from_comp (ee, priv->comp);
if (!cal_client_update_object (priv->client, priv->comp))
g_message ("save_event_object(): Could not update the object!");
@@ -2600,7 +2618,6 @@ void
event_editor_set_event_object (EventEditor *ee, CalComponent *comp)
{
EventEditorPrivate *priv;
- char *title;
g_return_if_fail (ee != NULL);
g_return_if_fail (IS_EVENT_EDITOR (ee));
@@ -2616,10 +2633,7 @@ event_editor_set_event_object (EventEditor *ee, CalComponent *comp)
priv->comp = cal_component_clone (comp);
}
- title = make_title_from_comp (priv->comp);
- gtk_window_set_title (GTK_WINDOW (priv->app), title);
- g_free (title);
-
+ set_title_from_comp (ee, priv->comp);
fill_widgets (ee);
}