aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/event-editor.c
diff options
context:
space:
mode:
authorGediminas Paulauskas <menesis@delfi.lt>2001-05-08 01:33:31 +0800
committerGediminas Paulauskas <menesis@src.gnome.org>2001-05-08 01:33:31 +0800
commita703c61b47151e7b6897fa657bc22be6e8526c3a (patch)
tree364bbc4de381773e824de8147d20734b49284597 /calendar/gui/event-editor.c
parent85a74e8277cb8064c5958b30de8484eac8b04d8a (diff)
downloadgsoc2013-evolution-a703c61b47151e7b6897fa657bc22be6e8526c3a.tar
gsoc2013-evolution-a703c61b47151e7b6897fa657bc22be6e8526c3a.tar.gz
gsoc2013-evolution-a703c61b47151e7b6897fa657bc22be6e8526c3a.tar.bz2
gsoc2013-evolution-a703c61b47151e7b6897fa657bc22be6e8526c3a.tar.lz
gsoc2013-evolution-a703c61b47151e7b6897fa657bc22be6e8526c3a.tar.xz
gsoc2013-evolution-a703c61b47151e7b6897fa657bc22be6e8526c3a.tar.zst
gsoc2013-evolution-a703c61b47151e7b6897fa657bc22be6e8526c3a.zip
use define from widgets/misc/e-filter-bar.h instead of own enumeration and
2001-05-07 Gediminas Paulauskas <menesis@delfi.lt> * gui/component/addressbook.c: use define from widgets/misc/e-filter-bar.h instead of own enumeration and search menu names. * gui/component/Makefile.am, gui/component/select-names/Makefile.am: removed EVOLUTION_VERSION. 2001-05-07 Gediminas Paulauskas <menesis@delfi.lt> * gui/event-editor.c (make_title_from_comp): conversion summary from utf8 here, use translated strings as is. (set_title_from_comp): reflect this, simplify. * gui/dialogs/task-editor.c: updated copies of above functions here. * gui/gnome-cal.c: use defines from widgets/misc/e-filter-bar.h for consistency in "Show all". svn path=/trunk/; revision=9693
Diffstat (limited to 'calendar/gui/event-editor.c')
-rw-r--r--calendar/gui/event-editor.c49
1 files changed, 22 insertions, 27 deletions
diff --git a/calendar/gui/event-editor.c b/calendar/gui/event-editor.c
index 07fe04d992..b497679bac 100644
--- a/calendar/gui/event-editor.c
+++ b/calendar/gui/event-editor.c
@@ -368,57 +368,52 @@ event_editor_destroy (GtkObject *object)
static char *
make_title_from_comp (CalComponent *comp)
{
- const char *summary;
+ char *title;
+ const char *type_string;
CalComponentVType type;
CalComponentText text;
if (!comp)
return g_strdup (_("Edit Appointment"));
- cal_component_get_summary (comp, &text);
- if (text.value)
- summary = text.value;
- else
- summary = _("No summary");
-
-
type = cal_component_get_vtype (comp);
switch (type) {
case CAL_COMPONENT_EVENT:
- return g_strdup_printf (_("Appointment - %s"), summary);
-
+ type_string = _("Appointment - %s");
+ break;
case CAL_COMPONENT_TODO:
- return g_strdup_printf (_("Task - %s"), summary);
-
+ type_string = _("Task - %s");
+ break;
case CAL_COMPONENT_JOURNAL:
- return g_strdup_printf (_("Journal entry - %s"), summary);
-
+ type_string = _("Journal entry - %s");
+ break;
default:
g_message ("make_title_from_comp(): Cannot handle object of type %d", type);
return NULL;
}
+
+ cal_component_get_summary (comp, &text);
+ if (text.value) {
+ char *summary;
+ summary = e_utf8_to_locale_string (text.value);
+ title = g_strdup_printf (type_string, summary);
+ g_free (summary);
+ } else
+ title = g_strdup_printf (type_string, _("No summary"));
+
+ return title;
}
/* 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;
+ EventEditorPrivate *priv = ee->priv;
+ char *title;
title = make_title_from_comp (comp);
- tmp = e_utf8_to_gtk_string (priv->app, title);
+ gtk_window_set_title (GTK_WINDOW (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 */