Mercurial > mplayer.hg
comparison gui/dialog/url.c @ 35988:ad1a5580c91d
Make create_URL() static.
It only has file scope.
In order to do so, relocate some other static functions.
Additionally, rename it create_URLDialog().
author | ib |
---|---|
date | Fri, 29 Mar 2013 01:11:48 +0000 |
parents | d2f24ce5c0ba |
children | 6c891a0e3fea |
comparison
equal
deleted
inserted
replaced
35987:d2f24ce5c0ba | 35988:ad1a5580c91d |
---|---|
40 | 40 |
41 static GtkWidget * URLCombo; | 41 static GtkWidget * URLCombo; |
42 static GtkWidget * URLEntry; | 42 static GtkWidget * URLEntry; |
43 static GList * URLComboEntrys = NULL; | 43 static GList * URLComboEntrys = NULL; |
44 | 44 |
45 void ShowURLDialog( void ) | |
46 { | |
47 urlItem * item; | |
48 | |
49 if ( URLDialog ) gtkActive( URLDialog ); | |
50 else URLDialog=create_URL(); | |
51 | |
52 item = listMgr( URLLIST_GET,0 ); | |
53 | |
54 if ( item ) | |
55 { | |
56 g_list_free( URLComboEntrys ); | |
57 URLComboEntrys=NULL; | |
58 while( item ) | |
59 { | |
60 URLComboEntrys=g_list_append( URLComboEntrys,(gchar *)item->url ); | |
61 item=item->next; | |
62 } | |
63 } | |
64 | |
65 if ( URLComboEntrys ) | |
66 { | |
67 gtk_entry_set_text( GTK_ENTRY( URLEntry ),URLComboEntrys->data ); | |
68 gtk_combo_set_popdown_strings( GTK_COMBO( URLCombo ),URLComboEntrys ); | |
69 } | |
70 | |
71 gtk_widget_show( URLDialog ); | |
72 } | |
73 | |
74 static void HideURLDialog( void ) | 45 static void HideURLDialog( void ) |
75 { | 46 { |
76 if ( !URLDialog ) return; | 47 if ( !URLDialog ) return; |
77 gtk_widget_hide( URLDialog ); | 48 gtk_widget_hide( URLDialog ); |
78 gtk_widget_destroy( URLDialog ); | 49 gtk_widget_destroy( URLDialog ); |
109 } | 80 } |
110 } | 81 } |
111 HideURLDialog(); | 82 HideURLDialog(); |
112 } | 83 } |
113 | 84 |
114 GtkWidget * create_URL( void ) | 85 static GtkWidget * create_URLDialog( void ) |
115 { | 86 { |
116 GtkWidget * vbox1; | 87 GtkWidget * vbox1; |
117 GtkWidget * hbox1; | 88 GtkWidget * hbox1; |
118 GtkWidget * hbuttonbox1; | 89 GtkWidget * hbuttonbox1; |
119 GtkWidget * Ok; | 90 GtkWidget * Ok; |
169 gtk_widget_grab_focus( URLEntry ); | 140 gtk_widget_grab_focus( URLEntry ); |
170 gtk_window_add_accel_group( GTK_WINDOW( URLDialog ),accel_group ); | 141 gtk_window_add_accel_group( GTK_WINDOW( URLDialog ),accel_group ); |
171 | 142 |
172 return URLDialog; | 143 return URLDialog; |
173 } | 144 } |
145 | |
146 void ShowURLDialog( void ) | |
147 { | |
148 urlItem * item; | |
149 | |
150 if ( URLDialog ) gtkActive( URLDialog ); | |
151 else URLDialog=create_URLDialog(); | |
152 | |
153 item = listMgr( URLLIST_GET,0 ); | |
154 | |
155 if ( item ) | |
156 { | |
157 g_list_free( URLComboEntrys ); | |
158 URLComboEntrys=NULL; | |
159 while( item ) | |
160 { | |
161 URLComboEntrys=g_list_append( URLComboEntrys,(gchar *)item->url ); | |
162 item=item->next; | |
163 } | |
164 } | |
165 | |
166 if ( URLComboEntrys ) | |
167 { | |
168 gtk_entry_set_text( GTK_ENTRY( URLEntry ),URLComboEntrys->data ); | |
169 gtk_combo_set_popdown_strings( GTK_COMBO( URLCombo ),URLComboEntrys ); | |
170 } | |
171 | |
172 gtk_widget_show( URLDialog ); | |
173 } |