Commit d5f41845 authored by Rocky Bernstein's avatar Rocky Bernstein

Make MRL's more regular across GUIs fix plugin names, and add CD-DA to list.

parent eff9d25c
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<widget> <widget>
<class>GtkPixmapMenuItem</class> <class>GtkPixmapMenuItem</class>
<name>menubar_disc</name> <name>menubar_disc</name>
<tooltip>Open a DVD or VCD</tooltip> <tooltip>Open Disc Media</tooltip>
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>GtkDiscOpenShow</handler> <handler>GtkDiscOpenShow</handler>
...@@ -511,7 +511,7 @@ ...@@ -511,7 +511,7 @@
<class>GtkButton</class> <class>GtkButton</class>
<child_name>Toolbar:button</child_name> <child_name>Toolbar:button</child_name>
<name>toolbar_disc</name> <name>toolbar_disc</name>
<tooltip>Open a DVD or VCD</tooltip> <tooltip>Open Disc Media</tooltip>
<signal> <signal>
<name>clicked</name> <name>clicked</name>
<handler>GtkDiscOpenShow</handler> <handler>GtkDiscOpenShow</handler>
...@@ -1851,6 +1851,26 @@ http://www.videolan.org/ ...@@ -1851,6 +1851,26 @@ http://www.videolan.org/
<fill>False</fill> <fill>False</fill>
</child> </child>
</widget> </widget>
<widget>
<class>GtkRadioButton</class>
<name>disc_cdda</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>GtkDiscOpenCDDA</handler>
<last_modification_time>Fri, 12 Dec 2003 01:00:17 GMT</last_modification_time>
</signal>
<label>Audio CD</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<group>disc</group>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget> </widget>
<widget> <widget>
...@@ -2004,7 +2024,7 @@ http://www.videolan.org/ ...@@ -2004,7 +2024,7 @@ http://www.videolan.org/
<snap>False</snap> <snap>False</snap>
<wrap>False</wrap> <wrap>False</wrap>
<value>1</value> <value>1</value>
<lower>1</lower> <lower>0</lower>
<upper>65536</upper> <upper>65536</upper>
<step>1</step> <step>1</step>
<page>10</page> <page>10</page>
......
/***************************************************************************** /*****************************************************************************
* This file is not used: everything is in gtk_callbacks.c * This file is not used: everything is in gtk_callbacks.c
*****************************************************************************/ *****************************************************************************/
void
GtkDiscOpenCDDA (GtkToggleButton *togglebutton,
gpointer user_data)
{
}
...@@ -2,3 +2,7 @@ ...@@ -2,3 +2,7 @@
* This file is not needed: everything is in gtk_callbacks.h * This file is not needed: everything is in gtk_callbacks.h
*****************************************************************************/ *****************************************************************************/
#include "gtk_callbacks.h" #include "gtk_callbacks.h"
void
GtkDiscOpenCDDA (GtkToggleButton *togglebutton,
gpointer user_data);
/* This file was created automatically by glade and fixed by bootstrap */ /*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#include <vlc/vlc.h> #ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
...@@ -24,7 +28,7 @@ static GnomeUIInfo menubar_file_menu_uiinfo[] = ...@@ -24,7 +28,7 @@ static GnomeUIInfo menubar_file_menu_uiinfo[] =
}, },
{ {
GNOME_APP_UI_ITEM, N_("Open _Disc..."), GNOME_APP_UI_ITEM, N_("Open _Disc..."),
N_("Open a DVD or VCD"), N_("Open Disc Media"),
(gpointer) GtkDiscOpenShow, NULL, NULL, (gpointer) GtkDiscOpenShow, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CDROM, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CDROM,
0, (GdkModifierType) 0, NULL 0, (GdkModifierType) 0, NULL
...@@ -513,7 +517,7 @@ create_intf_window (void) ...@@ -513,7 +517,7 @@ create_intf_window (void)
GTK_TOOLBAR_CHILD_BUTTON, GTK_TOOLBAR_CHILD_BUTTON,
NULL, NULL,
_("Disc"), _("Disc"),
_("Open a DVD or VCD"), NULL, _("Open Disc Media"), NULL,
tmp_toolbar_icon, NULL, NULL); tmp_toolbar_icon, NULL, NULL);
gtk_widget_ref (toolbar_disc); gtk_widget_ref (toolbar_disc);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_disc", toolbar_disc, gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_disc", toolbar_disc,
...@@ -679,7 +683,7 @@ create_intf_window (void) ...@@ -679,7 +683,7 @@ create_intf_window (void)
gtk_widget_show (vbox8); gtk_widget_show (vbox8);
gnome_app_set_contents (GNOME_APP (intf_window), vbox8); gnome_app_set_contents (GNOME_APP (intf_window), vbox8);
slider_frame = gtk_frame_new ("-:--:--"); slider_frame = gtk_frame_new (_("-:--:--"));
gtk_widget_ref (slider_frame); gtk_widget_ref (slider_frame);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "slider_frame", slider_frame, gtk_object_set_data_full (GTK_OBJECT (intf_window), "slider_frame", slider_frame,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
...@@ -736,7 +740,7 @@ create_intf_window (void) ...@@ -736,7 +740,7 @@ create_intf_window (void)
gtk_widget_show (label19); gtk_widget_show (label19);
gtk_box_pack_start (GTK_BOX (title_chapter_box), label19, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (title_chapter_box), label19, FALSE, FALSE, 0);
title_label = gtk_label_new ("--"); title_label = gtk_label_new (_("--"));
gtk_widget_ref (title_label); gtk_widget_ref (title_label);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "title_label", title_label, gtk_object_set_data_full (GTK_OBJECT (intf_window), "title_label", title_label,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
...@@ -779,7 +783,7 @@ create_intf_window (void) ...@@ -779,7 +783,7 @@ create_intf_window (void)
gtk_widget_show (label20); gtk_widget_show (label20);
gtk_box_pack_start (GTK_BOX (dvd_chapter_box), label20, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (dvd_chapter_box), label20, FALSE, FALSE, 0);
chapter_label = gtk_label_new ("---"); chapter_label = gtk_label_new (_("---"));
gtk_widget_ref (chapter_label); gtk_widget_ref (chapter_label);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "chapter_label", chapter_label, gtk_object_set_data_full (GTK_OBJECT (intf_window), "chapter_label", chapter_label,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
...@@ -990,7 +994,7 @@ static GnomeUIInfo popup_file_menu_uiinfo[] = ...@@ -990,7 +994,7 @@ static GnomeUIInfo popup_file_menu_uiinfo[] =
}, },
{ {
GNOME_APP_UI_ITEM, N_("Open _Disc..."), GNOME_APP_UI_ITEM, N_("Open _Disc..."),
N_("Open a DVD or VCD"), N_("Open Disc Media"),
(gpointer) GtkDiscOpenShow, NULL, NULL, (gpointer) GtkDiscOpenShow, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CDROM, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CDROM,
0, (GdkModifierType) 0, NULL 0, (GdkModifierType) 0, NULL
...@@ -1393,6 +1397,7 @@ create_intf_open (void) ...@@ -1393,6 +1397,7 @@ create_intf_open (void)
GSList *disc_group = NULL; GSList *disc_group = NULL;
GtkWidget *disc_dvd; GtkWidget *disc_dvd;
GtkWidget *disc_vcd; GtkWidget *disc_vcd;
GtkWidget *disc_cdda;
GtkWidget *label19; GtkWidget *label19;
GtkWidget *disc_name; GtkWidget *disc_name;
GtkWidget *disc_chapter_label; GtkWidget *disc_chapter_label;
...@@ -1618,6 +1623,14 @@ create_intf_open (void) ...@@ -1618,6 +1623,14 @@ create_intf_open (void)
gtk_widget_show (disc_vcd); gtk_widget_show (disc_vcd);
gtk_box_pack_start (GTK_BOX (hbox24), disc_vcd, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox24), disc_vcd, FALSE, FALSE, 0);
disc_cdda = gtk_radio_button_new_with_label (disc_group, _("Audio CD"));
disc_group = gtk_radio_button_group (GTK_RADIO_BUTTON (disc_cdda));
gtk_widget_ref (disc_cdda);
gtk_object_set_data_full (GTK_OBJECT (intf_open), "disc_cdda", disc_cdda,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (disc_cdda);
gtk_box_pack_start (GTK_BOX (hbox24), disc_cdda, FALSE, FALSE, 0);
label19 = gtk_label_new (_("Device name")); label19 = gtk_label_new (_("Device name"));
gtk_widget_ref (label19); gtk_widget_ref (label19);
gtk_object_set_data_full (GTK_OBJECT (intf_open), "label19", label19, gtk_object_set_data_full (GTK_OBJECT (intf_open), "label19", label19,
...@@ -1635,7 +1648,7 @@ create_intf_open (void) ...@@ -1635,7 +1648,7 @@ create_intf_open (void)
gtk_table_attach (GTK_TABLE (table5), disc_name, 1, 2, 1, 2, gtk_table_attach (GTK_TABLE (table5), disc_name, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0); (GtkAttachOptions) (0), 0, 0);
gtk_entry_set_text (GTK_ENTRY (disc_name), "/dev/dvd"); gtk_entry_set_text (GTK_ENTRY (disc_name), _("/dev/dvd"));
disc_chapter_label = gtk_label_new (_("Chapter")); disc_chapter_label = gtk_label_new (_("Chapter"));
gtk_widget_ref (disc_chapter_label); gtk_widget_ref (disc_chapter_label);
...@@ -1667,7 +1680,7 @@ create_intf_open (void) ...@@ -1667,7 +1680,7 @@ create_intf_open (void)
(GtkAttachOptions) (0), 0, 0); (GtkAttachOptions) (0), 0, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (disc_dvd_use_menu), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (disc_dvd_use_menu), TRUE);
disc_title_adj = gtk_adjustment_new (1, 1, 65536, 1, 10, 10); disc_title_adj = gtk_adjustment_new (1, 0, 65536, 1, 10, 10);
disc_title = gtk_spin_button_new (GTK_ADJUSTMENT (disc_title_adj), 1, 0); disc_title = gtk_spin_button_new (GTK_ADJUSTMENT (disc_title_adj), 1, 0);
gtk_widget_ref (disc_title); gtk_widget_ref (disc_title);
gtk_object_set_data_full (GTK_OBJECT (intf_open), "disc_title", disc_title, gtk_object_set_data_full (GTK_OBJECT (intf_open), "disc_title", disc_title,
...@@ -1937,12 +1950,12 @@ create_intf_open (void) ...@@ -1937,12 +1950,12 @@ create_intf_open (void)
gtk_table_attach (GTK_TABLE (table3), sat_fec, 1, 2, 3, 4, gtk_table_attach (GTK_TABLE (table3), sat_fec, 1, 2, 3, 4,
(GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0); (GtkAttachOptions) (0), 0, 0);
sat_fec_items = g_list_append (sat_fec_items, (gpointer) "1/2"); sat_fec_items = g_list_append (sat_fec_items, (gpointer) _("1/2"));
sat_fec_items = g_list_append (sat_fec_items, (gpointer) "2/3"); sat_fec_items = g_list_append (sat_fec_items, (gpointer) _("2/3"));
sat_fec_items = g_list_append (sat_fec_items, (gpointer) "3/4"); sat_fec_items = g_list_append (sat_fec_items, (gpointer) _("3/4"));
sat_fec_items = g_list_append (sat_fec_items, (gpointer) "4/5"); sat_fec_items = g_list_append (sat_fec_items, (gpointer) _("4/5"));
sat_fec_items = g_list_append (sat_fec_items, (gpointer) "5/6"); sat_fec_items = g_list_append (sat_fec_items, (gpointer) _("5/6"));
sat_fec_items = g_list_append (sat_fec_items, (gpointer) "7/8"); sat_fec_items = g_list_append (sat_fec_items, (gpointer) _("7/8"));
gtk_combo_set_popdown_strings (GTK_COMBO (sat_fec), sat_fec_items); gtk_combo_set_popdown_strings (GTK_COMBO (sat_fec), sat_fec_items);
g_list_free (sat_fec_items); g_list_free (sat_fec_items);
...@@ -1951,7 +1964,7 @@ create_intf_open (void) ...@@ -1951,7 +1964,7 @@ create_intf_open (void)
gtk_object_set_data_full (GTK_OBJECT (intf_open), "combo_entry1", combo_entry1, gtk_object_set_data_full (GTK_OBJECT (intf_open), "combo_entry1", combo_entry1,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (combo_entry1); gtk_widget_show (combo_entry1);
gtk_entry_set_text (GTK_ENTRY (combo_entry1), "3/4"); gtk_entry_set_text (GTK_ENTRY (combo_entry1), _("3/4"));
open_sat = gtk_label_new (_("Satellite")); open_sat = gtk_label_new (_("Satellite"));
gtk_widget_ref (open_sat); gtk_widget_ref (open_sat);
...@@ -2090,6 +2103,9 @@ create_intf_open (void) ...@@ -2090,6 +2103,9 @@ create_intf_open (void)
gtk_signal_connect (GTK_OBJECT (disc_vcd), "toggled", gtk_signal_connect (GTK_OBJECT (disc_vcd), "toggled",
GTK_SIGNAL_FUNC (GtkDiscOpenVcd), GTK_SIGNAL_FUNC (GtkDiscOpenVcd),
NULL); NULL);
gtk_signal_connect (GTK_OBJECT (disc_cdda), "toggled",
GTK_SIGNAL_FUNC (GtkDiscOpenCDDA),
NULL);
gtk_signal_connect (GTK_OBJECT (disc_name), "changed", gtk_signal_connect (GTK_OBJECT (disc_name), "changed",
GTK_SIGNAL_FUNC (GtkOpenChanged), GTK_SIGNAL_FUNC (GtkOpenChanged),
NULL); NULL);
......
/***************************************************************************** /*****************************************************************************
* gtk_callbacks.c : Callbacks for the Gtk+ plugin. * gtk_callbacks.c : Callbacks for the Gtk+ plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001, 2003 VideoLAN
* $Id: gtk_callbacks.c,v 1.14 2003/05/05 16:09:39 gbazin Exp $ * $Id: gtk_callbacks.c,v 1.15 2003/12/12 03:01:12 rocky Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -46,6 +46,18 @@ ...@@ -46,6 +46,18 @@
#include "common.h" #include "common.h"
#ifdef HAVE_CDDAX
#define CDDA_MRL "cddax://"
#else
#define CDDA_MRL "cdda://"
#endif
#ifdef HAVE_VCDX
#define VCD_MRL "vcdx://"
#else
#define VCD_MRL "vcdx://"
#endif
/***************************************************************************** /*****************************************************************************
* Useful function to retrieve p_intf * Useful function to retrieve p_intf
****************************************************************************/ ****************************************************************************/
...@@ -447,31 +459,45 @@ gboolean GtkDiscEject ( GtkWidget *widget, gpointer user_data ) ...@@ -447,31 +459,45 @@ gboolean GtkDiscEject ( GtkWidget *widget, gpointer user_data )
if( psz_current != NULL ) if( psz_current != NULL )
{ {
if( !strncmp(psz_current, "dvd:", 4) ) if( !strncmp(psz_current, "dvd://", 4) )
{ {
switch( psz_current[4] ) switch( psz_current[strlen("dvd://")] )
{ {
case '\0': case '\0':
case '@': case '@':
psz_device = config_GetPsz( p_intf, "dvd" ); psz_device = config_GetPsz( p_intf, "dvd" );
break; break;
default: default:
/* Omit the first 4 characters */ /* Omit the first MRL-selector characters */
psz_device = strdup( psz_current + 4 ); psz_device = strdup( psz_current + strlen("dvd://" ) );
break;
}
}
else if( !strncmp(psz_current, "vcd:", strlen("vcd:")) )
{
switch( psz_current[strlen("vcd:")] )
{
case '\0':
case '@':
psz_device = config_GetPsz( p_intf, VCD_MRL );
break;
default:
/* Omit the beginning MRL-selector characters */
psz_device = strdup( psz_current + strlen(VCD_MRL) );
break; break;
} }
} }
else if( !strncmp(psz_current, "vcd:", 4) ) else if( !strncmp(psz_current, CDDA_MRL, strlen(CDDA_MRL) ) )
{ {
switch( psz_current[4] ) switch( psz_current[strlen(CDDA_MRL)] )
{ {
case '\0': case '\0':
case '@': case '@':
psz_device = config_GetPsz( p_intf, "vcd" ); psz_device = config_GetPsz( p_intf, "cd-audio" );
break; break;
default: default:
/* Omit the first 4 characters */ /* Omit the beginning MRL-selector characters */
psz_device = strdup( psz_current + 4 ); psz_device = strdup( psz_current + strlen(CDDA_MRL) );
break; break;
} }
} }
......
...@@ -627,7 +627,7 @@ create_intf_window (void) ...@@ -627,7 +627,7 @@ create_intf_window (void)
GTK_TOOLBAR_CHILD_BUTTON, GTK_TOOLBAR_CHILD_BUTTON,
NULL, NULL,
_("Disc"), _("Disc"),
_("Open a DVD or VCD"), NULL, _("Open Disc Media"), NULL,
NULL, NULL, NULL); NULL, NULL, NULL);
gtk_widget_ref (toolbar_disc); gtk_widget_ref (toolbar_disc);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_disc", toolbar_disc, gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_disc", toolbar_disc,
...@@ -1408,7 +1408,7 @@ create_intf_popup (void) ...@@ -1408,7 +1408,7 @@ create_intf_popup (void)
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (popup_disc); gtk_widget_show (popup_disc);
gtk_container_add (GTK_CONTAINER (popup_open_menu), popup_disc); gtk_container_add (GTK_CONTAINER (popup_open_menu), popup_disc);
gtk_tooltips_set_tip (tooltips, popup_disc, _("Open a DVD or VCD"), NULL); gtk_tooltips_set_tip (tooltips, popup_disc, _("Open Disc Media"), NULL);
popup_network = gtk_menu_item_new_with_label (""); popup_network = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_network)->child), tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_network)->child),
...@@ -1700,6 +1700,7 @@ create_intf_open (void) ...@@ -1700,6 +1700,7 @@ create_intf_open (void)
GSList *disc_group = NULL; GSList *disc_group = NULL;
GtkWidget *disc_dvd; GtkWidget *disc_dvd;
GtkWidget *disc_vcd; GtkWidget *disc_vcd;
GtkWidget *disc_cdda;
GtkWidget *label19; GtkWidget *label19;
GtkWidget *disc_chapter_label; GtkWidget *disc_chapter_label;
GtkWidget *disc_title_label; GtkWidget *disc_title_label;
...@@ -1913,7 +1914,7 @@ create_intf_open (void) ...@@ -1913,7 +1914,7 @@ create_intf_open (void)
gtk_object_set_data_full (GTK_OBJECT (intf_open), "hbox24", hbox24, gtk_object_set_data_full (GTK_OBJECT (intf_open), "hbox24", hbox24,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox24); gtk_widget_show (hbox24);
gtk_table_attach (GTK_TABLE (table5), hbox24, 1, 2, 0, 1, gtk_table_attach (GTK_TABLE (table5), hbox24, 1, 3, 0, 1,
(GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (GTK_FILL), 0, 0); (GtkAttachOptions) (GTK_FILL), 0, 0);
...@@ -1933,6 +1934,14 @@ create_intf_open (void) ...@@ -1933,6 +1934,14 @@ create_intf_open (void)
gtk_widget_show (disc_vcd); gtk_widget_show (disc_vcd);
gtk_box_pack_start (GTK_BOX (hbox24), disc_vcd, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox24), disc_vcd, FALSE, FALSE, 0);
disc_cdda = gtk_radio_button_new_with_label (disc_group, _("Audio CD"));
disc_group = gtk_radio_button_group (GTK_RADIO_BUTTON (disc_cdda));
gtk_widget_ref (disc_cdda);
gtk_object_set_data_full (GTK_OBJECT (intf_open), "disc_cdda", disc_cdda,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (disc_cdda);
gtk_box_pack_start (GTK_BOX (hbox24), disc_cdda, FALSE, FALSE, 0);
label19 = gtk_label_new (_("Device name")); label19 = gtk_label_new (_("Device name"));
gtk_widget_ref (label19); gtk_widget_ref (label19);
gtk_object_set_data_full (GTK_OBJECT (intf_open), "label19", label19, gtk_object_set_data_full (GTK_OBJECT (intf_open), "label19", label19,
...@@ -2428,6 +2437,9 @@ create_intf_open (void) ...@@ -2428,6 +2437,9 @@ create_intf_open (void)
gtk_signal_connect (GTK_OBJECT (disc_vcd), "toggled", gtk_signal_connect (GTK_OBJECT (disc_vcd), "toggled",
GTK_SIGNAL_FUNC (GtkDiscOpenVcd), GTK_SIGNAL_FUNC (GtkDiscOpenVcd),
NULL); NULL);
gtk_signal_connect (GTK_OBJECT (disc_cdda), "toggled",
GTK_SIGNAL_FUNC (GtkDiscOpenCDDA),
NULL);
gtk_signal_connect (GTK_OBJECT (disc_name), "changed", gtk_signal_connect (GTK_OBJECT (disc_name), "changed",
GTK_SIGNAL_FUNC (GtkOpenChanged), GTK_SIGNAL_FUNC (GtkOpenChanged),
NULL); NULL);
......
/***************************************************************************** /*****************************************************************************
* gtk_open.c : functions to handle file/disc/network open widgets. * gtk_open.c : functions to handle file/disc/network open widgets.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001, 2003 VideoLAN
* $Id: open.c,v 1.15 2003/07/23 01:13:47 gbazin Exp $ * $Id: open.c,v 1.16 2003/12/12 03:01:13 rocky Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -141,19 +141,26 @@ void GtkDiscOpenDvd( GtkToggleButton * togglebutton, gpointer user_data ) ...@@ -141,19 +141,26 @@ void GtkDiscOpenDvd( GtkToggleButton * togglebutton, gpointer user_data )
intf_thread_t * p_intf = GtkGetIntf( togglebutton ); intf_thread_t * p_intf = GtkGetIntf( togglebutton );
char *psz_device; char *psz_device;
if( togglebutton->active if( togglebutton->active )
&& (psz_device = config_GetPsz( p_intf, "dvd" )) )
{ {
gtk_widget_set_sensitive( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "disc_dvd_use_menu" ) ) , TRUE); if ( (psz_device = config_GetPsz( p_intf, "dvd" )) )
{
gtk_widget_set_sensitive( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "disc_dvd_use_menu" ) ) , TRUE);
gtk_entry_set_text( gtk_entry_set_text(
GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton), GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton),
"disc_name" ) ), psz_device ); "disc_name" ) ), psz_device );
free( psz_device ); free( psz_device );
}
else
{
gtk_widget_set_sensitive( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "disc_dvd_use_menu" ) ), FALSE );
}
GtkDiscOpenChanged( (GtkWidget *) togglebutton, user_data );
} }
else else
{ {
gtk_widget_set_sensitive( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "disc_dvd_use_menu" ) ), FALSE ); gtk_widget_set_sensitive( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "disc_dvd_use_menu" ) ), FALSE );
} }
} }
...@@ -162,18 +169,40 @@ void GtkDiscOpenVcd( GtkToggleButton * togglebutton, gpointer user_data ) ...@@ -162,18 +169,40 @@ void GtkDiscOpenVcd( GtkToggleButton * togglebutton, gpointer user_data )
intf_thread_t * p_intf = GtkGetIntf( togglebutton ); intf_thread_t * p_intf = GtkGetIntf( togglebutton );
char *psz_device; char *psz_device;
if( togglebutton->active if( togglebutton->active )
&& (psz_device = config_GetPsz( p_intf, "vcd" )) ) {
{ if ( (psz_device = config_GetPsz( p_intf, "vcd" )) )
gtk_entry_set_text( {
gtk_entry_set_text(
GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton), GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton),
"disc_name" ) ), psz_device ); "disc_name" ) ), psz_device );
free( psz_device ); free( psz_device );
} }
GtkDiscOpenChanged( (GtkWidget *) togglebutton, user_data );
}
}
void GtkDiscOpenCDDA( GtkToggleButton * togglebutton, gpointer user_data )
{
intf_thread_t * p_intf = GtkGetIntf( togglebutton );
char *psz_device;
if( togglebutton->active )
{
if ( (psz_device = config_GetPsz( p_intf, "cd-audio" )) )
{
gtk_entry_set_text(
GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton),
"disc_name" ) ), psz_device );
free( psz_device );
}
GtkDiscOpenChanged( (GtkWidget *) togglebutton, user_data );
}
} }
static void GtkDiscOpenChanged( GtkWidget * button, gpointer user_data ) static void GtkDiscOpenChanged( GtkWidget * button, gpointer user_data )
{ {
intf_thread_t * p_intf = GtkGetIntf( button );
GString * p_target = g_string_new( "" ); GString * p_target = g_string_new( "" );
GtkWidget * p_open; GtkWidget * p_open;
vlc_bool_t b_menus = VLC_FALSE; vlc_bool_t b_menus = VLC_FALSE;
...@@ -192,28 +221,81 @@ static void GtkDiscOpenChanged( GtkWidget * button, gpointer user_data ) ...@@ -192,28 +221,81 @@ static void GtkDiscOpenChanged( GtkWidget * button, gpointer user_data )
} }
else else
{ {
g_string_append( p_target, "dvdold://" ); g_string_append( p_target, "dvdsimple://" );
} }
g_string_append( p_target,
gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "disc_name" ) ) ) );
if( !b_menus )
{
g_string_sprintfa( p_target, "@%i:%i",
gtk_spin_button_get_value_as_int(
GTK_SPIN_BUTTON( lookup_widget(
GTK_WIDGET(button), "disc_title" ) ) ),
gtk_spin_button_get_value_as_int(
GTK_SPIN_BUTTON( lookup_widget(
GTK_WIDGET(button), "disc_chapter" ) ) ) );
}
} }
else if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button), else if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
"disc_vcd" ) )->active ) "disc_vcd" ) )->active )
{ {
g_string_append( p_target, "vcd://" ); #ifdef HAVE_VCDX
int i = gtk_spin_button_get_value_as_int(
GTK_SPIN_BUTTON( lookup_widget(
GTK_WIDGET(button), "disc_title" ) ) );
g_string_append( p_target, "vcdx://" );
g_string_append( p_target,
gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "disc_name" ) ) ) );
if ( i )
g_string_sprintfa( p_target, "@%c%d",
config_GetInt( p_intf, "vcdx-PBC" )
? 'P' : 'E', i );
} }
#else
g_string_append( p_target, "vcd://" );
g_string_sprintfa( p_target, "@%d",
gtk_spin_button_get_value_as_int(
GTK_SPIN_BUTTON( lookup_widget(
GTK_WIDGET(button), "disc_title" ) ) ) );
#endif
g_string_append( p_target, else if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
"disc_cdda" ) )->active )
{
#ifdef HAVE_CDDAX
int i = gtk_spin_button_get_value_as_int(
GTK_SPIN_BUTTON( lookup_widget(
GTK_WIDGET(button), "disc_title" ) ) );
g_string_append( p_target, "cddax://" );
g_string_append( p_target,
gtk_entry_get_text( GTK_ENTRY( lookup_widget( gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "disc_name" ) ) ) ); GTK_WIDGET(button), "disc_name" ) ) ) );
if( !b_menus ) if ( i )
{ g_string_sprintfa( p_target, "@T%i",
g_string_sprintfa( p_target, "@%i,%i", gtk_spin_button_get_value_as_int(
gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( lookup_widget(
GTK_SPIN_BUTTON( lookup_widget( GTK_WIDGET(button), "disc_title" ) ) ) );
GTK_WIDGET(button), "disc_title" ) ) ),
#else
g_string_append( p_target, "cdda://" );
g_string_append( p_target,
gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "disc_name" ) ) ) );
g_string_sprintfa( p_target, "@%i:%i",
gtk_spin_button_get_value_as_int( gtk_spin_button_get_value_as_int(
GTK_SPIN_BUTTON( lookup_widget( GTK_SPIN_BUTTON( lookup_widget(
GTK_WIDGET(button), "disc_chapter" ) ) ) ); GTK_WIDGET(button), "disc_title" ) ) ) );
#endif
} }
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_open ), gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_open ),
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_open.h: prototypes for open functions * gtk_open.h: prototypes for open functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: open.h,v 1.1 2002/08/04 17:23:43 sam Exp $ * $Id: open.h,v 1.2 2003/12/12 03:01:13 rocky Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -29,6 +29,7 @@ void GtkFileOpenOk ( GtkButton *, gpointer ); ...@@ -29,6 +29,7 @@ void GtkFileOpenOk ( GtkButton *, gpointer );
gboolean GtkDiscOpenShow ( GtkWidget *, gpointer ); gboolean GtkDiscOpenShow ( GtkWidget *, gpointer );
void GtkDiscOpenDvd ( GtkToggleButton *, gpointer ); void GtkDiscOpenDvd ( GtkToggleButton *, gpointer );
void GtkDiscOpenVcd ( GtkToggleButton *, gpointer ); void GtkDiscOpenVcd ( GtkToggleButton *, gpointer );
void GtkDiscOpenCDDA ( GtkToggleButton *, gpointer );
void GtkDiscOpenOk ( GtkButton *, gpointer ); void GtkDiscOpenOk ( GtkButton *, gpointer );
void GtkDiscOpenCancel ( GtkButton *, gpointer ); void GtkDiscOpenCancel ( GtkButton *, gpointer );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment