After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 336384 - [Patch] Use GOption instead of popt
[Patch] Use GOption instead of popt
Status: RESOLVED WONTFIX
Product: gnopernicus
Classification: Deprecated
Component: general
1.1.x
Other All
: Normal normal
: ---
Assigned To: remus draica
firm
Depends on:
Blocks:
 
 
Reported: 2006-03-28 18:31 UTC by Przemysław Grzegorczyk
Modified: 2008-08-22 20:23 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Move from popt to GOption (17.03 KB, patch)
2006-03-28 18:34 UTC, Przemysław Grzegorczyk
none Details | Review
Updated patch (17.37 KB, patch)
2006-03-28 22:26 UTC, Przemysław Grzegorczyk
none Details | Review
Use GOption instead of popt (16.99 KB, patch)
2008-01-18 01:00 UTC, Christian Kirbach
none Details | Review
port from popt to glib command line parsing (20.87 KB, patch)
2008-01-31 22:39 UTC, Christian Kirbach
none Details | Review

Description Przemysław Grzegorczyk 2006-03-28 18:31:26 UTC
Please describe the problem:
http://live.gnome.org/GnomeGoals/PoptGOption

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Przemysław Grzegorczyk 2006-03-28 18:34:54 UTC
Created attachment 62233 [details] [review]
Move from popt to GOption

Works for me but it should be tested.
Comment 2 Tommi Vainikainen 2006-03-28 20:11:05 UTC
It seems that not all arg desciptions are marked for translations. (This was the case even with popt, but it should be easy to update the patch.)

Example:

	{
	 "default",
	 'd',
	 0,
	 G_OPTION_ARG_NONE,
	 &gn_defaultmode,
	 "Launch in execution with default settings",
 	 NULL
 	},

should be patched with

-	 "Launch in execution with default settings",
+	 N_("Launch in execution with default settings"),

Then the code which generates --help text, will automatically call gettext for parameter descriptions and --help message will be localised fully.
Comment 3 Przemysław Grzegorczyk 2006-03-28 22:26:29 UTC
Created attachment 62248 [details] [review]
Updated patch

I have added N_() to the args descriptions.
Comment 4 remus draica 2006-04-06 10:10:10 UTC
Comment on attachment 62248 [details] [review]
Updated patch


Patch applied on cvs head.
Comment 5 Oana Serb 2006-04-06 13:43:44 UTC
The patch doesn't compile.
Comment 6 Tommi Vainikainen 2006-04-06 14:16:44 UTC
It compiles for me, but it requires libgnome 2.14, so this needs to be added also:

diff -u -r1.195 configure.in
--- configure.in        6 Apr 2006 13:28:20 -0000       1.195
+++ configure.in        6 Apr 2006 14:15:21 -0000
@@ -420,7 +412,7 @@
 GTK_REQUIRED=2.4.1
 GCONF_REQUIRED=2.6.1
 LIBGLADE_REQUIRED=2.3.6
-LIBGNOME_REQUIRED=2.6.0
+LIBGNOME_REQUIRED=2.14.0
 LIBGNOMEUI_REQUIRED=2.6.1
 BONOBO_REQUIRED=2.6.1
 GNOME_SPEECH_REQUIRED=0.3.5
Comment 7 remus draica 2006-04-07 08:02:50 UTC
I tried to run gnopernicus with this patch with latest glib (2.10.1), libbonobo (2.14.0) and libgnome (2.14.0) without success. This because gnopernicus adds by program some command line parameters. For example it adds "--gtk-module=gail:atk-bridge". Those are not options for gnopernicus itself, but for other modules used (gtk in this case). Those are not recognized by the new implementation with GOption. Is this a limitation of GOption?
Comment 8 Lucas Rocha 2006-12-05 21:53:51 UTC
Remus, you just need to add the gtk option group (wherever it is needed) like this:

GOptionGroup *gtk_group = gtk_get_option_group (TRUE|FALSE);
g_option_context_add_group (context, gtk_group);

Go Go Go!
Comment 9 Christian Persch 2007-01-20 20:24:33 UTC
No, gnome_program_init automatically adds the gtk option group, you must not do it yourself.

If there's a problem with --gtk-module=a:b:c which is an option from the gtk option group, then it's either a gtk+ problem or a goption problem.

Is there anything left to do in this bug?
Comment 10 Lucas Rocha 2007-05-14 11:04:14 UTC
Any news about it?
Comment 11 André Klapper 2007-05-14 17:23:09 UTC
Remus, can you please answer christian's question?
Comment 12 Christian Persch 2008-01-03 22:37:00 UTC
Can this patch be applied, please?
Comment 13 Christian Kirbach 2008-01-18 00:57:46 UTC
patch does no longer apply cleanly. I merged in the rejects manually and i am going to attach the patch again.
Comment 14 Christian Kirbach 2008-01-18 01:00:13 UTC
Created attachment 103104 [details] [review]
Use GOption instead of popt

just a 'manual rediff'
Comment 15 Christian Kirbach 2008-01-31 22:36:51 UTC
I've moded the GOption structs into seperate functions for command line parsing (trick from behdad). This means the structs don't linger in memory all the time the program runs.

attaching updated patch.
note that we are in code freeze.
 
Comment 16 Christian Kirbach 2008-01-31 22:39:34 UTC
Created attachment 104146 [details] [review]
port from popt to glib command line parsing

improved version

not toroughly tested since I don't posses assistive technologies ;)
Comment 17 Christian Kirbach 2008-01-31 22:41:13 UTC
applies to current dev version
Comment 18 Christian Kirbach 2008-05-01 23:56:28 UTC
So, what's the status on this? Let it rot further?
Comment 19 André Klapper 2008-06-22 16:42:17 UTC
Who ships/includes/uses gnopernicus instead of Orca?
This project just seems to be dead.
Latest non-translation commit I see in svn is

Date: 	Mon Aug 21 13:16:19 2006 UTC (22 months ago)


Maybe we should just close all existing bugs as WONTFIX.
Comment 20 André Klapper 2008-08-22 20:23:17 UTC
There have not been any code commits to Gnopernicus for more than two years, and Gnopernicus has been superseded by Orca in GNOME.
Gnopernicus has been moved to the SVN archives today, and the developers did not respond to any emails.
Hence I'm closing all remaining 25 open bug reports as WONTFIX.