Commit 28521d8e authored by Jean-Paul Saman's avatar Jean-Paul Saman

PDA Interface

* simplefied network tabpage
parent 6b4fa4aa
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* pda_callbacks.c : Callbacks for the pda Linux Gtk+ plugin. * pda_callbacks.c : Callbacks for the pda Linux Gtk+ plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: pda_callbacks.c,v 1.7 2003/11/08 16:04:05 jpsaman Exp $ * $Id: pda_callbacks.c,v 1.8 2003/11/08 18:31:01 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -588,53 +588,36 @@ NetworkBuildMRL (GtkEditable *editable, ...@@ -588,53 +588,36 @@ NetworkBuildMRL (GtkEditable *editable,
{ {
GtkSpinButton *networkPort = NULL; GtkSpinButton *networkPort = NULL;
GtkEntry *entryMRL = NULL; GtkEntry *entryMRL = NULL;
GtkEntry *networkMRLType = NULL; GtkEntry *networkType = NULL;
GtkEntry *networkAddress = NULL; GtkEntry *networkAddress = NULL;
GtkEntry *networkProtocol = NULL; GtkEntry *networkProtocol = NULL;
GtkEntry *networkType = NULL; const gchar *mrlNetworkType;
const gchar *mrlType;
const gchar *mrlAddress; const gchar *mrlAddress;
gint mrlPort; gint mrlPort;
const gchar *mrlProtocol; const gchar *mrlProtocol;
const gchar *mrlNetworkType;
#define VLC_MAX_MRL 256 #define VLC_MAX_MRL 256
char text[VLC_MAX_MRL]; char text[VLC_MAX_MRL];
int pos = 0; int pos = 0;
entryMRL = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryMRL" ); entryMRL = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryMRL" );
networkMRLType = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkMRLType" ); networkType = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkType" );
networkAddress = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkAddress" ); networkAddress = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkAddress" );
networkPort = (GtkSpinButton*) lookup_widget( GTK_WIDGET(editable), "entryNetworkPort" ); networkPort = (GtkSpinButton*) lookup_widget( GTK_WIDGET(editable), "entryNetworkPort" );
networkProtocol = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkProtocolType" ); networkProtocol = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkProtocolType" );
networkType = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkType" );
mrlType = gtk_entry_get_text(GTK_ENTRY(networkMRLType)); mrlNetworkType = gtk_entry_get_text(GTK_ENTRY(networkType));
mrlAddress = gtk_entry_get_text(GTK_ENTRY(networkAddress)); mrlAddress = gtk_entry_get_text(GTK_ENTRY(networkAddress));
mrlPort = gtk_spin_button_get_value_as_int(networkPort); mrlPort = gtk_spin_button_get_value_as_int(networkPort);
mrlProtocol = gtk_entry_get_text(GTK_ENTRY(networkProtocol)); mrlProtocol = gtk_entry_get_text(GTK_ENTRY(networkProtocol));
mrlNetworkType = gtk_entry_get_text(GTK_ENTRY(networkType));
/* Build MRL from parts ;-) */ /* Build MRL from parts ;-) */
pos = snprintf( &text[0], VLC_MAX_MRL, "%s", (char*)mrlType); pos = snprintf( &text[0], VLC_MAX_MRL, "%s://", (char*)mrlProtocol);
if (strncasecmp( (char*)mrlProtocol, "IPv6",4)==0 )
{
pos += snprintf( &text[pos], VLC_MAX_MRL - pos, "6://" );
if (strncasecmp( (char*)mrlNetworkType, "multicast",9)==0)
{
pos += snprintf( &text[pos], VLC_MAX_MRL - pos, "@" );
}
pos += snprintf( &text[pos], VLC_MAX_MRL - pos, "[%s]:%d", (char*)mrlAddress, (int)mrlPort );
}
else
{
pos += snprintf( &text[pos], VLC_MAX_MRL - pos, "://" );
if (strncasecmp( (char*)mrlNetworkType, "multicast",9)==0) if (strncasecmp( (char*)mrlNetworkType, "multicast",9)==0)
{ {
pos += snprintf( &text[pos], VLC_MAX_MRL - pos, "@" ); pos += snprintf( &text[pos], VLC_MAX_MRL - pos, "@" );
} }
pos += snprintf( &text[pos], VLC_MAX_MRL - pos, "%s:%d", (char*)mrlAddress, (int)mrlPort ); pos += snprintf( &text[pos], VLC_MAX_MRL - pos, "%s:%d", (char*)mrlAddress, (int)mrlPort );
}
if (pos >= VLC_MAX_MRL) if (pos >= VLC_MAX_MRL)
text[VLC_MAX_MRL-1]='\0'; text[VLC_MAX_MRL-1]='\0';
......
...@@ -73,14 +73,6 @@ create_pda (void) ...@@ -73,14 +73,6 @@ create_pda (void)
GList *comboNetworkProtocolType_items = NULL; GList *comboNetworkProtocolType_items = NULL;
GtkWidget *entryNetworkProtocolType; GtkWidget *entryNetworkProtocolType;
GtkWidget *labelNetworkProtocol; GtkWidget *labelNetworkProtocol;
GtkWidget *labeNetworkMRLType;
GtkWidget *comboNetworkMRLType;
GList *comboNetworkMRLType_items = NULL;
GtkWidget *entryNetworkMRLType;
GtkWidget *labelNetworkStreamType;
GtkWidget *comboNetworkStreamType;
GList *comboNetworkStreamType_items = NULL;
GtkWidget *entryNetworkStreamType;
GtkWidget *hbox13; GtkWidget *hbox13;
GtkWidget *AddNetworkPlaylist; GtkWidget *AddNetworkPlaylist;
GtkWidget *Network; GtkWidget *Network;
...@@ -434,14 +426,21 @@ create_pda (void) ...@@ -434,14 +426,21 @@ create_pda (void)
gtk_table_attach (GTK_TABLE (table2), comboNetworkProtocolType, 1, 2, 3, 4, gtk_table_attach (GTK_TABLE (table2), comboNetworkProtocolType, 1, 2, 3, 4,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0); (GtkAttachOptions) (0), 0, 0);
comboNetworkProtocolType_items = g_list_append (comboNetworkProtocolType_items, (gpointer) _("IPv4")); comboNetworkProtocolType_items = g_list_append (comboNetworkProtocolType_items, (gpointer) _("udp"));
comboNetworkProtocolType_items = g_list_append (comboNetworkProtocolType_items, (gpointer) _("IPv6")); comboNetworkProtocolType_items = g_list_append (comboNetworkProtocolType_items, (gpointer) _("udp6"));
comboNetworkProtocolType_items = g_list_append (comboNetworkProtocolType_items, (gpointer) _("rtp"));
comboNetworkProtocolType_items = g_list_append (comboNetworkProtocolType_items, (gpointer) _("rtp4"));
comboNetworkProtocolType_items = g_list_append (comboNetworkProtocolType_items, (gpointer) _("ftp"));
comboNetworkProtocolType_items = g_list_append (comboNetworkProtocolType_items, (gpointer) _("http"));
comboNetworkProtocolType_items = g_list_append (comboNetworkProtocolType_items, (gpointer) _("sout"));
comboNetworkProtocolType_items = g_list_append (comboNetworkProtocolType_items, (gpointer) _("mms"));
gtk_combo_set_popdown_strings (GTK_COMBO (comboNetworkProtocolType), comboNetworkProtocolType_items); gtk_combo_set_popdown_strings (GTK_COMBO (comboNetworkProtocolType), comboNetworkProtocolType_items);
g_list_free (comboNetworkProtocolType_items); g_list_free (comboNetworkProtocolType_items);
entryNetworkProtocolType = GTK_COMBO (comboNetworkProtocolType)->entry; entryNetworkProtocolType = GTK_COMBO (comboNetworkProtocolType)->entry;
gtk_widget_set_name (entryNetworkProtocolType, "entryNetworkProtocolType"); gtk_widget_set_name (entryNetworkProtocolType, "entryNetworkProtocolType");
gtk_widget_show (entryNetworkProtocolType); gtk_widget_show (entryNetworkProtocolType);
gtk_entry_set_text (GTK_ENTRY (entryNetworkProtocolType), _("udp"));
labelNetworkProtocol = gtk_label_new (_("Protocol:")); labelNetworkProtocol = gtk_label_new (_("Protocol:"));
gtk_widget_set_name (labelNetworkProtocol, "labelNetworkProtocol"); gtk_widget_set_name (labelNetworkProtocol, "labelNetworkProtocol");
...@@ -452,62 +451,6 @@ create_pda (void) ...@@ -452,62 +451,6 @@ create_pda (void)
gtk_label_set_justify (GTK_LABEL (labelNetworkProtocol), GTK_JUSTIFY_LEFT); gtk_label_set_justify (GTK_LABEL (labelNetworkProtocol), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (labelNetworkProtocol), 0, 0.5); gtk_misc_set_alignment (GTK_MISC (labelNetworkProtocol), 0, 0.5);
labeNetworkMRLType = gtk_label_new (_("MRL:"));
gtk_widget_set_name (labeNetworkMRLType, "labeNetworkMRLType");
gtk_widget_show (labeNetworkMRLType);
gtk_table_attach (GTK_TABLE (table2), labeNetworkMRLType, 0, 1, 4, 5,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (labeNetworkMRLType), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (labeNetworkMRLType), 0, 0.5);
comboNetworkMRLType = gtk_combo_new ();
g_object_set_data (G_OBJECT (GTK_COMBO (comboNetworkMRLType)->popwin),
"GladeParentKey", comboNetworkMRLType);
gtk_widget_set_name (comboNetworkMRLType, "comboNetworkMRLType");
gtk_widget_show (comboNetworkMRLType);
gtk_table_attach (GTK_TABLE (table2), comboNetworkMRLType, 1, 2, 4, 5,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
comboNetworkMRLType_items = g_list_append (comboNetworkMRLType_items, (gpointer) _("udp"));
comboNetworkMRLType_items = g_list_append (comboNetworkMRLType_items, (gpointer) _("rtp"));
comboNetworkMRLType_items = g_list_append (comboNetworkMRLType_items, (gpointer) _("ftp"));
comboNetworkMRLType_items = g_list_append (comboNetworkMRLType_items, (gpointer) _("http"));
comboNetworkMRLType_items = g_list_append (comboNetworkMRLType_items, (gpointer) _("mms"));
gtk_combo_set_popdown_strings (GTK_COMBO (comboNetworkMRLType), comboNetworkMRLType_items);
g_list_free (comboNetworkMRLType_items);
entryNetworkMRLType = GTK_COMBO (comboNetworkMRLType)->entry;
gtk_widget_set_name (entryNetworkMRLType, "entryNetworkMRLType");
gtk_widget_show (entryNetworkMRLType);
gtk_entry_set_text (GTK_ENTRY (entryNetworkMRLType), _("udp"));
labelNetworkStreamType = gtk_label_new (_("Stream:"));
gtk_widget_set_name (labelNetworkStreamType, "labelNetworkStreamType");
gtk_widget_show (labelNetworkStreamType);
gtk_table_attach (GTK_TABLE (table2), labelNetworkStreamType, 0, 1, 5, 6,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (labelNetworkStreamType), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (labelNetworkStreamType), 0, 0.5);
comboNetworkStreamType = gtk_combo_new ();
g_object_set_data (G_OBJECT (GTK_COMBO (comboNetworkStreamType)->popwin),
"GladeParentKey", comboNetworkStreamType);
gtk_widget_set_name (comboNetworkStreamType, "comboNetworkStreamType");
gtk_widget_show (comboNetworkStreamType);
gtk_table_attach (GTK_TABLE (table2), comboNetworkStreamType, 1, 2, 5, 6,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
comboNetworkStreamType_items = g_list_append (comboNetworkStreamType_items, (gpointer) _("server"));
comboNetworkStreamType_items = g_list_append (comboNetworkStreamType_items, (gpointer) _("client"));
gtk_combo_set_popdown_strings (GTK_COMBO (comboNetworkStreamType), comboNetworkStreamType_items);
g_list_free (comboNetworkStreamType_items);
entryNetworkStreamType = GTK_COMBO (comboNetworkStreamType)->entry;
gtk_widget_set_name (entryNetworkStreamType, "entryNetworkStreamType");
gtk_widget_show (entryNetworkStreamType);
hbox13 = gtk_hbox_new (FALSE, 0); hbox13 = gtk_hbox_new (FALSE, 0);
gtk_widget_set_name (hbox13, "hbox13"); gtk_widget_set_name (hbox13, "hbox13");
gtk_widget_show (hbox13); gtk_widget_show (hbox13);
...@@ -962,12 +905,6 @@ create_pda (void) ...@@ -962,12 +905,6 @@ create_pda (void)
g_signal_connect ((gpointer) entryNetworkProtocolType, "changed", g_signal_connect ((gpointer) entryNetworkProtocolType, "changed",
G_CALLBACK (NetworkBuildMRL), G_CALLBACK (NetworkBuildMRL),
NULL); NULL);
g_signal_connect ((gpointer) entryNetworkMRLType, "changed",
G_CALLBACK (NetworkBuildMRL),
NULL);
g_signal_connect ((gpointer) entryNetworkStreamType, "changed",
G_CALLBACK (NetworkBuildMRL),
NULL);
g_signal_connect ((gpointer) AddNetworkPlaylist, "pressed", g_signal_connect ((gpointer) AddNetworkPlaylist, "pressed",
G_CALLBACK (onAddNetworkPlaylist), G_CALLBACK (onAddNetworkPlaylist),
NULL); NULL);
...@@ -1095,12 +1032,6 @@ create_pda (void) ...@@ -1095,12 +1032,6 @@ create_pda (void)
GLADE_HOOKUP_OBJECT (pda, comboNetworkProtocolType, "comboNetworkProtocolType"); GLADE_HOOKUP_OBJECT (pda, comboNetworkProtocolType, "comboNetworkProtocolType");
GLADE_HOOKUP_OBJECT (pda, entryNetworkProtocolType, "entryNetworkProtocolType"); GLADE_HOOKUP_OBJECT (pda, entryNetworkProtocolType, "entryNetworkProtocolType");
GLADE_HOOKUP_OBJECT (pda, labelNetworkProtocol, "labelNetworkProtocol"); GLADE_HOOKUP_OBJECT (pda, labelNetworkProtocol, "labelNetworkProtocol");
GLADE_HOOKUP_OBJECT (pda, labeNetworkMRLType, "labeNetworkMRLType");
GLADE_HOOKUP_OBJECT (pda, comboNetworkMRLType, "comboNetworkMRLType");
GLADE_HOOKUP_OBJECT (pda, entryNetworkMRLType, "entryNetworkMRLType");
GLADE_HOOKUP_OBJECT (pda, labelNetworkStreamType, "labelNetworkStreamType");
GLADE_HOOKUP_OBJECT (pda, comboNetworkStreamType, "comboNetworkStreamType");
GLADE_HOOKUP_OBJECT (pda, entryNetworkStreamType, "entryNetworkStreamType");
GLADE_HOOKUP_OBJECT (pda, hbox13, "hbox13"); GLADE_HOOKUP_OBJECT (pda, hbox13, "hbox13");
GLADE_HOOKUP_OBJECT (pda, AddNetworkPlaylist, "AddNetworkPlaylist"); GLADE_HOOKUP_OBJECT (pda, AddNetworkPlaylist, "AddNetworkPlaylist");
GLADE_HOOKUP_OBJECT (pda, Network, "Network"); GLADE_HOOKUP_OBJECT (pda, Network, "Network");
......
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