From a703c61b47151e7b6897fa657bc22be6e8526c3a Mon Sep 17 00:00:00 2001 From: Gediminas Paulauskas Date: Mon, 7 May 2001 17:33:31 +0000 Subject: use define from widgets/misc/e-filter-bar.h instead of own enumeration and 2001-05-07 Gediminas Paulauskas * 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 * 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 --- addressbook/ChangeLog | 9 ++++ addressbook/gui/component/Makefile.am | 1 - addressbook/gui/component/addressbook.c | 14 +++--- addressbook/gui/component/select-names/Makefile.am | 1 - calendar/ChangeLog | 11 +++++ calendar/gui/dialogs/task-editor.c | 50 ++++++++++------------ calendar/gui/event-editor.c | 49 ++++++++++----------- calendar/gui/gnome-cal.c | 9 ++-- 8 files changed, 73 insertions(+), 71 deletions(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 18ad52edb1..1c7513e9c5 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,12 @@ +2001-05-07 Gediminas Paulauskas + + * 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-04 Chris Toshok * gui/component/addressbook-component.c (remove_folder): un-#if 0 diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am index 3089f53901..de6e3f2337 100644 --- a/addressbook/gui/component/Makefile.am +++ b/addressbook/gui/component/Makefile.am @@ -15,7 +15,6 @@ INCLUDES = \ -I$(top_srcdir)/addressbook/backend \ -I$(top_builddir)/addressbook/backend \ $(BONOBO_HTML_GNOME_CFLAGS) \ - -DEVOLUTION_VERSION=\""$(VERSION)"\" \ -DEVOLUTION_DATADIR=\""$(datadir)"\" \ -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ -DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \ diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index 197de831fa..a67b004f31 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -35,6 +35,7 @@ #include #include +#include #define PROPERTY_FOLDER_URI "folder_uri" @@ -554,15 +555,10 @@ set_prop (BonoboPropertyBag *bag, } } -enum { - ESB_SHOW_ALL, - ESB_ADVANCED, -}; - static ESearchBarItem addressbook_search_menu_items[] = { - { N_("Show All"), ESB_SHOW_ALL }, + E_FILTERBAR_RESET, { NULL, 0 }, - { N_("Advanced..."), ESB_ADVANCED}, + E_FILTERBAR_ADVANCED, { NULL, -1 } }; @@ -571,10 +567,10 @@ addressbook_menu_activated (ESearchBar *esb, int id, AddressbookView *view) { EBook *book; switch (id) { - case ESB_SHOW_ALL: + case E_FILTERBAR_RESET_ID: e_addressbook_view_show_all(view->view); break; - case ESB_ADVANCED: + case E_FILTERBAR_ADVANCED_ID: gtk_object_get(GTK_OBJECT(view->view), "book", &book, NULL); diff --git a/addressbook/gui/component/select-names/Makefile.am b/addressbook/gui/component/select-names/Makefile.am index 2d877fdf6e..8c308d937a 100644 --- a/addressbook/gui/component/select-names/Makefile.am +++ b/addressbook/gui/component/select-names/Makefile.am @@ -39,7 +39,6 @@ INCLUDES = \ -I$(top_srcdir)/addressbook/backend \ -I$(top_builddir)/addressbook/backend \ $(BONOBO_HTML_GNOME_CFLAGS) \ - -DEVOLUTION_VERSION=\""$(VERSION)"\" \ -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ -DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \ -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 2c8ef1d3e4..a85f671b82 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,14 @@ +2001-05-07 Gediminas Paulauskas + + * 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". + 2001-05-04 JP Rosevear * gui/calendar-model.c (calendar_model_append_row): unref the diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 1aa484399f..b21de4bd32 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -695,61 +695,57 @@ task_editor_focus (TaskEditor *tedit) raise_and_focus (priv->app); } +#warning this is duplicated function from ../event-editor.c /* Creates an appropriate title for the task editor dialog */ 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 Task")); - 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 (TaskEditor *tedit, CalComponent *comp) { - TaskEditorPrivate *priv; - char *title, *tmp; - - priv = tedit->priv; + TaskEditorPrivate *priv = tedit->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), ""); - } } /* Fills the widgets with default values */ 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 */ diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 138e5cb280..eda8617b0b 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -38,6 +38,7 @@ #include #include #include "widgets/misc/e-search-bar.h" +#include "widgets/misc/e-filter-bar.h" #include "dialogs/alarm-notify-dialog.h" #include "e-calendar-table.h" #include "e-day-view.h" @@ -215,12 +216,8 @@ get_current_page (GnomeCalendar *gcal) return GTK_NOTEBOOK (priv->notebook)->cur_page->child; } -enum { - SEARCH_SHOW_ALL -}; - static ESearchBarItem search_menu_items[] = { - { N_("Show all "), SEARCH_SHOW_ALL }, + E_FILTERBAR_RESET, { NULL, -1 } }; @@ -333,7 +330,7 @@ search_bar_menu_activated_cb (ESearchBar *search_bar, int item, gpointer data) gcal = GNOME_CALENDAR (data); switch (item) { - case SEARCH_SHOW_ALL: + case E_FILTERBAR_RESET_ID: set_query (gcal, "#t"); /* match all */ /* FIXME: should we change the rest of the search bar so that * the user sees that he selected "show all" instead of some -- cgit v1.2.3