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