[Xfce4-commits] <terminal:master> Add full support for renaming the program name.

Nick Schermer noreply at xfce.org
Mon Feb 1 22:18:01 CET 2010


Updating branch refs/heads/master
         to 42f02847ac99087e5a563559d5bc8d6eed196cb9 (commit)
       from 5f45592df3421bcc9b926bd082d585208610de25 (commit)

commit 42f02847ac99087e5a563559d5bc8d6eed196cb9
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Feb 1 20:49:07 2010 +0100

    Add full support for renaming the program name.
    
    This allows a complete rename to for example xfce4-terminal
    using --program-transform-name='s/Terminal/xfce4-terminal/'
    in ./configure.

 configure.ac.in             |    1 +
 terminal/Makefile.am        |    1 +
 terminal/main.c             |    9 +++++----
 terminal/terminal-dialogs.c |    2 +-
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index d0af859..6ab37d9 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -32,6 +32,7 @@ Written by Benedikt Meurer <benny at xfce.org>.])
 AC_INIT([Terminal], [terminal_version], [http://bugzilla.xfce.org/], [Terminal])
 AC_REVISION([@REVISION@])
 AC_PREREQ([2.50])
+AC_ARG_PROGRAM()
 
 dnl ***************************
 dnl *** Initialize automake ***
diff --git a/terminal/Makefile.am b/terminal/Makefile.am
index b8bda66..4d26ffb 100644
--- a/terminal/Makefile.am
+++ b/terminal/Makefile.am
@@ -6,6 +6,7 @@ INCLUDES = \
 	-DLIBEXECDIR=\"$(libexecdir)\" \
 	-DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
 	-DSN_API_NOT_YET_FROZEN \
+	-DTERMINAL_NAME=\"`echo $(PACKAGE_NAME) | sed '$(program_transform_name)'`\" \
 	-I$(top_srcdir) \
 	$(PLATFORM_CPPFLAGS)
 
diff --git a/terminal/main.c b/terminal/main.c
index c035a8e..bf60732 100644
--- a/terminal/main.c
+++ b/terminal/main.c
@@ -44,7 +44,7 @@ usage (void)
 {
   g_print ("%s\n"
            "  %s [%s...]\n\n",
-           _("Usage:"), PACKAGE_NAME, _("OPTION"));
+           _("Usage:"), TERMINAL_NAME, _("OPTION"));
 
   g_print ("%s:\n"
            "  -h, --help; -V, --version; --disable-server;\n"
@@ -88,7 +88,7 @@ usage (void)
            _("icon"));
 
   g_print (_("See the %s man page for full explanation of the options above."),
-           PACKAGE_NAME);
+           TERMINAL_NAME);
 
   g_print ("\n\n");
 }
@@ -114,7 +114,7 @@ main (int argc, char **argv)
   signal (SIGPIPE, SIG_IGN);
 
   xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
-  g_set_application_name (_("Terminal"));
+  g_set_application_name (TERMINAL_NAME);
 
   /* required because we don't call gtk_init() prior to usage() */
   gtk_set_locale ();
@@ -137,7 +137,8 @@ main (int argc, char **argv)
                  "Written by Benedikt Meurer <benny at xfce.org>.\n\n"
                  "Built with Gtk+-%d.%d.%d, running with Gtk+-%d.%d.%d.\n\n"
                  "Please report bugs to <%s>.\n"),
-                 PACKAGE_STRING, xfce_version_string (),
+                 TERMINAL_NAME " " PACKAGE_VERSION,
+                 xfce_version_string (),
                  "2003-2010",
                  GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION,
                  gtk_major_version, gtk_minor_version, gtk_micro_version,
diff --git a/terminal/terminal-dialogs.c b/terminal/terminal-dialogs.c
index c9d100c..62afca1 100644
--- a/terminal/terminal-dialogs.c
+++ b/terminal/terminal-dialogs.c
@@ -90,7 +90,7 @@ terminal_dialogs_show_about (GtkWindow *parent)
                                       "Copyright \302\251 2007-2010 Nick Schermer",
                          "license", XFCE_LICENSE_GPL,
                          "logo", logo,
-                         "program-name", PACKAGE_NAME,
+                         "program-name", TERMINAL_NAME,
                          "translator-credits", _("translator-credits"),
                          "version", PACKAGE_VERSION,
                          "website", "http://goodies.xfce.org/projects/applications/terminal",



More information about the Xfce4-commits mailing list