annotate Gui/mplayer/gtk/sb.c @ 22109:95e936ac33cd

Fix vqscale description to match at least somewhat the code.
author reimar
date Sun, 04 Feb 2007 13:38:41 +0000
parents 86350b4b8203
children 8e6182a75006
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
1
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
2 #include <sys/stat.h>
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
3 #include <glob.h>
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
4 #include <unistd.h>
2985
44e4572d5673 missing #include's
pl
parents: 2901
diff changeset
5 #include <string.h>
44e4572d5673 missing #include's
pl
parents: 2901
diff changeset
6 #include <stdlib.h>
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3587
diff changeset
7 #include <stdio.h>
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
8
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
9 #include "sb.h"
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
10 #include "common.h"
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
11
17144
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 8977
diff changeset
12 #include "../app.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 8977
diff changeset
13 #include "../../config.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 8977
diff changeset
14 #include "../../help_mp.h"
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
15
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
16 #include "../widgets.h"
17144
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 8977
diff changeset
17 #include "app.h"
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
18
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
19 GtkWidget * SkinList = NULL;
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
20 char * sbSelectedSkin=NULL;
17974
9a5a62f480e6 Rename the default GUI skins directory from 'Skin' to 'skins', keeping
diego
parents: 17144
diff changeset
21 /* FIXME: Eventually remove the obsolete directory names. */
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
22 char * sbMPlayerDirInHome=NULL;
17974
9a5a62f480e6 Rename the default GUI skins directory from 'Skin' to 'skins', keeping
diego
parents: 17144
diff changeset
23 char * sbMPlayerDirInHome_obsolete=NULL;
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
24 char * sbMPlayerPrefixDir=NULL;
17974
9a5a62f480e6 Rename the default GUI skins directory from 'Skin' to 'skins', keeping
diego
parents: 17144
diff changeset
25 char * sbMPlayerPrefixDir_obsolete=NULL;
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
26
18066
2ee39341b7a6 fix segfault in the skin browser when sbSelectedSkin gets dereferenced before setting, when no skin is selected in the skin list upon opening the browser,
gpoirier
parents: 17974
diff changeset
27 char * gtkOldSkin=NULL;
2ee39341b7a6 fix segfault in the skin browser when sbSelectedSkin gets dereferenced before setting, when no skin is selected in the skin list upon opening the browser,
gpoirier
parents: 17974
diff changeset
28 static char * prev=NULL;
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
29
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
30 GtkWidget * SkinBrowser = NULL;
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
31
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
32 void ShowSkinBrowser( void )
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
33 {
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
34 if ( SkinBrowser ) gtkActive( SkinBrowser );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
35 else SkinBrowser=create_SkinBrowser();
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
36 }
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
37
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
38 void HideSkinBrowser( void )
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
39 {
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
40 if ( !SkinBrowser ) return;
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
41 gtk_widget_hide( SkinBrowser );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
42 gtk_widget_destroy( SkinBrowser );
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
43 SkinBrowser=NULL;
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
44 }
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
45
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
46 int gtkFillSkinList( gchar * mdir )
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
47 {
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
48 gchar * str[2];
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
49 gchar * tmp;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
50 int i;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
51 glob_t gg;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
52 struct stat fs;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
53
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3587
diff changeset
54 gtkOldSkin=strdup( skinName );
5690
436cf6ef67fd fix skin loading bug
pontscho
parents: 4818
diff changeset
55 prev=gtkOldSkin;
8977
5c7d92600018 10l found by Arpi (njamd)
pontscho
parents: 8719
diff changeset
56
5c7d92600018 10l found by Arpi (njamd)
pontscho
parents: 8719
diff changeset
57 str[0]="default";
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
58 str[1]="";
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
59 if ( gtkFindCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
60
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
61 glob( mdir,GLOB_NOSORT,NULL,&gg );
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
62 for( i=0;i<(int)gg.gl_pathc;i++ )
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
63 {
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
64 if ( !strcmp( gg.gl_pathv[i],"." ) || !strcmp( gg.gl_pathv[i],".." ) ) continue;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
65 stat( gg.gl_pathv[i],&fs );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
66 if ( S_ISDIR( fs.st_mode ) )
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
67 {
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
68 tmp=strrchr( gg.gl_pathv[i],'/' ); tmp++;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
69 if ( !strcmp( tmp,"default" ) ) continue;
8977
5c7d92600018 10l found by Arpi (njamd)
pontscho
parents: 8719
diff changeset
70 str[0]=tmp;
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
71 if ( gtkFindCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
72 }
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
73 }
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
74 globfree( &gg );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
75 return 1;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
76 }
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
77
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
78 static void prButton( GtkObject * object,gpointer user_data )
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
79 {
18066
2ee39341b7a6 fix segfault in the skin browser when sbSelectedSkin gets dereferenced before setting, when no skin is selected in the skin list upon opening the browser,
gpoirier
parents: 17974
diff changeset
80 if ( sbSelectedSkin )
2ee39341b7a6 fix segfault in the skin browser when sbSelectedSkin gets dereferenced before setting, when no skin is selected in the skin list upon opening the browser,
gpoirier
parents: 17974
diff changeset
81 {
2ee39341b7a6 fix segfault in the skin browser when sbSelectedSkin gets dereferenced before setting, when no skin is selected in the skin list upon opening the browser,
gpoirier
parents: 17974
diff changeset
82 switch ( (int)user_data )
2ee39341b7a6 fix segfault in the skin browser when sbSelectedSkin gets dereferenced before setting, when no skin is selected in the skin list upon opening the browser,
gpoirier
parents: 17974
diff changeset
83 {
2ee39341b7a6 fix segfault in the skin browser when sbSelectedSkin gets dereferenced before setting, when no skin is selected in the skin list upon opening the browser,
gpoirier
parents: 17974
diff changeset
84 case 0: // cancel
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
85 if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) ChangeSkin( gtkOldSkin );
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
86 break;
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
87 case 1: // ok
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
88 ChangeSkin( sbSelectedSkin );
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
89 if ( skinName ) free( skinName );
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
90 skinName=strdup( sbSelectedSkin );
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
91 break;
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
92 }
18066
2ee39341b7a6 fix segfault in the skin browser when sbSelectedSkin gets dereferenced before setting, when no skin is selected in the skin list upon opening the browser,
gpoirier
parents: 17974
diff changeset
93 }
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
94 HideSkinBrowser();
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3587
diff changeset
95 }
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3587
diff changeset
96
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
97 static void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * bevent,gpointer user_data )
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
98 {
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
99 gtk_clist_get_text( clist,row,0,&sbSelectedSkin );
5690
436cf6ef67fd fix skin loading bug
pontscho
parents: 4818
diff changeset
100 if ( strcmp( prev,sbSelectedSkin ) )
436cf6ef67fd fix skin loading bug
pontscho
parents: 4818
diff changeset
101 {
436cf6ef67fd fix skin loading bug
pontscho
parents: 4818
diff changeset
102 prev=sbSelectedSkin;
436cf6ef67fd fix skin loading bug
pontscho
parents: 4818
diff changeset
103 ChangeSkin( sbSelectedSkin );
6222
1a83bd7ff76e small changes in skin selection
pontscho
parents: 6146
diff changeset
104 gtkActive( SkinBrowser );
5690
436cf6ef67fd fix skin loading bug
pontscho
parents: 4818
diff changeset
105 }
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
106 if( !bevent ) return;
5690
436cf6ef67fd fix skin loading bug
pontscho
parents: 4818
diff changeset
107 if( bevent->type == GDK_2BUTTON_PRESS )
436cf6ef67fd fix skin loading bug
pontscho
parents: 4818
diff changeset
108 {
436cf6ef67fd fix skin loading bug
pontscho
parents: 4818
diff changeset
109 if ( skinName ) free( skinName );
436cf6ef67fd fix skin loading bug
pontscho
parents: 4818
diff changeset
110 skinName=strdup( sbSelectedSkin );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
111 HideSkinBrowser();
5690
436cf6ef67fd fix skin loading bug
pontscho
parents: 4818
diff changeset
112 }
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
113 }
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
114
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
115 GtkWidget * create_SkinBrowser( void )
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
116 {
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
117 GtkWidget * vbox5;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
118 GtkWidget * scrolledwindow1;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
119 GtkWidget * hbuttonbox4;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
120 GtkWidget * Cancel;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
121 GtkWidget * Ok;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
122 GtkAccelGroup * accel_group;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
123
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
124 accel_group = gtk_accel_group_new ();
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
125
8043
e5dda05f9aab cleanup
pontscho
parents: 6903
diff changeset
126 SkinBrowser=gtk_window_new( GTK_WINDOW_TOPLEVEL );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
127 gtk_widget_set_name( SkinBrowser,MSGTR_SkinBrowser );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
128 gtk_object_set_data( GTK_OBJECT( SkinBrowser ),MSGTR_SkinBrowser,SkinBrowser );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
129 gtk_widget_set_usize( SkinBrowser,256,320 );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
130 gtk_container_set_border_width( GTK_CONTAINER( SkinBrowser ),1 );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
131 GTK_WIDGET_SET_FLAGS( SkinBrowser,GTK_CAN_DEFAULT );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
132 gtk_widget_set_events( SkinBrowser,GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
133 gtk_window_set_title( GTK_WINDOW( SkinBrowser ),MSGTR_SkinBrowser );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
134 gtk_window_set_position( GTK_WINDOW( SkinBrowser ),GTK_WIN_POS_CENTER );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
135 gtk_window_set_policy( GTK_WINDOW( SkinBrowser ),FALSE,FALSE,TRUE );
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
136 gtk_window_set_wmclass( GTK_WINDOW( SkinBrowser ),"SkinBrowser","MPlayer" );
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6222
diff changeset
137
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6222
diff changeset
138 gtk_widget_realize( SkinBrowser );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6222
diff changeset
139 gtkAddIcon( SkinBrowser );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
140
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
141 vbox5=AddVBox( AddDialogFrame( SkinBrowser ),0 );
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
142 AddLabel( MSGTR_SKIN_LABEL,vbox5 );
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
143 AddHSeparator( vbox5 );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
144
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
145 scrolledwindow1=gtk_scrolled_window_new( NULL,NULL );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
146 gtk_widget_set_name( scrolledwindow1,"scrolledwindow1" );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
147 gtk_widget_ref( scrolledwindow1 );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
148 gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"scrolledwindow1",scrolledwindow1,(GtkDestroyNotify)gtk_widget_unref );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
149 gtk_widget_show( scrolledwindow1 );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
150 gtk_box_pack_start( GTK_BOX( vbox5 ),scrolledwindow1,TRUE,TRUE,0 );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
151 gtk_container_set_border_width( GTK_CONTAINER( scrolledwindow1 ),2 );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
152 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow1 ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
153
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
154 SkinList=gtk_clist_new( 1 );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
155 gtk_widget_set_name( SkinList,"SkinList" );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
156 gtk_widget_ref( SkinList );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
157 gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"SkinList",SkinList,(GtkDestroyNotify)gtk_widget_unref );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
158 gtk_widget_show( SkinList );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
159 gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),SkinList );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
160 gtk_clist_set_column_width( GTK_CLIST( SkinList ),0,80 );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
161 gtk_clist_set_selection_mode( GTK_CLIST( SkinList ),GTK_SELECTION_SINGLE );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
162 gtk_clist_column_titles_hide( GTK_CLIST( SkinList ) );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
163 gtk_clist_set_shadow_type( GTK_CLIST( SkinList ),GTK_SHADOW_ETCHED_OUT );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
164
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
165 AddHSeparator( vbox5 );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
166
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
167 hbuttonbox4=AddHButtonBox( vbox5 );
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
168 gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox4 ),GTK_BUTTONBOX_SPREAD );
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
169 gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox4 ),10 );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
170
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
171 Ok=AddButton( MSGTR_Ok,hbuttonbox4 );
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
172 Cancel=AddButton( MSGTR_Cancel,hbuttonbox4 );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
173
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
174 gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
175 gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
176
8719
dc27303ae528 correct widget destroy event handler (thank for D J Hawkey Jr <hawkeyd@visi.com>)
pontscho
parents: 8299
diff changeset
177 gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&SkinBrowser );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
178 gtk_signal_connect( GTK_OBJECT( SkinList ),"select_row",GTK_SIGNAL_FUNC( on_SkinList_select_row ),NULL );
8299
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
179 gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void *)1 );
5b67aed0fc28 - remove some unused/nonusable variables
pontscho
parents: 8043
diff changeset
180 gtk_signal_connect( GTK_OBJECT( Cancel ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void *)0 );
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
181
19061
86350b4b8203 drops casts from void * on malloc/calloc from the gui code
reynaldo
parents: 18066
diff changeset
182 if ( ( sbMPlayerDirInHome_obsolete=calloc( 1,strlen( skinDirInHome_obsolete ) + 4 ) ) != NULL )
17974
9a5a62f480e6 Rename the default GUI skins directory from 'Skin' to 'skins', keeping
diego
parents: 17144
diff changeset
183 { strcpy( sbMPlayerDirInHome_obsolete,skinDirInHome_obsolete ); strcat( sbMPlayerDirInHome_obsolete,"/*" ); }
19061
86350b4b8203 drops casts from void * on malloc/calloc from the gui code
reynaldo
parents: 18066
diff changeset
184 if ( ( sbMPlayerDirInHome=calloc( 1,strlen( skinDirInHome ) + 4 ) ) != NULL )
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
185 { strcpy( sbMPlayerDirInHome,skinDirInHome ); strcat( sbMPlayerDirInHome,"/*" ); }
19061
86350b4b8203 drops casts from void * on malloc/calloc from the gui code
reynaldo
parents: 18066
diff changeset
186 if ( ( sbMPlayerPrefixDir_obsolete=calloc( 1,strlen( skinMPlayerDir ) + 4 ) ) != NULL )
17974
9a5a62f480e6 Rename the default GUI skins directory from 'Skin' to 'skins', keeping
diego
parents: 17144
diff changeset
187 { strcpy( sbMPlayerPrefixDir_obsolete,skinMPlayerDir ); strcat( sbMPlayerPrefixDir_obsolete,"/*" ); }
19061
86350b4b8203 drops casts from void * on malloc/calloc from the gui code
reynaldo
parents: 18066
diff changeset
188 if ( ( sbMPlayerPrefixDir=calloc( 1,strlen( skinMPlayerDir ) + 4 ) ) != NULL )
2901
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
189 { strcpy( sbMPlayerPrefixDir,skinMPlayerDir ); strcat( sbMPlayerPrefixDir,"/*" ); }
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
190
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
191 gtk_window_add_accel_group( GTK_WINDOW( SkinBrowser ),accel_group );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
192 gtk_widget_grab_focus( SkinList );
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
193
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
194 return SkinBrowser;
f77f8379f28f rewrite ...
pontscho
parents:
diff changeset
195 }