annotate gui/dialog/skinbrowser.c @ 36174:dabe949e41e9

Support audio in GameCube rsd files.
author cehoyos
date Wed, 15 May 2013 09:54:40 +0000
parents 32a4d8f63ae3
children e1e9f2ea17c9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
1 /*
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
2 * This file is part of MPlayer.
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
3 *
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
7 * (at your option) any later version.
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
8 *
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
12 * GNU General Public License for more details.
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
13 *
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License along
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
17 */
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
18
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
19 #include <sys/stat.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
20 #include <glob.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
21 #include <unistd.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
22 #include <string.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
23 #include <stdlib.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
24 #include <stdio.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
25
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
26 #include "skinbrowser.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
27 #include "tools.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
28
35525
e27855a45128 Rebuild GUI directory structure.
ib
parents: 35493
diff changeset
29 #include "gui/app/app.h"
e27855a45128 Rebuild GUI directory structure.
ib
parents: 35493
diff changeset
30 #include "gui/app/cfg.h"
e27855a45128 Rebuild GUI directory structure.
ib
parents: 35493
diff changeset
31 #include "gui/app/gui.h"
36026
f96f37b4f5a1 Remove unnecessary #includes.
ib
parents: 36024
diff changeset
32 #include "gui/ui/actions.h"
33749
d8f49edf8f25 Remove skin related variables from interface.[ch].
ib
parents: 33738
diff changeset
33 #include "gui/skin/skin.h"
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
34 #include "help_mp.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
35
35529
8ad4d2fb46e8 Rebuild GUI directory structure.
ib
parents: 35526
diff changeset
36 #include "dialog.h"
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
37
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
38 GtkWidget * SkinList = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
39 char * sbSelectedSkin=NULL;
36043
40c13df3d953 Cosmetic: Rename variables (consistently).
ib
parents: 36034
diff changeset
40 char * sbSkinDirInHome=NULL;
40c13df3d953 Cosmetic: Rename variables (consistently).
ib
parents: 36034
diff changeset
41 char * sbSkinDirInData=NULL;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
42
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
43 char * gtkOldSkin=NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
44 static char * prev=NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
45
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
46 GtkWidget * SkinBrowser = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
47
34466
a650895d50a5 Use correct data types and common variable names in GTK callback functions.
ib
parents: 33749
diff changeset
48 static void prButton( GtkButton * button,gpointer user_data )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
49 {
36010
5c720c434d56 Silence "warning: unused parameter".
ib
parents: 36008
diff changeset
50 (void) button;
5c720c434d56 Silence "warning: unused parameter".
ib
parents: 36008
diff changeset
51
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
52 if ( sbSelectedSkin )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
53 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
54 switch ( (int)user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
55 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
56 case 0: // cancel
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
57 if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) uiChangeSkin( gtkOldSkin );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
58 break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
59 case 1: // ok
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
60 uiChangeSkin( sbSelectedSkin ); // NOTE TO MYSELF: skin already changed!
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
61 free( skinName );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
62 skinName=strdup( sbSelectedSkin );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
63 break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
64 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
65 }
35999
135a2c940db8 Remove HideSkinBrowser().
ib
parents: 35996
diff changeset
66 gtk_widget_destroy( SkinBrowser );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
67 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
68
34466
a650895d50a5 Use correct data types and common variable names in GTK callback functions.
ib
parents: 33749
diff changeset
69 static void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
70 {
36010
5c720c434d56 Silence "warning: unused parameter".
ib
parents: 36008
diff changeset
71 (void) column;
5c720c434d56 Silence "warning: unused parameter".
ib
parents: 36008
diff changeset
72 (void) user_data;
5c720c434d56 Silence "warning: unused parameter".
ib
parents: 36008
diff changeset
73
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
74 gtk_clist_get_text( clist,row,0,&sbSelectedSkin );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
75 if ( strcmp( prev,sbSelectedSkin ) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
76 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
77 prev=sbSelectedSkin;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
78 uiChangeSkin( sbSelectedSkin );
36019
d2d776c8e040 Cosmetic: Rename gtkActive() gtkRaise().
ib
parents: 36010
diff changeset
79 gtkRaise( SkinBrowser );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
80 }
34466
a650895d50a5 Use correct data types and common variable names in GTK callback functions.
ib
parents: 33749
diff changeset
81 if( !event ) return;
a650895d50a5 Use correct data types and common variable names in GTK callback functions.
ib
parents: 33749
diff changeset
82 if( event->type == GDK_2BUTTON_PRESS )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
83 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
84 free( skinName );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
85 skinName=strdup( sbSelectedSkin );
35999
135a2c940db8 Remove HideSkinBrowser().
ib
parents: 35996
diff changeset
86 gtk_widget_destroy( SkinBrowser );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
87 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
88 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
89
35996
6c891a0e3fea Cosmetic: Rename the functions creating the dialogs.
ib
parents: 35995
diff changeset
90 static GtkWidget * CreateSkinBrowser( void )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
91 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
92 GtkWidget * vbox5;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
93 GtkWidget * scrolledwindow1;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
94 GtkWidget * hbuttonbox4;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
95 GtkWidget * Cancel;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
96 GtkWidget * Ok;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
97 GtkAccelGroup * accel_group;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
98
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
99 accel_group = gtk_accel_group_new ();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
100
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
101 SkinBrowser=gtk_window_new( GTK_WINDOW_TOPLEVEL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
102 gtk_widget_set_usize( SkinBrowser,256,320 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
103 gtk_container_set_border_width( GTK_CONTAINER( SkinBrowser ),1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
104 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 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
105 gtk_window_set_title( GTK_WINDOW( SkinBrowser ),MSGTR_SkinBrowser );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
106 gtk_window_set_position( GTK_WINDOW( SkinBrowser ),GTK_WIN_POS_CENTER );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
107 gtk_window_set_policy( GTK_WINDOW( SkinBrowser ),FALSE,FALSE,TRUE );
36053
7affacef2f88 Define "MPlayer" string.
ib
parents: 36052
diff changeset
108 gtk_window_set_wmclass( GTK_WINDOW( SkinBrowser ),"SkinBrowser",MPlayer );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
109
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
110 gtk_widget_realize( SkinBrowser );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
111 gtkAddIcon( SkinBrowser );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
112
36023
a04e8798227b Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents: 36019
diff changeset
113 vbox5=gtkAddVBox( gtkAddDialogFrame( SkinBrowser ),0 );
a04e8798227b Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents: 36019
diff changeset
114 gtkAddLabel( MSGTR_SKIN_LABEL,vbox5 );
a04e8798227b Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents: 36019
diff changeset
115 gtkAddHSeparator( vbox5 );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
116
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
117 scrolledwindow1=gtk_scrolled_window_new( NULL,NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
118 gtk_widget_ref( scrolledwindow1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
119 gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"scrolledwindow1",scrolledwindow1,(GtkDestroyNotify)gtk_widget_unref );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
120 gtk_widget_show( scrolledwindow1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
121 gtk_box_pack_start( GTK_BOX( vbox5 ),scrolledwindow1,TRUE,TRUE,0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
122 gtk_container_set_border_width( GTK_CONTAINER( scrolledwindow1 ),2 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
123 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow1 ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
124
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
125 SkinList=gtk_clist_new( 1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
126 gtk_widget_ref( SkinList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
127 gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"SkinList",SkinList,(GtkDestroyNotify)gtk_widget_unref );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
128 gtk_widget_show( SkinList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
129 gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),SkinList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
130 gtk_clist_set_column_width( GTK_CLIST( SkinList ),0,80 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
131 gtk_clist_set_selection_mode( GTK_CLIST( SkinList ),GTK_SELECTION_SINGLE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
132 gtk_clist_column_titles_hide( GTK_CLIST( SkinList ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
133 gtk_clist_set_shadow_type( GTK_CLIST( SkinList ),GTK_SHADOW_ETCHED_OUT );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
134
36023
a04e8798227b Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents: 36019
diff changeset
135 gtkAddHSeparator( vbox5 );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
136
36023
a04e8798227b Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents: 36019
diff changeset
137 hbuttonbox4=gtkAddHButtonBox( vbox5 );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
138 gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox4 ),GTK_BUTTONBOX_SPREAD );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
139 gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox4 ),10 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
140
36023
a04e8798227b Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents: 36019
diff changeset
141 Ok=gtkAddButton( MSGTR_Ok,hbuttonbox4 );
a04e8798227b Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents: 36019
diff changeset
142 Cancel=gtkAddButton( MSGTR_Cancel,hbuttonbox4 );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
143
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
144 gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
145 gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
146
36008
d154d0035cb0 Don't use WidgetDestroy().
ib
parents: 35999
diff changeset
147 gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&SkinBrowser );
36101
32a4d8f63ae3 Cosmetic: Prefer hyphen to underline in signal names.
ib
parents: 36058
diff changeset
148 gtk_signal_connect( GTK_OBJECT( SkinList ),"select-row",GTK_SIGNAL_FUNC( on_SkinList_select_row ),NULL );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
149 gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void *)1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
150 gtk_signal_connect( GTK_OBJECT( Cancel ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void *)0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
151
36043
40c13df3d953 Cosmetic: Rename variables (consistently).
ib
parents: 36034
diff changeset
152 if ( ( sbSkinDirInHome=calloc( 1,strlen( skinDirInHome ) + 4 ) ) != NULL )
40c13df3d953 Cosmetic: Rename variables (consistently).
ib
parents: 36034
diff changeset
153 { strcpy( sbSkinDirInHome,skinDirInHome ); strcat( sbSkinDirInHome,"/*" ); }
40c13df3d953 Cosmetic: Rename variables (consistently).
ib
parents: 36034
diff changeset
154 if ( ( sbSkinDirInData=calloc( 1,strlen( skinDirInData ) + 4 ) ) != NULL )
40c13df3d953 Cosmetic: Rename variables (consistently).
ib
parents: 36034
diff changeset
155 { strcpy( sbSkinDirInData,skinDirInData ); strcat( sbSkinDirInData,"/*" ); }
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
156
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
157 gtk_window_add_accel_group( GTK_WINDOW( SkinBrowser ),accel_group );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
158 gtk_widget_grab_focus( SkinList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
159
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
160 return SkinBrowser;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
161 }
35995
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
162
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
163 void ShowSkinBrowser( void )
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
164 {
36019
d2d776c8e040 Cosmetic: Rename gtkActive() gtkRaise().
ib
parents: 36010
diff changeset
165 if ( SkinBrowser ) gtkRaise( SkinBrowser );
35996
6c891a0e3fea Cosmetic: Rename the functions creating the dialogs.
ib
parents: 35995
diff changeset
166 else SkinBrowser=CreateSkinBrowser();
35995
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
167 }
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
168
36034
e1d1d404ee9e Move function declaration where it belongs.
ib
parents: 36026
diff changeset
169 int FillSkinList( gchar * mdir )
35995
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
170 {
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
171 gchar * str[2];
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
172 gchar * tmp;
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
173 int i;
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
174 glob_t gg;
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
175 struct stat fs;
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
176
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
177 gtkOldSkin=strdup( skinName );
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
178 prev=gtkOldSkin;
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
179
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
180 str[0]="default";
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
181 str[1]="";
36024
a9e5f317d6e4 Move gtkFindCList() to tools.c.
ib
parents: 36023
diff changeset
182 if ( gtkFindInCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
35995
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
183
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
184 glob( mdir,GLOB_NOSORT,NULL,&gg );
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
185 for( i=0;i<(int)gg.gl_pathc;i++ )
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
186 {
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
187 if ( !strcmp( gg.gl_pathv[i],"." ) || !strcmp( gg.gl_pathv[i],".." ) ) continue;
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
188 if ( ( stat( gg.gl_pathv[i],&fs ) == 0 ) && S_ISDIR( fs.st_mode ) )
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
189 {
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
190 tmp=strrchr( gg.gl_pathv[i],'/' );
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
191 if (tmp) tmp++;
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
192 else tmp = gg.gl_pathv[i];
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
193 if ( !strcmp( tmp,"default" ) ) continue;
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
194 str[0]=tmp;
36024
a9e5f317d6e4 Move gtkFindCList() to tools.c.
ib
parents: 36023
diff changeset
195 if ( gtkFindInCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
35995
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
196 }
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
197 }
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
198 globfree( &gg );
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
199 return True;
454b0a86d1e8 Make create_SkinBrowser() static.
ib
parents: 35529
diff changeset
200 }