annotate src/audacious/ui_playlist.c @ 4505:a849b8af8db6

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