GNOME Bugzilla – Bug 338954
Use GOption argument parsing instead of popt
Last modified: 2006-11-29 19:23:34 UTC
Following these guidelines: http://live.gnome.org/GnomeGoals/PoptGOption
Created attachment 63839 [details] [review] Incorrect patch This is a first try, as totem option parsing was done manually. It's being rewritten using GOption.
The "FIXME"'s in the patch are the parts i'm currently struggling with... if someone has some hints, i'd be grateful ;-)
+ totem->seek_to = options->seek; /* FIXME: Should be a GINT64, but GOptions doesn't support it ATM */ You should file a bug on glib for that... In the mean time, you can use a G_OPTION_ARG_CALLBACK argument for this and parse the value yourself there. + /* FIXME: Hangs since popt->GOption migration, can this be removed safely ? */ g_once (&bvw_init_once, (GThreadFunc) bacon_video_widget_init_gst, NULL); Depending on when it needs to be run, you could call bacon_video_widget_init_gst into the returned option groups's pre or post-parse hook. +#if 0 /* FIXME: how to handle non totem options with goption ? */ Are there any options left that aren't handled by the gst optiong group, or the automatically used (via gnome_program_init) libgnome/libgnomeui/libbonobo/libbonoboui options groups?
*** Bug 344308 has been marked as a duplicate of this bug. ***
Hey Luis, I hope you're fine. Can we have information or an the update on the patch ? tx
Hi Baptiste! Well, kinda dropped the patch because option management in totem is kinda weird with the bacon init thingy... I think I can't have it working on my own. I have changed a few things in it (for example the GINT64 type is now supported by goption), but the g_once problem still remains, and without knowing the underlying code, I'm afraid of breaking some stuff... I'll soon post here my latest version, if someone wants to start from it.
Created attachment 72089 [details] [review] use goption in the mozilla viewer Here's a patch to implement goption parsing for the plugin/mozilla-viewer.
(In reply to comment #7) > Created an attachment (id=72089) [edit] > use goption in the mozilla viewer > > Here's a patch to implement goption parsing for the plugin/mozilla-viewer. s/DASH_DASH/DASHES/ so it's easier to type ;) Otherwise looks good to commit. Luis, I'll look at your patch this week-end.
hadess: *ping* - can you take a look at the patch? i'd like to get this gnomegoal solved... thanks. :-)
Created attachment 77361 [details] [review] totem-goption.patch Updated for the current code base. It tries to play the binary though... Weird.
The option parsing for when we're a server is still completely busted, and needs fixing. It's in bug #380617 for now, as I'm off to the pub! 2006-11-29 Bastien Nocera <hadess@hadess.net> * configure.in: upd the glib and libgnome requirements * src/backend/bacon-video-widget-gst-0.10.c: (bacon_video_widget_get_option_group), (bacon_video_widget_init_backend): * src/backend/bacon-video-widget.h: * src/totem-options.c: (totem_options_process_late), (totem_options_process_early), (totem_options_process_for_server): * src/totem-options.h: * src/totem-private.h: * src/totem-session.c: (totem_save_yourself_cb), (totem_session_setup), (totem_session_restore): * src/totem-session.h: * src/totem-video-indexer.c: (main): * src/totem-video-thumbnailer.c: * src/totem.c: (main): Adapted patch from Luis Menina <liberforce@fr.st> to port the main movie player, and the indexer to GOption (Closes: #338954)