Mercurial > audlegacy
annotate src/audacious/ui_playlist.c @ 2902:2b379b796c84 trunk
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Sun, 24 Jun 2007 16:29:22 +0200 |
parents | 5ed0674fabd6 |
children | ef8ad0a5cbdd |
rev | line source |
---|---|
2313 | 1 /* Audacious - Cross-platform multimedia player |
2 * Copyright (C) 2005-2006 Audacious development team. | |
3 * | |
4 * BMP - Cross-platform multimedia player | |
5 * Copyright (C) 2003-2004 BMP development team. | |
6 * | |
7 * Based on XMMS: | |
8 * Copyright (C) 1998-2003 XMMS development team. | |
9 * | |
10 * This program is free software; you can redistribute it and/or modify | |
11 * it under the terms of the GNU General Public License as published by | |
12 * the Free Software Foundation; under version 2 of the License. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
20 * along with this program; if not, write to the Free Software | |
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
22 */ | |
23 | |
24 #include "ui_playlist.h" | |
25 | |
26 #include <glib.h> | |
27 #include <glib/gi18n.h> | |
28 #include <gdk/gdk.h> | |
29 #include <gdk/gdkkeysyms.h> | |
30 #include <gtk/gtk.h> | |
31 #include <string.h> | |
32 | |
33 #include "platform/smartinclude.h" | |
34 | |
35 #include <unistd.h> | |
36 #include <errno.h> | |
37 | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
38 #include "actions-playlist.h" |
2313 | 39 #include "dnd.h" |
40 #include "dock.h" | |
41 #include "hints.h" | |
42 #include "input.h" | |
43 #include "main.h" | |
44 #include "playback.h" | |
45 #include "playlist.h" | |
46 #include "playlist_container.h" | |
2499
15a1f5ee4d1c
[svn] - playlist_manager -> ui_playlist_manager, since it's a UI component.
nenolod
parents:
2495
diff
changeset
|
47 #include "ui_playlist_manager.h" |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2363
diff
changeset
|
48 #include "strings.h" |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
49 #include "ui_equalizer.h" |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
50 #include "ui_fileopener.h" |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
51 #include "ui_fileinfopopup.h" |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
52 #include "ui_main.h" |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
53 #include "ui_manager.h" |
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
54 #include "util.h" |
2313 | 55 |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
2492
diff
changeset
|
56 #include "ui_skinned_window.h" |
2901
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
57 #include "ui_skinned_button.h" |
2494
59661bd074b4
[svn] Try to put some skinned window code in a common place.
nenolod
parents:
2492
diff
changeset
|
58 |
2313 | 59 #include "icons-stock.h" |
60 #include "images/audacious_playlist.xpm" | |
61 | |
62 GtkWidget *playlistwin; | |
63 | |
64 PlayList_List *playlistwin_list = NULL; | |
2901
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
65 GtkWidget *playlistwin_shade, *playlistwin_close; |
2313 | 66 |
67 static GdkPixmap *playlistwin_bg; | |
68 static GdkBitmap *playlistwin_mask = NULL; | |
69 | |
70 static gboolean playlistwin_hint_flag = FALSE; | |
71 | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
72 static GtkWidget *playlistwin_infopopup = NULL; |
2351
911743d27aba
[svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents:
2348
diff
changeset
|
73 static guint playlistwin_infopopup_sid = 0; |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
74 |
2313 | 75 static PlaylistSlider *playlistwin_slider = NULL; |
76 static TextBox *playlistwin_time_min, *playlistwin_time_sec; | |
77 static TextBox *playlistwin_info, *playlistwin_sinfo; | |
2902
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
78 static GtkWidget *playlistwin_srew, *playlistwin_splay; |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
79 static GtkWidget *playlistwin_spause, *playlistwin_sstop; |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
80 static GtkWidget *playlistwin_sfwd, *playlistwin_seject; |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
81 static GtkWidget *playlistwin_sscroll_up, *playlistwin_sscroll_down; |
2313 | 82 |
83 static GList *playlistwin_wlist = NULL; | |
84 | |
85 void playlistwin_select_search_cbt_cb( GtkWidget *called_cbt , | |
86 gpointer other_cbt ); | |
87 static gboolean playlistwin_select_search_kp_cb( GtkWidget *entry , GdkEventKey *event , | |
88 gpointer searchdlg_win ); | |
89 | |
90 static void playlistwin_draw_frame(void); | |
91 | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
92 static gboolean playlistwin_fileinfopopup_probe(gpointer * filepopup_win); |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
93 |
2491
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
94 static gboolean playlistwin_resizing = FALSE; |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
95 static gint playlistwin_resize_x, playlistwin_resize_y; |
2313 | 96 |
97 gboolean | |
98 playlistwin_is_shaded(void) | |
99 { | |
100 return cfg.playlist_shaded; | |
101 } | |
102 | |
103 gint | |
104 playlistwin_get_width(void) | |
105 { | |
106 cfg.playlist_width /= PLAYLISTWIN_WIDTH_SNAP; | |
107 cfg.playlist_width *= PLAYLISTWIN_WIDTH_SNAP; | |
108 return cfg.playlist_width; | |
109 } | |
110 | |
111 gint | |
112 playlistwin_get_height_unshaded(void) | |
113 { | |
114 gint height; | |
115 cfg.playlist_height /= PLAYLISTWIN_HEIGHT_SNAP; | |
116 cfg.playlist_height *= PLAYLISTWIN_HEIGHT_SNAP; | |
117 height = cfg.playlist_height; | |
118 return height; | |
119 } | |
120 | |
121 gint | |
122 playlistwin_get_height_shaded(void) | |
123 { | |
124 return PLAYLISTWIN_SHADED_HEIGHT; | |
125 } | |
126 | |
127 gint | |
128 playlistwin_get_height(void) | |
129 { | |
130 if (playlistwin_is_shaded()) | |
131 return playlistwin_get_height_shaded(); | |
132 else | |
133 return playlistwin_get_height_unshaded(); | |
134 } | |
135 | |
136 void | |
137 playlistwin_get_size(gint * width, gint * height) | |
138 { | |
139 if (width) | |
140 *width = playlistwin_get_width(); | |
141 | |
142 if (height) | |
143 *height = playlistwin_get_height(); | |
144 } | |
145 | |
146 static void | |
147 playlistwin_update_info(Playlist *playlist) | |
148 { | |
149 gchar *text, *sel_text, *tot_text; | |
150 gulong selection, total; | |
151 gboolean selection_more, total_more; | |
152 | |
153 playlist_get_total_time(playlist, &total, &selection, &total_more, &selection_more); | |
154 | |
155 if (selection > 0 || (selection == 0 && !selection_more)) { | |
156 if (selection > 3600) | |
157 sel_text = | |
158 g_strdup_printf("%lu:%-2.2lu:%-2.2lu%s", selection / 3600, | |
159 (selection / 60) % 60, selection % 60, | |
160 (selection_more ? "+" : "")); | |
161 else | |
162 sel_text = | |
163 g_strdup_printf("%lu:%-2.2lu%s", selection / 60, | |
164 selection % 60, (selection_more ? "+" : "")); | |
165 } | |
166 else | |
167 sel_text = g_strdup("?"); | |
168 if (total > 0 || (total == 0 && !total_more)) { | |
169 if (total > 3600) | |
170 tot_text = | |
171 g_strdup_printf("%lu:%-2.2lu:%-2.2lu%s", total / 3600, | |
172 (total / 60) % 60, total % 60, | |
173 total_more ? "+" : ""); | |
174 else | |
175 tot_text = | |
176 g_strdup_printf("%lu:%-2.2lu%s", total / 60, total % 60, | |
177 total_more ? "+" : ""); | |
178 } | |
179 else | |
180 tot_text = g_strdup("?"); | |
181 text = g_strconcat(sel_text, "/", tot_text, NULL); | |
182 textbox_set_text(playlistwin_info, text ? text : ""); | |
183 g_free(text); | |
184 g_free(tot_text); | |
185 g_free(sel_text); | |
186 } | |
187 | |
188 static void | |
189 playlistwin_update_sinfo(Playlist *playlist) | |
190 { | |
191 gchar *posstr, *timestr, *title, *info; | |
192 gint pos, time; | |
193 | |
194 pos = playlist_get_position(playlist); | |
195 title = playlist_get_songtitle(playlist, pos); | |
196 | |
197 if (!title) { | |
198 textbox_set_text(playlistwin_sinfo, ""); | |
199 return; | |
200 } | |
201 | |
202 convert_title_text(title); | |
203 | |
204 time = playlist_get_songtime(playlist, pos); | |
205 | |
206 if (cfg.show_numbers_in_pl) | |
207 posstr = g_strdup_printf("%d. ", pos + 1); | |
208 else | |
209 posstr = g_strdup(""); | |
210 | |
211 if (time != -1) { | |
212 timestr = g_strdup_printf(" (%d:%-2.2d)", time / 60000, | |
213 (time / 1000) % 60); | |
214 } | |
215 else | |
216 timestr = g_strdup(""); | |
217 | |
218 info = g_strdup_printf("%s%s%s", posstr, title, timestr); | |
219 | |
220 g_free(posstr); | |
221 g_free(title); | |
222 g_free(timestr); | |
223 | |
224 textbox_set_text(playlistwin_sinfo, info ? info : ""); | |
225 g_free(info); | |
226 } | |
227 | |
228 gboolean | |
229 playlistwin_item_visible(gint index) | |
230 { | |
231 if (index >= playlistwin_list->pl_first | |
232 && index < | |
233 (playlistwin_list->pl_first + playlistwin_list->pl_num_visible)) | |
234 return TRUE; | |
235 return FALSE; | |
236 } | |
237 | |
238 gint | |
239 playlistwin_get_toprow(void) | |
240 { | |
241 if (playlistwin_list) | |
242 return (playlistwin_list->pl_first); | |
243 return (-1); | |
244 } | |
245 | |
246 void | |
247 playlistwin_set_toprow(gint toprow) | |
248 { | |
249 if (playlistwin_list) | |
250 playlistwin_list->pl_first = toprow; | |
251 playlistwin_update_list(playlist_get_active()); | |
252 } | |
253 | |
254 void | |
255 playlistwin_update_list(Playlist *playlist) | |
256 { | |
257 /* this can happen early on. just bail gracefully. */ | |
2363 | 258 g_return_if_fail(playlistwin_list); |
2313 | 259 |
260 widget_draw(WIDGET(playlistwin_list)); | |
261 widget_draw(WIDGET(playlistwin_slider)); | |
262 playlistwin_update_info(playlist); | |
263 playlistwin_update_sinfo(playlist); | |
264 } | |
265 | |
266 static void | |
267 playlistwin_set_mask(void) | |
268 { | |
269 GdkGC *gc; | |
270 GdkColor pattern; | |
271 | |
272 if (playlistwin_mask) | |
273 g_object_unref(playlistwin_mask); | |
274 | |
275 playlistwin_mask = | |
276 gdk_pixmap_new(playlistwin->window, playlistwin_get_width(), | |
277 playlistwin_get_height(), 1); | |
278 gc = gdk_gc_new(playlistwin_mask); | |
279 pattern.pixel = 1; | |
280 gdk_gc_set_foreground(gc, &pattern); | |
281 gdk_draw_rectangle(playlistwin_mask, gc, TRUE, 0, 0, | |
282 playlistwin_get_width(), playlistwin_get_height()); | |
283 g_object_unref(gc); | |
284 | |
285 gtk_widget_shape_combine_mask(playlistwin, playlistwin_mask, 0, 0); | |
286 } | |
287 | |
288 static void | |
289 playlistwin_set_geometry_hints(gboolean shaded) | |
290 { | |
291 GdkGeometry geometry; | |
292 GdkWindowHints mask; | |
293 | |
294 geometry.min_width = PLAYLISTWIN_MIN_WIDTH; | |
295 geometry.max_width = G_MAXUINT16; | |
296 | |
297 geometry.width_inc = PLAYLISTWIN_WIDTH_SNAP; | |
298 geometry.height_inc = PLAYLISTWIN_HEIGHT_SNAP; | |
299 | |
300 if (shaded) { | |
301 geometry.min_height = PLAYLISTWIN_SHADED_HEIGHT; | |
302 geometry.max_height = PLAYLISTWIN_SHADED_HEIGHT; | |
303 geometry.base_height = PLAYLISTWIN_SHADED_HEIGHT; | |
304 } | |
305 else { | |
306 geometry.min_height = PLAYLISTWIN_MIN_HEIGHT; | |
307 geometry.max_height = G_MAXUINT16; | |
308 } | |
309 | |
310 mask = GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE | GDK_HINT_RESIZE_INC; | |
311 | |
312 gtk_window_set_geometry_hints(GTK_WINDOW(playlistwin), | |
313 playlistwin, &geometry, mask); | |
314 } | |
315 | |
316 void | |
317 playlistwin_set_sinfo_font(gchar *font) | |
318 { | |
319 gchar *tmp = NULL, *tmp2 = NULL; | |
320 | |
2363 | 321 g_return_if_fail(font); |
2313 | 322 |
323 tmp = g_strdup(font); | |
2363 | 324 g_return_if_fail(tmp); |
2313 | 325 |
326 *strrchr(tmp, ' ') = '\0'; | |
327 tmp2 = g_strdup_printf("%s 8", tmp); | |
2363 | 328 g_return_if_fail(tmp2); |
329 | |
2313 | 330 textbox_set_xfont(playlistwin_sinfo, cfg.mainwin_use_xfont, tmp2); |
331 | |
2363 | 332 g_free(tmp); |
333 g_free(tmp2); | |
2313 | 334 } |
335 | |
336 void | |
337 playlistwin_set_sinfo_scroll(gboolean scroll) | |
338 { | |
339 if(playlistwin_is_shaded()) | |
340 textbox_set_scroll(playlistwin_sinfo, cfg.autoscroll); | |
341 else | |
342 textbox_set_scroll(playlistwin_sinfo, FALSE); | |
343 } | |
344 | |
345 void | |
346 playlistwin_set_shade(gboolean shaded) | |
347 { | |
348 cfg.playlist_shaded = shaded; | |
349 | |
350 if (shaded) { | |
351 playlistwin_set_sinfo_font(cfg.playlist_font); | |
352 playlistwin_set_sinfo_scroll(cfg.autoscroll); | |
353 widget_show(WIDGET(playlistwin_sinfo)); | |
2901
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
354 UI_SKINNED_BUTTON(playlistwin_shade)->nx = 128; |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
355 UI_SKINNED_BUTTON(playlistwin_shade)->ny = 45; |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
356 UI_SKINNED_BUTTON(playlistwin_shade)->px = 150; |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
357 UI_SKINNED_BUTTON(playlistwin_shade)->py = 42; |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
358 UI_SKINNED_BUTTON(playlistwin_close)->nx = 138; |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
359 UI_SKINNED_BUTTON(playlistwin_close)->ny = 45; |
2313 | 360 } |
361 else { | |
362 widget_hide(WIDGET(playlistwin_sinfo)); | |
363 playlistwin_set_sinfo_scroll(FALSE); | |
2901
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
364 UI_SKINNED_BUTTON(playlistwin_shade)->nx = 157; |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
365 UI_SKINNED_BUTTON(playlistwin_shade)->ny = 3; |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
366 UI_SKINNED_BUTTON(playlistwin_shade)->px = 62; |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
367 UI_SKINNED_BUTTON(playlistwin_shade)->py = 42; |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
368 UI_SKINNED_BUTTON(playlistwin_close)->nx = 167; |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
369 UI_SKINNED_BUTTON(playlistwin_close)->ny = 3; |
2313 | 370 } |
371 | |
372 dock_shade(dock_window_list, GTK_WINDOW(playlistwin), | |
373 playlistwin_get_height()); | |
374 | |
375 playlistwin_set_geometry_hints(cfg.playlist_shaded); | |
376 | |
377 gtk_window_resize(GTK_WINDOW(playlistwin), | |
378 playlistwin_get_width(), | |
379 playlistwin_get_height()); | |
380 | |
381 playlistwin_set_mask(); | |
382 | |
383 widget_draw(WIDGET(playlistwin_list)); | |
384 widget_draw(WIDGET(playlistwin_slider)); | |
385 | |
386 draw_playlist_window(TRUE); | |
387 } | |
388 | |
389 static void | |
390 playlistwin_set_shade_menu(gboolean shaded) | |
391 { | |
392 GtkAction *action = gtk_action_group_get_action( | |
393 toggleaction_group_others , "roll up playlist editor" ); | |
394 gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , shaded ); | |
395 | |
396 playlistwin_set_shade(shaded); | |
397 playlistwin_update_list(playlist_get_active()); | |
398 } | |
399 | |
400 void | |
401 playlistwin_shade_toggle(void) | |
402 { | |
403 playlistwin_set_shade_menu(!cfg.playlist_shaded); | |
404 } | |
405 | |
406 static void | |
407 playlistwin_release(GtkWidget * widget, | |
408 GdkEventButton * event, | |
409 gpointer callback_data) | |
410 { | |
411 if (event->button == 3) | |
412 return; | |
413 | |
414 gdk_pointer_ungrab(GDK_CURRENT_TIME); | |
415 playlistwin_resizing = FALSE; | |
416 gdk_flush(); | |
417 | |
418 if (dock_is_moving(GTK_WINDOW(playlistwin))) | |
419 dock_move_release(GTK_WINDOW(playlistwin)); | |
420 else | |
421 { | |
422 handle_release_cb(playlistwin_wlist, widget, event); | |
423 draw_playlist_window(FALSE); | |
424 } | |
425 } | |
426 | |
427 void | |
428 playlistwin_scroll(gint num) | |
429 { | |
430 playlistwin_list->pl_first += num; | |
431 playlistwin_update_list(playlist_get_active()); | |
432 } | |
433 | |
434 void | |
435 playlistwin_scroll_up_pushed(void) | |
436 { | |
437 playlistwin_scroll(-3); | |
438 } | |
439 | |
440 void | |
441 playlistwin_scroll_down_pushed(void) | |
442 { | |
443 playlistwin_scroll(3); | |
444 } | |
445 | |
446 static void | |
447 playlistwin_select_all(void) | |
448 { | |
449 Playlist *playlist = playlist_get_active(); | |
450 | |
451 playlist_select_all(playlist, TRUE); | |
452 playlistwin_list->pl_prev_selected = 0; | |
453 playlistwin_list->pl_prev_min = 0; | |
454 playlistwin_list->pl_prev_max = playlist_get_length(playlist) - 1; | |
455 playlistwin_update_list(playlist); | |
456 } | |
457 | |
458 static void | |
459 playlistwin_select_none(void) | |
460 { | |
461 playlist_select_all(playlist_get_active(), FALSE); | |
462 playlistwin_list->pl_prev_selected = -1; | |
463 playlistwin_list->pl_prev_min = -1; | |
464 playlistwin_update_list(playlist_get_active()); | |
465 } | |
466 | |
467 static void | |
468 playlistwin_select_search(void) | |
469 { | |
470 Playlist *playlist = playlist_get_active(); | |
471 GtkWidget *searchdlg_win, *searchdlg_table; | |
472 GtkWidget *searchdlg_hbox, *searchdlg_logo, *searchdlg_helptext; | |
2807
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
473 GtkWidget *searchdlg_entry_title, *searchdlg_label_title; |
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
474 GtkWidget *searchdlg_entry_album, *searchdlg_label_album; |
2313 | 475 GtkWidget *searchdlg_entry_file_name, *searchdlg_label_file_name; |
476 GtkWidget *searchdlg_entry_performer, *searchdlg_label_performer; | |
477 GtkWidget *searchdlg_checkbt_clearprevsel; | |
478 GtkWidget *searchdlg_checkbt_newplaylist; | |
479 GtkWidget *searchdlg_checkbt_autoenqueue; | |
480 gint result; | |
481 | |
482 /* create dialog */ | |
483 searchdlg_win = gtk_dialog_new_with_buttons( | |
484 _("Search entries in active playlist") , GTK_WINDOW(mainwin) , | |
485 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT , | |
486 GTK_STOCK_CANCEL , GTK_RESPONSE_REJECT , GTK_STOCK_OK , GTK_RESPONSE_ACCEPT , NULL ); | |
487 /* help text and logo */ | |
488 searchdlg_hbox = gtk_hbox_new( FALSE , 4 ); | |
489 searchdlg_logo = gtk_image_new_from_stock( GTK_STOCK_FIND , GTK_ICON_SIZE_DIALOG ); | |
490 searchdlg_helptext = gtk_label_new( _("Select entries in playlist by filling one or more " | |
491 "fields. Fields use regular expressions syntax, case-insensitive. If you don't know how " | |
492 "regular expressions work, simply insert a literal portion of what you're searching for.") ); | |
493 gtk_label_set_line_wrap( GTK_LABEL(searchdlg_helptext) , TRUE ); | |
494 gtk_box_pack_start( GTK_BOX(searchdlg_hbox) , searchdlg_logo , FALSE , FALSE , 0 ); | |
495 gtk_box_pack_start( GTK_BOX(searchdlg_hbox) , searchdlg_helptext , FALSE , FALSE , 0 ); | |
2807
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
496 /* title */ |
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
497 searchdlg_label_title = gtk_label_new( _("Title: ") ); |
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
498 searchdlg_entry_title = gtk_entry_new(); |
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
499 gtk_misc_set_alignment( GTK_MISC(searchdlg_label_title) , 0 , 0.5 ); |
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
500 g_signal_connect( G_OBJECT(searchdlg_entry_title) , "key-press-event" , |
2313 | 501 G_CALLBACK(playlistwin_select_search_kp_cb) , searchdlg_win ); |
2807
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
502 /* album */ |
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
503 searchdlg_label_album= gtk_label_new( _("Album: ") ); |
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
504 searchdlg_entry_album= gtk_entry_new(); |
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
505 gtk_misc_set_alignment( GTK_MISC(searchdlg_label_album) , 0 , 0.5 ); |
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
506 g_signal_connect( G_OBJECT(searchdlg_entry_album) , "key-press-event" , |
2313 | 507 G_CALLBACK(playlistwin_select_search_kp_cb) , searchdlg_win ); |
508 /* artist */ | |
509 searchdlg_label_performer = gtk_label_new( _("Artist: ") ); | |
510 searchdlg_entry_performer = gtk_entry_new(); | |
511 gtk_misc_set_alignment( GTK_MISC(searchdlg_label_performer) , 0 , 0.5 ); | |
512 g_signal_connect( G_OBJECT(searchdlg_entry_performer) , "key-press-event" , | |
513 G_CALLBACK(playlistwin_select_search_kp_cb) , searchdlg_win ); | |
514 /* file name */ | |
515 searchdlg_label_file_name = gtk_label_new( _("Filename: ") ); | |
516 searchdlg_entry_file_name = gtk_entry_new(); | |
517 gtk_misc_set_alignment( GTK_MISC(searchdlg_label_file_name) , 0 , 0.5 ); | |
518 g_signal_connect( G_OBJECT(searchdlg_entry_file_name) , "key-press-event" , | |
519 G_CALLBACK(playlistwin_select_search_kp_cb) , searchdlg_win ); | |
520 /* some options that control behaviour */ | |
521 searchdlg_checkbt_clearprevsel = gtk_check_button_new_with_label( | |
522 _("Clear previous selection before searching") ); | |
523 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(searchdlg_checkbt_clearprevsel) , TRUE ); | |
524 searchdlg_checkbt_autoenqueue = gtk_check_button_new_with_label( | |
525 _("Automatically toggle queue for matching entries") ); | |
526 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(searchdlg_checkbt_autoenqueue) , FALSE ); | |
527 searchdlg_checkbt_newplaylist = gtk_check_button_new_with_label( | |
528 _("Create a new playlist with matching entries") ); | |
529 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(searchdlg_checkbt_newplaylist) , FALSE ); | |
530 g_signal_connect( G_OBJECT(searchdlg_checkbt_autoenqueue) , "clicked" , | |
531 G_CALLBACK(playlistwin_select_search_cbt_cb) , searchdlg_checkbt_newplaylist ); | |
532 g_signal_connect( G_OBJECT(searchdlg_checkbt_newplaylist) , "clicked" , | |
533 G_CALLBACK(playlistwin_select_search_cbt_cb) , searchdlg_checkbt_autoenqueue ); | |
534 /* place fields in searchdlg_table */ | |
535 searchdlg_table = gtk_table_new( 8 , 2 , FALSE ); | |
536 gtk_table_set_row_spacing( GTK_TABLE(searchdlg_table) , 0 , 8 ); | |
537 gtk_table_set_row_spacing( GTK_TABLE(searchdlg_table) , 4 , 8 ); | |
538 gtk_table_attach( GTK_TABLE(searchdlg_table) , searchdlg_hbox , | |
539 0 , 2 , 0 , 1 , GTK_FILL | GTK_EXPAND , GTK_FILL | GTK_EXPAND , 0 , 2 ); | |
2807
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
540 gtk_table_attach( GTK_TABLE(searchdlg_table) , searchdlg_label_title , |
2313 | 541 0 , 1 , 1 , 2 , GTK_FILL , GTK_FILL | GTK_EXPAND , 0 , 2 ); |
2807
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
542 gtk_table_attach( GTK_TABLE(searchdlg_table) , searchdlg_entry_title , |
2313 | 543 1 , 2 , 1 , 2 , GTK_FILL | GTK_EXPAND , GTK_FILL | GTK_EXPAND , 0 , 2 ); |
2807
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
544 gtk_table_attach( GTK_TABLE(searchdlg_table) , searchdlg_label_album, |
2313 | 545 0 , 1 , 2 , 3 , GTK_FILL , GTK_FILL | GTK_EXPAND , 0 , 2 ); |
2807
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
546 gtk_table_attach( GTK_TABLE(searchdlg_table) , searchdlg_entry_album, |
2313 | 547 1 , 2 , 2 , 3 , GTK_FILL | GTK_EXPAND , GTK_FILL | GTK_EXPAND , 0 , 2 ); |
548 gtk_table_attach( GTK_TABLE(searchdlg_table) , searchdlg_label_performer , | |
549 0 , 1 , 3 , 4 , GTK_FILL , GTK_FILL | GTK_EXPAND , 0 , 2 ); | |
550 gtk_table_attach( GTK_TABLE(searchdlg_table) , searchdlg_entry_performer , | |
551 1 , 2 , 3 , 4 , GTK_FILL | GTK_EXPAND , GTK_FILL | GTK_EXPAND , 0 , 2 ); | |
552 gtk_table_attach( GTK_TABLE(searchdlg_table) , searchdlg_label_file_name , | |
553 0 , 1 , 4 , 5 , GTK_FILL , GTK_FILL | GTK_EXPAND , 0 , 2 ); | |
554 gtk_table_attach( GTK_TABLE(searchdlg_table) , searchdlg_entry_file_name , | |
555 1 , 2 , 4 , 5 , GTK_FILL | GTK_EXPAND , GTK_FILL | GTK_EXPAND , 0 , 2 ); | |
556 gtk_table_attach( GTK_TABLE(searchdlg_table) , searchdlg_checkbt_clearprevsel , | |
557 0 , 2 , 5 , 6 , GTK_FILL | GTK_EXPAND , GTK_FILL | GTK_EXPAND , 0 , 1 ); | |
558 gtk_table_attach( GTK_TABLE(searchdlg_table) , searchdlg_checkbt_autoenqueue , | |
559 0 , 2 , 6 , 7 , GTK_FILL | GTK_EXPAND , GTK_FILL | GTK_EXPAND , 0 , 1 ); | |
560 gtk_table_attach( GTK_TABLE(searchdlg_table) , searchdlg_checkbt_newplaylist , | |
561 0 , 2 , 7 , 8 , GTK_FILL | GTK_EXPAND , GTK_FILL | GTK_EXPAND , 0 , 1 ); | |
562 | |
563 gtk_container_set_border_width( GTK_CONTAINER(searchdlg_table) , 5 ); | |
564 gtk_container_add( GTK_CONTAINER(GTK_DIALOG(searchdlg_win)->vbox) , searchdlg_table ); | |
565 gtk_widget_show_all( searchdlg_win ); | |
566 result = gtk_dialog_run( GTK_DIALOG(searchdlg_win) ); | |
567 switch(result) | |
568 { | |
569 case GTK_RESPONSE_ACCEPT: | |
570 { | |
571 gint matched_entries_num = 0; | |
572 /* create a TitleInput tuple with user search data */ | |
573 TitleInput *tuple = g_malloc(sizeof(TitleInput)); | |
574 gchar *searchdata = NULL; | |
2807
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
575 searchdata = (gchar*)gtk_entry_get_text( GTK_ENTRY(searchdlg_entry_title) ); |
2313 | 576 tuple->track_name = ( strcmp(searchdata,"") ) ? g_strdup(searchdata) : NULL; |
2807
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
577 searchdata = (gchar*)gtk_entry_get_text( GTK_ENTRY(searchdlg_entry_album) ); |
2313 | 578 tuple->album_name = ( strcmp(searchdata,"") ) ? g_strdup(searchdata) : NULL; |
579 searchdata = (gchar*)gtk_entry_get_text( GTK_ENTRY(searchdlg_entry_performer) ); | |
580 tuple->performer = ( strcmp(searchdata,"") ) ? g_strdup(searchdata) : NULL; | |
581 searchdata = (gchar*)gtk_entry_get_text( GTK_ENTRY(searchdlg_entry_file_name) ); | |
582 tuple->file_name = ( strcmp(searchdata,"") ) ? g_strdup(searchdata) : NULL; | |
583 /* check if previous selection should be cleared before searching */ | |
584 if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(searchdlg_checkbt_clearprevsel)) == TRUE ) | |
585 playlistwin_select_none(); | |
586 /* now send this tuple to the real search function */ | |
587 matched_entries_num = playlist_select_search( playlist , tuple , 0 ); | |
588 /* we do not need the tuple and its data anymore */ | |
589 if ( tuple->track_name != NULL ) g_free( tuple->track_name ); | |
590 if ( tuple->album_name != NULL ) g_free( tuple->album_name ); | |
591 if ( tuple->performer != NULL ) g_free( tuple->performer ); | |
592 if ( tuple->file_name != NULL ) g_free( tuple->file_name ); | |
593 g_free( tuple ); | |
594 playlistwin_update_list(playlist_get_active()); | |
595 /* check if a new playlist should be created after searching */ | |
596 if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(searchdlg_checkbt_newplaylist)) == TRUE ) | |
597 playlist_new_from_selected(); | |
598 /* check if matched entries should be queued */ | |
599 else if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(searchdlg_checkbt_autoenqueue)) == TRUE ) | |
600 playlist_queue(playlist_get_active()); | |
601 break; | |
602 } | |
603 default: | |
604 break; | |
605 } | |
606 /* done here :) */ | |
607 gtk_widget_destroy( searchdlg_win ); | |
608 } | |
609 | |
610 static void | |
611 playlistwin_inverse_selection(void) | |
612 { | |
613 playlist_select_invert_all(playlist_get_active()); | |
614 playlistwin_list->pl_prev_selected = -1; | |
615 playlistwin_list->pl_prev_min = -1; | |
616 playlistwin_update_list(playlist_get_active()); | |
617 } | |
618 | |
619 static void | |
620 playlistwin_resize(gint width, gint height) | |
621 { | |
2491
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
622 gint tx, ty; |
2507
e07c141dd326
[svn] - made new functions: widget_move_relative and widget_resize_relative
mf0102
parents:
2499
diff
changeset
|
623 gint dx, dy; |
2313 | 624 gboolean redraw; |
625 | |
626 g_return_if_fail(width > 0 && height > 0); | |
627 | |
2491
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
628 tx = (width - PLAYLISTWIN_MIN_WIDTH) / PLAYLISTWIN_WIDTH_SNAP; |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
629 tx = (tx * PLAYLISTWIN_WIDTH_SNAP) + PLAYLISTWIN_MIN_WIDTH; |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
630 if (tx < PLAYLISTWIN_MIN_WIDTH) |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
631 tx = PLAYLISTWIN_MIN_WIDTH; |
2313 | 632 |
633 if (!cfg.playlist_shaded) | |
2491
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
634 { |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
635 ty = (height - PLAYLISTWIN_MIN_HEIGHT) / PLAYLISTWIN_HEIGHT_SNAP; |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
636 ty = (ty * PLAYLISTWIN_HEIGHT_SNAP) + PLAYLISTWIN_MIN_HEIGHT; |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
637 if (ty < PLAYLISTWIN_MIN_HEIGHT) |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
638 ty = PLAYLISTWIN_MIN_HEIGHT; |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
639 } |
2313 | 640 else |
2491
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
641 ty = cfg.playlist_height; |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
642 |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
643 if (tx == cfg.playlist_width && ty == cfg.playlist_height) |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
644 return; |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
645 |
2507
e07c141dd326
[svn] - made new functions: widget_move_relative and widget_resize_relative
mf0102
parents:
2499
diff
changeset
|
646 /* difference between previous size and new size */ |
e07c141dd326
[svn] - made new functions: widget_move_relative and widget_resize_relative
mf0102
parents:
2499
diff
changeset
|
647 dx = tx - cfg.playlist_width; |
e07c141dd326
[svn] - made new functions: widget_move_relative and widget_resize_relative
mf0102
parents:
2499
diff
changeset
|
648 dy = ty - cfg.playlist_height; |
e07c141dd326
[svn] - made new functions: widget_move_relative and widget_resize_relative
mf0102
parents:
2499
diff
changeset
|
649 |
2491
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
650 cfg.playlist_width = width = tx; |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
651 cfg.playlist_height = height = ty; |
2313 | 652 |
653 | |
2507
e07c141dd326
[svn] - made new functions: widget_move_relative and widget_resize_relative
mf0102
parents:
2499
diff
changeset
|
654 widget_resize_relative(WIDGET(playlistwin_list), dx, dy); |
2313 | 655 |
2507
e07c141dd326
[svn] - made new functions: widget_move_relative and widget_resize_relative
mf0102
parents:
2499
diff
changeset
|
656 widget_move_relative(WIDGET(playlistwin_slider), dx, 0); |
e07c141dd326
[svn] - made new functions: widget_move_relative and widget_resize_relative
mf0102
parents:
2499
diff
changeset
|
657 widget_resize_relative(WIDGET(playlistwin_slider), 0, dy); |
2313 | 658 |
2507
e07c141dd326
[svn] - made new functions: widget_move_relative and widget_resize_relative
mf0102
parents:
2499
diff
changeset
|
659 widget_resize_relative(WIDGET(playlistwin_sinfo), dx, 0); |
2313 | 660 playlistwin_update_sinfo(playlist_get_active()); |
661 | |
2901
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
662 ui_skinned_button_move_relative(playlistwin_shade, dx, 0); |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
663 ui_skinned_button_move_relative(playlistwin_close, dx, 0); |
2507
e07c141dd326
[svn] - made new functions: widget_move_relative and widget_resize_relative
mf0102
parents:
2499
diff
changeset
|
664 widget_move_relative(WIDGET(playlistwin_time_min), dx, dy); |
e07c141dd326
[svn] - made new functions: widget_move_relative and widget_resize_relative
mf0102
parents:
2499
diff
changeset
|
665 widget_move_relative(WIDGET(playlistwin_time_sec), dx, dy); |
e07c141dd326
[svn] - made new functions: widget_move_relative and widget_resize_relative
mf0102
parents:
2499
diff
changeset
|
666 widget_move_relative(WIDGET(playlistwin_info), dx, dy); |
2902
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
667 ui_skinned_button_move_relative(playlistwin_srew, dx, dy); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
668 ui_skinned_button_move_relative(playlistwin_splay, dx, dy); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
669 ui_skinned_button_move_relative(playlistwin_spause, dx, dy); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
670 ui_skinned_button_move_relative(playlistwin_sstop, dx, dy); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
671 ui_skinned_button_move_relative(playlistwin_sfwd, dx, dy); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
672 ui_skinned_button_move_relative(playlistwin_seject, dx, dy); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
673 ui_skinned_button_move_relative(playlistwin_sscroll_up, dx, dy); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
674 ui_skinned_button_move_relative(playlistwin_sscroll_down, dx, dy); |
2313 | 675 |
676 g_object_unref(playlistwin_bg); | |
677 playlistwin_bg = gdk_pixmap_new(playlistwin->window, width, height, -1); | |
678 playlistwin_set_mask(); | |
679 | |
680 widget_list_lock(playlistwin_wlist); | |
681 | |
682 widget_list_change_pixmap(playlistwin_wlist, playlistwin_bg); | |
683 playlistwin_draw_frame(); | |
684 widget_list_draw(playlistwin_wlist, &redraw, TRUE); | |
685 widget_list_clear_redraw(playlistwin_wlist); | |
686 | |
687 widget_list_unlock(playlistwin_wlist); | |
688 | |
689 gdk_window_set_back_pixmap(playlistwin->window, playlistwin_bg, 0); | |
690 gdk_window_clear(playlistwin->window); | |
691 } | |
692 | |
693 static void | |
694 playlistwin_motion(GtkWidget * widget, | |
695 GdkEventMotion * event, | |
696 gpointer callback_data) | |
697 { | |
698 GdkEvent *gevent; | |
699 | |
2491
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
700 /* |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
701 * GDK2's resize is broken and doesn't really play nice, so we have |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
702 * to do all of this stuff by hand. |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
703 */ |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
704 if (playlistwin_resizing == TRUE) |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
705 { |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
706 if (event->x + playlistwin_resize_x != playlistwin_get_width() || |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
707 event->y + playlistwin_resize_y != playlistwin_get_height()) |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
708 { |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
709 playlistwin_resize(event->x + playlistwin_resize_x, |
2507
e07c141dd326
[svn] - made new functions: widget_move_relative and widget_resize_relative
mf0102
parents:
2499
diff
changeset
|
710 event->y + playlistwin_resize_y); |
2491
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
711 } |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
712 gdk_window_resize(playlistwin->window, |
2507
e07c141dd326
[svn] - made new functions: widget_move_relative and widget_resize_relative
mf0102
parents:
2499
diff
changeset
|
713 cfg.playlist_width, cfg.playlist_height); |
2491
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
714 } |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
715 else if (dock_is_moving(GTK_WINDOW(playlistwin))) |
2313 | 716 dock_move_motion(GTK_WINDOW(playlistwin), event); |
2491
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
717 else |
2aeea41ef023
[svn] - using ConfigureNotify for resizing is wrong per ICCCM guideline,
nenolod
parents:
2461
diff
changeset
|
718 { |
2313 | 719 handle_motion_cb(playlistwin_wlist, widget, event); |
720 draw_playlist_window(FALSE); | |
721 } | |
722 gdk_flush(); | |
723 | |
2601 | 724 while ((gevent = gdk_event_get()) != NULL) gdk_event_free(gevent); |
2313 | 725 } |
726 | |
727 static void | |
728 playlistwin_enter(GtkWidget * widget, | |
729 GdkEventMotion * event, | |
730 gpointer callback_data) | |
731 { | |
732 playlistwin_list->pl_tooltips = TRUE; | |
733 } | |
734 | |
735 static void | |
736 playlistwin_leave(GtkWidget * widget, | |
737 GdkEventMotion * event, | |
738 gpointer callback_data) | |
739 { | |
740 playlistwin_list->pl_tooltips = FALSE; | |
741 } | |
742 | |
743 static void | |
744 playlistwin_show_filebrowser(void) | |
745 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
746 run_filebrowser(NO_PLAY_BUTTON); |
2313 | 747 } |
748 | |
749 static void | |
750 playlistwin_fileinfo(void) | |
751 { | |
752 Playlist *playlist = playlist_get_active(); | |
753 | |
754 /* Show the first selected file, or the current file if nothing is | |
755 * selected */ | |
756 GList *list = playlist_get_selected(playlist); | |
757 if (list) { | |
758 playlist_fileinfo(playlist, GPOINTER_TO_INT(list->data)); | |
759 g_list_free(list); | |
760 } | |
761 else | |
762 playlist_fileinfo_current(playlist); | |
763 } | |
764 | |
765 static void | |
2363 | 766 show_playlist_save_error(GtkWindow *parent, |
767 const gchar *filename) | |
2313 | 768 { |
769 GtkWidget *dialog; | |
770 | |
771 g_return_if_fail(GTK_IS_WINDOW(parent)); | |
2363 | 772 g_return_if_fail(filename); |
2313 | 773 |
774 dialog = gtk_message_dialog_new(GTK_WINDOW(parent), | |
775 GTK_DIALOG_DESTROY_WITH_PARENT, | |
776 GTK_MESSAGE_ERROR, | |
777 GTK_BUTTONS_OK, | |
778 _("Error writing playlist \"%s\": %s"), | |
779 filename, strerror(errno)); | |
780 | |
2640 | 781 gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); /* centering */ |
2313 | 782 gtk_dialog_run(GTK_DIALOG(dialog)); |
783 gtk_widget_destroy(dialog); | |
784 } | |
785 | |
786 static gboolean | |
787 show_playlist_overwrite_prompt(GtkWindow * parent, | |
788 const gchar * filename) | |
789 { | |
790 GtkWidget *dialog; | |
791 gint result; | |
792 | |
793 g_return_val_if_fail(GTK_IS_WINDOW(parent), FALSE); | |
794 g_return_val_if_fail(filename != NULL, FALSE); | |
795 | |
796 dialog = gtk_message_dialog_new(GTK_WINDOW(parent), | |
797 GTK_DIALOG_DESTROY_WITH_PARENT, | |
798 GTK_MESSAGE_QUESTION, | |
799 GTK_BUTTONS_YES_NO, | |
800 _("%s already exist. Continue?"), | |
801 filename); | |
802 | |
2635 | 803 gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); /* centering */ |
2313 | 804 result = gtk_dialog_run(GTK_DIALOG(dialog)); |
805 gtk_widget_destroy(dialog); | |
806 | |
807 return (result == GTK_RESPONSE_YES); | |
808 } | |
809 | |
810 static void | |
811 show_playlist_save_format_error(GtkWindow * parent, | |
812 const gchar * filename) | |
813 { | |
814 const gchar *markup = | |
815 N_("<b><big>Unable to save playlist.</big></b>\n\n" | |
816 "Unknown file type for '%s'.\n"); | |
817 | |
818 GtkWidget *dialog; | |
819 | |
820 g_return_if_fail(GTK_IS_WINDOW(parent)); | |
821 g_return_if_fail(filename != NULL); | |
822 | |
823 dialog = | |
824 gtk_message_dialog_new_with_markup(GTK_WINDOW(parent), | |
825 GTK_DIALOG_DESTROY_WITH_PARENT, | |
826 GTK_MESSAGE_ERROR, | |
827 GTK_BUTTONS_OK, | |
828 _(markup), | |
829 filename); | |
2640 | 830 |
831 gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); /* centering */ | |
2313 | 832 gtk_dialog_run(GTK_DIALOG(dialog)); |
833 gtk_widget_destroy(dialog); | |
834 } | |
835 | |
836 static void | |
837 playlistwin_save_playlist(const gchar * filename) | |
838 { | |
839 PlaylistContainer *plc; | |
840 gchar *ext = strrchr(filename, '.') + 1; | |
841 | |
842 plc = playlist_container_find(ext); | |
843 if (plc == NULL) { | |
844 show_playlist_save_format_error(GTK_WINDOW(playlistwin), filename); | |
845 return; | |
846 } | |
847 | |
848 str_replace_in(&cfg.playlist_path, g_path_get_dirname(filename)); | |
849 | |
850 if (g_file_test(filename, G_FILE_TEST_IS_REGULAR)) | |
851 if (!show_playlist_overwrite_prompt(GTK_WINDOW(playlistwin), filename)) | |
852 return; | |
853 | |
854 if (!playlist_save(playlist_get_active(), filename)) | |
855 show_playlist_save_error(GTK_WINDOW(playlistwin), filename); | |
856 } | |
857 | |
858 static void | |
859 playlistwin_load_playlist(const gchar * filename) | |
860 { | |
861 Playlist *playlist = playlist_get_active(); | |
862 | |
863 g_return_if_fail(filename != NULL); | |
864 | |
2640 | 865 str_replace_in(&cfg.playlist_path, g_path_get_dirname(filename)); |
2313 | 866 |
867 playlist_clear(playlist); | |
868 mainwin_clear_song_info(); | |
869 mainwin_set_info_text(); | |
870 | |
871 playlist_load(playlist, filename); | |
872 playlist_set_current_name(playlist, filename); | |
873 } | |
874 | |
875 static gchar * | |
876 playlist_file_selection_load(const gchar * title, | |
877 const gchar * default_filename) | |
878 { | |
2514
7934ac463591
[svn] - removed unused function bmp_menu_translate()
mf0102
parents:
2508
diff
changeset
|
879 GtkWidget *dialog; |
2313 | 880 gchar *filename; |
881 | |
882 g_return_val_if_fail(title != NULL, NULL); | |
883 | |
2514
7934ac463591
[svn] - removed unused function bmp_menu_translate()
mf0102
parents:
2508
diff
changeset
|
884 dialog = make_filebrowser(title, FALSE); |
2640 | 885 gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), cfg.playlist_path); |
2514
7934ac463591
[svn] - removed unused function bmp_menu_translate()
mf0102
parents:
2508
diff
changeset
|
886 gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), default_filename); |
2640 | 887 gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); /* centering */ |
2313 | 888 |
889 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) | |
890 filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); | |
891 else | |
892 filename = NULL; | |
893 | |
2514
7934ac463591
[svn] - removed unused function bmp_menu_translate()
mf0102
parents:
2508
diff
changeset
|
894 gtk_widget_destroy(dialog); |
2313 | 895 return filename; |
896 } | |
897 | |
2636 | 898 static void |
899 on_static_toggle(GtkToggleButton *button, gpointer data) | |
900 { | |
901 Playlist *playlist = playlist_get_active(); | |
902 | |
903 playlist->attribute = | |
2640 | 904 gtk_toggle_button_get_active(button) ? |
905 playlist->attribute | PLAYLIST_STATIC : | |
906 playlist->attribute & ~PLAYLIST_STATIC; | |
2636 | 907 } |
908 | |
2641 | 909 static void |
910 on_relative_toggle(GtkToggleButton *button, gpointer data) | |
911 { | |
912 Playlist *playlist = playlist_get_active(); | |
913 | |
914 playlist->attribute = | |
915 gtk_toggle_button_get_active(button) ? | |
916 playlist->attribute | PLAYLIST_USE_RELATIVE : | |
917 playlist->attribute & ~PLAYLIST_USE_RELATIVE; | |
918 } | |
919 | |
2313 | 920 static gchar * |
921 playlist_file_selection_save(const gchar * title, | |
922 const gchar * default_filename) | |
923 { | |
2514
7934ac463591
[svn] - removed unused function bmp_menu_translate()
mf0102
parents:
2508
diff
changeset
|
924 GtkWidget *dialog; |
2313 | 925 gchar *filename; |
2641 | 926 GtkWidget *hbox; |
927 GtkWidget *toggle, *toggle2; | |
2313 | 928 |
929 g_return_val_if_fail(title != NULL, NULL); | |
930 | |
2514
7934ac463591
[svn] - removed unused function bmp_menu_translate()
mf0102
parents:
2508
diff
changeset
|
931 dialog = make_filebrowser(title, TRUE); |
2640 | 932 gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), cfg.playlist_path); |
2514
7934ac463591
[svn] - removed unused function bmp_menu_translate()
mf0102
parents:
2508
diff
changeset
|
933 gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), default_filename); |
2636 | 934 |
2641 | 935 hbox = gtk_hbox_new(FALSE, 5); |
936 | |
2636 | 937 /* static playlist */ |
2640 | 938 toggle = gtk_check_button_new_with_label("Save as Static Playlist"); |
2636 | 939 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), |
940 (playlist_get_active()->attribute & PLAYLIST_STATIC) ? TRUE : FALSE); | |
941 g_signal_connect(G_OBJECT(toggle), "toggled", G_CALLBACK(on_static_toggle), dialog); | |
2641 | 942 gtk_box_pack_start(GTK_BOX(hbox), toggle, FALSE, FALSE, 0); |
943 | |
944 /* use relative path */ | |
945 toggle2 = gtk_check_button_new_with_label("Use Relative Path"); | |
946 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle2), | |
947 (playlist_get_active()->attribute & PLAYLIST_USE_RELATIVE) ? TRUE : FALSE); | |
948 g_signal_connect(G_OBJECT(toggle2), "toggled", G_CALLBACK(on_relative_toggle), dialog); | |
949 gtk_box_pack_start(GTK_BOX(hbox), toggle2, FALSE, FALSE, 0); | |
950 | |
951 gtk_widget_show_all(hbox); | |
952 gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(dialog), hbox); | |
2508
ecdfed7b1861
[svn] - more playlist cleanups (generalized code for playlist loading/saving
mf0102
parents:
2507
diff
changeset
|
953 |
2313 | 954 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) |
955 filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); | |
956 else | |
957 filename = NULL; | |
958 | |
2514
7934ac463591
[svn] - removed unused function bmp_menu_translate()
mf0102
parents:
2508
diff
changeset
|
959 gtk_widget_destroy(dialog); |
2313 | 960 return filename; |
961 } | |
962 | |
963 void | |
964 playlistwin_select_playlist_to_load(const gchar * default_filename) | |
965 { | |
966 gchar *filename = | |
967 playlist_file_selection_load(_("Load Playlist"), default_filename); | |
968 | |
969 if (filename) { | |
970 playlistwin_load_playlist(filename); | |
971 g_free(filename); | |
972 } | |
973 } | |
974 | |
975 static void | |
976 playlistwin_select_playlist_to_save(const gchar * default_filename) | |
977 { | |
978 gchar *dot = NULL, *basename = NULL; | |
979 gchar *filename = | |
980 playlist_file_selection_save(_("Save Playlist"), default_filename); | |
981 | |
982 if (filename) { | |
983 /* Default to xspf if no filename has extension */ | |
984 basename = g_path_get_basename(filename); | |
985 dot = strrchr(basename, '.'); | |
986 if( dot == NULL || dot == basename) { | |
987 gchar *oldname = filename; | |
988 filename = g_strconcat(oldname, ".xspf", NULL); | |
989 g_free(oldname); | |
990 } | |
991 g_free(basename); | |
992 | |
993 playlistwin_save_playlist(filename); | |
994 g_free(filename); | |
995 } | |
996 } | |
997 | |
998 #define REGION_L(x1,x2,y1,y2) \ | |
999 (event->x >= (x1) && event->x < (x2) && \ | |
1000 event->y >= cfg.playlist_height - (y1) && \ | |
1001 event->y < cfg.playlist_height - (y2)) | |
1002 | |
1003 #define REGION_R(x1,x2,y1,y2) \ | |
1004 (event->x >= playlistwin_get_width() - (x1) && \ | |
1005 event->x < playlistwin_get_width() - (x2) && \ | |
1006 event->y >= cfg.playlist_height - (y1) && \ | |
1007 event->y < cfg.playlist_height - (y2)) | |
1008 | |
1009 static void | |
1010 playlistwin_scrolled(GtkWidget * widget, | |
1011 GdkEventScroll * event, | |
1012 gpointer callback_data) | |
1013 { | |
1014 | |
1015 if (event->direction == GDK_SCROLL_DOWN) | |
1016 playlistwin_scroll(cfg.scroll_pl_by); | |
1017 | |
1018 if (event->direction == GDK_SCROLL_UP) | |
1019 playlistwin_scroll(-cfg.scroll_pl_by); | |
1020 | |
1021 g_cond_signal(cond_scan); | |
1022 | |
1023 } | |
1024 | |
1025 static gboolean | |
1026 playlistwin_press(GtkWidget * widget, | |
1027 GdkEventButton * event, | |
1028 gpointer callback_data) | |
1029 { | |
1030 gboolean grab = TRUE; | |
1031 gint xpos, ypos; | |
1032 GtkRequisition req; | |
2653 | 1033 Playlist *playlist = playlist_get_active(); |
1034 gint idx = 0; | |
2313 | 1035 |
1036 gtk_window_get_position(GTK_WINDOW(playlistwin), &xpos, &ypos); | |
1037 | |
1038 if (event->button == 1 && !cfg.show_wm_decorations && | |
1039 ((!cfg.playlist_shaded && | |
1040 event->x > playlistwin_get_width() - 20 && | |
1041 event->y > cfg.playlist_height - 20) || | |
1042 (cfg.playlist_shaded && | |
1043 event->x >= playlistwin_get_width() - 31 && | |
1044 event->x < playlistwin_get_width() - 22))) { | |
1045 | |
1046 if (event->type != GDK_2BUTTON_PRESS && | |
1047 event->type != GDK_3BUTTON_PRESS) { | |
1048 playlistwin_resizing = TRUE; | |
2492
ea80fe9c3ba4
[svn] - use ConfigureNotify to set playlist location, a proper use of ICCCM.
nenolod
parents:
2491
diff
changeset
|
1049 playlistwin_resize_x = cfg.playlist_width - event->x; |
ea80fe9c3ba4
[svn] - use ConfigureNotify to set playlist location, a proper use of ICCCM.
nenolod
parents:
2491
diff
changeset
|
1050 playlistwin_resize_y = cfg.playlist_height - event->y; |
2313 | 1051 } |
1052 } | |
1053 else if (event->button == 1 && REGION_L(12, 37, 29, 11)) { | |
1054 /* ADD button menu */ | |
1055 gtk_widget_size_request(playlistwin_pladd_menu, &req); | |
1056 ui_manager_popup_menu_show(GTK_MENU(playlistwin_pladd_menu), | |
1057 xpos + 12, | |
1058 (ypos + playlistwin_get_height()) - 8 - req.height, | |
1059 event->button, | |
1060 event->time); | |
1061 grab = FALSE; | |
1062 } | |
1063 else if (event->button == 1 && REGION_L(41, 66, 29, 11)) { | |
1064 /* SUB button menu */ | |
1065 gtk_widget_size_request(playlistwin_pldel_menu, &req); | |
1066 ui_manager_popup_menu_show(GTK_MENU(playlistwin_pldel_menu), | |
1067 xpos + 40, | |
1068 (ypos + playlistwin_get_height()) - 8 - req.height, | |
1069 event->button, | |
1070 event->time); | |
1071 grab = FALSE; | |
1072 } | |
1073 else if (event->button == 1 && REGION_L(70, 95, 29, 11)) { | |
1074 /* SEL button menu */ | |
1075 gtk_widget_size_request(playlistwin_plsel_menu, &req); | |
1076 ui_manager_popup_menu_show(GTK_MENU(playlistwin_plsel_menu), | |
1077 xpos + 68, | |
1078 (ypos + playlistwin_get_height()) - 8 - req.height, | |
1079 event->button, | |
1080 event->time); | |
1081 grab = FALSE; | |
1082 } | |
1083 else if (event->button == 1 && REGION_L(99, 124, 29, 11)) { | |
1084 /* MISC button menu */ | |
1085 gtk_widget_size_request(playlistwin_plsort_menu, &req); | |
1086 ui_manager_popup_menu_show(GTK_MENU(playlistwin_plsort_menu), | |
1087 xpos + 100, | |
1088 (ypos + playlistwin_get_height()) - 8 - req.height, | |
1089 event->button, | |
1090 event->time); | |
1091 grab = FALSE; | |
1092 } | |
1093 else if (event->button == 1 && REGION_R(46, 23, 29, 11)) { | |
1094 /* LIST button menu */ | |
1095 gtk_widget_size_request(playlistwin_pllist_menu, &req); | |
1096 ui_manager_popup_menu_show(GTK_MENU(playlistwin_pllist_menu), | |
1097 xpos + playlistwin_get_width() - req.width - 12, | |
1098 (ypos + playlistwin_get_height()) - 8 - req.height, | |
1099 event->button, | |
1100 event->time); | |
1101 grab = FALSE; | |
1102 } | |
1103 else if (event->button == 1 && REGION_R(82, 54, 15, 9)) { | |
1104 if (cfg.timer_mode == TIMER_ELAPSED) | |
1105 cfg.timer_mode = TIMER_REMAINING; | |
1106 else | |
1107 cfg.timer_mode = TIMER_ELAPSED; | |
1108 } | |
1109 else if (event->button == 2 && (event->type == GDK_BUTTON_PRESS) && | |
1110 widget_contains(WIDGET(playlistwin_list), event->x, event->y)) { | |
1111 gtk_selection_convert(widget, GDK_SELECTION_PRIMARY, | |
1112 GDK_TARGET_STRING, event->time); | |
1113 } | |
1114 else if (event->button == 1 && event->type == GDK_BUTTON_PRESS && | |
2528
60f2787cc7fd
[svn] - playlist editor: use SkinnedWindow widgetlist
nenolod
parents:
2527
diff
changeset
|
1115 !ui_skinned_window_widgetlist_contained(playlistwin, event->x, |
2807
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
1116 event->y) && |
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
1117 (cfg.easy_move || event->y < 14)) |
2313 | 1118 { |
1119 dock_move_press(dock_window_list, GTK_WINDOW(playlistwin), event, | |
1120 FALSE); | |
1121 gtk_window_present(GTK_WINDOW(playlistwin)); | |
1122 } | |
1123 else if (event->button == 1 && event->type == GDK_2BUTTON_PRESS && | |
2528
60f2787cc7fd
[svn] - playlist editor: use SkinnedWindow widgetlist
nenolod
parents:
2527
diff
changeset
|
1124 !ui_skinned_window_widgetlist_contained(playlistwin, event->x, event->y) |
2313 | 1125 && event->y < 14) { |
1126 /* double click on title bar */ | |
1127 playlistwin_shade_toggle(); | |
1128 if (dock_is_moving(GTK_WINDOW(playlistwin))) | |
1129 dock_move_release(GTK_WINDOW(playlistwin)); | |
1130 return TRUE; | |
1131 } | |
1132 else if (event->button == 3 && | |
1133 !(widget_contains(WIDGET(playlistwin_list), event->x, event->y) || | |
1134 (event->y >= cfg.playlist_height - 29 && | |
1135 event->y < cfg.playlist_height - 11 && | |
1136 ((event->x >= 12 && event->x < 37) || | |
1137 (event->x >= 41 && event->x < 66) || | |
1138 (event->x >= 70 && event->x < 95) || | |
1139 (event->x >= 99 && event->x < 124) || | |
1140 (event->x >= playlistwin_get_width() - 46 && | |
1141 event->x < playlistwin_get_width() - 23))))) { | |
1142 /* | |
1143 * Pop up the main menu a few pixels down to avoid | |
1144 * anything to be selected initially. | |
1145 */ | |
1146 ui_manager_popup_menu_show(GTK_MENU(mainwin_general_menu), event->x_root, | |
1147 event->y_root + 2, 3, event->time); | |
1148 grab = FALSE; | |
1149 } | |
1150 else if (event->button == 3 && | |
1151 widget_contains(WIDGET(playlistwin_list), event->x, event->y)) { | |
2356
4b2c7d9523e7
[svn] right-clicking on playlist entry automatically selects the entry if it was unselected before, closes #728
mf0102
parents:
2351
diff
changeset
|
1152 handle_press_cb(playlistwin_wlist, widget, event); |
2313 | 1153 ui_manager_popup_menu_show(GTK_MENU(playlistwin_popup_menu), |
1154 event->x_root, event->y_root + 5, | |
1155 event->button, event->time); | |
1156 grab = FALSE; | |
1157 } | |
2650
f41ca301852a
[svn] - patch by Vincent Ratier to add Alt+Click enqueue to the playlist editor. Closes #860.
nenolod
parents:
2641
diff
changeset
|
1158 else if (event->button == 1 && (event->state & GDK_MOD1_MASK)) |
f41ca301852a
[svn] - patch by Vincent Ratier to add Alt+Click enqueue to the playlist editor. Closes #860.
nenolod
parents:
2641
diff
changeset
|
1159 { |
2653 | 1160 GList *node; |
2650
f41ca301852a
[svn] - patch by Vincent Ratier to add Alt+Click enqueue to the playlist editor. Closes #860.
nenolod
parents:
2641
diff
changeset
|
1161 |
f41ca301852a
[svn] - patch by Vincent Ratier to add Alt+Click enqueue to the playlist editor. Closes #860.
nenolod
parents:
2641
diff
changeset
|
1162 handle_press_cb(playlistwin_wlist, widget, event); |
f41ca301852a
[svn] - patch by Vincent Ratier to add Alt+Click enqueue to the playlist editor. Closes #860.
nenolod
parents:
2641
diff
changeset
|
1163 draw_playlist_window(FALSE); |
f41ca301852a
[svn] - patch by Vincent Ratier to add Alt+Click enqueue to the playlist editor. Closes #860.
nenolod
parents:
2641
diff
changeset
|
1164 |
2653 | 1165 node = playlist_get_selected(playlist); |
2652
2d0c90f38824
[svn] - fix alt+click enqueue. this is more like vincent ratier's original patch except that it's C90-capable for freebsd 4.
nenolod
parents:
2650
diff
changeset
|
1166 |
2653 | 1167 if (node != NULL) |
1168 { | |
1169 idx = GPOINTER_TO_INT(playlist_get_selected(playlist)->data); | |
1170 playlist_queue_position(playlist, idx); | |
1171 } | |
1172 | |
1173 grab = FALSE; | |
2650
f41ca301852a
[svn] - patch by Vincent Ratier to add Alt+Click enqueue to the playlist editor. Closes #860.
nenolod
parents:
2641
diff
changeset
|
1174 } |
2313 | 1175 else { |
1176 handle_press_cb(playlistwin_wlist, widget, event); | |
1177 draw_playlist_window(FALSE); | |
1178 } | |
1179 | |
1180 if (grab) | |
1181 gdk_pointer_grab(playlistwin->window, FALSE, | |
1182 GDK_BUTTON_MOTION_MASK | GDK_BUTTON_RELEASE_MASK | | |
1183 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | | |
1184 GDK_BUTTON1_MOTION_MASK, NULL, NULL, | |
1185 GDK_CURRENT_TIME); | |
1186 | |
1187 return FALSE; | |
1188 } | |
1189 | |
1190 static gboolean | |
1191 playlistwin_focus_in(GtkWidget * widget, GdkEvent * event, gpointer data) | |
1192 { | |
1193 draw_playlist_window(TRUE); | |
1194 return FALSE; | |
1195 } | |
1196 | |
1197 static gboolean | |
1198 playlistwin_focus_out(GtkWidget * widget, | |
1199 GdkEventButton * event, gpointer data) | |
1200 { | |
1201 draw_playlist_window(TRUE); | |
1202 return FALSE; | |
1203 } | |
1204 | |
1205 void | |
1206 playlistwin_set_back_pixmap(void) | |
1207 { | |
1208 gdk_window_set_back_pixmap(playlistwin->window, playlistwin_bg, 0); | |
1209 gdk_window_clear(playlistwin->window); | |
1210 } | |
1211 | |
1212 static gboolean | |
1213 playlistwin_delete(GtkWidget * w, gpointer data) | |
1214 { | |
1215 playlistwin_hide(); | |
1216 return TRUE; | |
1217 } | |
1218 | |
1219 static void | |
1220 playlistwin_keypress_up_down_handler(PlayList_List * pl, | |
1221 gboolean up, guint state) | |
1222 { | |
1223 Playlist *playlist = playlist_get_active(); | |
1224 | |
1225 if ((state & GDK_MOD1_MASK) && (state & GDK_SHIFT_MASK)) | |
1226 return; | |
1227 if (!(state & GDK_MOD1_MASK)) | |
1228 playlist_select_all(playlist, FALSE); | |
1229 | |
1230 if (pl->pl_prev_selected == -1 || | |
1231 (!playlistwin_item_visible(pl->pl_prev_selected) && | |
1232 !(state & GDK_SHIFT_MASK && pl->pl_prev_min != -1))) { | |
1233 pl->pl_prev_selected = pl->pl_first; | |
1234 } | |
1235 else if (state & GDK_SHIFT_MASK) { | |
1236 if (pl->pl_prev_min == -1) { | |
1237 pl->pl_prev_max = pl->pl_prev_selected; | |
1238 pl->pl_prev_min = pl->pl_prev_selected; | |
1239 } | |
1240 pl->pl_prev_max += (up ? -1 : 1); | |
1241 pl->pl_prev_max = | |
1242 CLAMP(pl->pl_prev_max, 0, playlist_get_length(playlist) - 1); | |
1243 | |
1244 pl->pl_first = MIN(pl->pl_first, pl->pl_prev_max); | |
1245 pl->pl_first = MAX(pl->pl_first, pl->pl_prev_max - | |
1246 pl->pl_num_visible + 1); | |
1247 playlist_select_range(playlist, pl->pl_prev_min, pl->pl_prev_max, TRUE); | |
1248 return; | |
1249 } | |
1250 else if (state & GDK_MOD1_MASK) { | |
1251 if (up) | |
1252 playlist_list_move_up(pl); | |
1253 else | |
1254 playlist_list_move_down(pl); | |
1255 if (pl->pl_prev_min < pl->pl_first) | |
1256 pl->pl_first = pl->pl_prev_min; | |
1257 else if (pl->pl_prev_max >= (pl->pl_first + pl->pl_num_visible)) | |
1258 pl->pl_first = pl->pl_prev_max - pl->pl_num_visible + 1; | |
1259 return; | |
1260 } | |
1261 else if (up) | |
1262 pl->pl_prev_selected--; | |
1263 else | |
1264 pl->pl_prev_selected++; | |
1265 | |
1266 pl->pl_prev_selected = | |
1267 CLAMP(pl->pl_prev_selected, 0, playlist_get_length(playlist) - 1); | |
1268 | |
1269 if (pl->pl_prev_selected < pl->pl_first) | |
1270 pl->pl_first--; | |
1271 else if (pl->pl_prev_selected >= (pl->pl_first + pl->pl_num_visible)) | |
1272 pl->pl_first++; | |
1273 | |
1274 playlist_select_range(playlist, pl->pl_prev_selected, pl->pl_prev_selected, TRUE); | |
1275 pl->pl_prev_min = -1; | |
1276 } | |
1277 | |
1278 /* FIXME: Handle the keys through menu */ | |
1279 | |
1280 static gboolean | |
1281 playlistwin_keypress(GtkWidget * w, GdkEventKey * event, gpointer data) | |
1282 { | |
1283 Playlist *playlist = playlist_get_active(); | |
1284 | |
1285 guint keyval; | |
1286 gboolean refresh = FALSE; | |
1287 | |
1288 if (cfg.playlist_shaded) | |
1289 return FALSE; | |
1290 | |
1291 switch (keyval = event->keyval) { | |
1292 case GDK_KP_Up: | |
1293 case GDK_KP_Down: | |
1294 case GDK_Up: | |
1295 case GDK_Down: | |
1296 playlistwin_keypress_up_down_handler(playlistwin_list, | |
1297 keyval == GDK_Up | |
1298 || keyval == GDK_KP_Up, | |
1299 event->state); | |
1300 refresh = TRUE; | |
1301 break; | |
1302 case GDK_Page_Up: | |
1303 playlistwin_scroll(-playlistwin_list->pl_num_visible); | |
1304 refresh = TRUE; | |
1305 break; | |
1306 case GDK_Page_Down: | |
1307 playlistwin_scroll(playlistwin_list->pl_num_visible); | |
1308 refresh = TRUE; | |
1309 break; | |
1310 case GDK_Home: | |
1311 playlistwin_list->pl_first = 0; | |
1312 refresh = TRUE; | |
1313 break; | |
1314 case GDK_End: | |
1315 playlistwin_list->pl_first = | |
1316 playlist_get_length(playlist) - playlistwin_list->pl_num_visible; | |
1317 refresh = TRUE; | |
1318 break; | |
1319 case GDK_Return: | |
1320 if (playlistwin_list->pl_prev_selected > -1 | |
1321 && playlistwin_item_visible(playlistwin_list->pl_prev_selected)) { | |
1322 playlist_set_position(playlist, playlistwin_list->pl_prev_selected); | |
1323 if (!playback_get_playing()) | |
1324 playback_initiate(); | |
1325 } | |
1326 break; | |
1327 case GDK_3: | |
1328 if (event->state & GDK_CONTROL_MASK) | |
1329 playlistwin_fileinfo(); | |
1330 break; | |
1331 case GDK_Delete: | |
1332 if (event->state & GDK_CONTROL_MASK) | |
1333 playlist_delete(playlist, TRUE); | |
1334 else | |
1335 playlist_delete(playlist, FALSE); | |
1336 break; | |
1337 case GDK_Insert: | |
1338 if (event->state & GDK_MOD1_MASK) | |
1339 mainwin_show_add_url_window(); | |
1340 else | |
1341 playlistwin_show_filebrowser(); | |
1342 break; | |
1343 case GDK_Left: | |
1344 case GDK_KP_Left: | |
1345 case GDK_KP_7: | |
1346 if (playlist_get_current_length(playlist) != -1) | |
1347 playback_seek(CLAMP | |
1348 (playback_get_time() - 5000, 0, | |
1349 playlist_get_current_length(playlist)) / 1000); | |
1350 break; | |
1351 case GDK_Right: | |
1352 case GDK_KP_Right: | |
1353 case GDK_KP_9: | |
1354 if (playlist_get_current_length(playlist) != -1) | |
1355 playback_seek(CLAMP | |
1356 (playback_get_time() + 5000, 0, | |
1357 playlist_get_current_length(playlist)) / 1000); | |
1358 break; | |
1359 case GDK_KP_4: | |
1360 playlist_prev(playlist); | |
1361 break; | |
1362 case GDK_KP_6: | |
1363 playlist_next(playlist); | |
1364 break; | |
1365 | |
1366 case GDK_Escape: | |
1367 mainwin_minimize_cb(); | |
1368 break; | |
1369 default: | |
1370 return FALSE; | |
1371 } | |
1372 | |
1373 if (refresh) { | |
1374 g_cond_signal(cond_scan); | |
1375 playlistwin_update_list(playlist_get_active()); | |
1376 } | |
1377 | |
1378 return TRUE; | |
1379 } | |
1380 | |
1381 static void | |
1382 playlistwin_draw_frame(void) | |
1383 { | |
1384 gboolean focus = | |
1385 gtk_window_has_toplevel_focus(GTK_WINDOW(playlistwin)) || | |
1386 !cfg.dim_titlebar; | |
1387 | |
1388 if (cfg.playlist_shaded) { | |
1389 skin_draw_playlistwin_shaded(bmp_active_skin, | |
2527
05c841971f9f
[svn] - playlist editor: use SkinnedWindow provided GC.
nenolod
parents:
2515
diff
changeset
|
1390 playlistwin_bg, SKINNED_WINDOW(playlistwin)->gc, |
2313 | 1391 playlistwin_get_width(), focus); |
1392 } | |
1393 else { | |
1394 skin_draw_playlistwin_frame(bmp_active_skin, | |
2527
05c841971f9f
[svn] - playlist editor: use SkinnedWindow provided GC.
nenolod
parents:
2515
diff
changeset
|
1395 playlistwin_bg, SKINNED_WINDOW(playlistwin)->gc, |
2313 | 1396 playlistwin_get_width(), |
1397 cfg.playlist_height, focus); | |
1398 } | |
1399 } | |
1400 | |
1401 void | |
1402 draw_playlist_window(gboolean force) | |
1403 { | |
1404 gboolean redraw; | |
1405 GList *wl; | |
1406 Widget *w; | |
1407 | |
1408 if (force) | |
1409 playlistwin_draw_frame(); | |
1410 | |
1411 widget_list_lock(playlistwin_wlist); | |
1412 widget_list_draw(playlistwin_wlist, &redraw, force); | |
1413 | |
1414 if (redraw || force) { | |
1415 if (force) { | |
1416 gdk_window_clear(playlistwin->window); | |
1417 } | |
1418 else { | |
1419 for (wl = playlistwin_wlist; wl; wl = g_list_next(wl)) { | |
1420 w = WIDGET(wl->data); | |
1421 if (w->redraw && w->visible) { | |
1422 gdk_window_clear_area(playlistwin->window, w->x, w->y, | |
1423 w->width, w->height); | |
1424 w->redraw = FALSE; | |
1425 } | |
1426 } | |
1427 } | |
1428 | |
1429 gdk_flush(); | |
1430 } | |
1431 | |
1432 widget_list_unlock(playlistwin_wlist); | |
1433 } | |
1434 | |
1435 | |
1436 void | |
1437 playlistwin_hide_timer(void) | |
1438 { | |
1439 textbox_set_text(playlistwin_time_min, " "); | |
1440 textbox_set_text(playlistwin_time_sec, " "); | |
1441 } | |
1442 | |
1443 void | |
1444 playlistwin_set_time(gint time, gint length, TimerMode mode) | |
1445 { | |
1446 gchar *text, sign; | |
1447 | |
1448 if (mode == TIMER_REMAINING && length != -1) { | |
1449 time = length - time; | |
1450 sign = '-'; | |
1451 } | |
1452 else | |
1453 sign = ' '; | |
1454 | |
1455 time /= 1000; | |
1456 | |
1457 if (time < 0) | |
1458 time = 0; | |
1459 if (time > 99 * 60) | |
1460 time /= 60; | |
1461 | |
1462 text = g_strdup_printf("%c%-2.2d", sign, time / 60); | |
1463 textbox_set_text(playlistwin_time_min, text); | |
1464 g_free(text); | |
1465 | |
1466 text = g_strdup_printf("%-2.2d", time % 60); | |
1467 textbox_set_text(playlistwin_time_sec, text); | |
1468 g_free(text); | |
1469 } | |
1470 | |
1471 static void | |
1472 playlistwin_drag_motion(GtkWidget * widget, | |
1473 GdkDragContext * context, | |
1474 gint x, gint y, | |
1475 GtkSelectionData * selection_data, | |
1476 guint info, guint time, gpointer user_data) | |
1477 { | |
1478 playlistwin_list->pl_drag_motion = TRUE; | |
1479 playlistwin_list->drag_motion_x = x; | |
1480 playlistwin_list->drag_motion_y = y; | |
1481 playlistwin_update_list(playlist_get_active()); | |
1482 playlistwin_hint_flag = TRUE; | |
1483 } | |
1484 | |
1485 static void | |
1486 playlistwin_drag_end(GtkWidget * widget, | |
1487 GdkDragContext * context, gpointer user_data) | |
1488 { | |
1489 playlistwin_list->pl_drag_motion = FALSE; | |
1490 playlistwin_hint_flag = FALSE; | |
1491 playlistwin_update_list(playlist_get_active()); | |
1492 } | |
1493 | |
1494 static void | |
1495 playlistwin_drag_data_received(GtkWidget * widget, | |
1496 GdkDragContext * context, | |
1497 gint x, gint y, | |
1498 GtkSelectionData * | |
1499 selection_data, guint info, | |
1500 guint time, gpointer user_data) | |
1501 { | |
1502 gint pos; | |
1503 Playlist *playlist = playlist_get_active(); | |
1504 | |
2363 | 1505 g_return_if_fail(selection_data); |
2313 | 1506 |
1507 if (!selection_data->data) { | |
1508 g_message("Received no DND data!"); | |
1509 return; | |
1510 } | |
1511 | |
1512 if (widget_contains(WIDGET(playlistwin_list), x, y)) { | |
1513 pos = (y - WIDGET(playlistwin_list)->y) / | |
1514 playlistwin_list->pl_fheight + playlistwin_list->pl_first; | |
1515 | |
1516 pos = MIN(pos, playlist_get_length(playlist)); | |
1517 playlist_ins_url(playlist, (gchar *) selection_data->data, pos); | |
1518 } | |
1519 else | |
1520 playlist_add_url(playlist, (gchar *) selection_data->data); | |
1521 } | |
1522 | |
1523 static void | |
1524 local_playlist_prev(void) | |
1525 { | |
1526 playlist_prev(playlist_get_active()); | |
1527 } | |
1528 | |
1529 static void | |
1530 local_playlist_next(void) | |
1531 { | |
1532 playlist_next(playlist_get_active()); | |
1533 } | |
1534 | |
1535 static void | |
1536 playlistwin_create_widgets(void) | |
1537 { | |
1538 /* This function creates the custom widgets used by the playlist editor */ | |
1539 | |
1540 /* text box for displaying song title in shaded mode */ | |
1541 playlistwin_sinfo = | |
2527
05c841971f9f
[svn] - playlist editor: use SkinnedWindow provided GC.
nenolod
parents:
2515
diff
changeset
|
1542 create_textbox(&playlistwin_wlist, playlistwin_bg, SKINNED_WINDOW(playlistwin)->gc, |
2313 | 1543 4, 4, playlistwin_get_width() - 35, TRUE, SKIN_TEXT); |
1544 | |
1545 playlistwin_set_sinfo_font(cfg.playlist_font); | |
1546 | |
1547 if (!cfg.playlist_shaded) | |
1548 widget_hide(WIDGET(playlistwin_sinfo)); | |
1549 | |
2901
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1550 playlistwin_shade = ui_skinned_button_new(); |
2313 | 1551 /* shade/unshade window push button */ |
1552 if (cfg.playlist_shaded) | |
2901
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1553 ui_skinned_push_button_setup(playlistwin_shade, SKINNED_WINDOW(playlistwin)->fixed, playlistwin_bg, |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1554 SKINNED_WINDOW(playlistwin)->gc, playlistwin_get_width() - 21, 3, |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1555 9, 9, 128, 45, 150, 42, SKIN_PLEDIT); |
2313 | 1556 else |
2901
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1557 ui_skinned_push_button_setup(playlistwin_shade, SKINNED_WINDOW(playlistwin)->fixed, playlistwin_bg, |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1558 SKINNED_WINDOW(playlistwin)->gc, playlistwin_get_width() - 21, 3, |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1559 9, 9, 157, 3, 62, 42, SKIN_PLEDIT); |
2313 | 1560 |
2901
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1561 g_signal_connect(playlistwin_shade, "clicked", playlistwin_shade_toggle, NULL ); |
2313 | 1562 |
1563 /* close window push button */ | |
2901
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1564 playlistwin_close = ui_skinned_button_new(); |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1565 ui_skinned_push_button_setup(playlistwin_close, SKINNED_WINDOW(playlistwin)->fixed, playlistwin_bg, |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1566 SKINNED_WINDOW(playlistwin)->gc, |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1567 playlistwin_get_width() - 11, 3, 9, 9, |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1568 cfg.playlist_shaded ? 138 : 167, |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1569 cfg.playlist_shaded ? 45 : 3, 52, 42, SKIN_PLEDIT); |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1570 |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1571 g_signal_connect(playlistwin_close, "clicked", playlistwin_hide, NULL ); |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1572 |
2528
60f2787cc7fd
[svn] - playlist editor: use SkinnedWindow widgetlist
nenolod
parents:
2527
diff
changeset
|
1573 ui_skinned_window_widgetlist_associate(playlistwin, WIDGET(playlistwin_close)); |
2313 | 1574 |
1575 /* playlist list box */ | |
1576 playlistwin_list = | |
1577 create_playlist_list(&playlistwin_wlist, playlistwin_bg, | |
2527
05c841971f9f
[svn] - playlist editor: use SkinnedWindow provided GC.
nenolod
parents:
2515
diff
changeset
|
1578 SKINNED_WINDOW(playlistwin)->gc, 12, 20, |
2313 | 1579 playlistwin_get_width() - 31, |
1580 cfg.playlist_height - 58); | |
1581 playlist_list_set_font(cfg.playlist_font); | |
2528
60f2787cc7fd
[svn] - playlist editor: use SkinnedWindow widgetlist
nenolod
parents:
2527
diff
changeset
|
1582 ui_skinned_window_widgetlist_associate(playlistwin, WIDGET(playlistwin_list)); |
2313 | 1583 |
1584 /* playlist list box slider */ | |
1585 playlistwin_slider = | |
1586 create_playlistslider(&playlistwin_wlist, playlistwin_bg, | |
2527
05c841971f9f
[svn] - playlist editor: use SkinnedWindow provided GC.
nenolod
parents:
2515
diff
changeset
|
1587 SKINNED_WINDOW(playlistwin)->gc, playlistwin_get_width() - 15, |
2313 | 1588 20, cfg.playlist_height - 58, playlistwin_list); |
2528
60f2787cc7fd
[svn] - playlist editor: use SkinnedWindow widgetlist
nenolod
parents:
2527
diff
changeset
|
1589 ui_skinned_window_widgetlist_associate(playlistwin, WIDGET(playlistwin_slider)); |
60f2787cc7fd
[svn] - playlist editor: use SkinnedWindow widgetlist
nenolod
parents:
2527
diff
changeset
|
1590 |
2313 | 1591 /* track time (minute) */ |
1592 playlistwin_time_min = | |
2527
05c841971f9f
[svn] - playlist editor: use SkinnedWindow provided GC.
nenolod
parents:
2515
diff
changeset
|
1593 create_textbox(&playlistwin_wlist, playlistwin_bg, SKINNED_WINDOW(playlistwin)->gc, |
2313 | 1594 playlistwin_get_width() - 82, |
1595 cfg.playlist_height - 15, 15, FALSE, SKIN_TEXT); | |
2528
60f2787cc7fd
[svn] - playlist editor: use SkinnedWindow widgetlist
nenolod
parents:
2527
diff
changeset
|
1596 ui_skinned_window_widgetlist_associate(playlistwin, WIDGET(playlistwin_time_min)); |
2313 | 1597 |
1598 /* track time (second) */ | |
1599 playlistwin_time_sec = | |
2527
05c841971f9f
[svn] - playlist editor: use SkinnedWindow provided GC.
nenolod
parents:
2515
diff
changeset
|
1600 create_textbox(&playlistwin_wlist, playlistwin_bg, SKINNED_WINDOW(playlistwin)->gc, |
2313 | 1601 playlistwin_get_width() - 64, |
1602 cfg.playlist_height - 15, 10, FALSE, SKIN_TEXT); | |
2528
60f2787cc7fd
[svn] - playlist editor: use SkinnedWindow widgetlist
nenolod
parents:
2527
diff
changeset
|
1603 ui_skinned_window_widgetlist_associate(playlistwin, WIDGET(playlistwin_time_sec)); |
2313 | 1604 |
1605 /* playlist information (current track length / total track length) */ | |
1606 playlistwin_info = | |
2527
05c841971f9f
[svn] - playlist editor: use SkinnedWindow provided GC.
nenolod
parents:
2515
diff
changeset
|
1607 create_textbox(&playlistwin_wlist, playlistwin_bg, SKINNED_WINDOW(playlistwin)->gc, |
2313 | 1608 playlistwin_get_width() - 143, |
1609 cfg.playlist_height - 28, 90, FALSE, SKIN_TEXT); | |
2528
60f2787cc7fd
[svn] - playlist editor: use SkinnedWindow widgetlist
nenolod
parents:
2527
diff
changeset
|
1610 ui_skinned_window_widgetlist_associate(playlistwin, WIDGET(playlistwin_info)); |
2313 | 1611 |
1612 /* mini play control buttons at right bottom corner */ | |
1613 | |
1614 /* rewind button */ | |
2902
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1615 playlistwin_srew = ui_skinned_button_new(); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1616 ui_skinned_small_button_setup(playlistwin_srew, SKINNED_WINDOW(playlistwin)->fixed, playlistwin_bg, |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1617 SKINNED_WINDOW(playlistwin)->gc, playlistwin_get_width() - 144, |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1618 cfg.playlist_height - 16, 8, 7); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1619 g_signal_connect(playlistwin_srew, "clicked", local_playlist_prev, NULL); |
2313 | 1620 |
1621 /* play button */ | |
2902
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1622 playlistwin_splay = ui_skinned_button_new(); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1623 ui_skinned_small_button_setup(playlistwin_splay, SKINNED_WINDOW(playlistwin)->fixed, playlistwin_bg, |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1624 SKINNED_WINDOW(playlistwin)->gc, playlistwin_get_width() - 138, |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1625 cfg.playlist_height - 16, 10, 7); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1626 g_signal_connect(playlistwin_splay, "clicked", mainwin_play_pushed, NULL); |
2313 | 1627 |
1628 /* pause button */ | |
2902
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1629 playlistwin_spause = ui_skinned_button_new(); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1630 ui_skinned_small_button_setup(playlistwin_spause, SKINNED_WINDOW(playlistwin)->fixed, playlistwin_bg, |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1631 SKINNED_WINDOW(playlistwin)->gc, playlistwin_get_width() - 128, |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1632 cfg.playlist_height - 16, 10, 7); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1633 g_signal_connect(playlistwin_spause, "clicked", playback_pause, NULL); |
2313 | 1634 |
1635 /* stop button */ | |
2902
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1636 playlistwin_sstop = ui_skinned_button_new(); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1637 ui_skinned_small_button_setup(playlistwin_sstop, SKINNED_WINDOW(playlistwin)->fixed, playlistwin_bg, |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1638 SKINNED_WINDOW(playlistwin)->gc, playlistwin_get_width() - 118, |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1639 cfg.playlist_height - 16, 9, 7); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1640 g_signal_connect(playlistwin_sstop, "clicked", mainwin_stop_pushed, NULL); |
2313 | 1641 |
1642 /* forward button */ | |
2902
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1643 playlistwin_sfwd = ui_skinned_button_new(); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1644 ui_skinned_small_button_setup(playlistwin_sfwd, SKINNED_WINDOW(playlistwin)->fixed, playlistwin_bg, |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1645 SKINNED_WINDOW(playlistwin)->gc, playlistwin_get_width() - 109, |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1646 cfg.playlist_height - 16, 8, 7); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1647 g_signal_connect(playlistwin_sfwd, "clicked", local_playlist_next, NULL); |
2313 | 1648 |
1649 /* eject button */ | |
2902
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1650 playlistwin_seject = ui_skinned_button_new(); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1651 ui_skinned_small_button_setup(playlistwin_seject, SKINNED_WINDOW(playlistwin)->fixed, playlistwin_bg, |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1652 SKINNED_WINDOW(playlistwin)->gc, playlistwin_get_width() - 100, |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1653 cfg.playlist_height - 16, 9, 7); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1654 g_signal_connect(playlistwin_seject, "clicked", mainwin_eject_pushed, NULL); |
2313 | 1655 |
2902
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1656 playlistwin_sscroll_up = ui_skinned_button_new(); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1657 ui_skinned_small_button_setup(playlistwin_sscroll_up, SKINNED_WINDOW(playlistwin)->fixed, playlistwin_bg, |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1658 SKINNED_WINDOW(playlistwin)->gc, playlistwin_get_width() - 14, |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1659 cfg.playlist_height - 35, 8, 5); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1660 g_signal_connect(playlistwin_sscroll_up, "clicked", playlistwin_scroll_up_pushed, NULL); |
2528
60f2787cc7fd
[svn] - playlist editor: use SkinnedWindow widgetlist
nenolod
parents:
2527
diff
changeset
|
1661 |
2902
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1662 playlistwin_sscroll_down = ui_skinned_button_new(); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1663 ui_skinned_small_button_setup(playlistwin_sscroll_down, SKINNED_WINDOW(playlistwin)->fixed, playlistwin_bg, |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1664 SKINNED_WINDOW(playlistwin)->gc, playlistwin_get_width() - 14, |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1665 cfg.playlist_height - 30, 8, 5); |
2b379b796c84
replace SButton in playlistwin with UiSkinnedButton, sbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2901
diff
changeset
|
1666 g_signal_connect(playlistwin_sscroll_down, "clicked", playlistwin_scroll_down_pushed, NULL); |
2313 | 1667 } |
1668 | |
1669 static void | |
1670 selection_received(GtkWidget * widget, | |
1671 GtkSelectionData * selection_data, gpointer data) | |
1672 { | |
1673 if (selection_data->type == GDK_SELECTION_TYPE_STRING && | |
1674 selection_data->length > 0) | |
1675 playlist_add_url(playlist_get_active(), (gchar *) selection_data->data); | |
1676 } | |
1677 | |
1678 static void | |
1679 playlistwin_create_window(void) | |
1680 { | |
1681 GdkPixbuf *icon; | |
1682 | |
2515
319b10203d7c
[svn] gtk_window_set_wmclass() has to be called before gtk_widget_realize(). Patched by Christian "Joker" Birchinger from Gentoo.
chainsaw
parents:
2514
diff
changeset
|
1683 playlistwin = ui_skinned_window_new(GTK_WINDOW_TOPLEVEL, "playlist"); |
2313 | 1684 gtk_window_set_title(GTK_WINDOW(playlistwin), _("Audacious Playlist Editor")); |
1685 gtk_window_set_role(GTK_WINDOW(playlistwin), "playlist"); | |
1686 gtk_window_set_default_size(GTK_WINDOW(playlistwin), | |
1687 playlistwin_get_width(), | |
1688 playlistwin_get_height()); | |
1689 gtk_window_set_resizable(GTK_WINDOW(playlistwin), TRUE); | |
1690 playlistwin_set_geometry_hints(cfg.playlist_shaded); | |
1691 | |
1692 gtk_window_set_transient_for(GTK_WINDOW(playlistwin), | |
1693 GTK_WINDOW(mainwin)); | |
1694 gtk_window_set_skip_taskbar_hint(GTK_WINDOW(playlistwin), TRUE); | |
1695 | |
1696 icon = gdk_pixbuf_new_from_xpm_data((const gchar **) bmp_playlist_icon); | |
1697 gtk_window_set_icon(GTK_WINDOW(playlistwin), icon); | |
1698 g_object_unref(icon); | |
1699 | |
1700 gtk_widget_set_app_paintable(playlistwin, TRUE); | |
1701 | |
1702 if (cfg.playlist_x != -1 && cfg.save_window_position) | |
1703 gtk_window_move(GTK_WINDOW(playlistwin), | |
1704 cfg.playlist_x, cfg.playlist_y); | |
1705 | |
1706 gtk_widget_add_events(playlistwin, GDK_POINTER_MOTION_MASK | | |
1707 GDK_FOCUS_CHANGE_MASK | GDK_BUTTON_MOTION_MASK | | |
1708 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | | |
1709 GDK_SCROLL_MASK | GDK_VISIBILITY_NOTIFY_MASK); | |
1710 gtk_widget_realize(playlistwin); | |
1711 | |
1712 g_signal_connect(playlistwin, "delete_event", | |
1713 G_CALLBACK(playlistwin_delete), NULL); | |
1714 g_signal_connect(playlistwin, "button_press_event", | |
1715 G_CALLBACK(playlistwin_press), NULL); | |
1716 g_signal_connect(playlistwin, "button_release_event", | |
1717 G_CALLBACK(playlistwin_release), NULL); | |
1718 g_signal_connect(playlistwin, "scroll_event", | |
1719 G_CALLBACK(playlistwin_scrolled), NULL); | |
1720 g_signal_connect(playlistwin, "motion_notify_event", | |
1721 G_CALLBACK(playlistwin_motion), NULL); | |
1722 g_signal_connect(playlistwin, "enter_notify_event", | |
1723 G_CALLBACK(playlistwin_enter), NULL); | |
1724 g_signal_connect(playlistwin, "leave_notify_event", | |
1725 G_CALLBACK(playlistwin_leave), NULL); | |
1726 g_signal_connect_after(playlistwin, "focus_in_event", | |
1727 G_CALLBACK(playlistwin_focus_in), NULL); | |
1728 g_signal_connect_after(playlistwin, "focus_out_event", | |
1729 G_CALLBACK(playlistwin_focus_out), NULL); | |
1730 g_signal_connect(playlistwin, "style_set", | |
1731 G_CALLBACK(playlistwin_set_back_pixmap), NULL); | |
1732 | |
1733 bmp_drag_dest_set(playlistwin); | |
1734 | |
1735 /* DnD stuff */ | |
1736 g_signal_connect(playlistwin, "drag-leave", | |
1737 G_CALLBACK(playlistwin_drag_end), NULL); | |
1738 g_signal_connect(playlistwin, "drag-data-delete", | |
1739 G_CALLBACK(playlistwin_drag_end), NULL); | |
1740 g_signal_connect(playlistwin, "drag-end", | |
1741 G_CALLBACK(playlistwin_drag_end), NULL); | |
1742 g_signal_connect(playlistwin, "drag-drop", | |
1743 G_CALLBACK(playlistwin_drag_end), NULL); | |
1744 g_signal_connect(playlistwin, "drag-data-received", | |
1745 G_CALLBACK(playlistwin_drag_data_received), NULL); | |
1746 g_signal_connect(playlistwin, "drag-motion", | |
1747 G_CALLBACK(playlistwin_drag_motion), NULL); | |
1748 | |
1749 g_signal_connect(playlistwin, "key_press_event", | |
1750 G_CALLBACK(playlistwin_keypress), NULL); | |
1751 g_signal_connect(playlistwin, "selection_received", | |
1752 G_CALLBACK(selection_received), NULL); | |
1753 | |
1754 playlistwin_set_mask(); | |
1755 } | |
1756 | |
1757 void | |
1758 playlistwin_create(void) | |
1759 { | |
1760 playlistwin_create_window(); | |
1761 | |
1762 /* create GC and back pixmap for custom widget to draw on */ | |
1763 playlistwin_bg = gdk_pixmap_new(playlistwin->window, | |
1764 playlistwin_get_width(), | |
1765 playlistwin_get_height_unshaded(), -1); | |
1766 gdk_window_set_back_pixmap(playlistwin->window, playlistwin_bg, 0); | |
1767 | |
1768 playlistwin_create_widgets(); | |
1769 playlistwin_update_info(playlist_get_active()); | |
1770 | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
1771 playlistwin_infopopup = audacious_fileinfopopup_create(); |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
1772 |
2313 | 1773 gtk_window_add_accel_group(GTK_WINDOW(playlistwin), ui_manager_get_accel_group()); |
1774 } | |
1775 | |
1776 | |
1777 void | |
1778 playlistwin_show(void) | |
1779 { | |
1780 GtkAction *action = gtk_action_group_get_action( | |
1781 toggleaction_group_others , "show playlist editor" ); | |
1782 gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , TRUE ); | |
1783 | |
1784 cfg.playlist_visible = TRUE; | |
2901
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1785 UI_SKINNED_BUTTON(mainwin_pl)->inside = TRUE; |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1786 g_signal_emit_by_name(mainwin_pl, "redraw"); |
2313 | 1787 |
1788 playlistwin_set_toprow(0); | |
1789 playlist_check_pos_current(playlist_get_active()); | |
1790 | |
2351
911743d27aba
[svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents:
2348
diff
changeset
|
1791 if ( playlistwin_infopopup_sid == 0 ) |
911743d27aba
[svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents:
2348
diff
changeset
|
1792 playlistwin_infopopup_sid = g_timeout_add( |
911743d27aba
[svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents:
2348
diff
changeset
|
1793 50 , (GSourceFunc)playlistwin_fileinfopopup_probe , playlistwin_infopopup ); |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
1794 |
2901
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1795 gtk_widget_show_all(playlistwin); |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1796 gtk_window_present(GTK_WINDOW(playlistwin)); |
2313 | 1797 } |
1798 | |
1799 void | |
1800 playlistwin_hide(void) | |
1801 { | |
1802 GtkAction *action = gtk_action_group_get_action( | |
1803 toggleaction_group_others , "show playlist editor" ); | |
1804 gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , FALSE ); | |
1805 | |
1806 gtk_widget_hide(playlistwin); | |
1807 cfg.playlist_visible = FALSE; | |
2901
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1808 UI_SKINNED_BUTTON(mainwin_pl)->inside = FALSE; |
5ed0674fabd6
replace PButton in playlistwin with UiSkinnedButton, pbutton.c is no longer needed
Tomasz Mon <desowin@gmail.com>
parents:
2843
diff
changeset
|
1809 g_signal_emit_by_name(mainwin_pl, "redraw"); |
2313 | 1810 |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
1811 /* no point in probing for playlistwin_infopopup trigger when the playlistwin is hidden */ |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
1812 if ( playlistwin_infopopup_sid != 0 ) |
2351
911743d27aba
[svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents:
2348
diff
changeset
|
1813 { |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
1814 g_source_remove( playlistwin_infopopup_sid ); |
2351
911743d27aba
[svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents:
2348
diff
changeset
|
1815 playlistwin_infopopup_sid = 0; |
911743d27aba
[svn] - simplify and optimize the metadata tooltip trigger function
giacomo
parents:
2348
diff
changeset
|
1816 } |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
1817 |
2338
d0a04f1ee732
[svn] - in playlistwin_hide(), pass focus to the player main window only if it's visible
giacomo
parents:
2328
diff
changeset
|
1818 if ( cfg.player_visible ) |
d0a04f1ee732
[svn] - in playlistwin_hide(), pass focus to the player main window only if it's visible
giacomo
parents:
2328
diff
changeset
|
1819 { |
d0a04f1ee732
[svn] - in playlistwin_hide(), pass focus to the player main window only if it's visible
giacomo
parents:
2328
diff
changeset
|
1820 gtk_window_present(GTK_WINDOW(mainwin)); |
d0a04f1ee732
[svn] - in playlistwin_hide(), pass focus to the player main window only if it's visible
giacomo
parents:
2328
diff
changeset
|
1821 gtk_widget_grab_focus(mainwin); |
d0a04f1ee732
[svn] - in playlistwin_hide(), pass focus to the player main window only if it's visible
giacomo
parents:
2328
diff
changeset
|
1822 } |
2313 | 1823 } |
1824 | |
1825 void action_playlist_track_info(void) | |
1826 { | |
1827 playlistwin_fileinfo(); | |
1828 } | |
1829 | |
1830 void action_queue_toggle(void) | |
1831 { | |
1832 playlist_queue(playlist_get_active()); | |
1833 } | |
1834 | |
1835 void action_playlist_sort_by_playlist_entry(void) | |
1836 { | |
1837 Playlist *playlist = playlist_get_active(); | |
1838 | |
1839 playlist_sort(playlist, PLAYLIST_SORT_PLAYLIST); | |
1840 playlistwin_update_list(playlist); | |
1841 } | |
1842 | |
1843 void action_playlist_sort_by_track_number(void) | |
1844 { | |
1845 Playlist *playlist = playlist_get_active(); | |
1846 | |
1847 playlist_sort(playlist, PLAYLIST_SORT_TRACK); | |
1848 playlistwin_update_list(playlist); | |
1849 } | |
1850 | |
1851 void action_playlist_sort_by_title(void) | |
1852 { | |
1853 Playlist *playlist = playlist_get_active(); | |
1854 | |
1855 playlist_sort(playlist, PLAYLIST_SORT_TITLE); | |
1856 playlistwin_update_list(playlist); | |
1857 } | |
1858 | |
1859 void action_playlist_sort_by_artist(void) | |
1860 { | |
1861 Playlist *playlist = playlist_get_active(); | |
1862 | |
1863 playlist_sort(playlist, PLAYLIST_SORT_ARTIST); | |
1864 playlistwin_update_list(playlist); | |
1865 } | |
1866 | |
1867 void action_playlist_sort_by_full_path(void) | |
1868 { | |
1869 Playlist *playlist = playlist_get_active(); | |
1870 | |
1871 playlist_sort(playlist, PLAYLIST_SORT_PATH); | |
1872 playlistwin_update_list(playlist); | |
1873 } | |
1874 | |
1875 void action_playlist_sort_by_date(void) | |
1876 { | |
1877 Playlist *playlist = playlist_get_active(); | |
1878 | |
1879 playlist_sort(playlist, PLAYLIST_SORT_DATE); | |
1880 playlistwin_update_list(playlist); | |
1881 } | |
1882 | |
1883 void action_playlist_sort_by_filename(void) | |
1884 { | |
1885 Playlist *playlist = playlist_get_active(); | |
1886 | |
1887 playlist_sort(playlist, PLAYLIST_SORT_FILENAME); | |
1888 playlistwin_update_list(playlist); | |
1889 } | |
1890 | |
1891 void action_playlist_sort_selected_by_playlist_entry(void) | |
1892 { | |
1893 Playlist *playlist = playlist_get_active(); | |
1894 | |
1895 playlist_sort_selected(playlist, PLAYLIST_SORT_PLAYLIST); | |
1896 playlistwin_update_list(playlist); | |
1897 } | |
1898 | |
1899 void action_playlist_sort_selected_by_track_number(void) | |
1900 { | |
1901 Playlist *playlist = playlist_get_active(); | |
1902 | |
1903 playlist_sort_selected(playlist, PLAYLIST_SORT_TRACK); | |
1904 playlistwin_update_list(playlist); | |
1905 } | |
1906 | |
1907 void action_playlist_sort_selected_by_title(void) | |
1908 { | |
1909 Playlist *playlist = playlist_get_active(); | |
1910 | |
1911 playlist_sort_selected(playlist, PLAYLIST_SORT_TITLE); | |
1912 playlistwin_update_list(playlist); | |
1913 } | |
1914 | |
1915 void action_playlist_sort_selected_by_artist(void) | |
1916 { | |
1917 Playlist *playlist = playlist_get_active(); | |
1918 | |
1919 playlist_sort_selected(playlist, PLAYLIST_SORT_ARTIST); | |
1920 playlistwin_update_list(playlist); | |
1921 } | |
1922 | |
1923 void action_playlist_sort_selected_by_full_path(void) | |
1924 { | |
1925 Playlist *playlist = playlist_get_active(); | |
1926 | |
1927 playlist_sort_selected(playlist, PLAYLIST_SORT_PATH); | |
1928 playlistwin_update_list(playlist); | |
1929 } | |
1930 | |
1931 void action_playlist_sort_selected_by_date(void) | |
1932 { | |
1933 Playlist *playlist = playlist_get_active(); | |
1934 | |
1935 playlist_sort_selected(playlist, PLAYLIST_SORT_DATE); | |
1936 playlistwin_update_list(playlist); | |
1937 } | |
1938 | |
1939 void action_playlist_sort_selected_by_filename(void) | |
1940 { | |
1941 Playlist *playlist = playlist_get_active(); | |
1942 | |
1943 playlist_sort_selected(playlist, PLAYLIST_SORT_FILENAME); | |
1944 playlistwin_update_list(playlist); | |
1945 } | |
1946 | |
1947 void action_playlist_randomize_list(void) | |
1948 { | |
1949 Playlist *playlist = playlist_get_active(); | |
1950 | |
1951 playlist_random(playlist); | |
1952 playlistwin_update_list(playlist); | |
1953 } | |
1954 | |
1955 void action_playlist_reverse_list(void) | |
1956 { | |
1957 Playlist *playlist = playlist_get_active(); | |
1958 | |
1959 playlist_reverse(playlist); | |
1960 playlistwin_update_list(playlist); | |
1961 } | |
1962 | |
1963 void | |
1964 action_playlist_clear_queue(void) | |
1965 { | |
1966 playlist_clear_queue(playlist_get_active()); | |
1967 } | |
1968 | |
1969 void | |
1970 action_playlist_remove_unavailable(void) | |
1971 { | |
1972 playlist_remove_dead_files(playlist_get_active()); | |
1973 } | |
1974 | |
1975 void | |
1976 action_playlist_remove_dupes_by_title(void) | |
1977 { | |
1978 playlist_remove_duplicates(playlist_get_active(), PLAYLIST_DUPS_TITLE); | |
1979 } | |
1980 | |
1981 void | |
1982 action_playlist_remove_dupes_by_filename(void) | |
1983 { | |
1984 playlist_remove_duplicates(playlist_get_active(), PLAYLIST_DUPS_FILENAME); | |
1985 } | |
1986 | |
1987 void | |
1988 action_playlist_remove_dupes_by_full_path(void) | |
1989 { | |
1990 playlist_remove_duplicates(playlist_get_active(), PLAYLIST_DUPS_PATH); | |
1991 } | |
1992 | |
1993 void | |
1994 action_playlist_remove_all(void) | |
1995 { | |
1996 playlist_clear(playlist_get_active()); | |
1997 | |
1998 /* XXX -- should this really be coupled here? -nenolod */ | |
1999 mainwin_clear_song_info(); | |
2000 mainwin_set_info_text(); | |
2001 } | |
2002 | |
2003 void | |
2004 action_playlist_remove_selected(void) | |
2005 { | |
2006 playlist_delete(playlist_get_active(), FALSE); | |
2007 } | |
2008 | |
2009 void | |
2010 action_playlist_remove_unselected(void) | |
2011 { | |
2012 playlist_delete(playlist_get_active(), TRUE); | |
2013 } | |
2014 | |
2015 void | |
2016 action_playlist_add_files(void) | |
2017 { | |
2416
0fd7f4f969ad
[svn] integrated urldecode.* from libaudacious into audacious directory, made separate ui_fileopener.*
mf0102
parents:
2373
diff
changeset
|
2018 run_filebrowser(NO_PLAY_BUTTON); |
2313 | 2019 } |
2020 | |
2021 void | |
2022 action_playlist_add_cd(void) | |
2023 { | |
2024 add_medium(); | |
2025 } | |
2026 | |
2027 void | |
2028 action_playlist_add_url(void) | |
2029 { | |
2030 mainwin_show_add_url_window(); | |
2031 } | |
2032 | |
2033 void | |
2034 action_playlist_new( void ) | |
2035 { | |
2036 Playlist *new_pl = playlist_new(); | |
2037 playlist_add_playlist(new_pl); | |
2038 playlist_select_playlist(new_pl); | |
2039 } | |
2040 | |
2041 void | |
2042 action_playlist_prev( void ) | |
2043 { | |
2807
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
2044 playlist_select_prev(); |
2313 | 2045 } |
2046 | |
2047 void | |
2048 action_playlist_next( void ) | |
2049 { | |
2807
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
2050 playlist_select_next(); |
2313 | 2051 } |
2052 | |
2053 void | |
2054 action_playlist_delete( void ) | |
2055 { | |
2807
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
2056 playlist_remove_playlist( playlist_get_active() ); |
2313 | 2057 } |
2058 | |
2059 void | |
2060 action_playlist_save_list(void) | |
2061 { | |
2062 Playlist *playlist = playlist_get_active(); | |
2063 | |
2064 playlistwin_select_playlist_to_save(playlist_get_current_name(playlist)); | |
2065 } | |
2066 | |
2067 void | |
2068 action_playlist_save_default_list(void) | |
2069 { | |
2070 Playlist *playlist = playlist_get_active(); | |
2071 | |
2072 playlist_save(playlist, bmp_paths[BMP_PATH_PLAYLIST_FILE]); | |
2073 } | |
2074 | |
2075 void | |
2076 action_playlist_load_list(void) | |
2077 { | |
2078 Playlist *playlist = playlist_get_active(); | |
2079 | |
2080 playlistwin_select_playlist_to_load(playlist_get_current_name(playlist)); | |
2081 } | |
2082 | |
2083 void | |
2084 action_playlist_refresh_list(void) | |
2085 { | |
2086 Playlist *playlist = playlist_get_active(); | |
2087 | |
2088 playlist_read_info_selection(playlist); | |
2089 playlistwin_update_list(playlist); | |
2090 } | |
2091 | |
2092 void | |
2093 action_open_list_manager(void) | |
2094 { | |
2095 playlist_manager_ui_show(); | |
2096 } | |
2097 | |
2098 void | |
2099 action_playlist_search_and_select(void) | |
2100 { | |
2101 playlistwin_select_search(); | |
2102 } | |
2103 | |
2104 void | |
2105 action_playlist_invert_selection(void) | |
2106 { | |
2107 playlistwin_inverse_selection(); | |
2108 } | |
2109 | |
2110 void | |
2111 action_playlist_select_none(void) | |
2112 { | |
2113 playlistwin_select_none(); | |
2114 } | |
2115 | |
2116 void | |
2117 action_playlist_select_all(void) | |
2118 { | |
2119 playlistwin_select_all(); | |
2120 } | |
2121 | |
2122 | |
2123 | |
2124 /* playlistwin_select_search callback functions | |
2125 placed here to avoid making the code messier :) */ | |
2126 void | |
2363 | 2127 playlistwin_select_search_cbt_cb(GtkWidget *called_cbt, gpointer other_cbt) |
2313 | 2128 { |
2363 | 2129 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(called_cbt)) == TRUE) |
2130 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(other_cbt), FALSE); | |
2313 | 2131 return; |
2132 } | |
2133 | |
2134 static gboolean | |
2363 | 2135 playlistwin_select_search_kp_cb(GtkWidget *entry, GdkEventKey *event, |
2807
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
2136 gpointer searchdlg_win) |
2313 | 2137 { |
2138 switch (event->keyval) | |
2139 { | |
2140 case GDK_Return: | |
2363 | 2141 gtk_dialog_response(GTK_DIALOG(searchdlg_win), GTK_RESPONSE_ACCEPT); |
2313 | 2142 return TRUE; |
2143 default: | |
2144 return FALSE; | |
2145 } | |
2146 } | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
2147 |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
2148 |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
2149 /* fileinfopopup callback for playlistwin */ |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
2150 static gboolean |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
2151 playlistwin_fileinfopopup_probe(gpointer * filepopup_win) |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
2152 { |
2363 | 2153 gint x, y, pos; |
2154 TitleInput *tuple; | |
2155 static gint prev_x = 0, prev_y = 0, ctr = 0, prev_pos = -1; | |
2156 static gint shaded_pos = -1, shaded_prev_pos = -1; | |
2157 gboolean skip = FALSE; | |
2158 GdkWindow *win; | |
2159 Playlist *playlist = playlist_get_active(); | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
2160 |
2363 | 2161 win = gdk_window_at_pointer(NULL, NULL); |
2162 gdk_window_get_pointer(GDK_WINDOW(playlistwin->window), &x, &y, NULL); | |
2163 pos = playlist_list_get_playlist_position(playlistwin_list, x, y); | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
2164 |
2363 | 2165 if (win == NULL |
2166 || cfg.show_filepopup_for_tuple == FALSE | |
2167 || playlistwin_list->pl_tooltips == FALSE | |
2168 || pos != prev_pos | |
2169 || win != GDK_WINDOW(playlistwin->window)) | |
2170 { | |
2171 prev_pos = pos; | |
2172 ctr = 0; | |
2173 audacious_fileinfopopup_hide(GTK_WIDGET(filepopup_win), NULL); | |
2174 return TRUE; | |
2175 } | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
2176 |
2363 | 2177 if (prev_x == x && prev_y == y) |
2178 ctr++; | |
2179 else | |
2180 { | |
2181 ctr = 0; | |
2182 prev_x = x; | |
2183 prev_y = y; | |
2184 audacious_fileinfopopup_hide(GTK_WIDGET(filepopup_win), NULL); | |
2185 return TRUE; | |
2186 } | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
2187 |
2363 | 2188 if (playlistwin_is_shaded()) |
2189 { | |
2190 shaded_pos = playlist_get_position(playlist); | |
2191 if (shaded_prev_pos != shaded_pos) | |
2192 skip = TRUE; | |
2193 } | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
2194 |
2807
26755684c0dc
[svn] - Fixed naming inconsistencies in search dialog
mf0102
parents:
2653
diff
changeset
|
2195 if (ctr >= cfg.filepopup_delay && (skip == TRUE || GTK_WIDGET_VISIBLE(GTK_WIDGET(filepopup_win)) != TRUE)) { |
2363 | 2196 if (pos == -1 && !playlistwin_is_shaded()) |
2197 { | |
2198 audacious_fileinfopopup_hide(GTK_WIDGET(filepopup_win), NULL); | |
2199 return TRUE; | |
2200 } | |
2201 /* shaded mode */ | |
2202 else | |
2203 { | |
2204 tuple = playlist_get_tuple(playlist, shaded_pos); | |
2205 audacious_fileinfopopup_hide(GTK_WIDGET(filepopup_win), NULL); | |
2206 audacious_fileinfopopup_show_from_tuple(GTK_WIDGET(filepopup_win), tuple); | |
2207 shaded_prev_pos = shaded_pos; | |
2208 } | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
2209 |
2363 | 2210 prev_pos = pos; |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
2211 |
2363 | 2212 tuple = playlist_get_tuple(playlist, pos); |
2213 audacious_fileinfopopup_show_from_tuple(GTK_WIDGET(filepopup_win), tuple); | |
2214 } | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
2215 |
2363 | 2216 return TRUE; |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
2338
diff
changeset
|
2217 } |