gnome-media r3793 - in trunk: . gst-mixer/src



Author: malureau
Date: Sun Mar 16 22:23:11 2008
New Revision: 3793
URL: http://svn.gnome.org/viewvc/gnome-media?rev=3793&view=rev

Log:
2008-03-17  Marc-Andre Lureau  <marcandre lureau gmail com>

        patch by: Andrea Del Signore
        reviewed by: Ronald Bultje & Bastien Nocera

        * gst-mixer/src/main.c, gst-mixer/src/window.c,
        gst-mixer/src/window.h: Specify tab at startup. Removed
        unnecessary g_print, as suggested by Bastien from the original
        patch.
        (Closes: #349106)


Modified:
   trunk/ChangeLog
   trunk/gst-mixer/src/main.c
   trunk/gst-mixer/src/window.c
   trunk/gst-mixer/src/window.h

Modified: trunk/gst-mixer/src/main.c
==============================================================================
--- trunk/gst-mixer/src/main.c	(original)
+++ trunk/gst-mixer/src/main.c	Sun Mar 16 22:23:11 2008
@@ -34,6 +34,12 @@
 #include "stock.h"
 #include "window.h"
 
+static gchar* page = NULL;
+static GOptionEntry entries[] =
+{
+  { "page", 'p', 0, G_OPTION_ARG_STRING, &page, N_("Startup page"), "playback|recording|switches|options" }
+};
+
 /*
  * Probe for mixer elements. Set up GList * with elements,
  * where each element has a GObject data node set of the
@@ -180,6 +186,7 @@
 
   g_thread_init (NULL);
   ctx = g_option_context_new ("gnome-volume-control");
+  g_option_context_add_main_entries(ctx, entries, GETTEXT_PACKAGE);
   g_option_context_add_group (ctx, gst_init_get_option_group ());
 
   gnome_program_init ("gnome-volume-control", VERSION,
@@ -205,6 +212,8 @@
 
   /* window contains everything automagically */
   win = gnome_volume_control_window_new (elements);
+  if (page != NULL)
+    gnome_volume_control_window_set_page(win, page);
   g_signal_connect (win, "destroy", G_CALLBACK (cb_destroy), NULL);
   g_signal_connect (win, "check_resize", G_CALLBACK (cb_check_resize), NULL);
 

Modified: trunk/gst-mixer/src/window.c
==============================================================================
--- trunk/gst-mixer/src/window.c	(original)
+++ trunk/gst-mixer/src/window.c	Sun Mar 16 22:23:11 2008
@@ -277,6 +277,22 @@
   return GTK_WIDGET (win);
 }
 
+void gnome_volume_control_window_set_page(GtkWidget *widget, const gchar *page)
+{
+  GnomeVolumeControlWindow *win = GNOME_VOLUME_CONTROL_WINDOW (widget);
+
+  if (g_ascii_strncasecmp(page, "playback",8) == 0)
+    gtk_notebook_set_current_page (GTK_NOTEBOOK (win->el), 0);
+  else if (g_ascii_strncasecmp(page, "recording",9) == 0)
+    gtk_notebook_set_current_page (GTK_NOTEBOOK (win->el), 1);
+  else if (g_ascii_strncasecmp(page, "switches",9) == 0)
+    gtk_notebook_set_current_page (GTK_NOTEBOOK (win->el), 2);
+  else if (g_ascii_strncasecmp(page, "options",9) == 0)
+    gtk_notebook_set_current_page (GTK_NOTEBOOK (win->el), 3);
+  else /* default is "playback" */
+    gtk_notebook_set_current_page (GTK_NOTEBOOK (win->el), 0);
+}
+
 static void
 gnome_volume_control_window_dispose (GObject *object)
 {

Modified: trunk/gst-mixer/src/window.h
==============================================================================
--- trunk/gst-mixer/src/window.h	(original)
+++ trunk/gst-mixer/src/window.h	Sun Mar 16 22:23:11 2008
@@ -70,8 +70,9 @@
   GnomeAppClass klass;
 } GnomeVolumeControlWindowClass;
 
-GType		gnome_volume_control_window_get_type	(void);
-GtkWidget *	gnome_volume_control_window_new		(GList *elements);
+GType		gnome_volume_control_window_get_type		(void);
+GtkWidget *	gnome_volume_control_window_new			(GList *elements);
+void		gnome_volume_control_window_set_page		(GtkWidget *win, const gchar *page);
 
 G_END_DECLS
 



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