annotate gui/ui/gtk/playlist.c @ 34851:4c5ef823ee0f

Enable translation of font file filter items.
author ib
date Mon, 21 May 2012 10:33:08 +0000
parents 42fa91951bd2
children 746e2e0577b2
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/types.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
20 #include <sys/stat.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
21 #include <string.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
22 #include <dirent.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
23 #include <unistd.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
24 #include <stdio.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
25 #include <stdlib.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
26
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
27 #include <gdk/gdkkeysyms.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
28 #include <gtk/gtk.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
29
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
30 #include "config.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
31 #include "help_mp.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
32 #include "stream/stream.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
33
33750
8b5898908212 Remove variable holding history of selected files from interface.[ch].
ib
parents: 33742
diff changeset
34 #include "gui/cfg.h"
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
35 #include "gui/ui/widgets.h"
33742
e1539e14d60f Move purely list related parts of gtkSet() from interface.c to list.c.
ib
parents: 33740
diff changeset
36 #include "gui/util/list.h"
33739
9f6d46d325de Remove gfree() from interface.c.
ib
parents: 33575
diff changeset
37 #include "gui/util/mem.h"
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
38 #include "playlist.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
39 #include "tools.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
40
33575
052789583781 Remove xpm definitions inside source file.
ib
parents: 33572
diff changeset
41 #include "gui/ui/pixmaps/open2.xpm"
052789583781 Remove xpm definitions inside source file.
ib
parents: 33572
diff changeset
42 #include "gui/ui/pixmaps/dir2.xpm"
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
43
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
44 GtkWidget * PlayList = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
45 static GtkWidget * CTDirTree;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
46 static GtkWidget * CLFiles;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
47 static GtkWidget * CLSelected;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
48 static GtkWidget * Add;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
49 static GtkWidget * Remove;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
50 static GtkWidget * Ok;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
51 static GtkWidget * Cancel;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
52 static GdkPixmap * pxOpenedBook;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
53 static GdkPixmap * pxClosedBook;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
54 static GdkBitmap * msOpenedBook;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
55 static GdkBitmap * msClosedBook;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
56
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
57 static int NrOfEntrys = 0;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
58 static int NrOfSelected = 0;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
59 static int * CLFileSelected = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
60 static int * CLListSelected = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
61
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
62 static int sigSel;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
63 static int sigUnsel;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
64 static int sigEvent;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
65
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
66 typedef struct
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
67 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
68 int scaned;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
69 char * path;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
70 } DirNodeType;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
71
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
72 static GtkCTreeNode * sibling;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
73 static GtkCTreeNode * parent;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
74 static gchar * current_path;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
75 static gchar * old_path = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
76
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
77 static int compare_func(const void *a, const void *b)
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
78 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
79 char * tmp;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
80 int i;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
81 if ( !a || !b || !( (DirNodeType *)a )->path ) return -1;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
82 tmp=strdup( (char *)b ); tmp[strlen( tmp )-1]=0;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
83 i=strcmp( ( (DirNodeType *)a )->path,tmp );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
84 free( tmp );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
85 return i;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
86 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
87
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
88 static void scan_dir( char * path );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
89
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
90 void ShowPlayList( void )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
91 {
34667
7c447e9db447 Remove global variable pointing to top of playlist.
ib
parents: 34666
diff changeset
92 plItem * next;
7c447e9db447 Remove global variable pointing to top of playlist.
ib
parents: 34666
diff changeset
93
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
94 if ( PlayList ) gtkActive( PlayList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
95 else PlayList=create_PlayList();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
96
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
97 if ( old_path && *old_path )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
98 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
99 char * currentdir = strdup( old_path );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
100 char * tpath,* pos;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
101 GtkCTreeNode * node,* nextnode;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
102 gboolean leaf;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
103 tpath=strdup( "/" );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
104 pos=strtok( currentdir,"/" );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
105 node=gtk_ctree_find_by_row_data_custom( GTK_CTREE( CTDirTree ),NULL,"/",compare_func );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
106 do
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
107 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
108 char * tpathnew = g_strconcat( tpath,pos,"/",NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
109 free( tpath ); tpath=tpathnew;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
110 nextnode=gtk_ctree_find_by_row_data_custom( GTK_CTREE( CTDirTree ),node,tpath,compare_func );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
111 if ( !nextnode ) break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
112 node=nextnode;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
113 pos=strtok( NULL,"/" );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
114 gtk_ctree_get_node_info( GTK_CTREE( CTDirTree ),node,NULL,NULL,NULL,NULL,NULL,NULL,&leaf,NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
115 if ( !leaf && pos ) gtk_ctree_expand( GTK_CTREE( CTDirTree ),node );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
116 else
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
117 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
118 DirNodeType * DirNode;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
119 gtk_ctree_select( GTK_CTREE( CTDirTree ),node );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
120 DirNode=gtk_ctree_node_get_row_data( GTK_CTREE( CTDirTree ),node );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
121 current_path=DirNode->path;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
122 scan_dir( DirNode->path );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
123 free( CLFileSelected );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
124 CLFileSelected=calloc( 1,NrOfEntrys * sizeof( int ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
125 break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
126 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
127 } while( pos );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
128 free( tpath );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
129 free( currentdir );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
130 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
131 else gtk_ctree_select( GTK_CTREE( CTDirTree ),parent );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
132
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
133 gtk_clist_freeze( GTK_CLIST( CLSelected ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
134 gtk_clist_clear( GTK_CLIST( CLSelected ) );
34667
7c447e9db447 Remove global variable pointing to top of playlist.
ib
parents: 34666
diff changeset
135 next = listMgr( PLAYLIST_GET,0 );
7c447e9db447 Remove global variable pointing to top of playlist.
ib
parents: 34666
diff changeset
136 if ( next )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
137 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
138 gchar * name, * path;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
139 while ( next || next->next )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
140 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
141 char * text[1][3]; text[0][2]="";
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
142 name = g_filename_to_utf8( next->name, -1, NULL, NULL, NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
143 path = g_filename_to_utf8( next->path, -1, NULL, NULL, NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
144 text[0][0]=name ? name : next->name;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
145 text[0][1]=path ? path : next->path;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
146 gtk_clist_append( GTK_CLIST( CLSelected ),text[0] );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
147 g_free( path );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
148 g_free( name );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
149 NrOfSelected++;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
150 if ( next->next ) next=next->next; else break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
151 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
152 CLListSelected=calloc( 1,NrOfSelected * sizeof( int ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
153 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
154 gtk_clist_thaw( GTK_CLIST( CLSelected ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
155
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
156 gtk_widget_show( PlayList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
157 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
158
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
159 void HidePlayList( void )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
160 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
161 if ( !PlayList ) return;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
162 NrOfSelected=NrOfEntrys=0;
33739
9f6d46d325de Remove gfree() from interface.c.
ib
parents: 33575
diff changeset
163 nfree( CLListSelected ); nfree( CLFileSelected );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
164 free( old_path );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
165 old_path=strdup( current_path );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
166 gtk_widget_hide( PlayList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
167 gtk_widget_destroy( PlayList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
168 PlayList=NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
169 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
170
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
171 static void plRowSelect( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
172 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
173 switch ( (int) user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
174 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
175 case 0: CLFileSelected[row]=1; break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
176 case 1: CLListSelected[row]=1; break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
177 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
178 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
179
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
180 static void plUnRowSelect( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
181 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
182 switch ( (int) user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
183 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
184 case 0: CLFileSelected[row]=0; break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
185 case 1: CLListSelected[row]=0; break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
186 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
187 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
188
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
189 static void plButtonReleased( GtkButton * button,gpointer user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
190 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
191 switch ( (int) user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
192 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
193 case 1: // ok
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
194 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
195 int i;
34664
4df4d842d5fb Remove global variable pointing to current playlist item.
ib
parents: 34663
diff changeset
196 plItem * item;
34666
a5c69b91ff2c Remove unnecessary condition.
ib
parents: 34664
diff changeset
197 listMgr( PLAYLIST_DELETE,0 );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
198 for ( i=0;i<NrOfSelected;i++ )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
199 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
200 char * text[3];
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
201 item=calloc( 1,sizeof( plItem ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
202 gtk_clist_get_text( GTK_CLIST( CLSelected ),i,0,&text[0] );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
203 gtk_clist_get_text( GTK_CLIST( CLSelected ),i,1,&text[1] );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
204 item->name=g_filename_from_utf8( text[0], -1, NULL, NULL, NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
205 if ( !item->name ) item->name = strdup( text[0] );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
206 item->path=g_filename_from_utf8( text[1], -1, NULL, NULL, NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
207 if ( !item->path ) item->path = strdup( text[1] );
34681
42fa91951bd2 Rename PLAYLIST_ITEM_ADD PLAYLIST_ITEM_APPEND.
ib
parents: 34667
diff changeset
208 listMgr( PLAYLIST_ITEM_APPEND,item );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
209 }
34664
4df4d842d5fb Remove global variable pointing to current playlist item.
ib
parents: 34663
diff changeset
210 item = listMgr( PLAYLIST_ITEM_GET_CURR,0 );
4df4d842d5fb Remove global variable pointing to current playlist item.
ib
parents: 34663
diff changeset
211 if ( item )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
212 {
34664
4df4d842d5fb Remove global variable pointing to current playlist item.
ib
parents: 34663
diff changeset
213 uiSetFileName( item->path,item->name,STREAMTYPE_FILE );
4df4d842d5fb Remove global variable pointing to current playlist item.
ib
parents: 34663
diff changeset
214 // setddup( &guiInfo.Filename,item->path,item->name );
33894
b2e63fe7fe17 Remove needless guiInfo member FilenameChanged.
ib
parents: 33873
diff changeset
215 // guiInfo.NewPlay=GUI_FILE_NEW;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
216 // guiInfo.StreamType=STREAMTYPE_FILE;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
217 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
218 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
219 case 0: // cancel
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
220 HidePlayList();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
221 break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
222 case 2: // remove
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
223 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
224 int i; int j; int c=0;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
225
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
226 gtk_signal_handler_block( GTK_OBJECT( CLSelected ),sigSel );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
227 gtk_signal_handler_block( GTK_OBJECT( CLSelected ),sigUnsel );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
228 gtk_signal_handler_block( GTK_OBJECT( CLSelected ),sigEvent );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
229
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
230 gtk_clist_freeze( GTK_CLIST( CLSelected ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
231 for ( i=0;i<NrOfSelected-c;i++ )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
232 if ( CLListSelected[i] )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
233 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
234 gtk_clist_remove( GTK_CLIST( CLSelected ),i - c );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
235 c++;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
236 for ( j=i;j<NrOfSelected-c;j++ )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
237 CLListSelected[i] = CLListSelected[i+1];
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
238 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
239 NrOfSelected-=c;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
240 gtk_clist_thaw( GTK_CLIST( CLSelected ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
241
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
242 gtk_signal_handler_unblock( GTK_OBJECT( CLSelected ),sigSel );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
243 gtk_signal_handler_unblock( GTK_OBJECT( CLSelected ),sigUnsel );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
244 gtk_signal_handler_unblock( GTK_OBJECT( CLSelected ),sigEvent );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
245
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
246 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
247 break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
248 case 3: // add
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
249 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
250 int i;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
251 void *p;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
252 char * itext[1][2];
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
253 gchar * cpath;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
254 char * text[1][3]; text[0][2]="";
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
255 gtk_clist_freeze( GTK_CLIST( CLSelected ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
256 for ( i=0;i<NrOfEntrys;i++ )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
257 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
258 if ( CLFileSelected[i] )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
259 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
260 NrOfSelected++;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
261 p=realloc( CLListSelected,NrOfSelected * sizeof( int ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
262 if ( !p ) NrOfSelected--;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
263 else
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
264 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
265 CLListSelected=p;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
266 CLListSelected[NrOfSelected - 1]=0;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
267 gtk_clist_get_text( GTK_CLIST( CLFiles ),i,0,(char **)&itext );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
268 cpath=g_filename_to_utf8( current_path, -1, NULL, NULL, NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
269 text[0][0]=itext[0][0]; text[0][1]=cpath ? cpath : current_path;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
270 gtk_clist_append( GTK_CLIST( CLSelected ),text[0] );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
271 g_free( cpath );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
272 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
273 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
274 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
275 gtk_clist_thaw( GTK_CLIST( CLSelected ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
276 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
277 break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
278 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
279 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
280
34348
be4236a5186c Add Return key events to playlist buttons.
ib
parents: 34347
diff changeset
281 static gboolean plKeyReleased( GtkWidget * widget,
be4236a5186c Add Return key events to playlist buttons.
ib
parents: 34347
diff changeset
282 GdkEventKey * event,
be4236a5186c Add Return key events to playlist buttons.
ib
parents: 34347
diff changeset
283 gpointer user_data )
be4236a5186c Add Return key events to playlist buttons.
ib
parents: 34347
diff changeset
284 {
34349
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
285 if (event->keyval == GDK_Return)
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
286 {
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
287 if ( GTK_WIDGET_TYPE( widget ) == GTK_TYPE_BUTTON ) plButtonReleased( NULL, user_data );
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
288 else
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
289 {
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
290 switch ( (int) user_data )
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
291 {
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
292 case 0:
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
293 plButtonReleased( NULL, (void *) 3 );
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
294 break;
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
295 case 1:
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
296 plButtonReleased( NULL, (void *) 2 );
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
297 break;
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
298 }
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
299 }
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
300 }
34348
be4236a5186c Add Return key events to playlist buttons.
ib
parents: 34347
diff changeset
301 return FALSE;
be4236a5186c Add Return key events to playlist buttons.
ib
parents: 34347
diff changeset
302 }
be4236a5186c Add Return key events to playlist buttons.
ib
parents: 34347
diff changeset
303
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
304 static gboolean plEvent ( GtkWidget * widget,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
305 GdkEvent * event,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
306 gpointer user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
307 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
308 GdkEventButton *bevent;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
309 gint row, col;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
310
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
311 bevent = (GdkEventButton *) event;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
312
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
313 if ( event->type == GDK_BUTTON_RELEASE && bevent->button == 2 )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
314 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
315 if ( gtk_clist_get_selection_info( GTK_CLIST( widget ), bevent->x, bevent->y, &row, &col ) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
316 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
317 switch ( (int) user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
318 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
319 case 0:
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
320 CLFileSelected[row] = 1;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
321 plButtonReleased( NULL, (void *) 3 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
322 CLFileSelected[row] = 0;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
323 return TRUE;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
324
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
325 case 1:
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
326 CLListSelected[row] = 1;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
327 plButtonReleased( NULL, (void *) 2 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
328 return TRUE;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
329 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
330 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
331 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
332
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
333 return FALSE;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
334 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
335
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
336 static int check_for_subdir( gchar * path )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
337 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
338 DIR * dir;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
339 struct dirent * dirent;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
340 struct stat statbuf;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
341 gchar * npath;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
342
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
343 if ( (dir=opendir( path )) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
344 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
345 while ( (dirent=readdir( dir )) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
346 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
347 if ( dirent->d_name[0] != '.' )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
348 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
349 npath=calloc( 1,strlen( path ) + strlen( dirent->d_name ) + 3 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
350 sprintf( npath,"%s/%s",path,dirent->d_name );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
351 if ( stat( npath,&statbuf ) != -1 && S_ISDIR( statbuf.st_mode ) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
352 { free( npath ); closedir( dir ); return 1; }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
353 free( npath );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
354 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
355 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
356 closedir( dir );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
357 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
358 return 0;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
359 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
360
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
361 static void plCTree( GtkCTree * ctree,GtkCTreeNode * parent_node,gpointer user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
362 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
363 GtkCTreeNode * node;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
364 DirNodeType * DirNode;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
365 gchar * text, * name = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
366 gchar * dummy = "dummy";
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
367 int subdir = 1;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
368 DIR * dir = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
369 struct dirent * dirent;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
370 gchar * path;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
371 struct stat statbuf;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
372
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
373 DirNode=gtk_ctree_node_get_row_data( ctree,parent_node );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
374 if ( !DirNode->scaned )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
375 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
376 DirNode->scaned=1; current_path=DirNode->path;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
377 gtk_clist_freeze( GTK_CLIST( ctree ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
378 node=gtk_ctree_find_by_row_data( ctree,parent_node,NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
379 gtk_ctree_remove_node( ctree,node );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
380
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
381 if ( (dir=opendir( DirNode->path ) ) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
382 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
383 while( (dirent=readdir( dir )) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
384 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
385 path=calloc( 1,strlen( DirNode->path ) + strlen( dirent->d_name ) + 2 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
386 if ( !strcmp( current_path,"/" ) ) sprintf( path,"/%s",dirent->d_name );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
387 else sprintf( path,"%s/%s",current_path,dirent->d_name );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
388 text=dirent->d_name;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
389 g_free( name );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
390 name=g_filename_to_utf8( text, -1, NULL, NULL, NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
391
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
392 if ( stat( path,&statbuf ) != -1 && S_ISDIR( statbuf.st_mode ) && dirent->d_name[0] != '.' )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
393 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
394 DirNode=malloc( sizeof( DirNodeType ) ); DirNode->scaned=0; DirNode->path=strdup( path );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
395 subdir=check_for_subdir( path );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
396 node=gtk_ctree_insert_node( ctree,parent_node,NULL,(name ? &name : &text ),4,pxOpenedBook,msOpenedBook,pxClosedBook,msClosedBook,!subdir,FALSE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
397 gtk_ctree_node_set_row_data_full( ctree,node,DirNode,NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
398 if ( subdir ) node=gtk_ctree_insert_node( ctree,node,NULL,&dummy,4,NULL,NULL,NULL,NULL,FALSE,FALSE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
399 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
400 free( path ); path=NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
401 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
402 closedir( dir );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
403 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
404
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
405 gtk_ctree_sort_node( ctree,parent_node );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
406 gtk_clist_thaw( GTK_CLIST( ctree ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
407 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
408
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
409 g_free( name );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
410 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
411
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
412 static void scan_dir( char * path )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
413 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
414 DIR * dir = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
415 char * curr;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
416 struct dirent * dirent;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
417 struct stat statbuf;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
418 gchar * name;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
419 char * text[1][2]; text[0][1]="";
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
420
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
421 gtk_clist_clear( GTK_CLIST( CLFiles ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
422 if ( (dir=opendir( path )) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
423 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
424 NrOfEntrys=0;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
425 while( (dirent=readdir( dir )) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
426 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
427 curr=calloc( 1,strlen( path ) + strlen( dirent->d_name ) + 3 ); sprintf( curr,"%s/%s",path,dirent->d_name );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
428 if ( stat( curr,&statbuf ) != -1 && ( S_ISREG( statbuf.st_mode ) || S_ISLNK( statbuf.st_mode ) ) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
429 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
430 name=g_filename_to_utf8( dirent->d_name, -1, NULL, NULL, NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
431 text[0][0]=name ? name : dirent->d_name;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
432 gtk_clist_append( GTK_CLIST( CLFiles ), text[0] );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
433 g_free( name );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
434 NrOfEntrys++;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
435 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
436 free( curr );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
437 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
438 closedir( dir );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
439 gtk_clist_sort( GTK_CLIST( CLFiles ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
440 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
441 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
442
34466
a650895d50a5 Use correct data types and common variable names in GTK callback functions.
ib
parents: 34349
diff changeset
443 static void plCTRow(GtkCList * clist, gint row, gint column, GdkEvent * event, gpointer user_data)
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
444 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
445 DirNodeType * DirNode;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
446 GtkCTreeNode * node;
34466
a650895d50a5 Use correct data types and common variable names in GTK callback functions.
ib
parents: 34349
diff changeset
447 node=gtk_ctree_node_nth( GTK_CTREE( clist ),row );
a650895d50a5 Use correct data types and common variable names in GTK callback functions.
ib
parents: 34349
diff changeset
448 DirNode=gtk_ctree_node_get_row_data( GTK_CTREE( clist ),node );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
449 current_path=DirNode->path;
34466
a650895d50a5 Use correct data types and common variable names in GTK callback functions.
ib
parents: 34349
diff changeset
450 gtk_ctree_expand( GTK_CTREE( clist ),node );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
451 scan_dir( DirNode->path );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
452 free( CLFileSelected );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
453 CLFileSelected=calloc( 1,NrOfEntrys * sizeof( int ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
454 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
455
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
456 GtkWidget * create_PlayList( void )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
457 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
458 GtkWidget * vbox1;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
459 GtkWidget * hbox1;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
460 GtkWidget * scrolledwindow1;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
461 GtkWidget * vbox2;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
462 GtkWidget * scrolledwindow2;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
463 GtkWidget * scrolledwindow3;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
464 GtkWidget * hbuttonbox1;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
465 GtkAccelGroup * accel_group;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
466 GdkColor transparent = { 0,0,0,0 };
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
467 gchar * root = "/";
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
468 gchar * dummy = "dummy";
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
469 DirNodeType * DirNode;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
470
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
471 accel_group=gtk_accel_group_new();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
472
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
473 PlayList=gtk_window_new( GTK_WINDOW_TOPLEVEL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
474 gtk_object_set_data( GTK_OBJECT( PlayList ),"PlayList",PlayList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
475 gtk_widget_set_usize( PlayList,512,384 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
476 gtk_window_set_title( GTK_WINDOW( PlayList ),MSGTR_PlayList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
477 gtk_window_set_position( GTK_WINDOW( PlayList ),GTK_WIN_POS_CENTER );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
478 // gtk_window_set_policy( GTK_WINDOW( PlayList ),FALSE,FALSE,FALSE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
479 gtk_window_set_wmclass( GTK_WINDOW( PlayList ),"Playlist","MPlayer" );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
480
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
481 gtk_widget_realize( PlayList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
482 gtkAddIcon( PlayList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
483
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
484 vbox1=AddVBox( AddDialogFrame( PlayList ),0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
485 hbox1=AddHBox( NULL,1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
486 gtk_box_pack_start( GTK_BOX( vbox1 ),hbox1,TRUE,TRUE,0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
487
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
488 scrolledwindow1=gtk_scrolled_window_new( NULL,NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
489 gtk_widget_show( scrolledwindow1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
490 gtk_container_add( GTK_CONTAINER(
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
491 AddFrame( NULL,0,hbox1,1 ) ),scrolledwindow1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
492 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow1 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
493
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
494 CTDirTree=gtk_ctree_new( 1,0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
495 gtk_signal_connect( GTK_OBJECT( CTDirTree ),"tree_expand",GTK_SIGNAL_FUNC( plCTree ),(void*)0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
496 gtk_signal_connect( GTK_OBJECT( CTDirTree ),"select_row",GTK_SIGNAL_FUNC( plCTRow ),(void *)0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
497 gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),CTDirTree );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
498 gtk_clist_set_column_auto_resize( GTK_CLIST( CTDirTree ),0,TRUE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
499 gtk_clist_set_column_width( GTK_CLIST( CTDirTree ),0,80 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
500 gtk_clist_set_selection_mode( GTK_CLIST( CTDirTree ),GTK_SELECTION_SINGLE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
501 gtk_ctree_set_line_style( GTK_CTREE( CTDirTree ),GTK_CTREE_LINES_SOLID );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
502 gtk_clist_column_titles_show( GTK_CLIST( CTDirTree ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
503 gtk_clist_set_shadow_type( GTK_CLIST( CTDirTree ),GTK_SHADOW_NONE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
504
33575
052789583781 Remove xpm definitions inside source file.
ib
parents: 33572
diff changeset
505 if ( !pxOpenedBook ) pxOpenedBook=gdk_pixmap_create_from_xpm_d( PlayList->window,&msOpenedBook,&transparent,(gchar **)dir2_xpm );
052789583781 Remove xpm definitions inside source file.
ib
parents: 33572
diff changeset
506 if ( !pxClosedBook ) pxClosedBook=gdk_pixmap_create_from_xpm_d( PlayList->window,&msClosedBook,&transparent,(gchar **)open2_xpm );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
507
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
508 parent=gtk_ctree_insert_node( GTK_CTREE( CTDirTree ),NULL,NULL,&root,4,pxOpenedBook,msOpenedBook,pxClosedBook,msClosedBook,FALSE,FALSE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
509 DirNode=malloc( sizeof( DirNodeType ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
510 DirNode->scaned=0; DirNode->path=strdup( root );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
511 gtk_ctree_node_set_row_data_full(GTK_CTREE( CTDirTree ),parent,DirNode,NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
512 sibling=gtk_ctree_insert_node( GTK_CTREE( CTDirTree ),parent,NULL,&dummy,4,NULL,NULL,NULL,NULL,TRUE,TRUE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
513 gtk_ctree_expand( GTK_CTREE( CTDirTree ),parent );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
514 gtk_widget_show( CTDirTree );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
515
33873
983ffb8be5bd Check directory history entry prior to its usage.
ib
parents: 33788
diff changeset
516 if ( fsHistory[0] ) old_path = g_filename_from_utf8( fsHistory[0], -1, NULL, NULL, NULL );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
517
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
518 gtk_clist_set_column_widget( GTK_CLIST( CTDirTree ),0,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
519 AddLabel( MSGTR_PLAYLIST_DirectoryTree,NULL ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
520
34347
8861ea3ec08c Make column titles in playlist passive.
ib
parents: 33894
diff changeset
521 gtk_clist_column_title_passive( GTK_CLIST( CTDirTree ),0 );
8861ea3ec08c Make column titles in playlist passive.
ib
parents: 33894
diff changeset
522
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
523 vbox2=AddVBox(
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
524 AddFrame( NULL,1,hbox1,1 ),0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
525
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
526 scrolledwindow2=gtk_scrolled_window_new( NULL,NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
527 gtk_widget_show( scrolledwindow2 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
528 gtk_box_pack_start( GTK_BOX( vbox2 ),scrolledwindow2,TRUE,TRUE,0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
529 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow2 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
530
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
531 CLFiles=gtk_clist_new( 1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
532 gtk_widget_show( CLFiles );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
533 gtk_container_add( GTK_CONTAINER( scrolledwindow2 ),CLFiles );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
534 gtk_clist_set_column_width( GTK_CLIST( CLFiles ),0,80 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
535 gtk_clist_set_selection_mode( GTK_CLIST( CLFiles ),GTK_SELECTION_EXTENDED );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
536 gtk_clist_column_titles_show( GTK_CLIST( CLFiles ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
537 gtk_clist_set_shadow_type( GTK_CLIST( CLFiles ),GTK_SHADOW_NONE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
538
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
539 gtk_clist_set_column_widget( GTK_CLIST( CLFiles ),0,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
540 AddLabel( MSGTR_PLAYLIST_Files,NULL ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
541
34347
8861ea3ec08c Make column titles in playlist passive.
ib
parents: 33894
diff changeset
542 gtk_clist_column_title_passive( GTK_CLIST( CLFiles ),0 );
8861ea3ec08c Make column titles in playlist passive.
ib
parents: 33894
diff changeset
543
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
544 AddHSeparator( vbox2 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
545
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
546 scrolledwindow3=gtk_scrolled_window_new( NULL,NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
547 gtk_widget_show( scrolledwindow3 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
548 gtk_box_pack_start( GTK_BOX( vbox2 ),scrolledwindow3,TRUE,TRUE,0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
549 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow3 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
550
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
551 CLSelected=gtk_clist_new( 2 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
552 gtk_widget_show( CLSelected );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
553 gtk_container_add( GTK_CONTAINER( scrolledwindow3 ),CLSelected );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
554 gtk_clist_set_column_width( GTK_CLIST( CLSelected ),0,295 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
555 gtk_clist_set_column_width( GTK_CLIST( CLSelected ),1,295 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
556 gtk_clist_set_selection_mode( GTK_CLIST( CLSelected ),GTK_SELECTION_MULTIPLE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
557 gtk_clist_column_titles_show( GTK_CLIST( CLSelected ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
558 gtk_clist_set_shadow_type( GTK_CLIST( CLSelected ),GTK_SHADOW_NONE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
559
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
560 gtk_clist_set_column_widget( GTK_CLIST( CLSelected ),0,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
561 AddLabel( MSGTR_PLAYLIST_Selected,NULL ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
562
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
563 gtk_clist_set_column_widget( GTK_CLIST( CLSelected ),1,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
564 AddLabel( MSGTR_PLAYLIST_Path,NULL ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
565
34347
8861ea3ec08c Make column titles in playlist passive.
ib
parents: 33894
diff changeset
566 gtk_clist_column_title_passive( GTK_CLIST( CLSelected ),0 );
8861ea3ec08c Make column titles in playlist passive.
ib
parents: 33894
diff changeset
567
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
568 AddHSeparator( vbox1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
569
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
570 hbuttonbox1=AddHButtonBox( vbox1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
571 gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
572 gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
573
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
574 Add=AddButton( MSGTR_Add,hbuttonbox1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
575 Remove=AddButton( MSGTR_Remove,hbuttonbox1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
576 Ok=AddButton( MSGTR_Ok,hbuttonbox1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
577 Cancel=AddButton( MSGTR_Cancel,hbuttonbox1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
578
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
579 gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
580
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
581 gtk_signal_connect( GTK_OBJECT( PlayList ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&PlayList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
582
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
583 gtk_signal_connect( GTK_OBJECT( CLFiles ),"select_row",GTK_SIGNAL_FUNC( plRowSelect ),(void *)0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
584 gtk_signal_connect( GTK_OBJECT( CLFiles ),"unselect_row",GTK_SIGNAL_FUNC( plUnRowSelect ),(void *)0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
585 gtk_signal_connect( GTK_OBJECT( CLFiles ),"event",GTK_SIGNAL_FUNC( plEvent ),(void *)0 );
34349
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
586 gtk_signal_connect( GTK_OBJECT( CLFiles ),"key_release_event",GTK_SIGNAL_FUNC( plKeyReleased ),(void *)0 );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
587 sigSel=gtk_signal_connect( GTK_OBJECT( CLSelected ),"select_row",GTK_SIGNAL_FUNC( plRowSelect ),(void*)1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
588 sigUnsel=gtk_signal_connect( GTK_OBJECT( CLSelected ),"unselect_row",GTK_SIGNAL_FUNC( plUnRowSelect ),(void*)1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
589 sigEvent=gtk_signal_connect( GTK_OBJECT( CLSelected ),"event",GTK_SIGNAL_FUNC( plEvent ),(void *)1 );
34349
6e4af5500f8f Add Return key events to playlist's file lists.
ib
parents: 34348
diff changeset
590 gtk_signal_connect( GTK_OBJECT( CLSelected ),"key_release_event",GTK_SIGNAL_FUNC( plKeyReleased ),(void *)1 );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
591
34348
be4236a5186c Add Return key events to playlist buttons.
ib
parents: 34347
diff changeset
592 gtk_signal_connect( GTK_OBJECT( Add ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)3 );
be4236a5186c Add Return key events to playlist buttons.
ib
parents: 34347
diff changeset
593 gtk_signal_connect( GTK_OBJECT( Add ),"key_release_event",GTK_SIGNAL_FUNC( plKeyReleased ),(void*)3 );
be4236a5186c Add Return key events to playlist buttons.
ib
parents: 34347
diff changeset
594 gtk_signal_connect( GTK_OBJECT( Remove ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)2 );
be4236a5186c Add Return key events to playlist buttons.
ib
parents: 34347
diff changeset
595 gtk_signal_connect( GTK_OBJECT( Remove ),"key_release_event",GTK_SIGNAL_FUNC( plKeyReleased ),(void*)2 );
be4236a5186c Add Return key events to playlist buttons.
ib
parents: 34347
diff changeset
596 gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)1 );
be4236a5186c Add Return key events to playlist buttons.
ib
parents: 34347
diff changeset
597 gtk_signal_connect( GTK_OBJECT( Ok ),"key_release_event",GTK_SIGNAL_FUNC( plKeyReleased ),(void*)1 );
be4236a5186c Add Return key events to playlist buttons.
ib
parents: 34347
diff changeset
598 gtk_signal_connect( GTK_OBJECT( Cancel ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)0 );
be4236a5186c Add Return key events to playlist buttons.
ib
parents: 34347
diff changeset
599 gtk_signal_connect( GTK_OBJECT( Cancel ),"key_release_event",GTK_SIGNAL_FUNC( plKeyReleased ),(void*)0 );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
600
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
601 gtk_window_add_accel_group( GTK_WINDOW( PlayList ),accel_group );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
602
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
603 return PlayList;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
604 }