From d027c27ca1afbc0b988f272746b6536e13468b38 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Tue, 24 Sep 2002 20:43:45 +0000 Subject: [PATCH] support --version, #92796 patch from Christian Neumair 2002-09-24 Havoc Pennington * src/main.c (main): support --version, #92796 patch from Christian Neumair * autogen.sh: change gettext test to be happy with glib-gettextize, #81425 * src/menu.c: change mnemonics to match bug #78999 * src/theme.c (meta_theme_validate): consolidate some nearly-identical themes for ease of translation, #70962 --- ChangeLog | 13 +++++++++++++ autogen.sh | 32 ++++++++++++++++++++++---------- src/main.c | 15 ++++++++++++++- src/menu.c | 4 ++-- src/theme.c | 10 +++++----- 5 files changed, 56 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab3491333..1511c0e39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2002-09-24 Havoc Pennington + + * src/main.c (main): support --version, #92796 patch from + Christian Neumair + + * autogen.sh: change gettext test to be happy with + glib-gettextize, #81425 + + * src/menu.c: change mnemonics to match bug #78999 + + * src/theme.c (meta_theme_validate): consolidate some + nearly-identical themes for ease of translation, #70962 + 2002-09-24 Arvind Samptur * src/menu.c: Replace strings Shade with Roll Up and Unshade with Unroll. diff --git a/autogen.sh b/autogen.sh index 8b444007f..35e63cc27 100755 --- a/autogen.sh +++ b/autogen.sh @@ -46,16 +46,28 @@ ACLOCAL=aclocal-1.4 } } -grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null && { - grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \ - (gettext --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`gettext' installed to compile $PROJECT." - echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz" - echo "(or a newer version if it is available)" - DIE=1 - } -} +if grep "^AM_[A-Z0-9_]\{1,\}_GETTEXT" "$CONFIGURE" >/dev/null; then + if grep "sed.*POTFILES" "$CONFIGURE" >/dev/null; then + GETTEXTIZE="" + else + if grep "^AM_GLIB_GNU_GETTEXT" "$CONFIGURE" >/dev/null; then + GETTEXTIZE="glib-gettextize" + GETTEXTIZE_URL="ftp://ftp.gtk.org/pub/gtk/v2.0/glib-2.0.0.tar.gz" + else + GETTEXTIZE="gettextize" + GETTEXTIZE_URL="ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz" + fi + + $GETTEXTIZE --version < /dev/null > /dev/null 2>&1 + if test $? -ne 0; then + echo + echo "**Error**: You must have \`$GETTEXTIZE' installed to compile $PKG_NAME." + echo "Get $GETTEXTIZE_URL" + echo "(or a newer version if it is available)" + DIE=1 + fi + fi +fi if test "$DIE" -eq 1; then exit 1 diff --git a/src/main.c b/src/main.c index 4bf83894f..88fc13501 100644 --- a/src/main.c +++ b/src/main.c @@ -60,10 +60,21 @@ log_handler (const gchar *log_domain, static void usage (void) { - g_print (_("metacity [--disable-sm] [--sm-save-file=FILENAME] [--display=DISPLAY] [--replace]\n")); + g_print (_("metacity [--disable-sm] [--sm-save-file=FILENAME] [--display=DISPLAY] [--replace] [--version]\n")); exit (1); } +static void +version (void) +{ + g_print (_("metacity %s\n" + "Copyright (C) 2001-2002 Havoc Pennington, Red Hat, Inc., and others\n" + "This is free software; see the source for copying conditions.\n" + "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"), + VERSION); + exit (0); +} + int main (int argc, char **argv) { @@ -136,6 +147,8 @@ main (int argc, char **argv) strcmp (arg, "-h") == 0 || strcmp (arg, "-?") == 0) usage (); + else if (strcmp (arg, "--version") == 0) + version (); else if (strcmp (arg, "--sm-disable") == 0) disable_sm = TRUE; else if (strcmp (arg, "--replace") == 0) diff --git a/src/menu.c b/src/menu.c index b508c73d0..783183cf8 100644 --- a/src/menu.c +++ b/src/menu.c @@ -48,12 +48,12 @@ struct _MenuData static void activate_cb (GtkWidget *menuitem, gpointer data); static MenuItem menuitems[] = { - { META_MENU_OP_MINIMIZE, METACITY_STOCK_MINIMIZE, N_("_Minimize") }, + { META_MENU_OP_MINIMIZE, METACITY_STOCK_MINIMIZE, N_("Mi_nimize") }, { META_MENU_OP_MAXIMIZE, METACITY_STOCK_MAXIMIZE, N_("Ma_ximize") }, { META_MENU_OP_UNMAXIMIZE, NULL, N_("Unma_ximize") }, { META_MENU_OP_SHADE, NULL, N_("Roll _Up") }, { META_MENU_OP_UNSHADE, NULL, N_("_Unroll") }, - { META_MENU_OP_MOVE, NULL, N_("Mo_ve") }, + { META_MENU_OP_MOVE, NULL, N_("_Move") }, { META_MENU_OP_RESIZE, NULL, N_("_Resize") }, { 0, NULL, NULL }, /* separator */ { META_MENU_OP_DELETE, METACITY_STOCK_DELETE, N_("_Close") }, diff --git a/src/theme.c b/src/theme.c index d2430761d..56a559421 100644 --- a/src/theme.c +++ b/src/theme.c @@ -4229,35 +4229,35 @@ meta_theme_validate (MetaTheme *theme, if (theme->readable_name == NULL) { g_set_error (error, META_THEME_ERROR, META_THEME_ERROR_FAILED, - _("No set for theme \"%s\""), theme->name); + _("No <%s> set for theme \"%s\""), "name", theme->name); return FALSE; } if (theme->author == NULL) { g_set_error (error, META_THEME_ERROR, META_THEME_ERROR_FAILED, - _("No set for theme \"%s\""), theme->name); + _("No <%s> set for theme \"%s\""), "author", theme->name); return FALSE; } if (theme->date == NULL) { g_set_error (error, META_THEME_ERROR, META_THEME_ERROR_FAILED, - _("No set for theme \"%s\""), theme->name); + _("No <%s> set for theme \"%s\""), "date", theme->name); return FALSE; } if (theme->description == NULL) { g_set_error (error, META_THEME_ERROR, META_THEME_ERROR_FAILED, - _("No set for theme \"%s\""), theme->name); + _("No <%s> set for theme \"%s\""), "description", theme->name); return FALSE; } if (theme->copyright == NULL) { g_set_error (error, META_THEME_ERROR, META_THEME_ERROR_FAILED, - _("No set for theme \"%s\""), theme->name); + _("No <%s> set for theme \"%s\""), "copyright", theme->name); return FALSE; }