Mercurial > audlegacy
annotate src/audacious/ui_fileinfopopup.c @ 2608:f4fa6b295b43 trunk
[svn] - Remove even more duplicate code
author | mf0102 |
---|---|
date | Mon, 05 Mar 2007 13:50:32 -0800 |
parents | 7c19bb5516db |
children | 2c41c0ef0c36 |
rev | line source |
---|---|
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
1 /* |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
2 * Audacious: A cross-platform multimedia player |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
3 * Copyright (c) 2006 William Pitcock, Tony Vroon, George Averill, |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
4 * Giacomo Lozito, Derek Pomery and Yoshiki Yazawa. |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
5 * |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
6 * This program is free software; you can redistribute it and/or modify |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
7 * it under the terms of the GNU General Public License as published by |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
8 * the Free Software Foundation; under version 2 of the License. |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
9 * |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
10 * This program is distributed in the hope that it will be useful, |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
13 * GNU General Public License for more details. |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
14 * |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
16 * along with this program; if not, write to the Free Software |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
18 * 02110-1301, USA. |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
19 */ |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
20 |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
21 #ifdef HAVE_CONFIG_H |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
22 # include "config.h" |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
23 #endif |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
24 |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
25 #include <glib.h> |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
26 #include <glib/gi18n.h> |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
27 #include <gtk/gtk.h> |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
28 #include <string.h> |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
29 |
2604 | 30 #include "main.h" |
31 #include "playlist.h" | |
32 #include "playback.h" | |
33 #include "strings.h" | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
34 #include "titlestring.h" |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
35 #include "ui_fileinfopopup.h" |
2604 | 36 #include "ui_fileinfo.h" |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
37 |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
38 static void |
2604 | 39 filepopup_entry_set_text(GtkWidget *filepopup_win, const gchar *entry_name, |
40 const gchar *text) | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
41 { |
2604 | 42 GtkWidget *widget = g_object_get_data(G_OBJECT(filepopup_win), entry_name); |
43 g_return_if_fail(widget != NULL); | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
44 |
2604 | 45 gtk_label_set_text(GTK_LABEL(widget), text); |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
46 } |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
47 |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
48 static void |
2604 | 49 filepopup_entry_set_image(GtkWidget *filepopup_win, const gchar *entry_name, |
50 const gchar *text) | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
51 { |
2604 | 52 GtkWidget *widget = g_object_get_data(G_OBJECT(filepopup_win), entry_name); |
53 GdkPixbuf *pixbuf, *pixbuf2; | |
54 int width, height; | |
55 double aspect; | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
56 |
2604 | 57 g_return_if_fail(widget != NULL); |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
58 |
2604 | 59 pixbuf = gdk_pixbuf_new_from_file(text, NULL); |
60 g_return_if_fail(pixbuf != NULL); | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
61 |
2604 | 62 width = gdk_pixbuf_get_width(GDK_PIXBUF(pixbuf)); |
63 height = gdk_pixbuf_get_height(GDK_PIXBUF(pixbuf)); | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
64 |
2604 | 65 if (strcmp(DATA_DIR "/images/audio.png", text)) |
66 { | |
67 if (width == 0) | |
68 width = 1; | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
69 |
2604 | 70 aspect = (double)height / (double)width; |
71 if (aspect > 1.0) { | |
72 height = (int)(cfg.filepopup_pixelsize * aspect); | |
73 width = cfg.filepopup_pixelsize; | |
74 } else { | |
75 height = cfg.filepopup_pixelsize; | |
76 width = (int)(cfg.filepopup_pixelsize / aspect); | |
77 } | |
78 | |
79 pixbuf2 = gdk_pixbuf_scale_simple(GDK_PIXBUF(pixbuf), width, height, | |
80 GDK_INTERP_BILINEAR); | |
81 g_object_unref(G_OBJECT(pixbuf)); | |
82 pixbuf = pixbuf2; | |
83 } | |
84 | |
85 gtk_image_set_from_pixbuf(GTK_IMAGE(widget), GDK_PIXBUF(pixbuf)); | |
86 g_object_unref(G_OBJECT(pixbuf)); | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
87 } |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
88 |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
89 static gboolean |
2604 | 90 audacious_fileinfopopup_progress_cb(gpointer filepopup_win) |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
91 { |
2604 | 92 GtkWidget *progressbar = |
93 g_object_get_data(G_OBJECT(filepopup_win), "progressbar"); | |
94 gchar *tooltip_file = g_object_get_data(G_OBJECT(filepopup_win), "file"); | |
95 gchar *current_file; | |
96 Playlist *pl; | |
97 gint length = | |
98 GPOINTER_TO_INT(g_object_get_data(G_OBJECT(filepopup_win), "length")); | |
99 gint pos, time; | |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
100 |
2604 | 101 g_return_val_if_fail(progressbar != NULL, FALSE); |
2484
adc63272c9ff
[svn] - add some debugging assertions to this code
nenolod
parents:
2442
diff
changeset
|
102 |
2604 | 103 pl = playlist_get_active(); |
104 g_return_val_if_fail(pl != NULL, FALSE); | |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
105 |
2604 | 106 pos = playlist_get_position(pl); |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
107 |
2604 | 108 current_file = playlist_get_filename(pl , pos); |
109 time = playback_get_time(); | |
110 | |
111 g_return_val_if_fail(current_file != NULL, FALSE); | |
2484
adc63272c9ff
[svn] - add some debugging assertions to this code
nenolod
parents:
2442
diff
changeset
|
112 |
2604 | 113 if (time != -1 && length != -1 && |
114 current_file != NULL && tooltip_file != NULL && | |
115 !strcmp(tooltip_file, current_file) && cfg.filepopup_showprogressbar) | |
116 { | |
117 gchar *progress_time = | |
118 g_strdup_printf("%d:%02d", time / 60000, (time / 1000) % 60); | |
119 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar), | |
120 (gdouble)time / (gdouble)length); | |
121 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progressbar), progress_time); | |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
122 |
2604 | 123 if (!GTK_WIDGET_VISIBLE(progressbar)) |
124 gtk_widget_show(progressbar); | |
125 | |
126 g_free(progress_time); | |
127 } | |
128 else | |
129 { | |
130 /* tooltip opened, but song is not the same, | |
131 * or playback is stopped, or length is not applicabile */ | |
132 if (GTK_WIDGET_VISIBLE(progressbar)) | |
133 gtk_widget_hide(progressbar); | |
134 } | |
135 | |
136 return TRUE; | |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
137 } |
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
138 |
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
139 static gboolean |
2604 | 140 audacious_fileinfopopup_progress_check_active(GtkWidget *filepopup_win) |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
141 { |
2604 | 142 if (g_object_get_data(G_OBJECT(filepopup_win), "progress_sid") == NULL) |
143 return FALSE; | |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
144 return TRUE; |
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
145 } |
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
146 |
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
147 static void |
2604 | 148 audacious_fileinfopopup_progress_init(GtkWidget *filepopup_win) |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
149 { |
2604 | 150 g_object_set_data(G_OBJECT(filepopup_win), "progress_sid", NULL); |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
151 } |
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
152 |
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
153 static void |
2604 | 154 audacious_fileinfopopup_progress_start(GtkWidget *filepopup_win) |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
155 { |
2604 | 156 gint sid = |
157 g_timeout_add(500, (GSourceFunc)audacious_fileinfopopup_progress_cb, | |
158 filepopup_win); | |
159 g_object_set_data(G_OBJECT(filepopup_win), "progress_sid", | |
160 GINT_TO_POINTER(sid)); | |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
161 } |
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
162 |
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
163 static void |
2604 | 164 audacious_fileinfopopup_progress_stop(GtkWidget *filepopup_win) |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
165 { |
2604 | 166 gint sid = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(filepopup_win), |
167 "progress_sid")); | |
168 if (sid != 0) | |
169 { | |
170 g_source_remove(sid); | |
171 g_object_set_data(G_OBJECT(filepopup_win), "progress_sid", NULL); | |
172 } | |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
173 } |
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
174 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
175 static void |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
176 audacious_fileinfopopup_add_category(GtkWidget *filepopup_win, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
177 GtkWidget *filepopup_data_table, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
178 const gchar *category, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
179 const gchar *header_data, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
180 const gchar *label_data, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
181 const gint position) |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
182 { |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
183 gchar *markup; |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
184 |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
185 GtkWidget *filepopup_data_info_header = gtk_label_new(""); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
186 GtkWidget *filepopup_data_info_label = gtk_label_new(""); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
187 gtk_misc_set_alignment(GTK_MISC(filepopup_data_info_header), 0, 0.5); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
188 gtk_misc_set_alignment(GTK_MISC(filepopup_data_info_label), 0, 0.5); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
189 gtk_misc_set_padding(GTK_MISC(filepopup_data_info_header), 0, 3); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
190 gtk_misc_set_padding(GTK_MISC(filepopup_data_info_label), 0, 3); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
191 |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
192 markup = |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
193 g_markup_printf_escaped("<span style=\"italic\">%s</span>", category); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
194 |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
195 gtk_label_set_markup(GTK_LABEL(filepopup_data_info_header), markup); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
196 g_free(markup); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
197 |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
198 g_object_set_data(G_OBJECT(filepopup_win), header_data, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
199 filepopup_data_info_header); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
200 g_object_set_data(G_OBJECT(filepopup_win), label_data, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
201 filepopup_data_info_label); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
202 gtk_table_attach(GTK_TABLE(filepopup_data_table), |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
203 filepopup_data_info_header, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
204 0, 1, position, position + 1, GTK_FILL, 0, 0, 0); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
205 gtk_table_attach(GTK_TABLE(filepopup_data_table), |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
206 filepopup_data_info_label, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
207 1, 2, position, position + 1, GTK_FILL, 0, 0, 0); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
208 } |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
209 |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
210 |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
211 |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
212 GtkWidget * |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
213 audacious_fileinfopopup_create(void) |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
214 { |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
215 GtkWidget *filepopup_win; |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
216 GtkWidget *filepopup_hbox; |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
217 GtkWidget *filepopup_data_image; |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
218 GtkWidget *filepopup_data_table; |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
219 GtkWidget *filepopup_progress; |
2355
f03beaca8e81
[svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents:
2351
diff
changeset
|
220 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
221 filepopup_win = gtk_window_new(GTK_WINDOW_POPUP); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
222 gtk_window_set_decorated(GTK_WINDOW(filepopup_win), FALSE); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
223 gtk_container_set_border_width(GTK_CONTAINER(filepopup_win), 6); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
224 gtk_window_set_transient_for(GTK_WINDOW(filepopup_win), |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
225 GTK_WINDOW(mainwin)); |
2355
f03beaca8e81
[svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents:
2351
diff
changeset
|
226 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
227 filepopup_hbox = gtk_hbox_new(FALSE, 0); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
228 gtk_container_add(GTK_CONTAINER(filepopup_win), filepopup_hbox); |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
229 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
230 filepopup_data_image = gtk_image_new(); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
231 gtk_misc_set_alignment(GTK_MISC(filepopup_data_image), 0.5, 0); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
232 gtk_image_set_from_file(GTK_IMAGE(filepopup_data_image), |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
233 DATA_DIR "/images/audio.png"); |
2355
f03beaca8e81
[svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents:
2351
diff
changeset
|
234 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
235 g_object_set_data(G_OBJECT(filepopup_win), "image_artwork", |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
236 filepopup_data_image); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
237 g_object_set_data(G_OBJECT(filepopup_win), "last_artwork", NULL); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
238 gtk_box_pack_start(GTK_BOX(filepopup_hbox), filepopup_data_image, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
239 FALSE, FALSE, 0); |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
240 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
241 gtk_box_pack_start(GTK_BOX(filepopup_hbox), gtk_vseparator_new(), |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
242 FALSE, FALSE, 6); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
243 |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
244 filepopup_data_table = gtk_table_new(8, 2, FALSE); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
245 gtk_table_set_row_spacings(GTK_TABLE(filepopup_data_table), 0); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
246 gtk_table_set_col_spacings(GTK_TABLE(filepopup_data_table), 6); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
247 gtk_box_pack_start(GTK_BOX(filepopup_hbox), filepopup_data_table, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
248 TRUE, TRUE, 0); |
2355
f03beaca8e81
[svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents:
2351
diff
changeset
|
249 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
250 audacious_fileinfopopup_add_category(filepopup_win, filepopup_data_table, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
251 _("Title"), |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
252 "header_title", "label_title", 0); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
253 audacious_fileinfopopup_add_category(filepopup_win, filepopup_data_table, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
254 _("Artist"), |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
255 "header_artist", "label_artist", 1); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
256 audacious_fileinfopopup_add_category(filepopup_win, filepopup_data_table, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
257 _("Album"), |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
258 "header_album", "label_album", 2); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
259 audacious_fileinfopopup_add_category(filepopup_win, filepopup_data_table, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
260 _("Genre"), |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
261 "header_genre", "label_genre", 3); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
262 audacious_fileinfopopup_add_category(filepopup_win, filepopup_data_table, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
263 _("Year"), |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
264 "header_year", "label_year", 4); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
265 audacious_fileinfopopup_add_category(filepopup_win, filepopup_data_table, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
266 _("Track Number"), |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
267 "header_tracknum", "label_tracknum", |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
268 5); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
269 audacious_fileinfopopup_add_category(filepopup_win, filepopup_data_table, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
270 _("Track Length"), |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
271 "header_tracklen", "label_tracklen", |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
272 6); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
273 |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
274 gtk_table_set_row_spacing(GTK_TABLE(filepopup_data_table), 6, 6); |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
275 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
276 /* track progress */ |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
277 filepopup_progress = gtk_progress_bar_new(); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
278 gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(filepopup_progress), |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
279 GTK_PROGRESS_LEFT_TO_RIGHT); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
280 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(filepopup_progress), ""); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
281 gtk_table_attach(GTK_TABLE(filepopup_data_table), filepopup_progress, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
282 0, 2, 7, 8, GTK_FILL, 0, 0, 0); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
283 g_object_set_data(G_OBJECT(filepopup_win), "file", NULL); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
284 g_object_set_data(G_OBJECT(filepopup_win), "progressbar", |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
285 filepopup_progress); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
286 audacious_fileinfopopup_progress_init(filepopup_win); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
287 |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
288 /* this will realize all widgets contained in filepopup_hbox */ |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
289 gtk_widget_show_all(filepopup_hbox); |
2355
f03beaca8e81
[svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents:
2351
diff
changeset
|
290 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
291 /* do not show the track progress */ |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
292 gtk_widget_hide(filepopup_progress); |
2355
f03beaca8e81
[svn] - ui_fileinfopopup.c uses gtk code, no more glade in it
giacomo
parents:
2351
diff
changeset
|
293 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
294 return filepopup_win; |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
295 } |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
296 |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
297 void |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
298 audacious_fileinfopopup_destroy(GtkWidget *filepopup_win) |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
299 { |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
300 audacious_fileinfopopup_progress_stop(filepopup_win); |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
301 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
302 gchar *last_artwork = |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
303 g_object_get_data(G_OBJECT(filepopup_win), "last_artwork"); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
304 if (last_artwork != NULL) |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
305 g_free(last_artwork); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
306 |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
307 gtk_widget_destroy(filepopup_win); |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
308 } |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
309 |
2608 | 310 static void |
311 audacious_fileinfopupup_update_data(GtkWidget *filepopup_win, | |
312 const gchar *text, | |
313 const gchar *label_data, | |
314 const gchar *header_data) | |
315 { | |
316 if (text != NULL) | |
317 { | |
318 filepopup_entry_set_text(filepopup_win, label_data, text); | |
319 gtk_widget_show(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win), header_data))); | |
320 gtk_widget_show(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win), label_data))); | |
321 } | |
322 else | |
323 { | |
324 gtk_widget_hide(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win), header_data))); | |
325 gtk_widget_hide(GTK_WIDGET(g_object_get_data(G_OBJECT(filepopup_win), label_data))); | |
326 } | |
327 } | |
328 | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
329 void |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
330 audacious_fileinfopopup_show_from_tuple(GtkWidget *filepopup_win, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
331 TitleInput *tuple) |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
332 { |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
333 gchar *tmp = NULL; |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
334 gint x, y, x_off = 3, y_off = 3, h, w; |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
335 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
336 gchar *last_artwork = |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
337 g_object_get_data(G_OBJECT(filepopup_win), "last_artwork"); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
338 const static gchar default_artwork[] = DATA_DIR "/images/audio.png"; |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
339 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
340 g_return_if_fail(tuple != NULL); |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
341 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
342 tmp = g_object_get_data(G_OBJECT(filepopup_win), "file"); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
343 if (tmp != NULL) { |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
344 g_free(tmp); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
345 tmp = NULL; |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
346 g_object_set_data(G_OBJECT(filepopup_win), "file", NULL); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
347 } |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
348 if (tuple->file_path && tuple->file_name) |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
349 g_object_set_data(G_OBJECT(filepopup_win), "file", |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
350 g_build_filename(tuple->file_path, tuple->file_name, |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
351 NULL)); |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
352 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
353 gtk_widget_realize(filepopup_win); |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
354 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
355 if (tuple->track_name != NULL) |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
356 { |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
357 gchar *markup = |
2608 | 358 g_markup_printf_escaped("<span style=\"italic\">%s</span>", _("Title")); |
359 gtk_label_set_markup(GTK_LABEL(g_object_get_data(G_OBJECT(filepopup_win), "header_title")), markup); | |
360 g_free(markup); | |
2395
b047268eec32
[svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents:
2362
diff
changeset
|
361 filepopup_entry_set_text(filepopup_win, "label_title", tuple->track_name); |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
362 } |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
363 else |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
364 { |
2608 | 365 /* display filename if track_name is not available */ |
366 gchar *markup = | |
367 g_markup_printf_escaped("<span style=\"italic\">%s</span>", _("Filename")); | |
368 gchar *utf_filename = filename_to_utf8(tuple->file_name); | |
369 gtk_label_set_markup(GTK_LABEL(g_object_get_data(G_OBJECT(filepopup_win), "header_title")), markup); | |
370 g_free(markup); | |
371 filepopup_entry_set_text(filepopup_win, "label_title", utf_filename); | |
372 g_free(utf_filename); | |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
373 } |
2395
b047268eec32
[svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents:
2362
diff
changeset
|
374 |
2608 | 375 audacious_fileinfopupup_update_data(filepopup_win, tuple->performer, |
376 "label_artist", "header_artist"); | |
377 audacious_fileinfopupup_update_data(filepopup_win, tuple->album_name, | |
378 "label_album", "header_album"); | |
379 audacious_fileinfopupup_update_data(filepopup_win, tuple->genre, | |
380 "label_genre", "header_genre"); | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
381 |
2608 | 382 gchar *length_string = (tuple->length > 0) ? |
383 g_strdup_printf("%d:%02d", tuple->length / 60000, (tuple->length / 1000) % 60) : NULL; | |
384 audacious_fileinfopupup_update_data(filepopup_win, length_string, | |
385 "label_tracklen", "header_tracklen"); | |
386 g_free(length_string); | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
387 |
2608 | 388 gchar *year_string = (tuple->year == 0) ? NULL : g_strdup_printf("%d", tuple->year); |
389 audacious_fileinfopupup_update_data(filepopup_win, year_string, | |
390 "label_year", "header_year"); | |
391 g_free(year_string); | |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
392 |
2608 | 393 gchar *track_string = (tuple->track_number == 0) ? NULL : g_strdup_printf("%d", tuple->track_number); |
394 audacious_fileinfopupup_update_data(filepopup_win, track_string, | |
395 "label_tracknum", "header_tracknum"); | |
396 g_free(track_string); | |
397 | |
398 if (tuple->file_path && tuple->file_name) | |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
399 { |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
400 tmp = fileinfo_recursive_get_image(tuple->file_path, tuple->file_name, 0); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
401 if (tmp) { // picture found |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
402 if (!last_artwork || strcmp(last_artwork, tmp)) { // new picture |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
403 filepopup_entry_set_image(filepopup_win, "image_artwork", tmp); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
404 if (last_artwork) g_free(last_artwork); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
405 last_artwork = tmp; |
2608 | 406 g_object_set_data(G_OBJECT(filepopup_win), "last_artwork", last_artwork); |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
407 } |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
408 else { // same picture |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
409 } |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
410 } |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
411 else { // no picture found |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
412 if (!last_artwork || strcmp(last_artwork, default_artwork)) { |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
413 filepopup_entry_set_image(filepopup_win, "image_artwork", default_artwork); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
414 if (last_artwork) g_free(last_artwork); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
415 last_artwork = g_strdup(default_artwork); |
2608 | 416 g_object_set_data(G_OBJECT(filepopup_win), "last_artwork", last_artwork); |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
417 } |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
418 else { |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
419 } |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
420 } |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
421 } |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
422 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
423 /* start a timer that updates a progress bar if the tooltip |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
424 is shown for the song that is being currently played */ |
2608 | 425 if (audacious_fileinfopopup_progress_check_active(filepopup_win) == FALSE) |
426 { | |
427 audacious_fileinfopopup_progress_start(filepopup_win); | |
428 /* immediately run the callback once to update progressbar status */ | |
429 audacious_fileinfopopup_progress_cb(filepopup_win); | |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
430 } |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
431 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
432 gdk_window_get_pointer(NULL, &x, &y, NULL); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
433 gtk_window_get_size(GTK_WINDOW(filepopup_win), &w, &h); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
434 if (gdk_screen_width()-(w+3) < x) x_off = (w*-1)-3; |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
435 if (gdk_screen_height()-(h+3) < y) y_off = (h*-1)-3; |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
436 gtk_window_move(GTK_WINDOW(filepopup_win), x + x_off, y + y_off); |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
437 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
438 gtk_widget_show(filepopup_win); |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
439 } |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
440 |
2395
b047268eec32
[svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents:
2362
diff
changeset
|
441 void |
b047268eec32
[svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents:
2362
diff
changeset
|
442 audacious_fileinfopopup_show_from_title(GtkWidget *filepopup_win, gchar *title) |
b047268eec32
[svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents:
2362
diff
changeset
|
443 { |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
444 TitleInput * tuple = bmp_title_input_new(); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
445 tuple->track_name = g_strdup(title); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
446 audacious_fileinfopopup_show_from_tuple(filepopup_win, tuple); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
447 bmp_title_input_free(tuple); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
448 return; |
2395
b047268eec32
[svn] - made the song info popup window a bit smarter; do not display missing information, display filename if title is missing; also, added a audacious_fileinfopopup_show_from_title to show a popup using a generic string (i.e. the one picked from playlist_get_songtitle when a tuple is not available, useful for http streams)
giacomo
parents:
2362
diff
changeset
|
449 } |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
450 |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
451 void |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
452 audacious_fileinfopopup_hide(GtkWidget *filepopup_win, gpointer unused) |
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
453 { |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
454 if (GTK_WIDGET_VISIBLE(filepopup_win)) |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
455 { |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
456 audacious_fileinfopopup_progress_stop(filepopup_win); |
2357
139d2358f617
[svn] - added progressbar with display of elapsed time for metadata tooltip
giacomo
parents:
2355
diff
changeset
|
457 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
458 gtk_widget_hide(filepopup_win); |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
459 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
460 filepopup_entry_set_text(GTK_WIDGET(filepopup_win), "label_title", ""); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
461 filepopup_entry_set_text(GTK_WIDGET(filepopup_win), "label_artist", ""); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
462 filepopup_entry_set_text(GTK_WIDGET(filepopup_win), "label_album", ""); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
463 filepopup_entry_set_text(GTK_WIDGET(filepopup_win), "label_genre", ""); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
464 filepopup_entry_set_text(GTK_WIDGET(filepopup_win), "label_track", ""); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
465 filepopup_entry_set_text(GTK_WIDGET(filepopup_win), "label_year", ""); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
466 filepopup_entry_set_text(GTK_WIDGET(filepopup_win), "label_length", ""); |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
467 |
2606
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
468 gtk_window_resize(GTK_WINDOW(filepopup_win), 1, 1); |
7c19bb5516db
[svn] - Removed some of the horrible code duplication in the file popup code
mf0102
parents:
2604
diff
changeset
|
469 } |
2348
564e8a1fe09a
[svn] - made a public API for fileinfopopup (popup that displays metadata, the same used in playlist); now plugins can include ui_fileinfopopup.h to display metadata popups (i.e. statusicon and libnotify plugins)
giacomo
parents:
diff
changeset
|
470 } |