gfloppy r526 - in trunk: . src
- From: cosimoc svn gnome org
- To: svn-commits-list gnome org
- Subject: gfloppy r526 - in trunk: . src
- Date: Tue, 23 Dec 2008 00:25:03 +0000 (UTC)
Author: cosimoc
Date: Tue Dec 23 00:25:03 2008
New Revision: 526
URL: http://svn.gnome.org/viewvc/gfloppy?rev=526&view=rev
Log:
2008-12-23 Cosimo Cecchi <cosimoc gnome org>
* src/main.c (on_help_button_clicked), (main):
Remove libgnome/libgnomeui dependency.
Thanks to Emilio Pozuelo Monfort (#565388).
Modified:
trunk/ChangeLog
trunk/src/main.c
Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c (original)
+++ trunk/src/main.c Tue Dec 23 00:25:03 2008
@@ -29,8 +29,6 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gconf/gconf-client.h>
-#include <libgnomeui/gnome-help.h>
-#include <libgnomeui/gnome-ui-init.h>
#include <glade/glade.h>
#ifdef USE_HAL
@@ -503,8 +501,8 @@
{
GError *error = NULL;
- gnome_help_display_desktop_on_screen (NULL, "gfloppy", "gfloppy", "usage",
- gtk_widget_get_screen (widget), &error);
+ gtk_show_uri (gtk_widget_get_screen (widget), "ghelp:gfloppy#usage",
+ gtk_get_current_event_time (), &error);
if (error) {
show_error_dialog (toplevel, _("Could not display help for the floppy formatter."), error->message);
g_error_free (error);
@@ -552,7 +550,6 @@
int
main (int argc, char *argv[])
{
- GnomeProgram *program;
GOptionContext *context;
GConfClient *client;
GFloppyConfig config;
@@ -564,6 +561,7 @@
GtkSizeGroup *size_group;
GSList *l;
gchar *label_text;
+ GError *error;
/* This is for the libhal context, should we need it */
gpointer ctx;
@@ -581,15 +579,17 @@
textdomain(GETTEXT_PACKAGE);
context = g_option_context_new (_("- Floppy Formatter"));
-
g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
+ g_option_context_add_group (context, gtk_get_option_group (TRUE));
+
+ if (!g_option_context_parse (context, &argc, &argv, &error)) {
+ g_critical ("Unable to parse options: %s", error->message);
+ g_error_free (error);
+ g_option_context_free (context);
+ exit (1);
+ }
- program = gnome_program_init
- (argv[0], VERSION, LIBGNOMEUI_MODULE,
- argc, argv,
- GNOME_PARAM_GOPTION_CONTEXT, context,
- GNOME_PARAM_APP_DATADIR,DATADIR,
- GNOME_PARAM_NONE);
+ g_option_context_free (context);
#ifdef USE_HAL
ctx = (gpointer)get_hal_context ();
@@ -600,7 +600,7 @@
init_commands ();
/* Now we can set up glade */
- glade_gnome_init();
+ glade_init ();
xml = glade_xml_new (GLADEDIR "/gfloppy2.glade", NULL, NULL);
if (xml == NULL)
@@ -742,7 +742,6 @@
}
#endif
- g_object_unref (program);
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]