[MPlayer-cvslog] r38505 - in trunk/gui/dialog: equalizer.c fileselect.c preferences.c tools.c tools.h url.c
ib
subversion at mplayerhq.hu
Thu May 2 22:41:56 EEST 2024
Author: ib
Date: Thu May 2 22:41:56 2024
New Revision: 38505
Log:
Replace the GtkCombo entry with GtkComboBoxEntry.
As of GTK+ 2.4, GtkCombo has been deprecated in favor of GtkComboBox.
Also, replace gtk_combo_set_popdown_strings() by collecting the strings
with gtk_combo_box_append_text().
In addition, add gtkEntry() and gtkEntrySetEditable() to allow access to
the entry, regardless of the type of the overlaying combo box.
Modified:
trunk/gui/dialog/equalizer.c
trunk/gui/dialog/fileselect.c
trunk/gui/dialog/preferences.c
trunk/gui/dialog/tools.c
trunk/gui/dialog/tools.h
trunk/gui/dialog/url.c
Modified: trunk/gui/dialog/equalizer.c
==============================================================================
--- trunk/gui/dialog/equalizer.c Thu May 2 22:37:45 2024 (r38504)
+++ trunk/gui/dialog/equalizer.c Thu May 2 22:41:56 2024 (r38505)
@@ -512,17 +512,11 @@ void ShowEqualizer( void )
/* equalizer config dialog box */
static GtkWidget * CBChannel1;
-static GtkWidget * CEChannel1;
static GtkWidget * CBChannel2;
-static GtkWidget * CEChannel2;
static GtkWidget * CBChannel3;
-static GtkWidget * CEChannel3;
static GtkWidget * CBChannel4;
-static GtkWidget * CEChannel4;
static GtkWidget * CBChannel5;
-static GtkWidget * CEChannel5;
static GtkWidget * CBChannel6;
-static GtkWidget * CEChannel6;
static GtkWidget * ecOk;
static GtkWidget * ecCancel;
@@ -530,7 +524,7 @@ GtkWidget * CreateEquConfig( void );
void ShowEquConfig( void )
{
- GList * Items = NULL;
+ GList * Items = NULL, *list;
if ( EquConfig ) gtkRaise( EquConfig );
else EquConfig=CreateEquConfig();
@@ -542,21 +536,28 @@ void ShowEquConfig( void )
Items=g_list_append( Items,(gpointer)_(MSGTR_GUI_Center) );
Items=g_list_append( Items,(gpointer)_(MSGTR_GUI_Bass) );
- gtk_combo_set_popdown_strings( GTK_COMBO( CBChannel1 ),Items );
- gtk_combo_set_popdown_strings( GTK_COMBO( CBChannel2 ),Items );
- gtk_combo_set_popdown_strings( GTK_COMBO( CBChannel3 ),Items );
- gtk_combo_set_popdown_strings( GTK_COMBO( CBChannel4 ),Items );
- gtk_combo_set_popdown_strings( GTK_COMBO( CBChannel5 ),Items );
- gtk_combo_set_popdown_strings( GTK_COMBO( CBChannel6 ),Items );
+ list = Items;
+
+ while (list)
+ {
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBChannel1), list->data);
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBChannel2), list->data);
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBChannel3), list->data);
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBChannel4), list->data);
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBChannel5), list->data);
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBChannel6), list->data);
+
+ list = list->next;
+ }
g_list_free( Items );
- gtk_entry_set_text( GTK_ENTRY( CEChannel1 ),gtkEquChannel1 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel1 ),FALSE );
- gtk_entry_set_text( GTK_ENTRY( CEChannel2 ),gtkEquChannel2 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel2 ),FALSE );
- gtk_entry_set_text( GTK_ENTRY( CEChannel3 ),gtkEquChannel3 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel3 ),FALSE );
- gtk_entry_set_text( GTK_ENTRY( CEChannel4 ),gtkEquChannel4 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel4 ),FALSE );
- gtk_entry_set_text( GTK_ENTRY( CEChannel5 ),gtkEquChannel5 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel5 ),FALSE );
- gtk_entry_set_text( GTK_ENTRY( CEChannel6 ),gtkEquChannel6 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel6 ),FALSE );
+ gtk_entry_set_text(gtkEntry(CBChannel1), gtkEquChannel1); gtkEntrySetEditable(CBChannel1, FALSE);
+ gtk_entry_set_text(gtkEntry(CBChannel2), gtkEquChannel2); gtkEntrySetEditable(CBChannel2, FALSE);
+ gtk_entry_set_text(gtkEntry(CBChannel3), gtkEquChannel3); gtkEntrySetEditable(CBChannel3, FALSE);
+ gtk_entry_set_text(gtkEntry(CBChannel4), gtkEquChannel4); gtkEntrySetEditable(CBChannel4, FALSE);
+ gtk_entry_set_text(gtkEntry(CBChannel5), gtkEquChannel5); gtkEntrySetEditable(CBChannel5, FALSE);
+ gtk_entry_set_text(gtkEntry(CBChannel6), gtkEquChannel6); gtkEntrySetEditable(CBChannel6, FALSE);
gtk_widget_show( EquConfig );
gtkSetLayer( EquConfig );
@@ -568,12 +569,12 @@ static void ecButtonReleased( GtkButton
if ( GPOINTER_TO_INT(user_data) )
{ // if you pressed Ok
- nfree( gtkEquChannel1 ); gtkEquChannel1=gstrdup( gtk_entry_get_text( GTK_ENTRY( CEChannel1 ) ) );
- nfree( gtkEquChannel2 ); gtkEquChannel2=gstrdup( gtk_entry_get_text( GTK_ENTRY( CEChannel2 ) ) );
- nfree( gtkEquChannel3 ); gtkEquChannel3=gstrdup( gtk_entry_get_text( GTK_ENTRY( CEChannel3 ) ) );
- nfree( gtkEquChannel4 ); gtkEquChannel4=gstrdup( gtk_entry_get_text( GTK_ENTRY( CEChannel4 ) ) );
- nfree( gtkEquChannel5 ); gtkEquChannel5=gstrdup( gtk_entry_get_text( GTK_ENTRY( CEChannel5 ) ) );
- nfree( gtkEquChannel6 ); gtkEquChannel6=gstrdup( gtk_entry_get_text( GTK_ENTRY( CEChannel6 ) ) );
+ nfree( gtkEquChannel1 ); gtkEquChannel1=gstrdup( gtk_entry_get_text( gtkEntry( CBChannel1 ) ) );
+ nfree( gtkEquChannel2 ); gtkEquChannel2=gstrdup( gtk_entry_get_text( gtkEntry( CBChannel2 ) ) );
+ nfree( gtkEquChannel3 ); gtkEquChannel3=gstrdup( gtk_entry_get_text( gtkEntry( CBChannel3 ) ) );
+ nfree( gtkEquChannel4 ); gtkEquChannel4=gstrdup( gtk_entry_get_text( gtkEntry( CBChannel4 ) ) );
+ nfree( gtkEquChannel5 ); gtkEquChannel5=gstrdup( gtk_entry_get_text( gtkEntry( CBChannel5 ) ) );
+ nfree( gtkEquChannel6 ); gtkEquChannel6=gstrdup( gtk_entry_get_text( gtkEntry( CBChannel6 ) ) );
eqSetChannelNames();
}
gtk_widget_destroy( EquConfig );
@@ -634,39 +635,21 @@ GtkWidget * CreateEquConfig( void )
CBChannel1=gtkAddCombo( NULL );
gtk_table_attach( GTK_TABLE( table1 ),CBChannel1,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 );
- CEChannel1=GTK_COMBO( CBChannel1 )->entry;
- gtk_widget_show( CEChannel1 );
-
CBChannel2=gtkAddCombo( NULL );
gtk_table_attach( GTK_TABLE( table1 ),CBChannel2,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 );
- CEChannel2=GTK_COMBO( CBChannel2 )->entry;
- gtk_widget_show( CEChannel2 );
-
CBChannel3=gtkAddCombo( NULL );
gtk_table_attach( GTK_TABLE( table1 ),CBChannel3,1,2,2,3,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 );
- CEChannel3=GTK_COMBO( CBChannel3 )->entry;
- gtk_widget_show( CEChannel3 );
-
CBChannel4=gtkAddCombo( NULL );
gtk_table_attach( GTK_TABLE( table1 ),CBChannel4,1,2,3,4,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 );
- CEChannel4=GTK_COMBO( CBChannel4 )->entry;
- gtk_widget_show( CEChannel4 );
-
CBChannel5=gtkAddCombo( NULL );
gtk_table_attach( GTK_TABLE( table1 ),CBChannel5,1,2,4,5,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 );
- CEChannel5=GTK_COMBO( CBChannel5 )->entry;
- gtk_widget_show( CEChannel5 );
-
CBChannel6=gtkAddCombo( NULL );
gtk_table_attach( GTK_TABLE( table1 ),CBChannel6,1,2,5,6,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 );
- CEChannel6=GTK_COMBO( CBChannel6 )->entry;
- gtk_widget_show( CEChannel6 );
-
gtkAddHSeparator( vbox1 );
hbuttonbox1=gtkAddHButtonBox( vbox1 );
Modified: trunk/gui/dialog/fileselect.c
==============================================================================
--- trunk/gui/dialog/fileselect.c Thu May 2 22:37:45 2024 (r38504)
+++ trunk/gui/dialog/fileselect.c Thu May 2 22:41:56 2024 (r38505)
@@ -159,12 +159,9 @@ GdkColormap *fsColorMap;
GtkWidget *fsOk;
GtkWidget *fsUp;
GtkWidget *fsCancel;
-GtkWidget *fsCombo4;
GtkWidget *fsPathCombo;
-GList *fsList_items;
GList *fsTopList_items;
GHashTable *fsPathTable;
-GtkWidget *List;
GtkWidget *fsFilterCombo;
GtkStyle *style;
@@ -444,7 +441,7 @@ static void fs_fsFilterCombo_changed(Gtk
(void)editable;
- str = gtk_entry_get_text(GTK_ENTRY(user_data));
+ str = gtk_entry_get_text(gtkEntry(user_data));
switch (fsType) {
case FILESELECT_VIDEO_AUDIO:
@@ -518,7 +515,7 @@ static void fs_fsPathCombo_changed(GtkEd
(void)editable;
- str = gtk_entry_get_text(GTK_ENTRY(user_data));
+ str = gtk_entry_get_text(gtkEntry(user_data));
dirname = g_hash_table_lookup(fsPathTable, str);
if (chdir(dirname ? (const unsigned char *)dirname : str) != -1)
@@ -571,7 +568,7 @@ static void fs_Up_released(GtkButton *bu
chdir("..");
CheckDir(fsFNameList);
utf8dir = get_current_dir_name_utf8();
- gtk_entry_set_text(GTK_ENTRY(fsPathCombo), utf8dir);
+ gtk_entry_set_text(gtkEntry(fsPathCombo), utf8dir);
g_free(utf8dir);
fsSelectedFile = fsThisDir;
@@ -604,7 +601,7 @@ static void fs_Ok_released(GtkButton *bu
CheckDir(fsFNameList);
utf8dir = get_current_dir_name_utf8();
- gtk_entry_set_text(GTK_ENTRY(fsPathCombo), utf8dir);
+ gtk_entry_set_text(gtkEntry(fsPathCombo), utf8dir);
g_free(utf8dir);
gtk_widget_grab_focus(fsFNameList);
fsSelectedFile = fsThisDir;
@@ -712,7 +709,7 @@ static gboolean fs_key_release_event(Gtk
if (GTK_IS_SCROLLED_WINDOW(widget))
gtk_button_clicked(GTK_BUTTON(fsOk));
- else if (GTK_IS_ENTRY(widget))
+ else if (GTK_IS_COMBO_BOX(widget))
gtk_widget_grab_focus(fsFNameList);
break;
@@ -777,10 +774,7 @@ static GtkWidget *CreateFileSelect(void)
vbox4 = gtkAddVBox(gtkAddDialogFrame(FileSelector), 0);
hbox4 = gtkAddHBox(vbox4, 1);
- fsCombo4 = gtkAddCombo(hbox4);
-
- fsPathCombo = GTK_COMBO(fsCombo4)->entry;
- gtk_widget_show(fsPathCombo);
+ fsPathCombo = gtkAddCombo(hbox4);
vseparator1 = gtk_vseparator_new();
gtk_widget_show(vseparator1);
@@ -816,14 +810,11 @@ static GtkWidget *CreateFileSelect(void)
gtkAddHSeparator(vbox4);
- List = gtkAddCombo(NULL);
- g_object_ref(List);
- g_object_set_data_full(G_OBJECT(FileSelector), "List", List, (GDestroyNotify)g_object_unref);
- gtk_box_pack_start(GTK_BOX(vbox4), List, FALSE, FALSE, 0);
-
- fsFilterCombo = GTK_COMBO(List)->entry;
- gtk_widget_show(fsFilterCombo);
- gtk_entry_set_editable(GTK_ENTRY(fsFilterCombo), FALSE);
+ fsFilterCombo = gtkAddCombo(NULL);
+ g_object_ref(fsFilterCombo);
+ g_object_set_data_full(G_OBJECT(FileSelector), "fsFilterCombo", fsFilterCombo, (GDestroyNotify)g_object_unref);
+ gtk_box_pack_start(GTK_BOX(vbox4), fsFilterCombo, FALSE, FALSE, 0);
+ gtkEntrySetEditable(fsFilterCombo, FALSE);
gtkAddHSeparator(vbox4);
@@ -844,7 +835,7 @@ static GtkWidget *CreateFileSelect(void)
g_signal_connect(G_OBJECT(fsPathCombo), "changed", G_CALLBACK(fs_fsPathCombo_changed), fsPathCombo);
g_signal_connect(G_OBJECT(fsPathCombo), "key-release-event", G_CALLBACK(fs_key_release_event), NULL);
g_signal_connect(G_OBJECT(fsUp), "clicked", G_CALLBACK(fs_Up_released), fsFNameList);
- g_signal_connect(G_OBJECT(fsOk), "clicked", G_CALLBACK(fs_Ok_released), fsCombo4);
+ g_signal_connect(G_OBJECT(fsOk), "clicked", G_CALLBACK(fs_Ok_released), fsPathCombo);
g_signal_connect(G_OBJECT(fsCancel), "clicked", G_CALLBACK(fs_Cancel_released), NULL);
g_signal_connect(G_OBJECT(fsFNameList), "select-row", G_CALLBACK(fs_fsFNameList_select_row), NULL);
g_signal_connect(G_OBJECT(fsFNameList), "event", G_CALLBACK(fs_fsFNameList_event), NULL);
@@ -860,6 +851,7 @@ void ShowFileSelector(int type)
char *tmp = NULL, *dir = NULL;
const gchar *fname;
struct stat f;
+ GList *list;
if (FileSelector)
gtkRaise(FileSelector);
@@ -868,75 +860,62 @@ void ShowFileSelector(int type)
fsType = type;
+ gtk_list_store_clear(GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(fsFilterCombo))));
+
switch (type) {
case FILESELECT_VIDEO_AUDIO:
gtk_window_set_title(GTK_WINDOW(FileSelector), MSGTR_GUI_SelectFile);
- fsList_items = NULL;
for (i = 0; fsVideoAudioFilterNames[i][0]; i++)
if ((strcmp(fsVideoAudioFilterNames[i][0], MSGTR_GUI_FilterFilePlaylist) != 0) || allow_playlist_parsing)
- fsList_items = g_list_append(fsList_items, _(fsVideoAudioFilterNames[i][0]));
+ gtk_combo_box_append_text(GTK_COMBO_BOX(fsFilterCombo), _(fsVideoAudioFilterNames[i][0]));
k = fsLastVideoAudioFilterSelected;
- gtk_combo_set_popdown_strings(GTK_COMBO(List), fsList_items);
- g_list_free(fsList_items);
- gtk_entry_set_text(GTK_ENTRY(fsFilterCombo), _(fsVideoAudioFilterNames[k >= 0 ? k : i - 4][0]));
+ gtk_entry_set_text(gtkEntry(fsFilterCombo), _(fsVideoAudioFilterNames[k >= 0 ? k : i - 4][0]));
//tmp=guiInfo.Filename;
break;
case FILESELECT_SUBTITLE:
gtk_window_set_title(GTK_WINDOW(FileSelector), MSGTR_GUI_SelectSubtitle);
- fsList_items = NULL;
for (i = 0; fsSubtitleFilterNames[i][0]; i++)
- fsList_items = g_list_append(fsList_items, _(fsSubtitleFilterNames[i][0]));
+ gtk_combo_box_append_text(GTK_COMBO_BOX(fsFilterCombo), _(fsSubtitleFilterNames[i][0]));
k = fsLastSubtitleFilterSelected;
- gtk_combo_set_popdown_strings(GTK_COMBO(List), fsList_items);
- g_list_free(fsList_items);
- gtk_entry_set_text(GTK_ENTRY(fsFilterCombo), _(fsSubtitleFilterNames[k >= 0 ? k : i - 2][0]));
+ gtk_entry_set_text(gtkEntry(fsFilterCombo), _(fsSubtitleFilterNames[k >= 0 ? k : i - 2][0]));
tmp = guiInfo.SubtitleFilename;
break;
case FILESELECT_AUDIO_TRACK:
gtk_window_set_title(GTK_WINDOW(FileSelector), MSGTR_GUI_SelectAudioFile);
- fsList_items = NULL;
for (i = 0; fsAudioFileNames[i][0]; i++)
- fsList_items = g_list_append(fsList_items, _(fsAudioFileNames[i][0]));
+ gtk_combo_box_append_text(GTK_COMBO_BOX(fsFilterCombo), _(fsAudioFileNames[i][0]));
k = fsLastAudioFilterSelected;
- gtk_combo_set_popdown_strings(GTK_COMBO(List), fsList_items);
- g_list_free(fsList_items);
- gtk_entry_set_text(GTK_ENTRY(fsFilterCombo), _(fsAudioFileNames[k >= 0 ? k : i - 2][0]));
+ gtk_entry_set_text(gtkEntry(fsFilterCombo), _(fsAudioFileNames[k >= 0 ? k : i - 2][0]));
tmp = guiInfo.AudioFilename;
break;
case FILESELECT_FONT:
gtk_window_set_title(GTK_WINDOW(FileSelector), MSGTR_GUI_SelectFont);
- fsList_items = NULL;
for (i = 0; fsFontFileNames[i][0]; i++)
- fsList_items = g_list_append(fsList_items, _(fsFontFileNames[i][0]));
+ gtk_combo_box_append_text(GTK_COMBO_BOX(fsFilterCombo), _(fsFontFileNames[i][0]));
k = fsLastFontFilterSelected;
- gtk_combo_set_popdown_strings(GTK_COMBO(List), fsList_items);
- g_list_free(fsList_items);
- gtk_entry_set_text(GTK_ENTRY(fsFilterCombo), _(fsFontFileNames[k >= 0 ? k : i - 2][0]));
+ gtk_entry_set_text(gtkEntry(fsFilterCombo), _(fsFontFileNames[k >= 0 ? k : i - 2][0]));
tmp = font_name;
break;
case FILESELECT_IMAGE:
gtk_window_set_title(GTK_WINDOW(FileSelector), MSGTR_GUI_SelectImage);
- fsList_items = NULL;
for (i = 0; fsImageFilterNames[i][0]; i++)
- fsList_items = g_list_append(fsList_items, _(fsImageFilterNames[i][0]));
+ gtk_combo_box_append_text(GTK_COMBO_BOX(fsFilterCombo), _(fsImageFilterNames[i][0]));
k = fsLastImageFilterSelected;
- gtk_combo_set_popdown_strings(GTK_COMBO(List), fsList_items);
- g_list_free(fsList_items);
- gtk_entry_set_text(GTK_ENTRY(fsFilterCombo), _(fsImageFilterNames[k >= 0 ? k : 0][0]));
+ gtk_entry_set_text(gtkEntry(fsFilterCombo), _(fsImageFilterNames[k >= 0 ? k : 0][0]));
tmp = guiInfo.ImageFilename;
break;
}
@@ -994,7 +973,16 @@ void ShowFileSelector(int type)
fsTopList_items = fs_AddPath(fsTopList_items, g_strdup("/mnt"), GTK_POS_BOTTOM);
fsTopList_items = fs_AddPath(fsTopList_items, g_strdup("/"), GTK_POS_BOTTOM);
- gtk_combo_set_popdown_strings(GTK_COMBO(fsCombo4), fsTopList_items);
+
+ list = fsTopList_items;
+ gtk_list_store_clear(GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(fsPathCombo))));
+
+ while (list) {
+ gtk_combo_box_append_text(GTK_COMBO_BOX(fsPathCombo), list->data);
+ list = list->next;
+ }
+
+ gtk_combo_box_set_active(GTK_COMBO_BOX(fsPathCombo), 0);
gtk_widget_grab_focus(fsFNameList);
Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c Thu May 2 22:37:45 2024 (r38504)
+++ trunk/gui/dialog/preferences.c Thu May 2 22:41:56 2024 (r38505)
@@ -79,8 +79,6 @@ static GtkWidget * CLVDrivers;
GtkWidget * prEFontName;
GtkWidget * prEDVDDevice;
GtkWidget * prECDRomDevice;
-static GtkWidget * EVFM;
-static GtkWidget * EAFM;
static GtkWidget * CBVFM;
static GtkWidget * CBAFM;
@@ -149,7 +147,7 @@ static GtkAdjustment * HSSubPositionadj,
#ifdef CONFIG_FREETYPE
static GtkWidget * HSFontBlur, * HSFontOutLine, * HSFontTextScale, * HSFontOSDScale;
static GtkAdjustment * HSFontBluradj, * HSFontOutLineadj, * HSFontTextScaleadj, * HSFontOSDScaleadj;
-static GtkWidget * CBFontEncoding, * EFontEncoding;
+static GtkWidget * CBFontEncoding;
static GtkWidget * RBFontNoAutoScale, * RBFontAutoScaleWidth, * RBFontAutoScaleHeight, * RBFontAutoScaleDiagonal;
//static GtkWidget * AutoScale;
#else
@@ -158,7 +156,7 @@ static GtkAdjustment * HSFontFactoradj;
#endif
#ifdef CONFIG_ICONV
-static GtkWidget * CBSubEncoding, * ESubEncoding;
+static GtkWidget *CBSubEncoding;
#endif
#if defined(CONFIG_FREETYPE) || defined(CONFIG_ICONV)
@@ -237,7 +235,7 @@ static void prEntry( GtkEditable * edita
{
#ifdef CONFIG_FREETYPE
case 0: // font encoding
- comment=gtk_entry_get_text( GTK_ENTRY( EFontEncoding ) );
+ comment=gtk_entry_get_text(gtkEntry(CBFontEncoding));
for ( i=0;lEncoding[i].name;i++ )
if ( !gstrcmp( _(lEncoding[i].comment),comment ) ) break;
if ( lEncoding[i].comment ) mplayer( MPLAYER_SET_FONT_ENCODING,0,lEncoding[i].name );
@@ -246,7 +244,7 @@ static void prEntry( GtkEditable * edita
#endif
#ifdef CONFIG_ICONV
case 1: // sub encoding
- comment=gtk_entry_get_text( GTK_ENTRY( ESubEncoding ) );
+ comment=gtk_entry_get_text(gtkEntry(CBSubEncoding));
for ( i=0;lEncoding[i].name;i++ )
if ( !gstrcmp( _(lEncoding[i].comment),comment ) ) break;
if ( lEncoding[i].comment ) mplayer( MPLAYER_SET_SUB_ENCODING,0,lEncoding[i].name );
@@ -361,7 +359,7 @@ static void prButton( GtkButton * button
{
int i;
- const char * tmp = gtk_entry_get_text( GTK_ENTRY( EVFM ) );
+ const char *tmp = gtk_entry_get_text(gtkEntry(CBVFM));
for( i=0;mpcodecs_vd_drivers[i];i++ )
if ( !gstrcmp( tmp,mpcodecs_vd_drivers[i]->info->name ) )
{ listSet( &video_fm_list,mpcodecs_vd_drivers[i]->info->short_name ); break; }
@@ -369,7 +367,7 @@ static void prButton( GtkButton * button
{
int i;
- const char * tmp = gtk_entry_get_text( GTK_ENTRY( EAFM ) );
+ const char *tmp = gtk_entry_get_text(gtkEntry(CBAFM));
for( i=0;mpcodecs_ad_drivers[i];i++ )
if ( !gstrcmp( tmp,mpcodecs_ad_drivers[i]->info->name ) )
{ listSet( &audio_fm_list,mpcodecs_ad_drivers[i]->info->short_name ); break; }
@@ -607,6 +605,7 @@ static GtkWidget * CreatePreferences( vo
iconv_t cd;
GList * CBSubEncoding_items = NULL;
#endif
+ GList *list;
GtkWidget * vbox7;
GtkWidget * vbox8;
GtkWidget * table1;
@@ -861,12 +860,18 @@ static GtkWidget * CreatePreferences( vo
}
if ( !listed ) CBSubEncoding_items=g_list_insert( CBSubEncoding_items,sub_cp,1 );
}
- gtk_combo_set_popdown_strings( GTK_COMBO( CBSubEncoding ),CBSubEncoding_items );
+
+ list = CBSubEncoding_items;
+
+ while (list)
+ {
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBSubEncoding), list->data);
+ list = list->next;
+ }
+
g_list_free( CBSubEncoding_items );
- ESubEncoding=GTK_COMBO( CBSubEncoding )->entry;
- gtk_entry_set_editable( GTK_ENTRY( ESubEncoding ),FALSE );
- gtk_widget_show( ESubEncoding );
+ gtkEntrySetEditable(CBSubEncoding, FALSE);
#endif
hbox3=gtkAddHBox( NULL,0 );
@@ -964,12 +969,18 @@ static GtkWidget * CreatePreferences( vo
}
if ( !listed ) CBFontEncoding_items=g_list_insert( CBFontEncoding_items,subtitle_font_encoding,1 );
}
- gtk_combo_set_popdown_strings( GTK_COMBO( CBFontEncoding ),CBFontEncoding_items );
+
+ list = CBFontEncoding_items;
+
+ while (list)
+ {
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBFontEncoding), list->data);
+ list = list->next;
+ }
+
g_list_free( CBFontEncoding_items );
- EFontEncoding=GTK_COMBO( CBFontEncoding )->entry;
- gtk_entry_set_editable( GTK_ENTRY( EFontEncoding ),FALSE );
- gtk_widget_show( EFontEncoding );
+ gtkEntrySetEditable(CBFontEncoding, FALSE);
label=gtkAddLabelColon( _(MSGTR_GUI_Blur),NULL );
gtk_table_attach( GTK_TABLE( table1 ),label,0,1,2,3,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 );
@@ -1029,9 +1040,7 @@ static GtkWidget * CreatePreferences( vo
CBVFM=gtkAddCombo(hbox5);
- EVFM=GTK_COMBO( CBVFM )->entry;
- gtk_entry_set_editable( GTK_ENTRY( EVFM ),FALSE );
- gtk_widget_show( EVFM );
+ gtkEntrySetEditable(CBVFM, FALSE);
hbox5=gtkAddHBox( vbox604,1 );
@@ -1039,9 +1048,7 @@ static GtkWidget * CreatePreferences( vo
CBAFM=gtkAddCombo(hbox5);
- EAFM=GTK_COMBO( CBAFM )->entry;
- gtk_entry_set_editable( GTK_ENTRY( EAFM ),FALSE );
- gtk_widget_show( EAFM );
+ gtkEntrySetEditable(CBAFM, FALSE);
label=gtkAddLabel( _(MSGTR_GUI_Demuxers_Codecs),NULL );
gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),4 ),label );
@@ -1195,6 +1202,8 @@ static GtkWidget * CreatePreferences( vo
void ShowPreferences( void )
{
+ GList *list;
+
if ( Preferences ) gtkRaise( Preferences );
else Preferences=CreatePreferences();
@@ -1325,12 +1334,16 @@ void ShowPreferences( void )
int i;
for ( i=0;lEncoding[i].name;i++ )
if ( !av_strcasecmp( sub_cp,lEncoding[i].name ) ) break;
- if ( lEncoding[i].name ) gtk_entry_set_text( GTK_ENTRY( ESubEncoding ),_(lEncoding[i].comment) );
- else gtk_entry_set_text( GTK_ENTRY( ESubEncoding ),sub_cp );
+ if (lEncoding[i].name) gtk_entry_set_text(gtkEntry(CBSubEncoding), _(lEncoding[i].comment));
+ else gtk_entry_set_text(gtkEntry(CBSubEncoding), sub_cp);
gtk_widget_set_sensitive( CBSubUtf8,FALSE );
gtk_widget_set_sensitive( CBSubUnicode,FALSE );
}
- else gtk_widget_set_sensitive( CBSubEncoding,(!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CBSubUtf8)) && !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CBSubUnicode))) );
+ else
+ {
+ gtk_combo_box_set_active(GTK_COMBO_BOX(CBSubEncoding), 0);
+ gtk_widget_set_sensitive(CBSubEncoding, !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CBSubUtf8)) && !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CBSubUnicode)));
+ }
#endif
/* 4th page */
@@ -1346,8 +1359,8 @@ void ShowPreferences( void )
const char *s = (subtitle_font_encoding ? subtitle_font_encoding : ENC_UNICODE);
for ( i=0;lEncoding[i].name;i++ )
if ( !av_strcasecmp( s,lEncoding[i].name ) ) break;
- if ( lEncoding[i].name ) gtk_entry_set_text( GTK_ENTRY( EFontEncoding ),_(lEncoding[i].comment) );
- else gtk_entry_set_text( GTK_ENTRY( EFontEncoding ),s );
+ if (lEncoding[i].name) gtk_entry_set_text(gtkEntry(CBFontEncoding) ,_(lEncoding[i].comment));
+ else gtk_entry_set_text(gtkEntry(CBFontEncoding), s);
}
switch ( subtitle_autoscale )
{
@@ -1366,33 +1379,55 @@ void ShowPreferences( void )
{
int i;
GList * Items = NULL;
- const char * name = NULL;
+ const char *name;
Items=g_list_append( Items,_(MSGTR_GUI__Default_) );
+ name = Items->data;
+
for( i=0;mpcodecs_vd_drivers[i];i++ )
{
Items=g_list_append( Items,(char *)mpcodecs_vd_drivers[i]->info->name );
if ( video_fm_list && !gstrcmp( video_fm_list[0],mpcodecs_vd_drivers[i]->info->short_name ) ) name=mpcodecs_vd_drivers[i]->info->name;
}
- gtk_combo_set_popdown_strings( GTK_COMBO( CBVFM ),Items );
+
+ list = Items;
+
+ while (list)
+ {
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBVFM), list->data);
+ list = list->next;
+ }
+
+ gtk_entry_set_text(gtkEntry(CBVFM), name);
+
g_list_free( Items );
- if ( name ) gtk_entry_set_text( GTK_ENTRY( EVFM ),name );
}
{
int i;
GList * Items = NULL;
- const char * name = NULL;
+ const char *name;
Items=g_list_append( Items,_(MSGTR_GUI__Default_) );
+ name = Items->data;
+
for( i=0;mpcodecs_ad_drivers[i];i++ )
{
Items=g_list_append( Items,(char *)mpcodecs_ad_drivers[i]->info->name );
if ( audio_fm_list && !gstrcmp( audio_fm_list[0],mpcodecs_ad_drivers[i]->info->short_name ) ) name=mpcodecs_ad_drivers[i]->info->name;
}
- gtk_combo_set_popdown_strings( GTK_COMBO( CBAFM ),Items );
+
+ list = Items;
+
+ while (list)
+ {
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBAFM), list->data);
+ list = list->next;
+ }
+
+ gtk_entry_set_text(gtkEntry(CBAFM), name);
+
g_list_free( Items );
- if ( name ) gtk_entry_set_text( GTK_ENTRY( EAFM ),name );
}
/* 6th page */
@@ -1468,12 +1503,12 @@ void ShowPreferences( void )
g_signal_connect( G_OBJECT( HSFontOutLine ),"motion-notify-event",G_CALLBACK( prHScaler ),GINT_TO_POINTER(7) );
g_signal_connect( G_OBJECT( HSFontTextScale ),"motion-notify-event",G_CALLBACK( prHScaler ),GINT_TO_POINTER(8) );
g_signal_connect( G_OBJECT( HSFontOSDScale ),"motion-notify-event",G_CALLBACK( prHScaler ),GINT_TO_POINTER(9) );
- g_signal_connect( G_OBJECT( EFontEncoding ),"changed",G_CALLBACK( prEntry ),GINT_TO_POINTER(0) );
+ g_signal_connect( G_OBJECT( CBFontEncoding ),"changed",G_CALLBACK( prEntry ),GINT_TO_POINTER(0) );
#else
g_signal_connect( G_OBJECT( HSFontFactor ),"motion-notify-event",G_CALLBACK( prHScaler ),GINT_TO_POINTER(5) );
#endif
#ifdef CONFIG_ICONV
- g_signal_connect( G_OBJECT( ESubEncoding ),"changed",G_CALLBACK( prEntry ),GINT_TO_POINTER(1) );
+ g_signal_connect( G_OBJECT( CBSubEncoding ),"changed",G_CALLBACK( prEntry ),GINT_TO_POINTER(1) );
#endif
g_signal_connect( G_OBJECT( HSPPQuality ),"motion-notify-event",G_CALLBACK( prHScaler ),GINT_TO_POINTER(10) );
@@ -1594,7 +1629,7 @@ static GList *appendESDDevices(GList *l)
// _(MSGTR_GUI_DefaultSetting) as null string.
static const char *getGtkEntryText(GtkWidget *from)
{
- const char *tmp = gtk_entry_get_text(GTK_ENTRY(from));
+ const char *tmp = gtk_entry_get_text(gtkEntry(from));
if (strcmp(tmp, _(MSGTR_GUI_DefaultSetting)) == 0) {
tmp = NULL;
}
@@ -1608,15 +1643,12 @@ static void setGtkEntryText(GtkWidget *d
if (!to) {
to = _(MSGTR_GUI_DefaultSetting);
}
- gtk_entry_set_text(GTK_ENTRY(dest),to);
+ gtk_entry_set_text(gtkEntry(dest), to);
}
#endif
-static GtkWidget *CEAudioDevice;
static GtkWidget *CBAudioDevice;
-static GtkWidget *CEAudioMixer;
static GtkWidget *CBAudioMixer;
-static GtkWidget *CEAudioMixerChannel;
static GtkWidget *CBAudioMixerChannel;
static GtkWidget *BAudioOk;
static GtkWidget *BAudioCancel;
@@ -1630,33 +1662,33 @@ static void audioButton(GtkButton *butto
#ifdef CONFIG_OSS_AUDIO
if (strncmp(ao_driver[0], "oss", 3) == 0) {
nfree(gtkAOOSSDevice);
- gtkAOOSSDevice = gstrdup(getGtkEntryText(CEAudioDevice));
+ gtkAOOSSDevice = gstrdup(getGtkEntryText(CBAudioDevice));
nfree(gtkAOOSSMixer);
- gtkAOOSSMixer = gstrdup(getGtkEntryText(CEAudioMixer));
+ gtkAOOSSMixer = gstrdup(getGtkEntryText(CBAudioMixer));
nfree(gtkAOOSSMixerChannel);
- gtkAOOSSMixerChannel = gstrdup(getGtkEntryText(CEAudioMixerChannel));
+ gtkAOOSSMixerChannel = gstrdup(getGtkEntryText(CBAudioMixerChannel));
}
#endif
#ifdef CONFIG_ALSA
if (strncmp(ao_driver[0], "alsa", 4) == 0) {
nfree(gtkAOALSADevice);
- gtkAOALSADevice = gstrdup(getGtkEntryText(CEAudioDevice));
+ gtkAOALSADevice = gstrdup(getGtkEntryText(CBAudioDevice));
nfree(gtkAOALSAMixer);
- gtkAOALSAMixer = gstrdup(getGtkEntryText(CEAudioMixer));
+ gtkAOALSAMixer = gstrdup(getGtkEntryText(CBAudioMixer));
nfree(gtkAOALSAMixerChannel);
- gtkAOALSAMixerChannel = gstrdup(getGtkEntryText(CEAudioMixerChannel));
+ gtkAOALSAMixerChannel = gstrdup(getGtkEntryText(CBAudioMixerChannel));
}
#endif
#ifdef CONFIG_SDL
if (strncmp(ao_driver[0], "sdl", 3) == 0) {
nfree(gtkAOSDLDriver);
- gtkAOSDLDriver = gstrdup(getGtkEntryText(CEAudioDevice));
+ gtkAOSDLDriver = gstrdup(getGtkEntryText(CBAudioDevice));
}
#endif
#ifdef CONFIG_ESD
if (strncmp(ao_driver[0], "esd", 3) == 0) {
nfree(gtkAOESDDevice);
- gtkAOESDDevice = gstrdup(getGtkEntryText(CEAudioDevice));
+ gtkAOESDDevice = gstrdup(getGtkEntryText(CBAudioDevice));
}
#endif
// fall through
@@ -1668,7 +1700,7 @@ static void audioButton(GtkButton *butto
}
static GtkWidget *CreateAudioConfig( void ) {
- GList *items = NULL;
+ GList *items = NULL, *list;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *label;
@@ -1712,13 +1744,18 @@ static GtkWidget *CreateAudioConfig( voi
if (strncmp(ao_driver[0], "esd", 3) == 0)
items = appendESDDevices(items);
#endif
- gtk_combo_set_popdown_strings(GTK_COMBO(CBAudioDevice), items);
+
+ list = items;
+
+ while (list)
+ {
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBAudioDevice), list->data);
+ list = list->next;
+ }
+
g_list_free(items);
items = NULL;
- CEAudioDevice = GTK_COMBO(CBAudioDevice)->entry;
- gtk_widget_show(CEAudioDevice);
-
label = gtkAddLabelColon(_(MSGTR_GUI_Mixer), NULL);
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0);
@@ -1733,13 +1770,18 @@ static GtkWidget *CreateAudioConfig( voi
if (strncmp(ao_driver[0], "alsa", 4) == 0)
items = appendALSAMixers(items);
#endif
- gtk_combo_set_popdown_strings(GTK_COMBO(CBAudioMixer), items);
+
+ list = items;
+
+ while (list)
+ {
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBAudioMixer), list->data);
+ list = list->next;
+ }
+
g_list_free(items);
items = NULL;
- CEAudioMixer = GTK_COMBO(CBAudioMixer)->entry;
- gtk_widget_show(CEAudioMixer);
-
label = gtkAddLabelColon(_(MSGTR_GUI_MixerChannel), NULL);
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0);
@@ -1754,12 +1796,16 @@ static GtkWidget *CreateAudioConfig( voi
if (strncmp(ao_driver[0], "alsa", 4) == 0)
items = appendALSAMixerChannels(items);
#endif
- gtk_combo_set_popdown_strings(GTK_COMBO(CBAudioMixerChannel), items);
- g_list_free(items);
- items = NULL;
- CEAudioMixerChannel = GTK_COMBO(CBAudioMixerChannel)->entry;
- gtk_widget_show(CEAudioMixerChannel);
+ list = items;
+
+ while (list)
+ {
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBAudioMixerChannel), list->data);
+ list = list->next;
+ }
+
+ g_list_free(items);
gtkAddHSeparator(vbox);
@@ -1787,26 +1833,26 @@ void ShowAudioConfig( void ) {
#ifdef CONFIG_OSS_AUDIO
if (strncmp(ao_driver[0], "oss", 3) == 0) {
- setGtkEntryText(CEAudioDevice, gtkAOOSSDevice);
- setGtkEntryText(CEAudioMixer, gtkAOOSSMixer);
- setGtkEntryText(CEAudioMixerChannel, gtkAOOSSMixerChannel);
+ setGtkEntryText(CBAudioDevice, gtkAOOSSDevice);
+ setGtkEntryText(CBAudioMixer, gtkAOOSSMixer);
+ setGtkEntryText(CBAudioMixerChannel, gtkAOOSSMixerChannel);
}
#endif
#ifdef CONFIG_ALSA
if (strncmp(ao_driver[0], "alsa", 4) == 0) {
- setGtkEntryText(CEAudioDevice, gtkAOALSADevice);
- setGtkEntryText(CEAudioMixer, gtkAOALSAMixer);
- setGtkEntryText(CEAudioMixerChannel, gtkAOALSAMixerChannel);
+ setGtkEntryText(CBAudioDevice, gtkAOALSADevice);
+ setGtkEntryText(CBAudioMixer, gtkAOALSAMixer);
+ setGtkEntryText(CBAudioMixerChannel, gtkAOALSAMixerChannel);
}
#endif
#ifdef CONFIG_SDL
if (strncmp(ao_driver[0], "sdl", 3) == 0) {
- setGtkEntryText(CEAudioDevice, gtkAOSDLDriver);
+ setGtkEntryText(CBAudioDevice, gtkAOSDLDriver);
}
#endif
#ifdef CONFIG_ESD
if (strncmp(ao_driver[0], "esd", 3) == 0) {
- setGtkEntryText(CEAudioDevice, gtkAOESDDevice);
+ setGtkEntryText(CBAudioDevice, gtkAOESDDevice);
}
#endif
@@ -1816,8 +1862,7 @@ void ShowAudioConfig( void ) {
/* dxr3 config box */
-static GtkWidget * CBDevice;
-static GtkWidget * CEDXR3Device;
+static GtkWidget * CBDXR3Device;
static GtkWidget * RBVNone;
static GtkWidget * RBVLavc;
static GtkWidget * dxr3BOk;
@@ -1830,7 +1875,7 @@ void ShowDXR3Config( void )
if ( DXR3Config ) gtkRaise( DXR3Config );
else DXR3Config=CreateDXR3Config();
- gtk_entry_set_text( GTK_ENTRY( CEDXR3Device ),gtkDXR3Device );
+ gtk_entry_set_text(gtkEntry(CBDXR3Device), gtkDXR3Device);
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVNone ),TRUE );
if ( gtkVfLAVC ) gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVLavc ),TRUE );
@@ -1846,7 +1891,7 @@ static void dxr3Button( GtkButton * butt
switch ( GPOINTER_TO_INT(user_data) )
{
case 0: // Ok
- nfree( gtkDXR3Device ); gtkDXR3Device=strdup( gtk_entry_get_text( GTK_ENTRY( CEDXR3Device ) ) );
+ nfree(gtkDXR3Device); gtkDXR3Device = strdup(gtk_entry_get_text(gtkEntry(CBDXR3Device)));
gtkVfLAVC=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBVLavc ) );
// fall through
@@ -1861,7 +1906,6 @@ GtkWidget * CreateDXR3Config( void )
GtkWidget * vbox1;
GtkWidget * vbox2;
GtkWidget * hbox1;
- GList * CBDevice_items = NULL;
GtkWidget * vbox3;
GSList * VEncoder_group = NULL;
GtkWidget * hbuttonbox1;
@@ -1884,19 +1928,15 @@ GtkWidget * CreateDXR3Config( void )
hbox1=gtkAddHBox( vbox2,1 );
gtkAddLabelColon( _(MSGTR_GUI_Device),hbox1 );
- CBDevice=gtkAddCombo( hbox1 );
+ CBDXR3Device=gtkAddCombo( hbox1 );
- CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300" );
- CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-0" );
- CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-1" );
- CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-2" );
- CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-3" );
- gtk_combo_set_popdown_strings( GTK_COMBO( CBDevice ),CBDevice_items );
- g_list_free( CBDevice_items );
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBDXR3Device), "/dev/em8300");
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBDXR3Device), "/dev/em8300-0");
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBDXR3Device), "/dev/em8300-1");
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBDXR3Device), "/dev/em8300-2");
+ gtk_combo_box_append_text(GTK_COMBO_BOX(CBDXR3Device), "/dev/em8300-3");
- CEDXR3Device=GTK_COMBO( CBDevice )->entry;
- gtk_widget_show( CEDXR3Device );
- gtk_entry_set_text( GTK_ENTRY( CEDXR3Device ),"/dev/em8300" );
+ gtk_entry_set_text(gtkEntry(CBDXR3Device), "/dev/em8300");
gtkAddHSeparator( vbox2 );
vbox3=gtkAddVBox( vbox2,0 );
Modified: trunk/gui/dialog/tools.c
==============================================================================
--- trunk/gui/dialog/tools.c Thu May 2 22:37:45 2024 (r38504)
+++ trunk/gui/dialog/tools.c Thu May 2 22:41:56 2024 (r38505)
@@ -230,7 +230,7 @@ GtkWidget * gtkAddVScale( GtkAdjustment
GtkWidget * gtkAddCombo( GtkWidget * parent )
{
GtkWidget * CB;
- CB=gtk_combo_new();
+ CB=gtk_combo_box_entry_new_text();
gtk_widget_show( CB );
if ( parent ) gtk_box_pack_start( GTK_BOX( parent ),CB,TRUE,TRUE,0 );
return CB;
@@ -250,3 +250,13 @@ int gtkFindInCList (GtkWidget *list, cha
return -1;
}
+
+GtkEntry *gtkEntry (GtkWidget *combo_box)
+{
+ return GTK_ENTRY(gtk_bin_get_child(GTK_BIN(combo_box)));
+}
+
+void gtkEntrySetEditable (GtkWidget *combo_box, gboolean editable)
+{
+ gtk_editable_set_editable(GTK_EDITABLE(gtkEntry(combo_box)), editable);
+}
Modified: trunk/gui/dialog/tools.h
==============================================================================
--- trunk/gui/dialog/tools.h Thu May 2 22:37:45 2024 (r38504)
+++ trunk/gui/dialog/tools.h Thu May 2 22:41:56 2024 (r38505)
@@ -39,5 +39,7 @@ GtkWidget * gtkAddHScale( GtkAdjustment
GtkWidget * gtkAddVScale( GtkAdjustment * adj, GtkWidget * parent, int digit );
GtkWidget * gtkAddCombo( GtkWidget * parent );
int gtkFindInCList(GtkWidget *list, char *item);
+GtkEntry *gtkEntry(GtkWidget *);
+void gtkEntrySetEditable(GtkWidget *, gboolean);
#endif /* MPLAYER_GUI_TOOLS_H */
Modified: trunk/gui/dialog/url.c
==============================================================================
--- trunk/gui/dialog/url.c Thu May 2 22:37:45 2024 (r38504)
+++ trunk/gui/dialog/url.c Thu May 2 22:41:56 2024 (r38505)
@@ -36,8 +36,6 @@
GtkWidget *URLDialog;
static GtkWidget *urlCombo;
-static GtkWidget *urlEntry;
-static GList *urlEntries;
/**
* @brief Add the entered URL to the URL list and stream it,
@@ -55,7 +53,7 @@ static void button_clicked(GtkButton *bu
(void)button;
if (user_data) {
- char *str = strdup(gtk_entry_get_text(GTK_ENTRY(urlEntry)));
+ char *str = strdup(gtk_entry_get_text(gtkEntry(urlCombo)));
if (str) {
if (!strstr(str, "://")) {
@@ -117,13 +115,6 @@ static GtkWidget *CreateURLDialog(void)
gtkAddLabel("URL: ", hbox1);
urlCombo = gtkAddCombo(hbox1);
-/*
- * gtk_combo_new();
- * gtk_widget_show( urlCombo );
- * gtk_box_pack_start( GTK_BOX( hbox1 ),urlCombo,TRUE,TRUE,0 );
- */
- urlEntry = GTK_COMBO(urlCombo)->entry;
- gtk_widget_show(urlEntry);
gtkAddHSeparator(vbox1);
@@ -145,7 +136,7 @@ static GtkWidget *CreateURLDialog(void)
g_signal_connect(G_OBJECT(Ok), "clicked", G_CALLBACK(button_clicked), Ok);
g_signal_connect(G_OBJECT(Cancel), "clicked", G_CALLBACK(button_clicked), NULL);
- gtk_widget_grab_focus(urlEntry);
+ gtk_widget_grab_focus(urlCombo);
gtk_window_add_accel_group(GTK_WINDOW(URLDialog), accel_group);
return URLDialog;
@@ -163,18 +154,12 @@ void ShowURLDialog(void)
item = listMgr(URLLIST_GET, 0);
if (item) {
- g_list_free(urlEntries);
- urlEntries = NULL;
-
while (item) {
- urlEntries = g_list_append(urlEntries, item->url);
- item = item->next;
+ gtk_combo_box_append_text(GTK_COMBO_BOX(urlCombo), item->url);
+ item = item->next;
}
- }
- if (urlEntries) {
- gtk_entry_set_text(GTK_ENTRY(urlEntry), urlEntries->data);
- gtk_combo_set_popdown_strings(GTK_COMBO(urlCombo), urlEntries);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(urlCombo), 0);
}
gtk_widget_show(URLDialog);
More information about the MPlayer-cvslog
mailing list