Little patch

Nicolas Centa <[email protected]> Fri, 19 Sep 2003 22:13:18 +0200
Newsgroups gmane.editors.mlview.devel
Message-ID <[email protected]>
Hello,

(It's my first post on mlview's mailing list ! and it won't be the last I think :-)

Here is just a little patch I wrote to correct some little bugs in mlview CVS :
the command line parsing which was disabled after Dodji's update with
gnome_program_init (), and the toolbar with no icons wich displayed nothing (see
the screenshot right down) for those who have "Icons only" in their
gnome-ui-properties (see the attached .diff).

I'm also trying to improve mlview's GUI ; you can see some of my experiments on
this screenshot : 

http://happypeng.free.fr/mlview-6.png

I will try to send a patch as soon as possible ; I have to port this changes to
the CVS version and I also have to make some little UI choices - so please give
me your opinions about that.

You can also find me on the IRC : #mlview (GIMPNet). Or just tell Dodji what you
think :-)

Nicolas Centa (HappyPeng)
patch.diff (application/octet-stream, 2.4 KB)
diff -x CVS -Nurp /usr/src/origcvs/mlview/src/main.c /usr/src/mlview/src/main.c
--- /usr/src/origcvs/mlview/src/main.c	2003-09-16 00:12:25.000000000 +0200
+++ /usr/src/mlview/src/main.c	2003-09-19 21:44:48.000000000 +0200
@@ -50,10 +50,12 @@
 int
 main (int argc, char **argv)
 {
+        GnomeProgram *mlview_program = NULL;
         GnomeApp *mlview_application = NULL;
 
         gchar **args = NULL;
-        poptContext popt_context = { 0 };
+        poptContext popt_context = NULL;
+        GValue popt_context_value = { 0, };
         gboolean show_version = FALSE,
                 show_info = FALSE;
         struct poptOption cmd_options_table[] = {
@@ -81,12 +83,20 @@ main (int argc, char **argv)
         mlview_utils_init ();
 
         /*init gnome */
-        gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE,
-                            argc, argv,
-                            GNOME_PARAM_POPT_TABLE, cmd_options_table,
-                            GNOME_PARAM_APP_DATADIR, DATADIR,
-                            GNOME_PARAM_NONE);
+        mlview_program = gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE,
+                                             argc, argv,
+                                             GNOME_PARAM_POPT_TABLE, cmd_options_table,
+                                             GNOME_PARAM_APP_DATADIR, DATADIR, 
+                                             GNOME_PARAM_NONE);
         
+        gnome_program_parse_args (mlview_program);
+
+        g_value_init (&popt_context_value, G_TYPE_POINTER);
+        g_object_get_property (G_OBJECT (mlview_program), GNOME_PARAM_POPT_CONTEXT,
+                               &popt_context_value);
+        popt_context = g_value_peek_pointer (&popt_context_value);
+        g_value_unset (&popt_context_value);
+
         /*Then, parse the non option command arguments */
         args = (gchar **) poptGetArgs (popt_context);
 
diff -x CVS -Nurp /usr/src/origcvs/mlview/src/mlview-app.c /usr/src/mlview/src/mlview-app.c
--- /usr/src/origcvs/mlview/src/mlview-app.c	2003-09-16 00:12:25.000000000 +0200
+++ /usr/src/mlview/src/mlview-app.c	2003-09-19 20:27:58.000000000 +0200
@@ -827,6 +827,8 @@ install_menu_and_toolbar (GnomeApp * a_a
         gnome_app_add_toolbar (a_appwin, tb, "edition",
                                BONOBO_DOCK_ITEM_BEH_EXCLUSIVE,
                                BONOBO_DOCK_TOP, 2, 0, 0);
+
+        gtk_toolbar_set_style (tb, GTK_TOOLBAR_TEXT);
 }