Mercurial > audlegacy
annotate src/audlegacy/ui_jumptotrack.c @ 4832:fb89eae5492c
Acknowledge contributions from John Lindgren, Debian bug #517692.
author | Tony Vroon <chainsaw@gentoo.org> |
---|---|
date | Wed, 04 Mar 2009 13:02:14 +0000 |
parents | 7bf7f83a217e |
children |
rev | line source |
---|---|
4700
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1 /* Audacious - Cross-platform multimedia player |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
2 * Copyright (C) 2005-2006 Audacious development team. |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
3 * |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
4 * BMP - Cross-platform multimedia player |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
5 * Copyright (C) 2003-2004 BMP development team. |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
6 * |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
7 * Based on XMMS: |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
8 * Copyright (C) 1998-2003 XMMS development team. |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
9 * |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
10 * This program is free software; you can redistribute it and/or modify |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
11 * it under the terms of the GNU General Public License as published by |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
12 * the Free Software Foundation; under version 3 of the License. |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
13 * |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
14 * This program is distributed in the hope that it will be useful, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
17 * GNU General Public License for more details. |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
18 * |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
19 * You should have received a copy of the GNU General Public License |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
20 * along with this program. If not, see <http://www.gnu.org/licenses>. |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
21 * |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
22 * The Audacious team does not consider modular code linking to |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
23 * Audacious or using our public API to be a derived work. |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
24 */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
25 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
26 #ifdef HAVE_CONFIG_H |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
27 # include "config.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
28 #endif |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
29 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
30 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
31 #include <glib.h> |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
32 #include <glib/gi18n.h> |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
33 #include <glib/gprintf.h> |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
34 #include <gtk/gtk.h> |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
35 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
36 /* GDK including */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
37 #include "platform/smartinclude.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
38 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
39 #include <math.h> |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
40 #include <stdlib.h> |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
41 #include <string.h> |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
42 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
43 #include <sys/types.h> |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
44 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
45 #if defined(USE_REGEX_ONIGURUMA) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
46 #include <onigposix.h> |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
47 #elif defined(USE_REGEX_PCRE) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
48 #include <pcreposix.h> |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
49 #else |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
50 #include <regex.h> |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
51 #endif |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
52 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
53 #include "icons-stock.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
54 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
55 #include "actions-mainwin.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
56 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
57 #include "main.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
58 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
59 #include "dnd.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
60 #include "input.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
61 #include "playback.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
62 #include "playlist.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
63 #include "pluginenum.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
64 #include "ui_credits.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
65 #include "ui_fileopener.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
66 #include "ui_preferences.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
67 #include "strings.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
68 #include "util.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
69 #include "visualization.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
70 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
71 #include "ui_jumptotrack_cache.h" |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
72 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
73 static GtkWidget *jump_to_track_win = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
74 static gulong serial = 0; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
75 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
76 static JumpToTrackCache* cache = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
77 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
78 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
79 change_song(guint pos) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
80 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
81 if (playback_get_playing()) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
82 playback_stop(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
83 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
84 playlist_set_position(playlist_get_active(), pos); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
85 playback_initiate(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
86 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
87 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
88 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
89 ui_jump_to_track_hide(void) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
90 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
91 g_return_if_fail(jump_to_track_win != NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
92 gtk_widget_hide(jump_to_track_win); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
93 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
94 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
95 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
96 ui_jump_to_track_jump(GtkTreeView * treeview) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
97 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
98 GtkTreeModel *model; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
99 GtkTreeSelection *selection; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
100 GtkTreeIter iter; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
101 guint pos; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
102 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
103 model = gtk_tree_view_get_model(treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
104 selection = gtk_tree_view_get_selection(treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
105 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
106 if (!gtk_tree_selection_get_selected(selection, NULL, &iter)) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
107 return; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
108 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
109 gtk_tree_model_get(model, &iter, 0, &pos, -1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
110 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
111 change_song(pos - 1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
112 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
113 if(cfg.close_jtf_dialog) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
114 ui_jump_to_track_hide(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
115 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
116 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
117 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
118 ui_jump_to_track_toggle_cb(GtkWidget * toggle) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
119 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
120 cfg.close_jtf_dialog = |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
121 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
122 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
123 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
124 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
125 ui_jump_to_track_toggle2_cb(GtkWidget * toggle) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
126 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
127 cfg.remember_jtf_entry = |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
128 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
129 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
130 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
131 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
132 ui_jump_to_track_jump_cb(GtkTreeView * treeview, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
133 gpointer data) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
134 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
135 ui_jump_to_track_jump(treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
136 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
137 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
138 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
139 ui_jump_to_track_set_queue_button_label(GtkButton * button, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
140 guint pos) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
141 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
142 if (playlist_is_position_queued(playlist_get_active(), pos)) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
143 gtk_button_set_label(button, _("Un_queue")); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
144 else |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
145 gtk_button_set_label(button, _("_Queue")); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
146 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
147 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
148 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
149 ui_jump_to_track_queue_cb(GtkButton * button, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
150 gpointer data) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
151 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
152 GtkTreeView *treeview; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
153 GtkTreeModel *model; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
154 GtkTreeSelection *selection; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
155 GtkTreeIter iter; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
156 guint pos; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
157 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
158 treeview = GTK_TREE_VIEW(data); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
159 model = gtk_tree_view_get_model(treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
160 selection = gtk_tree_view_get_selection(treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
161 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
162 if (!gtk_tree_selection_get_selected(selection, NULL, &iter)) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
163 return; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
164 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
165 gtk_tree_model_get(model, &iter, 0, &pos, -1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
166 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
167 playlist_queue_position(playlist_get_active(), (pos - 1)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
168 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
169 ui_jump_to_track_set_queue_button_label(button, (pos - 1)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
170 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
171 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
172 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
173 ui_jump_to_track_selection_changed_cb(GtkTreeSelection *treesel, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
174 gpointer data) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
175 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
176 GtkTreeView *treeview; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
177 GtkTreeModel *model; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
178 GtkTreeSelection *selection; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
179 GtkTreeIter iter; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
180 guint pos; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
181 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
182 treeview = gtk_tree_selection_get_tree_view(treesel); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
183 model = gtk_tree_view_get_model(treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
184 selection = gtk_tree_view_get_selection(treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
185 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
186 if (!gtk_tree_selection_get_selected(selection, NULL, &iter)) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
187 return; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
188 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
189 gtk_tree_model_get(model, &iter, 0, &pos, -1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
190 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
191 ui_jump_to_track_set_queue_button_label(GTK_BUTTON(data), (pos - 1)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
192 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
193 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
194 static gboolean |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
195 ui_jump_to_track_edit_keypress_cb(GtkWidget * object, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
196 GdkEventKey * event, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
197 gpointer data) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
198 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
199 switch (event->keyval) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
200 case GDK_Return: |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
201 if (gtk_im_context_filter_keypress (GTK_ENTRY (object)->im_context, event)) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
202 GTK_ENTRY (object)->need_im_reset = TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
203 return TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
204 } else { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
205 ui_jump_to_track_jump(GTK_TREE_VIEW(data)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
206 return TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
207 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
208 default: |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
209 return FALSE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
210 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
211 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
212 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
213 static gboolean |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
214 ui_jump_to_track_keypress_cb(GtkWidget * object, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
215 GdkEventKey * event, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
216 gpointer data) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
217 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
218 switch (event->keyval) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
219 case GDK_Escape: |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
220 ui_jump_to_track_hide(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
221 return TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
222 case GDK_KP_Enter: |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
223 ui_jump_to_track_queue_cb(NULL, data); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
224 return TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
225 default: |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
226 return FALSE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
227 }; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
228 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
229 return FALSE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
230 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
231 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
232 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
233 ui_jump_to_track_update(GtkWidget * widget, gpointer user_data) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
234 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
235 guint row; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
236 GList *playlist_glist; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
237 gchar *desc_buf = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
238 GtkTreeIter iter; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
239 GtkTreeSelection *selection; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
240 Playlist *playlist; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
241 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
242 GtkTreeModel *store; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
243 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
244 GtkTreeView *tree = GTK_TREE_VIEW(g_object_get_data(user_data, "treeview")); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
245 GtkEntry *edit = g_object_get_data(user_data, "edit"); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
246 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
247 if (!jump_to_track_win) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
248 return; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
249 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
250 /* clear edit widget */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
251 if(edit){ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
252 gtk_entry_set_text(edit, ""); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
253 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
254 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
255 store = gtk_tree_view_get_model(tree); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
256 gtk_list_store_clear(GTK_LIST_STORE(store)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
257 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
258 row = 1; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
259 playlist = playlist_get_active(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
260 for (playlist_glist = playlist->entries; playlist_glist; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
261 playlist_glist = g_list_next(playlist_glist)) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
262 PlaylistEntry *entry = PLAYLIST_ENTRY(playlist_glist->data); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
263 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
264 if (entry->title) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
265 desc_buf = g_strdup(entry->title); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
266 else { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
267 gchar *realfn = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
268 realfn = g_filename_from_uri(entry->filename, NULL, NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
269 if (strchr(realfn ? realfn : entry->filename, '/')) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
270 desc_buf = str_assert_utf8(strrchr(realfn ? realfn : entry->filename, '/') + 1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
271 else |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
272 desc_buf = str_assert_utf8(realfn ? realfn : entry->filename); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
273 g_free(realfn); realfn = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
274 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
275 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
276 gtk_list_store_append(GTK_LIST_STORE(store), &iter); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
277 gtk_list_store_set(GTK_LIST_STORE(store), &iter, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
278 0, row, 1, desc_buf, -1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
279 row++; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
280 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
281 g_free(desc_buf); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
282 desc_buf = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
283 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
284 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
285 gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
286 selection = gtk_tree_view_get_selection(tree); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
287 gtk_tree_selection_select_iter(selection, &iter); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
288 serial = playlist->serial; // important. --yaz |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
289 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
290 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
291 static void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
292 ui_jump_to_track_edit_cb(GtkEntry * entry, gpointer user_data) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
293 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
294 GtkTreeView *treeview = GTK_TREE_VIEW(user_data); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
295 GtkTreeSelection *selection; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
296 GtkTreeIter iter; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
297 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
298 GtkListStore *store; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
299 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
300 const GArray *search_matches; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
301 Playlist *playlist; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
302 int i; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
303 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
304 if (cache == NULL) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
305 cache = ui_jump_to_track_cache_new(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
306 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
307 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
308 /* FIXME: Remove the connected signals before clearing |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
309 * (row-selected will still eventually arrive once) */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
310 store = GTK_LIST_STORE(gtk_tree_view_get_model(treeview)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
311 /* detach model from treeview */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
312 g_object_ref( store ); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
313 gtk_tree_view_set_model( GTK_TREE_VIEW(treeview) , NULL ); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
314 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
315 gtk_list_store_clear(store); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
316 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
317 playlist = playlist_get_active(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
318 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
319 PLAYLIST_LOCK(playlist); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
320 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
321 search_matches = ui_jump_to_track_cache_search(cache, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
322 playlist, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
323 gtk_entry_get_text(entry)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
324 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
325 for (i = 0; i < search_matches->len; i++) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
326 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
327 JumpToTrackEntry *jttentry = g_array_index(search_matches, JumpToTrackEntry*, i); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
328 PlaylistEntry* entry = jttentry->entry; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
329 gchar *title = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
330 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
331 if (entry->title) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
332 title = g_strdup(entry->title); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
333 else { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
334 gchar *realfn = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
335 realfn = g_filename_from_uri(entry->filename, NULL, NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
336 if (strchr(realfn ? realfn : entry->filename, '/')) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
337 title = str_assert_utf8(strrchr(realfn ? realfn : entry->filename, '/') + 1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
338 else |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
339 title = str_assert_utf8(realfn ? realfn : entry->filename); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
340 g_free(realfn); realfn = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
341 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
342 gtk_list_store_append(store, &iter); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
343 gtk_list_store_set(store, &iter, 0, jttentry->playlist_position + 1 , 1, title, -1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
344 g_free(title); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
345 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
346 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
347 PLAYLIST_UNLOCK(playlist); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
348 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
349 /* attach the model again to the treeview */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
350 gtk_tree_view_set_model( GTK_TREE_VIEW(treeview) , GTK_TREE_MODEL(store) ); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
351 g_object_unref( store ); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
352 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
353 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
354 selection = gtk_tree_view_get_selection(treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
355 gtk_tree_selection_select_iter(selection, &iter); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
356 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
357 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
358 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
359 static gboolean |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
360 ui_jump_to_track_fill(gpointer treeview) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
361 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
362 GList *playlist_glist; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
363 Playlist *playlist; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
364 gchar *desc_buf = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
365 guint row; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
366 GtkTreeIter iter; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
367 GtkListStore *jtf_store = (GtkListStore*)gtk_tree_view_get_model( GTK_TREE_VIEW(treeview) ); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
368 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
369 /* detach model from treeview before fill */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
370 g_object_ref(jtf_store); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
371 gtk_tree_view_set_model( GTK_TREE_VIEW(treeview), NULL ); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
372 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
373 gtk_list_store_clear(jtf_store); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
374 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
375 row = 1; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
376 playlist = playlist_get_active(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
377 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
378 PLAYLIST_LOCK(playlist); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
379 for (playlist_glist = playlist->entries; playlist_glist; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
380 playlist_glist = g_list_next(playlist_glist)) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
381 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
382 PlaylistEntry *entry = PLAYLIST_ENTRY(playlist_glist->data); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
383 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
384 if (entry->title) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
385 desc_buf = g_strdup(entry->title); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
386 else { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
387 gchar *realfn = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
388 realfn = g_filename_from_uri(entry->filename, NULL, NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
389 if (strchr(realfn ? realfn : entry->filename, '/')) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
390 desc_buf = str_assert_utf8(strrchr(realfn ? realfn : entry->filename, '/') + 1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
391 else |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
392 desc_buf = str_assert_utf8(realfn ? realfn : entry->filename); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
393 g_free(realfn); realfn = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
394 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
395 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
396 gtk_list_store_append(GTK_LIST_STORE(jtf_store), &iter); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
397 gtk_list_store_set(GTK_LIST_STORE(jtf_store), &iter, |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
398 0, row, 1, desc_buf, -1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
399 row++; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
400 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
401 g_free(desc_buf); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
402 desc_buf = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
403 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
404 PLAYLIST_UNLOCK(playlist); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
405 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
406 /* attach liststore to treeview */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
407 gtk_tree_view_set_model(GTK_TREE_VIEW(treeview), GTK_TREE_MODEL(jtf_store)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
408 g_object_unref(jtf_store); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
409 serial = playlist->serial; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
410 return FALSE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
411 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
412 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
413 static gboolean |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
414 watchdog(gpointer storage) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
415 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
416 GtkWidget *widget; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
417 Playlist *playlist = playlist_get_active(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
418 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
419 if(serial == playlist->serial) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
420 return TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
421 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
422 widget = g_object_get_data(storage, "widget"); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
423 ui_jump_to_track_update(widget, storage); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
424 return TRUE; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
425 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
426 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
427 void |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
428 ui_jump_to_track(void) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
429 { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
430 GtkWidget *scrollwin; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
431 GtkWidget *vbox, *bbox, *sep; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
432 GtkWidget *toggle, *toggle2; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
433 GtkWidget *jump, *queue, *close; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
434 GtkWidget *rescan; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
435 GtkWidget *search_label, *hbox; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
436 static GtkWidget *edit; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
437 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
438 GtkWidget *treeview = NULL; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
439 GtkListStore *jtf_store; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
440 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
441 GtkCellRenderer *renderer; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
442 GtkTreeViewColumn *column; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
443 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
444 gpointer storage; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
445 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
446 if (jump_to_track_win) { |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
447 gtk_window_present(GTK_WINDOW(jump_to_track_win)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
448 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
449 if(!cfg.remember_jtf_entry) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
450 gtk_entry_set_text(GTK_ENTRY(edit), ""); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
451 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
452 gtk_widget_grab_focus(edit); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
453 gtk_editable_select_region(GTK_EDITABLE(edit), 0, -1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
454 return; |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
455 } |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
456 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
457 #if defined(USE_REGEX_ONIGURUMA) |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
458 /* set encoding for Oniguruma regex to UTF-8 */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
459 reg_set_encoding( REG_POSIX_ENCODING_UTF8 ); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
460 onig_set_default_syntax( ONIG_SYNTAX_POSIX_BASIC ); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
461 #endif |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
462 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
463 jump_to_track_win = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
464 gtk_window_set_type_hint(GTK_WINDOW(jump_to_track_win), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
465 GDK_WINDOW_TYPE_HINT_DIALOG); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
466 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
467 gtk_window_set_title(GTK_WINDOW(jump_to_track_win), _("Jump to Track")); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
468 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
469 gtk_window_set_position(GTK_WINDOW(jump_to_track_win), GTK_WIN_POS_CENTER); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
470 g_signal_connect(jump_to_track_win, "destroy", |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
471 G_CALLBACK(gtk_widget_destroyed), &jump_to_track_win); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
472 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
473 gtk_container_border_width(GTK_CONTAINER(jump_to_track_win), 10); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
474 gtk_window_set_default_size(GTK_WINDOW(jump_to_track_win), 600, 500); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
475 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
476 vbox = gtk_vbox_new(FALSE, 5); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
477 gtk_container_add(GTK_CONTAINER(jump_to_track_win), vbox); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
478 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
479 jtf_store = gtk_list_store_new(2, G_TYPE_UINT, G_TYPE_STRING); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
480 treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(jtf_store)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
481 g_object_unref(jtf_store); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
482 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
483 gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
484 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
485 column = gtk_tree_view_column_new(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
486 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
487 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
488 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
489 renderer = gtk_cell_renderer_text_new(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
490 gtk_tree_view_column_pack_start(column, renderer, FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
491 gtk_tree_view_column_set_attributes(column, renderer, "text", 0, NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
492 gtk_tree_view_column_set_spacing(column, 4); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
493 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
494 renderer = gtk_cell_renderer_text_new(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
495 gtk_tree_view_column_pack_start(column, renderer, FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
496 gtk_tree_view_column_set_attributes(column, renderer, "text", 1, NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
497 gtk_tree_view_column_set_spacing(column, 4); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
498 gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
499 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
500 gtk_tree_view_set_search_column(GTK_TREE_VIEW(treeview), 1); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
501 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
502 g_signal_connect(treeview, "row-activated", |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
503 G_CALLBACK(ui_jump_to_track_jump), NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
504 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
505 hbox = gtk_hbox_new(FALSE, 3); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
506 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 3); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
507 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
508 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
509 /* filter box */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
510 search_label = gtk_label_new(_("Filter: ")); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
511 gtk_label_set_markup_with_mnemonic(GTK_LABEL(search_label), _("_Filter:")); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
512 gtk_box_pack_start(GTK_BOX(hbox), search_label, FALSE, FALSE, 0); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
513 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
514 edit = gtk_entry_new(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
515 gtk_entry_set_editable(GTK_ENTRY(edit), TRUE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
516 gtk_label_set_mnemonic_widget(GTK_LABEL(search_label), edit); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
517 g_signal_connect(edit, "changed", |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
518 G_CALLBACK(ui_jump_to_track_edit_cb), treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
519 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
520 g_signal_connect(edit, "key_press_event", |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
521 G_CALLBACK(ui_jump_to_track_edit_keypress_cb), treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
522 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
523 g_signal_connect(jump_to_track_win, "key_press_event", |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
524 G_CALLBACK(ui_jump_to_track_keypress_cb), treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
525 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
526 gtk_box_pack_start(GTK_BOX(hbox), edit, TRUE, TRUE, 3); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
527 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
528 /* remember text entry */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
529 toggle2 = gtk_check_button_new_with_label(_("Remember")); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
530 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle2), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
531 cfg.remember_jtf_entry ? TRUE : FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
532 gtk_box_pack_start(GTK_BOX(hbox), toggle2, FALSE, FALSE, 0); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
533 g_signal_connect(toggle2, "clicked", |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
534 G_CALLBACK(ui_jump_to_track_toggle2_cb), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
535 toggle2); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
536 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
537 /* clear button */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
538 rescan = gtk_button_new_from_stock(GTK_STOCK_CLEAR); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
539 gtk_box_pack_start(GTK_BOX(hbox), rescan, FALSE, FALSE, 0); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
540 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
541 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
542 /* pack to container */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
543 storage = g_object_new(G_TYPE_OBJECT, NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
544 g_object_set_data(storage, "widget", rescan); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
545 g_object_set_data(storage, "treeview", treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
546 g_object_set_data(storage, "edit", edit); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
547 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
548 g_signal_connect(rescan, "clicked", |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
549 G_CALLBACK(ui_jump_to_track_update), storage); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
550 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
551 GTK_WIDGET_SET_FLAGS(rescan, GTK_CAN_DEFAULT); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
552 gtk_widget_grab_default(rescan); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
553 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
554 scrollwin = gtk_scrolled_window_new(NULL, NULL); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
555 gtk_container_add(GTK_CONTAINER(scrollwin), treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
556 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
557 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
558 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrollwin), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
559 GTK_SHADOW_IN); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
560 gtk_box_pack_start(GTK_BOX(vbox), scrollwin, TRUE, TRUE, 0); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
561 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
562 sep = gtk_hseparator_new(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
563 gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
564 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
565 bbox = gtk_hbutton_box_new(); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
566 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
567 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 4); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
568 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
569 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
570 /* close dialog toggle */ |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
571 toggle = gtk_check_button_new_with_label(_("Close on Jump")); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
572 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
573 cfg.close_jtf_dialog ? TRUE : FALSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
574 gtk_box_pack_start(GTK_BOX(bbox), toggle, FALSE, FALSE, 0); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
575 g_signal_connect(toggle, "clicked", |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
576 G_CALLBACK(ui_jump_to_track_toggle_cb), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
577 toggle); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
578 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
579 queue = gtk_button_new_with_mnemonic(_("_Queue")); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
580 gtk_button_set_image(GTK_BUTTON(queue), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
581 gtk_image_new_from_stock(AUD_STOCK_QUEUETOGGLE, GTK_ICON_SIZE_BUTTON)); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
582 gtk_box_pack_start(GTK_BOX(bbox), queue, FALSE, FALSE, 0); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
583 GTK_WIDGET_SET_FLAGS(queue, GTK_CAN_DEFAULT); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
584 g_signal_connect(queue, "clicked", |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
585 G_CALLBACK(ui_jump_to_track_queue_cb), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
586 treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
587 g_signal_connect(gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)), "changed", |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
588 G_CALLBACK(ui_jump_to_track_selection_changed_cb), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
589 queue); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
590 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
591 jump = gtk_button_new_from_stock(GTK_STOCK_JUMP_TO); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
592 gtk_box_pack_start(GTK_BOX(bbox), jump, FALSE, FALSE, 0); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
593 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
594 g_signal_connect_swapped(jump, "clicked", |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
595 G_CALLBACK(ui_jump_to_track_jump_cb), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
596 treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
597 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
598 GTK_WIDGET_SET_FLAGS(jump, GTK_CAN_DEFAULT); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
599 gtk_widget_grab_default(jump); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
600 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
601 close = gtk_button_new_from_stock(GTK_STOCK_CLOSE); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
602 gtk_box_pack_start(GTK_BOX(bbox), close, FALSE, FALSE, 0); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
603 g_signal_connect_swapped(close, "clicked", |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
604 G_CALLBACK(gtk_widget_hide), |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
605 jump_to_track_win); // just hide --yaz |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
606 GTK_WIDGET_SET_FLAGS(close, GTK_CAN_DEFAULT); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
607 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
608 g_timeout_add(100, (GSourceFunc)ui_jump_to_track_fill, treeview); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
609 g_timeout_add(500, (GSourceFunc)watchdog, storage); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
610 |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
611 gtk_widget_show_all(jump_to_track_win); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
612 gtk_widget_grab_focus(edit); |
3a56d2786063
move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
613 } |