* enable the network channel box when selecting network channel input
[vlc.git] / modules / gui / gtk / open.c
index a337090..99149a3 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_open.c : functions to handle file/disc/network open widgets.
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: open.c,v 1.3 2002/09/30 11:05:39 sam Exp $
+ * $Id: open.c,v 1.6 2003/01/10 11:02:21 asmax Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          St├ęphane Borel <stef@via.ecp.fr>
@@ -43,7 +43,6 @@
 #include "gtk_interface.h"
 #include "gtk_support.h"
 
-#include "playlist.h"
 #include "common.h"
 
 #include "netutils.h"
@@ -274,8 +273,8 @@ static void GtkNetworkOpenChanged( GtkWidget *button, gpointer user_data )
     }
     else if( SELECTED( "network_http" ) )
     {
-        g_string_sprintfa( p_target, "http://%s",
-                           gtk_entry_get_text( GTK_ENTRY( lookup_widget(
+        g_string_assign( p_target,
+                         gtk_entry_get_text( GTK_ENTRY( lookup_widget(
                                GTK_WIDGET(button), "network_http_url" ) ) ) );
     }
 
@@ -462,6 +461,10 @@ static void GtkOpenShow( intf_thread_t *p_intf, int i_page )
         free( psz_var );
     }
 
+    gtk_entry_set_text( GTK_ENTRY( gtk_object_get_data(
+        GTK_OBJECT( p_intf->p_sys->p_open ), "network_http_url" ) ),
+        "http://" );
+
     gtk_spin_button_set_value( GTK_SPIN_BUTTON( gtk_object_get_data(
         GTK_OBJECT( p_intf->p_sys->p_open ), "network_channel_port" ) ),
         config_GetInt( p_intf, "channel-port" ) );
@@ -529,6 +532,14 @@ void GtkOpenOk( GtkButton * button, gpointer user_data )
     GtkRebuildCList( p_playlist_clist, p_playlist );
 
     vlc_object_release( p_playlist );
+
+    /* Enable the channel box when network channel is selected */
+    if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
+                                               "network_channel" ) )->active )
+    {
+        p_intf->p_sys->b_playing = 1;
+    }
+    
 }
 
 void GtkOpenCancel( GtkButton * button, gpointer user_data )