1 /*****************************************************************************
2 * network.c : Network interface of the gtk-familiar plugin.
3 *****************************************************************************
4 * Copyright (C) 2000, 2001 VideoLAN
5 * $Id: network.c,v 1.1 2003/03/13 15:50:17 marcari Exp $
7 * Authors: Marc Ariberti <marcari@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
28 #include <sys/types.h> /* off_t */
47 #include "callbacks.h"
48 #include "interface.h"
52 static void update_network_multicast(GtkWidget * widget);
54 static void update_network_multicast(GtkWidget * widget)
56 intf_thread_t * p_intf = GtkGetIntf( widget );
57 GtkToggleButton * p_network_multicast =
58 GTK_GET( TOGGLE_BUTTON, "network_multicast" );
59 GtkEditable * p_network_multicast_address =
60 GTK_GET( EDITABLE, "network_multicast_address" );
61 GtkEditable * p_network_multicast_port =
62 GTK_GET( EDITABLE, "network_multicast_port" );
64 if (gtk_toggle_button_get_active(p_network_multicast))
66 gchar * str = g_strconcat( "udp://@",
67 gtk_editable_get_chars(p_network_multicast_address, 0, -1), ":",
68 gtk_editable_get_chars(p_network_multicast_port, 0, -1), NULL );
69 gtk_entry_set_text(p_intf->p_sys->p_mrlentry, str);
76 on_network_multicast_toggled (GtkToggleButton *togglebutton,
79 update_network_multicast(GTK_WIDGET(togglebutton));
84 on_network_multicast_port_changed (GtkEditable *editable,
87 update_network_multicast(GTK_WIDGET(editable));
92 on_network_multicast_address_changed (GtkEditable *editable,
95 update_network_multicast(GTK_WIDGET(editable));
100 on_network_http_toggled (GtkToggleButton *togglebutton,
103 intf_thread_t * p_intf = GtkGetIntf( togglebutton );
105 if (gtk_toggle_button_get_active(togglebutton))
107 gtk_entry_set_text(p_intf->p_sys->p_mrlentry, "http://");
113 on_network_ftp_toggled (GtkToggleButton *togglebutton,
116 intf_thread_t * p_intf = GtkGetIntf( togglebutton );
118 if (gtk_toggle_button_get_active(togglebutton))
120 gtk_entry_set_text(p_intf->p_sys->p_mrlentry, "ftp://");
126 on_network_mms_toggled (GtkToggleButton *togglebutton,
129 intf_thread_t * p_intf = GtkGetIntf( togglebutton );
131 if (gtk_toggle_button_get_active(togglebutton))
133 gtk_entry_set_text(p_intf->p_sys->p_mrlentry, "mms://");