annotate Gui/mplayer/gtk/url.c @ 6996:163f78ece9c2

add uri2filename converter
author pontscho
date Wed, 14 Aug 2002 12:17:04 +0000
parents c2d4100c964e
children 8e9607c5897e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
1
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
2 #include <sys/types.h>
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
3 #include <sys/stat.h>
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
4 #include <unistd.h>
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
5 #include <stdlib.h>
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
6 #include <stdio.h>
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
7 #include <string.h>
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
8
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
9 #include <gdk/gdkkeysyms.h>
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
10 #include <gtk/gtk.h>
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
11
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
12 #include "url.h"
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
13 #include "../../interface.h"
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
14 #include "../../events.h"
6335
e9bd97d5c5cc warning & newline fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 6298
diff changeset
15 #include "../widgets.h"
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
16 #include "../../help_mp.h"
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
17
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
18 GtkWidget * URL;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
19 int gtkVURLDialogBox = 0;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
20
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
21 static GtkWidget * URLCombo;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
22 static GtkWidget * URLEntry;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
23 static GList * URLComboEntrys = NULL;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
24
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
25 void ShowURLDialogBox( void )
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
26 {
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
27 if ( gtkVURLDialogBox ) gtkActive( URL );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
28 else URL=create_URL();
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
29
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
30 if ( URLComboEntrys )
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
31 {
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
32 gtk_entry_set_text( GTK_ENTRY( URLEntry ),URLComboEntrys->data );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
33 gtk_combo_set_popdown_strings( GTK_COMBO( URLCombo ),URLComboEntrys );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
34 }
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
35
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
36 gtk_widget_show( URL );
6903
c2d4100c964e - fix mixer handling
pontscho
parents: 6854
diff changeset
37 gtkVURLDialogBox=1;
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
38 }
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
39
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
40 void HideURLDialogBox( void )
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
41 {
6755
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6651
diff changeset
42 if ( !gtkVURLDialogBox ) return;
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
43 gtk_widget_hide( URL );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
44 gtk_widget_destroy( URL );
6903
c2d4100c964e - fix mixer handling
pontscho
parents: 6854
diff changeset
45 gtkVURLDialogBox=0;
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
46 }
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
47
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
48 static gboolean on_URL_destroy_event( GtkWidget * widget,GdkEvent * event,gpointer user_data )
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
49 {
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
50 HideURLDialogBox();
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
51 return FALSE;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
52 }
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
53
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
54 static void on_Button_pressed( GtkButton * button,gpointer user_data )
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
55 {
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
56 if ( (int)user_data )
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
57 {
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
58 gchar * str= strdup( gtk_entry_get_text( GTK_ENTRY( URLEntry ) ) );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
59
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
60 if ( str )
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
61 {
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
62 if ( strncmp( str,"http://",7 ) && strncmp( str,"ftp://",6 ) && !strncmp( str,"mms://",6 ) )
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
63 {
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
64 gchar * tmp;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
65 tmp=malloc( strlen( str ) + 8 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
66 sprintf( tmp,"http://%s",str );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
67 free( str ); str=tmp;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
68 }
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
69 URLComboEntrys=g_list_prepend( URLComboEntrys,(gchar *)str );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
70
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
71 guiSetFilename( guiIntfStruct.Filename,str ); guiIntfStruct.FilenameChanged=1;
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
72 mplEventHandling( evPlayNetwork,0 );
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
73 }
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
74 }
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
75 HideURLDialogBox();
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
76 }
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
77
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
78 static void ab_URL_show( GtkButton * button,gpointer user_data )
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
79 { gtkVURLDialogBox=(int)user_data; }
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
80
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
81 GtkWidget * create_URL( void )
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
82 {
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
83 GtkWidget * frame1;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
84 GtkWidget * frame2;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
85 GtkWidget * frame3;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
86 GtkWidget * frame4;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
87 GtkWidget * vbox1;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
88 GtkWidget * hbox1;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
89 GtkWidget * label1;
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
90 GtkWidget * hsep;
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
91 GtkWidget * hbuttonbox1;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
92 GtkWidget * Ok;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
93 GtkWidget * Cancel;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
94 GtkAccelGroup * accel_group;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
95
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
96 accel_group=gtk_accel_group_new();
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
97
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
98 URL=gtk_window_new( GTK_WINDOW_DIALOG );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
99 gtk_widget_set_name( URL,"URL" );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
100 gtk_object_set_data( GTK_OBJECT( URL ),"URL",URL );
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
101 gtk_widget_set_usize( URL,384,70 );
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
102 GTK_WIDGET_SET_FLAGS( URL,GTK_CAN_DEFAULT );
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
103 gtk_window_set_title( GTK_WINDOW( URL ),MSGTR_Network );
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
104 gtk_window_set_position( GTK_WINDOW( URL ),GTK_WIN_POS_CENTER );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
105 gtk_window_set_policy( GTK_WINDOW( URL ),TRUE,TRUE,FALSE );
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
106 gtk_window_set_wmclass( GTK_WINDOW( URL ),MSGTR_Network,"MPlayer" );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
107
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
108 gtk_widget_realize( URL );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
109 gtkAddIcon( URL );
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
110
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
111 frame1=gtk_frame_new( NULL );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
112 gtk_widget_set_name( frame1,"frame1" );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
113 gtk_widget_ref( frame1 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
114 gtk_object_set_data_full( GTK_OBJECT( URL ),"frame1",frame1,(GtkDestroyNotify)gtk_widget_unref );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
115 gtk_widget_show( frame1 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
116 gtk_container_add( GTK_CONTAINER( URL ),frame1 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
117 gtk_container_set_border_width( GTK_CONTAINER( frame1 ),1 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
118 gtk_frame_set_shadow_type( GTK_FRAME( frame1 ),GTK_SHADOW_IN );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
119
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
120 frame2=gtk_frame_new( NULL );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
121 gtk_widget_set_name( frame2,"frame2" );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
122 gtk_widget_ref( frame2 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
123 gtk_object_set_data_full( GTK_OBJECT( URL ),"frame2",frame2,(GtkDestroyNotify)gtk_widget_unref );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
124 gtk_widget_show( frame2 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
125 gtk_container_add( GTK_CONTAINER( frame1 ),frame2 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
126 gtk_container_set_border_width( GTK_CONTAINER( frame2 ),1 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
127 gtk_frame_set_shadow_type( GTK_FRAME( frame2 ),GTK_SHADOW_NONE );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
128
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
129 frame3=gtk_frame_new( NULL );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
130 gtk_widget_set_name( frame3,"frame3" );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
131 gtk_widget_ref( frame3 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
132 gtk_object_set_data_full( GTK_OBJECT( URL ),"frame3",frame3,(GtkDestroyNotify)gtk_widget_unref );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
133 gtk_widget_show( frame3 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
134 gtk_container_add( GTK_CONTAINER( frame2 ),frame3 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
135 gtk_frame_set_shadow_type( GTK_FRAME( frame3 ),GTK_SHADOW_ETCHED_OUT );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
136
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
137 frame4=gtk_frame_new( NULL );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
138 gtk_widget_set_name( frame4,"frame4" );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
139 gtk_widget_ref( frame4 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
140 gtk_object_set_data_full( GTK_OBJECT( URL ),"frame4",frame4,(GtkDestroyNotify)gtk_widget_unref );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
141 gtk_widget_show( frame4 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
142 gtk_container_add( GTK_CONTAINER( frame3 ),frame4 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
143 gtk_frame_set_shadow_type( GTK_FRAME( frame4 ),GTK_SHADOW_NONE );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
144
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
145 vbox1=gtk_vbox_new( FALSE,0 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
146 gtk_widget_set_name( vbox1,"vbox1" );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
147 gtk_widget_ref( vbox1 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
148 gtk_object_set_data_full( GTK_OBJECT( URL ),"vbox1",vbox1,(GtkDestroyNotify)gtk_widget_unref );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
149 gtk_widget_show( vbox1 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
150 gtk_container_add( GTK_CONTAINER( frame4 ),vbox1 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
151
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
152 hbox1=gtk_hbox_new( FALSE,0 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
153 gtk_widget_set_name( hbox1,"hbox1" );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
154 gtk_widget_ref( hbox1 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
155 gtk_object_set_data_full( GTK_OBJECT( URL ),"hbox1",hbox1,(GtkDestroyNotify)gtk_widget_unref );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
156 gtk_widget_show( hbox1 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
157 gtk_box_pack_start( GTK_BOX( vbox1 ),hbox1,TRUE,TRUE,0 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
158
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
159 label1=gtk_label_new( "URL: " );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
160 gtk_widget_set_name( label1,"label1" );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
161 gtk_widget_ref( label1 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
162 gtk_object_set_data_full( GTK_OBJECT( URL ),"label1",label1,(GtkDestroyNotify)gtk_widget_unref );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
163 gtk_widget_show( label1 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
164 gtk_box_pack_start( GTK_BOX( hbox1 ),label1,FALSE,FALSE,0 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
165 gtk_widget_set_usize( label1,38,-2 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
166 gtk_label_set_justify( GTK_LABEL( label1 ),GTK_JUSTIFY_FILL );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
167 gtk_misc_set_alignment( GTK_MISC( label1 ),0.5,0.49 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
168
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
169 URLCombo=gtk_combo_new();
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
170 gtk_widget_set_name( URLCombo,"URLCombo" );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
171 gtk_widget_ref( URLCombo );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
172 gtk_object_set_data_full( GTK_OBJECT( URL ),"URLCombo",URLCombo,(GtkDestroyNotify)gtk_widget_unref );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
173 gtk_widget_show( URLCombo );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
174 gtk_box_pack_start( GTK_BOX( hbox1 ),URLCombo,TRUE,TRUE,0 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
175
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
176 URLEntry=GTK_COMBO( URLCombo )->entry;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
177 gtk_widget_set_name( URLEntry,"URLEntry" );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
178 gtk_widget_ref( URLEntry );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
179 gtk_object_set_data_full( GTK_OBJECT( URL ),"URLEntry",URLEntry,(GtkDestroyNotify)gtk_widget_unref );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
180 gtk_widget_show( URLEntry );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
181
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
182 hsep=gtk_hseparator_new();
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
183 gtk_widget_set_name( hsep,"hsep" );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
184 gtk_widget_ref( hsep );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
185 gtk_object_set_data_full( GTK_OBJECT( URL ),"hsep",hsep,(GtkDestroyNotify)gtk_widget_unref );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
186 gtk_widget_show( hsep );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
187 gtk_box_pack_start( GTK_BOX( vbox1 ),hsep,FALSE,TRUE,0 );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
188 gtk_widget_set_usize( hsep,-2,8 );
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
189
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
190 hbuttonbox1=gtk_hbutton_box_new();
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
191 gtk_widget_set_name( hbuttonbox1,"hbuttonbox1" );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
192 gtk_widget_ref( hbuttonbox1 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
193 gtk_object_set_data_full( GTK_OBJECT( URL ),"hbuttonbox1",hbuttonbox1,(GtkDestroyNotify)gtk_widget_unref );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
194 gtk_widget_show( hbuttonbox1 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
195 gtk_box_pack_start( GTK_BOX( vbox1 ),hbuttonbox1,FALSE,FALSE,0 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
196 gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END );
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
197 gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
198 gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox1 ),85,20 );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
199 gtk_button_box_set_child_ipadding( GTK_BUTTON_BOX( hbuttonbox1 ),0,0 );
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
200
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
201 Ok=gtk_button_new_with_label( MSGTR_Ok );
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
202 gtk_widget_set_name( Ok,"Ok" );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
203 gtk_widget_ref( Ok );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
204 gtk_object_set_data_full( GTK_OBJECT( URL ),"Ok",Ok,(GtkDestroyNotify)gtk_widget_unref );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
205 gtk_widget_show( Ok );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
206 gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Ok );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
207
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
208 Cancel=gtk_button_new_with_label( MSGTR_Cancel );
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
209 gtk_widget_set_name( Cancel,"Cancel" );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
210 gtk_widget_ref( Cancel );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
211 gtk_object_set_data_full( GTK_OBJECT( URL ),"Cancel",Cancel,(GtkDestroyNotify)gtk_widget_unref );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
212 gtk_widget_show( Cancel );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
213 gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Cancel );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
214
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
215 gtk_widget_add_accelerator( Ok,"pressed",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
216 // gtk_widget_add_accelerator( Ok,"pressed",accel_group,GDK_O,GDK_MOD1_MASK,GTK_ACCEL_VISIBLE );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
217 // gtk_widget_add_accelerator( Ok,"pressed",accel_group,GDK_o,GDK_MOD1_MASK,GTK_ACCEL_VISIBLE );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
218 gtk_widget_add_accelerator( Cancel,"pressed",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
219 // gtk_widget_add_accelerator( Cancel,"pressed",accel_group,GDK_C,GDK_MOD1_MASK,GTK_ACCEL_VISIBLE );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
220 // gtk_widget_add_accelerator( Cancel,"pressed",accel_group,GDK_c,GDK_MOD1_MASK,GTK_ACCEL_VISIBLE );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
221
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
222 gtk_signal_connect( GTK_OBJECT( URL ),"destroy",GTK_SIGNAL_FUNC( on_URL_destroy_event ),NULL );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
223 gtk_signal_connect( GTK_OBJECT( URL ),"show",GTK_SIGNAL_FUNC( ab_URL_show ),(void *)1 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
224 gtk_signal_connect( GTK_OBJECT( URL ),"hide",GTK_SIGNAL_FUNC( ab_URL_show ),0 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
225
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
226 gtk_signal_connect( GTK_OBJECT( Ok ),"pressed",GTK_SIGNAL_FUNC( on_Button_pressed ),(void *)1 );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
227 gtk_signal_connect( GTK_OBJECT( Cancel ),"pressed",GTK_SIGNAL_FUNC( on_Button_pressed ),NULL );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
228
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6335
diff changeset
229 gtk_widget_grab_focus( URLEntry );
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
230 gtk_window_add_accel_group( GTK_WINDOW( URL ),accel_group );
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
231
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
232 return URL;
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
233 }
d42cb911d7f7 add network streaming support for gui
pontscho
parents:
diff changeset
234