From 41bbafe351ec044e9e8f7abedf0747751e464b9d Mon Sep 17 00:00:00 2001 From: Javier Fernandez Garcia-Boente Date: Wed, 20 Jun 2007 06:47:03 +0000 Subject: [PATCH] * Changes in the localization structure. GETTEXT package is configure in configure.ac, checking version of application in order to use trnaslation packages or .po files. * Avoid using GTK_WIDGET_HAS_FOCUS to check if some widget has the focus, because we need to check window local focus, rather than global focus. pmo-trunk-r2321 --- configure.ac | 16 ++++++++++------ src/maemo/modest-main-window.c | 11 ----------- src/maemo/modest-msg-edit-window.c | 2 +- src/maemo/modest-msg-view-window.c | 10 ---------- src/modest-init.c | 16 +++++++++------- src/modest-tny-send-queue.c | 11 +++-------- src/modest-tny-send-queue.h | 2 -- src/modest-ui-actions.c | 2 +- src/modest-ui-dimming-rules.c | 9 +++++---- src/widgets/modest-account-view.c | 4 ++-- 10 files changed, 31 insertions(+), 52 deletions(-) diff --git a/configure.ac b/configure.ac index 25fad32..822c38f 100644 --- a/configure.ac +++ b/configure.ac @@ -32,10 +32,6 @@ AC_CONFIG_HEADERS([config.h]) AC_CONFIG_SRCDIR(src/modest-main.c) AM_INIT_AUTOMAKE([dist-bzip2]) -# Check for gettext support -GETTEXT_PACKAGE=modest -AC_SUBST(GETTEXT_PACKAGE) -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", ["Description"]) ALL_LINGUAS="en_GB" @@ -94,9 +90,13 @@ if test "x$with_platform" = "xmaemo"; then if test "$hildon1" == "yes"; then # the 'new' hildon PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_MAEMO, conic libtinymail-maemo-1.0 hildon-1 libosso libhildonmime osso-addressbook-1.0 wpeditor hildon-help libebook-1.2 libalarm hildon-notify libnotify) + GETTEXT_PACKAGE=osso-email + else # the old hildon - PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_MAEMO, conic libtinymail-maemo-1.0 hildon-libs >= 0.12.0 libosso libossomime libossohelp osso-addressbook-1.0 libwpeditor-plus libebook-1.2 libalarm gnome-vfs-module-2.0) - AC_DEFINE_UNQUOTED(MODEST_HILDON_VERSION_0, 1, ["The Hildon version we support."]) + PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_MAEMO, conic libtinymail-maemo-1.0 hildon-libs >= 0.12.0 libosso libossomime libossohelp osso-addressbook-1.0 libwpeditor-plus libebook-1.2 libalarm gnome-vfs-module-2.0) + AC_DEFINE_UNQUOTED(MODEST_HILDON_VERSION_0, 1, ["The Hildon version we support."]) + + GETTEXT_PACKAGE=modest fi AC_SUBST(MODEST_LIBTINYMAIL_MAEMO_CFLAGS) @@ -117,6 +117,10 @@ if test "x$with_platform" = "xmaemo"; then pluginlibdir=`$PKG_CONFIG hildon-control-panel --variable=plugindir` plugindesktopentrydir=`$PKG_CONFIG hildon-control-panel --variable=plugindesktopentrydir` + # Check for gettext support + AC_SUBST(GETTEXT_PACKAGE) + AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", ["Description"]) + dbus_api="dbus_api" AC_SUBST(dbus_api) diff --git a/src/maemo/modest-main-window.c b/src/maemo/modest-main-window.c index 0204e87..32f6b89 100644 --- a/src/maemo/modest-main-window.c +++ b/src/maemo/modest-main-window.c @@ -135,10 +135,6 @@ modest_main_window_cleanup_queue_error_signals (ModestMainWindow *self); static GtkWidget * create_empty_view (void); -static gchar * -translate_func (const gchar *msgid, - const gchar *domain_name); - /* list my signals */ enum { @@ -790,7 +786,6 @@ modest_main_window_new (void) action_group = gtk_action_group_new ("ModestMainWindowActions"); gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE); - gtk_action_group_set_translate_func (action_group, (GtkTranslateFunc) translate_func, GETTEXT_PACKAGE, g_free); menu_rules_group = modest_dimming_rules_group_new ("ModestMenuDimmingRules"); toolbar_rules_group = modest_dimming_rules_group_new ("ModestToolbarDimmingRules"); @@ -1937,9 +1932,3 @@ on_send_receive_csm_activated (GtkMenuItem *item, refresh_account ((const gchar*) user_data); } -static gchar * -translate_func (const gchar *msgid, - const gchar *domain_name) -{ - return _(msgid); -} diff --git a/src/maemo/modest-msg-edit-window.c b/src/maemo/modest-msg-edit-window.c index 292ace4..b9487e5 100644 --- a/src/maemo/modest-msg-edit-window.c +++ b/src/maemo/modest-msg-edit-window.c @@ -125,7 +125,6 @@ static void modest_msg_edit_window_find_toolbar_search (GtkWidget *widget, static void modest_msg_edit_window_find_toolbar_close (GtkWidget *widget, ModestMsgEditWindow *window); - /* list my signals */ enum { /* MY_SIGNAL_1, */ @@ -2577,3 +2576,4 @@ modest_msg_edit_window_find_toolbar_close (GtkWidget *widget, gtk_toggle_action_set_active (toggle, FALSE); } + diff --git a/src/maemo/modest-msg-view-window.c b/src/maemo/modest-msg-view-window.c index 2da7e8a..45bf9ff 100644 --- a/src/maemo/modest-msg-view-window.c +++ b/src/maemo/modest-msg-view-window.c @@ -104,9 +104,6 @@ static gboolean set_toolbar_transfer_mode (ModestMsgViewWindow *self); static void update_window_title (ModestMsgViewWindow *window); -static gchar * -translate_func (const gchar *msgid, - const gchar *domain_name); /* list my signals */ enum { @@ -529,7 +526,6 @@ modest_msg_view_window_new (TnyMsg *msg, action_group = gtk_action_group_new ("ModestMsgViewWindowActions"); gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE); - gtk_action_group_set_translate_func (action_group, (GtkTranslateFunc) translate_func, GETTEXT_PACKAGE, g_free); menu_rules_group = modest_dimming_rules_group_new ("ModestMenuDimmingRules"); toolbar_rules_group = modest_dimming_rules_group_new ("ModestToolbarDimmingRules"); @@ -1758,9 +1754,3 @@ update_window_title (ModestMsgViewWindow *window) gtk_window_set_title (GTK_WINDOW (window), subject); } -static gchar * -translate_func (const gchar *msgid, - const gchar *domain_name) -{ - return _(msgid); -} diff --git a/src/modest-init.c b/src/modest-init.c index 98ed12d..b853246 100644 --- a/src/modest-init.c +++ b/src/modest-init.c @@ -496,14 +496,16 @@ init_i18n (void) const gchar* gettext_package; /* Setup gettext, to use our .po files: */ /* GETTEXT_PACKAGE and MODEST_LOCALE_DIR are defined in config.h */ -#ifdef MODEST_HILDON_VERSION_0 - gettext_package = GETTEXT_PACKAGE; - bindtextdomain (gettext_package, MODEST_LOCALE_DIR); -#else - gettext_package = "osso-email"; /* HACK to use the localizations */ - bindtextdomain (gettext_package, "/usr/share/locale"); -#endif /*MODEST_HILDON_VERSION_0*/ +/* #ifdef MODEST_HILDON_VERSION_0 */ +/* gettext_package = GETTEXT_PACKAGE; */ +/* bindtextdomain (gettext_package, MODEST_LOCALE_DIR); */ +/* #else */ +/* gettext_package = "osso-email"; /\* HACK to use the localizations *\/ */ +/* bindtextdomain (gettext_package, "/usr/share/locale"); */ +/* #endif /\*MODEST_HILDON_VERSION_0*\/ */ + gettext_package = GETTEXT_PACKAGE; + bind_textdomain_codeset (gettext_package, "UTF-8"); textdomain (gettext_package); diff --git a/src/modest-tny-send-queue.c b/src/modest-tny-send-queue.c index 0f06f76..d3c5db9 100644 --- a/src/modest-tny-send-queue.c +++ b/src/modest-tny-send-queue.c @@ -333,22 +333,17 @@ modest_tny_send_queue_try_to_send (ModestTnySendQueue* self) /* tny_camel_send_queue_flush (TNY_CAMEL_SEND_QUEUE(self)); */ } -#if 0 gboolean modest_tny_send_queue_msg_is_being_sent (ModestTnySendQueue* self, const gchar *msg_id) { - ModestTnySendQueuePrivate *priv; + ModestTnySendQueueStatus status; g_return_val_if_fail (msg_id != NULL, FALSE); - priv = MODEST_TNY_SEND_QUEUE_GET_PRIVATE (self); - if (modest_tny_send_queue_sending_in_progress(self)) - return g_ascii_strcasecmp(priv->current_msg_id, msg_id); - else - return FALSE; + status = modest_tny_send_queue_get_msg_status (self, msg_id); + return status == MODEST_TNY_SEND_QUEUE_SENDING; } -#endif gboolean modest_tny_send_queue_sending_in_progress (ModestTnySendQueue* self) diff --git a/src/modest-tny-send-queue.h b/src/modest-tny-send-queue.h index 0e6a1de..8b9af1b 100644 --- a/src/modest-tny-send-queue.h +++ b/src/modest-tny-send-queue.h @@ -109,7 +109,6 @@ void modest_tny_send_queue_try_to_send (ModestTnySendQueue* self); */ gboolean modest_tny_send_queue_sending_in_progress (ModestTnySendQueue* self); -#if 0 /** * modest_tny_send_queue_msg_is_being_sent: * @self: a valid #ModestTnySendQueue instance @@ -118,7 +117,6 @@ gboolean modest_tny_send_queue_sending_in_progress (ModestTnySendQueue* self); * Checks if message identifies with @msg_id is currently being sent. */ gboolean modest_tny_send_queue_msg_is_being_sent (ModestTnySendQueue* self, const gchar *msg_id); -#endif /** * modest_tny_send_queue_get_msg_status: diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index a4a6ff3..2079d84 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -272,7 +272,7 @@ modest_ui_actions_on_delete (GtkAction *action, ModestWindow *win) if (MODEST_IS_MAIN_WINDOW (win)) { header_view = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW (win), MODEST_WIDGET_TYPE_HEADER_VIEW); - if (!GTK_WIDGET_HAS_FOCUS (header_view)) + if (!gtk_widget_is_focus (header_view)) return; } diff --git a/src/modest-ui-dimming-rules.c b/src/modest-ui-dimming-rules.c index bd1ec89..f02ed03 100644 --- a/src/modest-ui-dimming-rules.c +++ b/src/modest-ui-dimming-rules.c @@ -297,7 +297,7 @@ modest_ui_dimming_rules_on_delete_msg (ModestWindow *win, gpointer user_data) if (!dimmed) { dimmed = _selected_folder_is_empty (MODEST_MAIN_WINDOW(win)); if (dimmed) - modest_dimming_rule_set_notification (rule, _("mcen_ib_nothing_to_del")); + modest_dimming_rule_set_notification (rule, _("ckct_ib_nothing_to_delete")); } if (!dimmed) { dimmed = _invalid_msg_selected (MODEST_MAIN_WINDOW(win), FALSE, user_data); @@ -1029,8 +1029,9 @@ _invalid_msg_selected (ModestMainWindow *win, /* Check dimmed rule (TODO: check focus on widgets */ if (!result) { - result = ((selected_headers == NULL) || - (GTK_WIDGET_HAS_FOCUS (folder_view))); + result = (selected_headers == NULL); +/* result = ((selected_headers == NULL) || */ +/* (GTK_WIDGET_HAS_FOCUS (folder_view))); */ if (result) modest_dimming_rule_set_notification (rule, _("mcen_ib_no_message_selected")); } @@ -1244,7 +1245,7 @@ _selected_msg_sent_in_progress (ModestWindow *win) } /* Check if msg id is being processed inside send queue */ - result = (modest_tny_send_queue_get_msg_status (send_queue, tny_header_get_message_id(header)) == MODEST_TNY_SEND_QUEUE_SENDING); + result = modest_tny_send_queue_msg_is_being_sent (send_queue, id); /* Free */ g_free(id); diff --git a/src/widgets/modest-account-view.c b/src/widgets/modest-account-view.c index ac1598d..8875b00 100644 --- a/src/widgets/modest-account-view.c +++ b/src/widgets/modest-account-view.c @@ -300,8 +300,8 @@ on_account_busy_changed(ModestAccountMgr *account_mgr, const gchar *account_name return; gchar* last_updated_string = get_last_updated_string(account_mgr, account_data); gtk_list_store_set(model, &iter, - MODEST_ACCOUNT_VIEW_LAST_UPDATED_COLUMN, last_updated_string, - -1); + MODEST_ACCOUNT_VIEW_LAST_UPDATED_COLUMN, last_updated_string, + -1); g_free (last_updated_string); modest_account_mgr_free_account_data (account_mgr, account_data); return; -- 1.7.9.5