[nautilus-actions] Factorize help description
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] Factorize help description
- Date: Thu, 2 Dec 2010 23:51:34 +0000 (UTC)
commit 113c1d391bd38df2965f9ee035f721b02ebc976c
Author: Pierre Wieser <pwieser trychlos org>
Date: Thu Dec 2 20:17:48 2010 +0100
Factorize help description
ChangeLog | 13 +++++++++++++
po/POTFILES.in | 1 +
src/utils/console-utils.c | 15 +++++++++++++++
src/utils/console-utils.h | 4 +++-
src/utils/nautilus-actions-new.c | 7 ++-----
src/utils/nautilus-actions-run.c | 6 +-----
src/utils/nautilus-actions-schemas.c | 6 +-----
7 files changed, 36 insertions(+), 16 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9cdda58..6c6ccda 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2010-12-02 Pierre Wieser <pwieser trychlos org>
+ Factorize help description.
+
+ * po/POTFILES.in: add src/utils/console-utils.c file.
+
+ * src/utils/console-utils.c:
+ * src/utils/console-utils.h (console_cmdline_get_description):
+ New function.
+
+ * src/utils/nautilus-actions-new.c (init_options):
+ * src/utils/nautilus-actions-run.c (init_options):
+ * src/utils/nautilus-actions-schemas.c (init_options):
+ Updated to take advantage of new function.
+
* configure.ac: Display a summary of configuration options.
* m4/na-enable-manuals.m4:
diff --git a/po/POTFILES.in b/po/POTFILES.in
index ce94e7d..e653804 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -56,6 +56,7 @@ src/nact/nact-window.c
[type: gettext/glade] src/nact/nautilus-actions-config-tool.ui
src/plugin-menu/nautilus-actions.c
src/test/test-reader.c
+src/utils/console-utils.c
src/utils/nautilus-actions-new.c
src/utils/nautilus-actions-run.c
src/utils/nautilus-actions-schemas.c
diff --git a/src/utils/console-utils.c b/src/utils/console-utils.c
index d6d7472..cad7a8b 100644
--- a/src/utils/console-utils.c
+++ b/src/utils/console-utils.c
@@ -33,6 +33,7 @@
#endif
#include <glib.h>
+#include <glib/gi18n.h>
#include "console-utils.h"
@@ -41,6 +42,20 @@ static void log_handler( const gchar *log_domain, GLogLevelFlags log_level, cons
static GLogFunc st_default_log_func = NULL;
/**
+ * console_cmdline_get_description:
+ *
+ * Returns: a newly allocated string to be displayed as a description
+ * of the usage message. The returned string should be g_free() by the
+ * caller.
+ */
+gchar *
+console_cmdline_get_description( void ){
+ return( g_strdup_printf( "%s.\n%s", PACKAGE_STRING,
+ _( "Bug reports are welcomed at http://bugzilla.gnome.org,"
+ " or you may prefer to mail to <maintainer nautilus-actions org>.\n" )));
+}
+
+/**
* console_init_log_handler:
*
* Initialize log handler so that debug messages are not outputed when
diff --git a/src/utils/console-utils.h b/src/utils/console-utils.h
index 5eb92f3..b503b8a 100644
--- a/src/utils/console-utils.h
+++ b/src/utils/console-utils.h
@@ -37,6 +37,8 @@
* @include: utils/console-utils.h
*/
-void console_init_log_handler( void );
+gchar *console_cmdline_get_description( void );
+
+void console_init_log_handler( void );
#endif /* __CONSOLE_UTILS_H__ */
diff --git a/src/utils/nautilus-actions-new.c b/src/utils/nautilus-actions-new.c
index ffb6bba..988df38 100644
--- a/src/utils/nautilus-actions-new.c
+++ b/src/utils/nautilus-actions-new.c
@@ -331,13 +331,10 @@ init_options( void )
g_option_context_add_main_entries( context, entries, NULL );
#endif
- description = g_strdup_printf( "%s.\n%s", PACKAGE_STRING,
- _( "Bug reports are welcomed at http://bugzilla.gnome.org,"
- " or you may prefer to mail to <maintainer nautilus-actions org>.\n" ));
+ g_free( entries );
+ description = console_cmdline_get_description();
g_option_context_set_description( context, description );
-
- g_free( entries );
g_free( description );
output_group = g_option_group_new(
diff --git a/src/utils/nautilus-actions-run.c b/src/utils/nautilus-actions-run.c
index 87dccf5..a22e48c 100644
--- a/src/utils/nautilus-actions-run.c
+++ b/src/utils/nautilus-actions-run.c
@@ -193,12 +193,8 @@ init_options( void )
g_option_context_add_main_entries( context, entries, NULL );
#endif
- description = g_strdup_printf( "%s.\n%s", PACKAGE_STRING,
- _( "Bug reports are welcomed at http://bugzilla.gnome.org,"
- " or you may prefer to mail to <maintainer nautilus-actions org>.\n" ));
-
+ description = console_cmdline_get_description();
g_option_context_set_description( context, description );
-
g_free( description );
misc_group = g_option_group_new(
diff --git a/src/utils/nautilus-actions-schemas.c b/src/utils/nautilus-actions-schemas.c
index 2f9c8f7..fd5d1fc 100644
--- a/src/utils/nautilus-actions-schemas.c
+++ b/src/utils/nautilus-actions-schemas.c
@@ -172,12 +172,8 @@ init_options( void )
g_option_context_add_main_entries( context, entries, NULL );
#endif
- description = g_strdup_printf( "%s.\n%s", PACKAGE_STRING,
- _( "Bug reports are welcomed at http://bugzilla.gnome.org,"
- " or you may prefer to mail to <maintainer nautilus-actions org>.\n" ));
-
+ description = console_cmdline_get_description();
g_option_context_set_description( context, description );
-
g_free( description );
misc_group = g_option_group_new(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]