[ghex] Remove libgnomeui/gnome-ui-init.h dependency
- From: Javier Jardón <jjardon src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [ghex] Remove libgnomeui/gnome-ui-init.h dependency
- Date: Mon, 8 Feb 2010 00:14:50 +0000 (UTC)
commit 9a80135b9bb810955a097ae3fd944044540e0fb6
Author: Javier Jardón <jjardon gnome org>
Date: Wed Jan 27 05:15:52 2010 +0100
Remove libgnomeui/gnome-ui-init.h dependency
Replace gnome_program_init() with gtk_init_with_args()
Also, the GOptionContext stuff from previous patch is not needed
https://bugzilla.gnome.org/show_bug.cgi?id=590995
src/main.c | 40 ++++++++++++----------------------------
1 files changed, 12 insertions(+), 28 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index f30569c..b29dce3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -24,7 +24,6 @@
#include <config.h>
#include <libgnomeui/gnome-client.h>
-#include <libgnomeui/gnome-ui-init.h>
#include "configuration.h"
#include "session.h"
@@ -44,30 +43,25 @@ static GOptionEntry options[] = {
int
main(int argc, char **argv)
{
- GOptionContext *context;
GnomeClient *client;
- GnomeProgram *program;
GtkWidget *win;
GError *error = NULL;
- context = g_option_context_new (_("- GTK+ binary editor"));
-#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
- g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
-#else
- g_option_context_add_main_entries (context, options, NULL);
-#endif
-
- /* Initialize gnome program */
- program = gnome_program_init ("ghex2", VERSION,
- LIBGNOMEUI_MODULE, argc, argv,
- GNOME_PARAM_POPT_TABLE, options,
- GNOME_PARAM_HUMAN_READABLE_NAME,
- _("The gnome binary editor"),
- GNOME_PARAM_APP_DATADIR, DATADIR,
- NULL);
+
+ /* Initialize GTK+ program */
+ if (!gtk_init_with_args (&argc, &argv,
+ _("- GTK+ binary editor"),
+ options,
+ GETTEXT_PACKAGE,
+ &error)) {
+ g_printerr (_("%s\nRun '%s --help' to see a full list of available command line options.\n"),
+ error->message, argv[0]);
+ g_error_free (error);
+ return 1;
+ }
/* Set default window icon */
gtk_window_set_default_icon_name ("ghex");
@@ -89,16 +83,6 @@ main(int argc, char **argv)
g_signal_connect (G_OBJECT (client), "die",
G_CALLBACK (client_die), NULL);
- /* Parse args and build the list of files to be loaded at startup */
- if (g_option_context_parse (context, &argc, &argv, &error) == FALSE) {
- g_print (_("%s\nRun '%s --help' to see a full list of available command line options.\n"),
- error->message, argv[0]);
- g_error_free (error);
- g_option_context_free (context);
- exit(1);
- }
- g_option_context_free (context);
-
if (args_remaining != NULL) {
gchar **filename;
for (filename = args_remaining; *filename != NULL; filename++) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]