From 3fdfee96b812d8e1794d388a3975334133ccf61b Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Wed, 4 Apr 2007 08:14:01 +0000 Subject: [PATCH] 2007-04-04 Murray Cumming * Makefile.am: * configure.ac: * src/modest-runtime.c: (init_i18n): Restored the translation infrastructure, so that GETTEXT_PACKAGE and MODEST_LOCALE_DIR are defined in config.h, and the translations are installed. * src/maemo/easysetup/: Include config.h so that GETTEXT_PACKAGE is defined for translation. pmo-trunk-r1499 --- ChangeLog2 | 11 +++++++++++ Makefile.am | 3 +-- configure.ac | 9 +++++---- src/maemo/easysetup/main.c | 2 +- .../easysetup/modest-easysetup-country-combo-box.c | 5 +++++ .../modest-easysetup-provider-combo-box.c | 8 +++++--- .../modest-easysetup-secureauth-combo-box.c | 8 +++++--- .../modest-easysetup-serversecurity-combo-box.c | 8 +++++--- .../modest-easysetup-servertype-combo-box.c | 8 +++++--- src/maemo/easysetup/modest-easysetup-wizard.c | 13 +++++++++---- src/maemo/easysetup/modest-presets.c | 5 +++++ src/maemo/easysetup/modest-validating-entry.c | 5 +++++ src/modest-runtime.c | 5 +++-- src/modest-ui-actions.c | 6 +++--- 14 files changed, 68 insertions(+), 28 deletions(-) diff --git a/ChangeLog2 b/ChangeLog2 index c34ad7d..5ddeb72 100644 --- a/ChangeLog2 +++ b/ChangeLog2 @@ -1,3 +1,14 @@ +2007-04-04 Murray Cumming + + * Makefile.am: + * configure.ac: + * src/modest-runtime.c: (init_i18n): Restored the translation + infrastructure, so that GETTEXT_PACKAGE and MODEST_LOCALE_DIR + are defined in config.h, and the translations are installed. + + * src/maemo/easysetup/: Include config.h so that GETTEXT_PACKAGE + is defined for translation. + 2007-04-03 Murray Cumming * src/maemo/easysetup/modest-easysetup-country-combo-box.c: diff --git a/Makefile.am b/Makefile.am index d6d1734..226e15b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,8 +26,7 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.b -SUBDIRS= src man -#po +SUBDIRS= src man po if BUILD_TESTS SUBDIRS += tests diff --git a/configure.ac b/configure.ac index f4a01a3..4327723 100644 --- a/configure.ac +++ b/configure.ac @@ -33,16 +33,17 @@ AC_CONFIG_SRCDIR(src/modest-main.c) AM_INIT_AUTOMAKE([dist-bzip2]) # Check for gettext support -QGETTEXT_PACKAGE=modest +GETTEXT_PACKAGE=modest AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", ["Description"]) ALL_LINGUAS="en_GB gl nl" -#AM_GLIB_DEFINE_LOCALEDIR([MODEST_LOCALE_DIR]) + +MODEST_LOCALE_DIR='$prefix/${DATADIRNAME}/locale' +AM_GLIB_DEFINE_LOCALEDIR([MODEST_LOCALE_DIR]) AM_GLIB_GNU_GETTEXT -modestlocaledir='$prefix/${DATADIRNAME}/locale' -AC_SUBST(modestlocaledir) + if test x$prefix = xNONE; then prefix=/usr/local diff --git a/src/maemo/easysetup/main.c b/src/maemo/easysetup/main.c index 3cd0d74..b1aa7dd 100644 --- a/src/maemo/easysetup/main.c +++ b/src/maemo/easysetup/main.c @@ -27,7 +27,7 @@ static gboolean modest_easysetup_init(int argc, char *argv[]) { /* Setup gettext, to use our .po files: */ /* GETTEXT_PACKAGE is defined in config.h */ - /* OSSO_MODEST_EASYSETUP_LOCALEDIR is defined in the Makefile.am */ + /* OSSO_MODEST_EASYSETUP_LOCALEDIR is defined in config.h */ bindtextdomain (GETTEXT_PACKAGE, OSSO_MODEST_EASYSETUP_LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); diff --git a/src/maemo/easysetup/modest-easysetup-country-combo-box.c b/src/maemo/easysetup/modest-easysetup-country-combo-box.c index 3b69935..511d8d9 100644 --- a/src/maemo/easysetup/modest-easysetup-country-combo-box.c +++ b/src/maemo/easysetup/modest-easysetup-country-combo-box.c @@ -16,6 +16,11 @@ #include /* For dgettext(). */ +/* Include config.h so that _() works: */ +#ifdef HAVE_CONFIG_H +#include +#endif + G_DEFINE_TYPE (EasysetupCountryComboBox, easysetup_country_combo_box, GTK_TYPE_COMBO_BOX); #define COUNTRY_COMBO_BOX_GET_PRIVATE(o) \ diff --git a/src/maemo/easysetup/modest-easysetup-provider-combo-box.c b/src/maemo/easysetup/modest-easysetup-provider-combo-box.c index c68b662..3caded6 100644 --- a/src/maemo/easysetup/modest-easysetup-provider-combo-box.c +++ b/src/maemo/easysetup/modest-easysetup-provider-combo-box.c @@ -3,9 +3,6 @@ * */ -#define _GNU_SOURCE /* So we can use the getline() function, which is a convenient GNU extension. */ -#include - #include "modest-easysetup-provider-combo-box.h" #include #include @@ -15,6 +12,11 @@ #include #include /* For memcpy() */ +/* Include config.h so that _() works: */ +#ifdef HAVE_CONFIG_H +#include +#endif + G_DEFINE_TYPE (EasysetupProviderComboBox, easysetup_provider_combo_box, GTK_TYPE_COMBO_BOX); #define PROVIDER_COMBO_BOX_GET_PRIVATE(o) \ diff --git a/src/maemo/easysetup/modest-easysetup-secureauth-combo-box.c b/src/maemo/easysetup/modest-easysetup-secureauth-combo-box.c index 01c8453..240280a 100644 --- a/src/maemo/easysetup/modest-easysetup-secureauth-combo-box.c +++ b/src/maemo/easysetup/modest-easysetup-secureauth-combo-box.c @@ -3,9 +3,6 @@ * */ -#define _GNU_SOURCE /* So we can use the getline() function, which is a convenient GNU extension. */ -#include - #include "modest-easysetup-secureauth-combo-box.h" #include #include @@ -15,6 +12,11 @@ #include #include /* For memcpy() */ +/* Include config.h so that _() works: */ +#ifdef HAVE_CONFIG_H +#include +#endif + G_DEFINE_TYPE (EasysetupSecureauthComboBox, easysetup_secureauth_combo_box, GTK_TYPE_COMBO_BOX); #define SECUREAUTH_COMBO_BOX_GET_PRIVATE(o) \ diff --git a/src/maemo/easysetup/modest-easysetup-serversecurity-combo-box.c b/src/maemo/easysetup/modest-easysetup-serversecurity-combo-box.c index 5486e12..f2ce3ee 100644 --- a/src/maemo/easysetup/modest-easysetup-serversecurity-combo-box.c +++ b/src/maemo/easysetup/modest-easysetup-serversecurity-combo-box.c @@ -3,9 +3,6 @@ * */ -#define _GNU_SOURCE /* So we can use the getline() function, which is a convenient GNU extension. */ -#include - #include "modest-easysetup-serversecurity-combo-box.h" #include #include @@ -15,6 +12,11 @@ #include #include /* For memcpy() */ +/* Include config.h so that _() works: */ +#ifdef HAVE_CONFIG_H +#include +#endif + G_DEFINE_TYPE (EasysetupServersecurityComboBox, easysetup_serversecurity_combo_box, GTK_TYPE_COMBO_BOX); #define SERVERSECURITY_COMBO_BOX_GET_PRIVATE(o) \ diff --git a/src/maemo/easysetup/modest-easysetup-servertype-combo-box.c b/src/maemo/easysetup/modest-easysetup-servertype-combo-box.c index 7e87ecb..f7ea654 100644 --- a/src/maemo/easysetup/modest-easysetup-servertype-combo-box.c +++ b/src/maemo/easysetup/modest-easysetup-servertype-combo-box.c @@ -3,9 +3,6 @@ * */ -#define _GNU_SOURCE /* So we can use the getline() function, which is a convenient GNU extension. */ -#include - #include "modest-easysetup-servertype-combo-box.h" #include #include @@ -15,6 +12,11 @@ #include #include /* For memcpy() */ +/* Include config.h so that _() works: */ +#ifdef HAVE_CONFIG_H +#include +#endif + G_DEFINE_TYPE (EasysetupServertypeComboBox, easysetup_servertype_combo_box, GTK_TYPE_COMBO_BOX); #define SERVERTYPE_COMBO_BOX_GET_PRIVATE(o) \ diff --git a/src/maemo/easysetup/modest-easysetup-wizard.c b/src/maemo/easysetup/modest-easysetup-wizard.c index 3b4d499..820b5b8 100644 --- a/src/maemo/easysetup/modest-easysetup-wizard.c +++ b/src/maemo/easysetup/modest-easysetup-wizard.c @@ -23,9 +23,15 @@ #include "modest-validating-entry.h" #include "modest-text-utils.h" #include "modest-account-mgr.h" +#include "modest-runtime.h" /* For modest_runtime_get_account_mgr(). */ #include #include /* For strlen(). */ +/* Include config.h so that _() works: */ +#ifdef HAVE_CONFIG_H +#include +#endif + #define EXAMPLE_EMAIL_ADDRESS "first.last@provider.com" G_DEFINE_TYPE (ModestEasysetupWizardDialog, modest_easysetup_wizard_dialog, MODEST_TYPE_WIZARD_DIALOG); @@ -685,12 +691,11 @@ modest_easysetup_wizard_dialog_init (ModestEasysetupWizardDialog *self) g_assert(priv->presets); - /* Create the account manager object, + /* Get the account manager object, * so we can check for existing accounts, * and create new accounts: */ - ModestConf *conf = modest_conf_new (); /* Just a thin wrapper around GConfClient. */ - self->account_manager = modest_account_mgr_new (conf); - g_object_unref (conf); + self->account_manager = modest_runtime_get_account_mgr (); + g_assert (self->account_manager); /* Create the common pages, */ diff --git a/src/maemo/easysetup/modest-presets.c b/src/maemo/easysetup/modest-presets.c index bea2069..051d284 100644 --- a/src/maemo/easysetup/modest-presets.c +++ b/src/maemo/easysetup/modest-presets.c @@ -30,6 +30,11 @@ #include /* for strcmp */ #include "modest-presets.h" +/* Include config.h so that _() works: */ +#ifdef HAVE_CONFIG_H +#include +#endif + #define MODEST_PRESETS_KEY_NAME "Name" #define MODEST_PRESETS_KEY_DOMAIN "Domain" #define MODEST_PRESETS_KEY_MCC "MCC" diff --git a/src/maemo/easysetup/modest-validating-entry.c b/src/maemo/easysetup/modest-validating-entry.c index 79f2ea3..b1d1191 100644 --- a/src/maemo/easysetup/modest-validating-entry.c +++ b/src/maemo/easysetup/modest-validating-entry.c @@ -7,6 +7,11 @@ #include /* For the gtk_signal_stop_emit_by_name() convenience function. */ #include /* For strlen(). */ +/* Include config.h so that _() works: */ +#ifdef HAVE_CONFIG_H +#include +#endif + G_DEFINE_TYPE (EasysetupValidatingEntry, easysetup_validating_entry, GTK_TYPE_ENTRY); #define VALIDATING_ENTRY_GET_PRIVATE(o) \ diff --git a/src/modest-runtime.c b/src/modest-runtime.c index 5ed7526..5c67519 100644 --- a/src/modest-runtime.c +++ b/src/modest-runtime.c @@ -524,10 +524,11 @@ init_debug_logging (void) static void init_i18n (void) { - bindtextdomain (GETTEXT_PACKAGE, MODEST_LOCALEDIR); + /* Setup gettext, to use our .po files: */ + /* GETTEXT_PACKAGE and MODEST_LOCALE_DIR are defined in config.h */ + bindtextdomain (GETTEXT_PACKAGE, MODEST_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); - } diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index f979316..3315b50 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -238,11 +238,11 @@ modest_ui_actions_on_accounts (GtkAction *action, ModestWindow *win) void modest_ui_actions_on_new_account (GtkAction *action, ModestWindow *win) -{ +{ ModestEasysetupWizardDialog *wizard = modest_easysetup_wizard_dialog_new (); - gtk_window_set_transient_for (GTK_WINDOW (wizard), win); + gtk_window_set_transient_for (GTK_WINDOW (wizard), GTK_WINDOW (win)); gtk_dialog_run (GTK_DIALOG (wizard)); - gtk_widget_destroy (wizard); + gtk_widget_destroy (GTK_WIDGET (wizard)); } void -- 1.7.9.5