Re: gnome-volume-control -i



Samuel Stringham wrote:

gnome-volume-control -i (for reinitialization of values from previous run) is not working, and on default .gnomerc or what have you, it is run, and hangs waiting for gnome-session to start up. This is in .19.0 The file that runs it is $PREFIX/etc/gdm/gnomerc . It checks if it exists, then executes it without checking which version it is, if it had a simple pkg-config --modversion to tell if it is the (I presume broken) version of gnome-volume control then it could not execute it. Either that, or just fix gnome-volume-control to accept the -i switch again.

Samuel Stringham

Here is a patch for gnome-volume-control. It was initialy for garnome
0.18.3 but should apply cleanly on 0.19
I'll put it also on
http://www.rcsnet.net/pub/gnome-volume-control-initonly.patch

Enjoy

diff -u tmp/gnome-media-2.1.0/gmix/gmix.c work/gnome-media-2.1.0/gmix/gmix.c
--- tmp/gnome-media-2.1.0/gmix/gmix.c	Wed Oct  9 01:40:43 2002
+++ work/gnome-media-2.1.0/gmix/gmix.c	Mon Oct 28 11:43:38 2002
@@ -138,10 +138,15 @@
 GList *devices;
 GHashTable *device_by_name = NULL;
 
+int mode = 0, mode_initonly=0;
+#define M_NORESTORE	1
+#define M_INITONLY 	2
+#define M_NOSAVE	4
 static int num_mixers;
 static char *mixer_device = NULL;
 
 static const struct poptOption options[] = {
+  {"initonly", 'i', POPT_ARG_NONE, &mode_initonly, 0, N_("initialise the mixer(s) from stored configuration and exit"), NULL},
   { "device", '\0', POPT_ARG_STRING, &mixer_device,0,
     N_("Mixer device to use"), NULL },
   {NULL, '\0', 0, NULL, 0}
@@ -362,14 +367,27 @@
 	else
 		gnome_window_icon_set_default_from_file (GNOME_ICONDIR"/gnome-mixer.png");
 
+	if (mode_initonly) {
+		mode |= M_INITONLY;
+	}
+
 	scan_devices();
 	if (devices) {
+		if (~mode & M_INITONLY) {
+		        get_gui_config();
+			/* Beware boolean bastardization */
+			if (!prefs.set_mixer_on_start)
+				mode |= M_NORESTORE;
+			  
+		}
 		get_gui_config();
 		/* Beware boolean bastardization */
 		get_device_config();
 		init_devices();
 		
-		open_dialog();
+		if (~mode & M_INITONLY) {
+			open_dialog();
+		}
 		put_device_config();
 		
 		free_devices();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]