Mercurial > audlegacy
annotate src/audacious/ui_fileinfo.c @ 4021:d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
author | Eugene Zagidullin <e.asphyx@gmail.com> |
---|---|
date | Tue, 27 Nov 2007 22:52:32 +0300 |
parents | 66529edae49d |
children | 85315c67252d |
rev | line source |
---|---|
2313 | 1 /* |
2 * Audacious: A cross-platform multimedia player | |
3 * Copyright (c) 2006 William Pitcock, Tony Vroon, George Averill, | |
4 * Giacomo Lozito, Derek Pomery and Yoshiki Yazawa. | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3113
diff
changeset
|
8 * the Free Software Foundation; under version 3 of the License. |
2313 | 9 * |
10 * This program is distributed in the hope that it will be useful, | |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 * GNU General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU General Public License | |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3113
diff
changeset
|
16 * along with this program. If not, see <http://www.gnu.org/licenses>. |
3123
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
17 * |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
18 * The Audacious team does not consider modular code linking to |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
19 * Audacious or using our public API to be a derived work. |
2313 | 20 */ |
21 | |
22 #ifdef HAVE_CONFIG_H | |
23 # include "config.h" | |
24 #endif | |
25 | |
26 #include <glib.h> | |
27 #include <glib/gi18n.h> | |
28 #include <gtk/gtk.h> | |
29 #include <string.h> | |
30 #include <stddef.h> | |
31 #include <stdio.h> | |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
32 #include <stdarg.h> |
2313 | 33 #include <sys/types.h> |
34 #include <dirent.h> | |
35 #include <unistd.h> | |
36 #include <errno.h> | |
37 #include <sys/types.h> | |
38 #include <sys/stat.h> | |
39 | |
40 #include "plugin.h" | |
41 #include "pluginenum.h" | |
42 #include "input.h" | |
43 #include "effect.h" | |
2385
ab2b1b6f6179
[svn] - add missing inclusion of strings.h where necessary, do not export main.h and export strings.h
giacomo
parents:
2348
diff
changeset
|
44 #include "strings.h" |
2313 | 45 #include "general.h" |
46 #include "output.h" | |
47 #include "visualization.h" | |
48 | |
49 #include "main.h" | |
50 #include "util.h" | |
51 #include "dnd.h" | |
3298
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3123
diff
changeset
|
52 #include "tuple.h" |
4019
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
53 #include "vfs.h" |
2313 | 54 |
55 #include "playlist.h" | |
56 | |
57 #include "ui_main.h" | |
58 #include "ui_playlist.h" | |
59 #include "build_stamp.h" | |
60 #include "ui_fileinfo.h" | |
61 #include "ui_playlist.h" | |
62 | |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
63 #define G_FREE_CLEAR(a) { if(a != NULL) { g_free(a); a = NULL; } } |
4021
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
64 #define STATUS_TIMEOUT 3*1000 |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
65 |
2313 | 66 GtkWidget *fileinfo_win; |
67 | |
3986 | 68 GtkWidget *entry_location; |
69 GtkWidget *entry_title; | |
70 GtkWidget *entry_artist; | |
71 GtkWidget *entry_album; | |
72 GtkWidget *entry_comment; | |
73 GtkWidget *entry_year; | |
74 GtkWidget *entry_track; | |
75 GtkWidget *entry_genre; | |
76 | |
77 GtkWidget *image_artwork; | |
78 | |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
79 GtkWidget *image_fileicon; |
4013
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
80 GtkWidget *label_format_name; |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
81 GtkWidget *label_quality; |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
82 GtkWidget *btn_apply; |
4021
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
83 GtkWidget *label_mini_status; |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
84 |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
85 static gchar *current_file = NULL; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
86 static InputPlugin *current_ip = NULL; |
4019
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
87 |
2313 | 88 static void |
3986 | 89 fileinfo_entry_set_text(GtkWidget *widget, const char *text) |
2313 | 90 { |
3986 | 91 if (widget == NULL) |
92 return; | |
2313 | 93 |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
94 gtk_entry_set_text(GTK_ENTRY(widget), text != NULL ? text : ""); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
95 } |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
96 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
97 static void |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
98 set_entry_str_from_field(GtkWidget *widget, Tuple *tuple, gint fieldn) |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
99 { |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
100 gchar *text; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
101 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
102 if(widget != NULL) { |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
103 text = (gchar*)tuple_get_string(tuple, fieldn, NULL); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
104 gtk_entry_set_text(GTK_ENTRY(widget), text != NULL ? text : ""); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
105 } |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
106 } |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
107 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
108 static void |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
109 set_entry_int_from_field(GtkWidget *widget, Tuple *tuple, gint fieldn) |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
110 { |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
111 gchar *text; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
112 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
113 if(widget == NULL) return; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
114 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
115 if(tuple_get_value_type(tuple, fieldn, NULL) == TUPLE_INT) { |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
116 text = g_strdup_printf("%d", tuple_get_int(tuple, fieldn, NULL)); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
117 gtk_entry_set_text(GTK_ENTRY(widget), text); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
118 g_free(text); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
119 } else { |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
120 gtk_entry_set_text(GTK_ENTRY(widget), ""); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
121 } |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
122 } |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
123 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
124 static void |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
125 set_field_str_from_entry(Tuple *tuple, gint fieldn, GtkWidget *widget) |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
126 { |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
127 if(widget == NULL) return; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
128 tuple_associate_string(tuple, fieldn, NULL, gtk_entry_get_text(GTK_ENTRY(widget))); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
129 } |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
130 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
131 static void |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
132 set_field_int_from_entry(Tuple *tuple, gint fieldn, GtkWidget *widget) |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
133 { |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
134 if(widget == NULL) return; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
135 tuple_associate_int(tuple, fieldn, NULL, atoi(gtk_entry_get_text(GTK_ENTRY(widget)))); |
2313 | 136 } |
137 | |
138 static void | |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
139 fileinfo_label_set_text(GtkWidget *widget, const char *text) |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
140 { |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
141 gchar *tmp; |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
142 |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
143 if (widget == NULL) |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
144 return; |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
145 |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
146 if (text) { |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
147 tmp = g_strdup_printf("<span size=\"small\">%s</span>", text); |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
148 gtk_label_set_text(GTK_LABEL(widget), tmp); |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
149 gtk_label_set_use_markup(GTK_LABEL(widget), TRUE); |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
150 g_free(tmp); |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
151 } else { |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
152 gtk_label_set_text(GTK_LABEL(widget), _("<span size=\"small\">n/a</span>")); |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
153 gtk_label_set_use_markup(GTK_LABEL(widget), TRUE); |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
154 } |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
155 } |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
156 |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
157 static void |
3986 | 158 fileinfo_entry_set_image(GtkWidget *widget, const char *text) |
2313 | 159 { |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
160 GdkPixbuf *pixbuf; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
161 int width, height; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
162 double aspect; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
163 GdkPixbuf *pixbuf2; |
2313 | 164 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
165 if (widget == NULL) |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
166 return; |
2313 | 167 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
168 pixbuf = gdk_pixbuf_new_from_file(text, NULL); |
2313 | 169 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
170 if (pixbuf == NULL) |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
171 return; |
2313 | 172 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
173 width = gdk_pixbuf_get_width(GDK_PIXBUF(pixbuf)); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
174 height = gdk_pixbuf_get_height(GDK_PIXBUF(pixbuf)); |
2313 | 175 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
176 if(strcmp(DATA_DIR "/images/audio.png", text)) |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
177 { |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
178 if(width == 0) |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
179 width = 1; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
180 aspect = (double)height / (double)width; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
181 if(aspect > 1.0) { |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
182 height = (int)(cfg.filepopup_pixelsize * aspect); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
183 width = cfg.filepopup_pixelsize; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
184 } else { |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
185 height = cfg.filepopup_pixelsize; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
186 width = (int)(cfg.filepopup_pixelsize / aspect); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
187 } |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
188 pixbuf2 = gdk_pixbuf_scale_simple(GDK_PIXBUF(pixbuf), width, height, GDK_INTERP_BILINEAR); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
189 g_object_unref(G_OBJECT(pixbuf)); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
190 pixbuf = pixbuf2; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
191 } |
2313 | 192 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
193 gtk_image_set_from_pixbuf(GTK_IMAGE(widget), GDK_PIXBUF(pixbuf)); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
194 g_object_unref(G_OBJECT(pixbuf)); |
2313 | 195 } |
196 | |
197 void fileinfo_hide(gpointer unused) | |
198 { | |
4019
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
199 if(GTK_WIDGET_VISIBLE(fileinfo_win)) gtk_widget_hide(fileinfo_win); |
2313 | 200 |
3986 | 201 /* Clear it out. */ |
202 fileinfo_entry_set_text(entry_title, ""); | |
203 fileinfo_entry_set_text(entry_artist, ""); | |
204 fileinfo_entry_set_text(entry_album, ""); | |
205 fileinfo_entry_set_text(entry_comment, ""); | |
206 fileinfo_entry_set_text(entry_genre, ""); | |
207 fileinfo_entry_set_text(entry_year, ""); | |
208 fileinfo_entry_set_text(entry_track, ""); | |
209 fileinfo_entry_set_text(entry_location, ""); | |
2313 | 210 |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
211 fileinfo_label_set_text(label_format_name, NULL); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
212 fileinfo_label_set_text(label_quality, NULL); |
4021
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
213 |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
214 if (label_mini_status != NULL) { |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
215 gtk_label_set_text(GTK_LABEL(label_mini_status), "<span size=\"small\"></span>"); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
216 gtk_label_set_use_markup(GTK_LABEL(label_mini_status), TRUE); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
217 } |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
218 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
219 current_ip = NULL; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
220 G_FREE_CLEAR(current_file); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
221 |
3986 | 222 fileinfo_entry_set_image(image_artwork, DATA_DIR "/images/audio.png"); |
2313 | 223 } |
224 | |
4021
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
225 static gboolean |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
226 ministatus_timeout_proc (gpointer data) |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
227 { |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
228 GtkLabel *status = GTK_LABEL(data); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
229 gtk_label_set_text(status, "<span size=\"small\"></span>"); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
230 gtk_label_set_use_markup(status, TRUE); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
231 |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
232 return FALSE; |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
233 } |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
234 |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
235 static void |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
236 ministatus_display_message(gchar *text) |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
237 { |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
238 if(label_mini_status != NULL) { |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
239 gchar *tmp = g_strdup_printf("<span size=\"small\">%s</span>", text); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
240 gtk_label_set_text(GTK_LABEL(label_mini_status), tmp); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
241 g_free(tmp); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
242 gtk_label_set_use_markup(GTK_LABEL(label_mini_status), TRUE); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
243 g_timeout_add (STATUS_TIMEOUT, (GSourceFunc) ministatus_timeout_proc, (gpointer) label_mini_status); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
244 } |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
245 } |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
246 |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
247 static void |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
248 message_update_successfull() |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
249 { |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
250 ministatus_display_message(_("Metadata updated successfully")); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
251 } |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
252 |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
253 static void |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
254 message_update_failed() |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
255 { |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
256 ministatus_display_message(_("Metadata updating failed")); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
257 } |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
258 |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
259 static void |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
260 fileinfo_update_tuple(gpointer data) |
4019
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
261 { |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
262 Tuple *tuple; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
263 VFSFile *fd; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
264 if(current_file != NULL && current_ip != NULL && current_ip->update_song_tuple != NULL) { /* TODO only if changed*/ |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
265 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
266 tuple = tuple_new(); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
267 fd = vfs_fopen(current_file, "r+b"); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
268 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
269 if (fd != NULL) { |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
270 set_field_str_from_entry(tuple, FIELD_TITLE, entry_title); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
271 set_field_str_from_entry(tuple, FIELD_ARTIST, entry_artist); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
272 set_field_str_from_entry(tuple, FIELD_ALBUM, entry_album); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
273 set_field_str_from_entry(tuple, FIELD_COMMENT, entry_comment); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
274 set_field_str_from_entry(tuple, FIELD_GENRE, entry_genre); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
275 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
276 set_field_int_from_entry(tuple, FIELD_YEAR, entry_year); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
277 set_field_int_from_entry(tuple, FIELD_TRACK_NUMBER, entry_track); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
278 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
279 if(current_ip->update_song_tuple(tuple, fd)) { |
4021
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
280 message_update_successfull(); |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
281 } else { |
4021
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
282 message_update_failed(); |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
283 } |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
284 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
285 vfs_fclose(fd); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
286 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
287 } else { |
4021
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
288 message_update_failed(); |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
289 } |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
290 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
291 mowgli_object_unref(tuple); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
292 } |
4019
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
293 } |
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
294 |
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
295 |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
296 GdkPixbuf * |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
297 themed_icon_lookup(gint size, const gchar *name, ...) /* NULL-terminated list of icon names */ |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
298 { |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
299 GtkIconTheme *icon_theme; |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
300 GdkPixbuf *pixbuf; |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
301 GError *error = NULL; |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
302 gchar *n; |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
303 va_list par; |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
304 |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
305 icon_theme = gtk_icon_theme_get_default (); |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
306 //fprintf(stderr, "looking for %s\n", name); |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
307 pixbuf = gtk_icon_theme_load_icon (icon_theme, name, size, 0, &error); |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
308 if(pixbuf) return pixbuf; |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
309 |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
310 if(error != NULL) g_error_free(error); |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
311 |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
312 /* fallback */ |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
313 va_start(par, name); |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
314 while((n = (gchar*)va_arg(par, gchar *)) != NULL) { |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
315 //fprintf(stderr, "looking for %s\n", n); |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
316 error = NULL; |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
317 pixbuf = gtk_icon_theme_load_icon (icon_theme, n, size, 0, &error); |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
318 if(pixbuf) { |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
319 //fprintf(stderr, "%s is ok\n", n); |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
320 va_end(par); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
321 return pixbuf; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
322 } |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
323 if(error != NULL) g_error_free(error); |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
324 } |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
325 |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
326 return NULL; |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
327 } |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
328 |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
329 GdkPixbuf * |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
330 mime_icon_lookup(gint size, const gchar *mime_type) /* smart icon resolving routine :) */ |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
331 { |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
332 gchar *mime_as_is; /* audio-x-mp3 */ |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
333 gchar *mime_gnome; /* gnome-mime-audio-x-mp3 */ |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
334 gchar *mime_generic; /* audio-x-generic */ |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
335 gchar *mime_gnome_generic; /* gnome-mime-audio */ |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
336 |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
337 GdkPixbuf *icon = NULL; |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
338 |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
339 gchar **s = g_strsplit(mime_type, "/", 2); |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
340 if(s[1] != NULL) { |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
341 mime_as_is = g_strdup_printf("%s-%s", s[0], s[1]); |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
342 mime_gnome = g_strdup_printf("gnome-mime-%s-%s", s[0], s[1]); |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
343 mime_generic = g_strdup_printf("%s-x-generic", s[0]); |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
344 mime_gnome_generic = g_strdup_printf("gnome-mime-%s", s[0]); |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
345 //fprintf(stderr, "will look for %s, %s, %s, %s, %s\n", mime_as_is, mime_gnome, mime_generic, mime_gnome_generic, s[0]); |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
346 icon = themed_icon_lookup(size, mime_as_is, mime_gnome, mime_generic, mime_gnome_generic, s[0], NULL); /* s[0] is category */ |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
347 g_free(mime_gnome_generic); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
348 g_free(mime_generic); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
349 g_free(mime_gnome); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
350 g_free(mime_as_is); |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
351 } |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
352 g_strfreev(s); |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
353 |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
354 return icon; |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
355 } |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
356 |
2313 | 357 void |
358 create_fileinfo_window(void) | |
359 { | |
3986 | 360 GtkWidget *hbox; |
4021
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
361 GtkWidget *hbox_status_and_bbox; |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
362 GtkWidget *vbox0; |
3986 | 363 GtkWidget *vbox1; |
364 GtkWidget *vbox2; | |
365 GtkWidget *label_title; | |
366 GtkWidget *label_artist; | |
367 GtkWidget *label_album; | |
368 GtkWidget *label_comment; | |
369 GtkWidget *label_genre; | |
370 GtkWidget *label_year; | |
371 GtkWidget *label_track; | |
372 GtkWidget *label_location; | |
4013
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
373 GtkWidget *label_general; |
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
374 GtkWidget *label_format; |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
375 GtkWidget *label_quality_label; |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
376 GtkWidget *codec_hbox; |
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
377 GtkWidget *codec_table; |
3986 | 378 GtkWidget *table1; |
379 GtkWidget *bbox_close; | |
380 GtkWidget *btn_close; | |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
381 GtkWidget *alignment; |
4011
c19c8d47e221
vseparator in fileinfo came back
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4010
diff
changeset
|
382 GtkWidget *separator; |
3986 | 383 |
384 fileinfo_win = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
385 gtk_container_set_border_width(GTK_CONTAINER(fileinfo_win), 6); | |
386 gtk_window_set_title(GTK_WINDOW(fileinfo_win), _("Track Information")); | |
387 gtk_window_set_position(GTK_WINDOW(fileinfo_win), GTK_WIN_POS_CENTER); | |
388 gtk_window_set_resizable(GTK_WINDOW(fileinfo_win), FALSE); | |
389 gtk_window_set_type_hint(GTK_WINDOW(fileinfo_win), GDK_WINDOW_TYPE_HINT_DIALOG); | |
390 gtk_window_set_transient_for(GTK_WINDOW(fileinfo_win), GTK_WINDOW(mainwin)); | |
391 | |
4021
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
392 vbox0 = gtk_vbox_new(FALSE, 0); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
393 gtk_container_add(GTK_CONTAINER(fileinfo_win), vbox0); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
394 |
4011
c19c8d47e221
vseparator in fileinfo came back
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4010
diff
changeset
|
395 hbox = gtk_hbox_new(FALSE, 6); |
4021
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
396 gtk_box_pack_start(GTK_BOX(vbox0), hbox, TRUE, TRUE, 0); |
2313 | 397 |
3986 | 398 image_artwork = gtk_image_new(); |
399 gtk_box_pack_start(GTK_BOX(hbox), image_artwork, FALSE, FALSE, 0); | |
400 gtk_misc_set_alignment(GTK_MISC(image_artwork), 0.5, 0); | |
401 gtk_image_set_from_file(GTK_IMAGE(image_artwork), DATA_DIR "/images/audio.png"); | |
4011
c19c8d47e221
vseparator in fileinfo came back
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4010
diff
changeset
|
402 separator = gtk_vseparator_new(); |
c19c8d47e221
vseparator in fileinfo came back
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4010
diff
changeset
|
403 gtk_box_pack_start(GTK_BOX(hbox), separator, FALSE, FALSE, 0); |
3986 | 404 |
405 vbox1 = gtk_vbox_new(FALSE, 0); | |
406 gtk_box_pack_start(GTK_BOX(hbox), vbox1, TRUE, TRUE, 0); | |
407 | |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
408 alignment = gtk_alignment_new(0.5, 0.5, 1, 1); |
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
409 gtk_box_pack_start(GTK_BOX(vbox1), alignment, TRUE, TRUE, 0); |
3986 | 410 vbox2 = gtk_vbox_new(FALSE, 0); |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
411 gtk_container_add(GTK_CONTAINER(alignment), vbox2); |
4010
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
412 |
4013
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
413 label_general = gtk_label_new(_("<span size=\"small\">General</span>")); |
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
414 gtk_box_pack_start (GTK_BOX (vbox2), label_general, FALSE, FALSE, 0); |
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
415 gtk_label_set_use_markup(GTK_LABEL(label_general), TRUE); |
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
416 gtk_misc_set_alignment(GTK_MISC(label_general), 0, 0.5); |
4010
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
417 |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
418 alignment = gtk_alignment_new (0.5, 0.5, 1, 1); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
419 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 6, 6, 0, 0); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
420 gtk_box_pack_start (GTK_BOX (vbox2), alignment, FALSE, FALSE, 0); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
421 |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
422 codec_hbox = gtk_hbox_new(FALSE, 6); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
423 gtk_container_add (GTK_CONTAINER(alignment), codec_hbox); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
424 |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
425 image_fileicon = gtk_image_new_from_stock (GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_DIALOG); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
426 gtk_box_pack_start (GTK_BOX (codec_hbox), image_fileicon, FALSE, FALSE, 0); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
427 |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
428 codec_table = gtk_table_new(2, 2, FALSE); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
429 gtk_table_set_row_spacings (GTK_TABLE(codec_table), 6); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
430 gtk_table_set_col_spacings (GTK_TABLE(codec_table), 12); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
431 gtk_box_pack_start (GTK_BOX (codec_hbox), codec_table, FALSE, FALSE, 0); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
432 |
4013
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
433 label_format = gtk_label_new(_("<span size=\"small\">Format:</span>")); |
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
434 gtk_label_set_use_markup(GTK_LABEL(label_format), TRUE); |
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
435 gtk_misc_set_alignment(GTK_MISC(label_format), 0, 0.5); |
4010
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
436 label_quality_label = gtk_label_new(_("<span size=\"small\">Quality:</span>")); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
437 gtk_label_set_use_markup(GTK_LABEL(label_quality_label), TRUE); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
438 gtk_misc_set_alignment(GTK_MISC(label_quality_label), 0, 0.5); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
439 |
4013
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
440 label_format_name = gtk_label_new(_("<span size=\"small\">n/a</span>")); |
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
441 gtk_label_set_use_markup(GTK_LABEL(label_format_name), TRUE); |
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
442 gtk_misc_set_alignment(GTK_MISC(label_format_name), 0, 0.5); |
4010
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
443 label_quality = gtk_label_new(_("<span size=\"small\">n/a</span>")); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
444 gtk_label_set_use_markup(GTK_LABEL(label_quality), TRUE); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
445 gtk_misc_set_alignment(GTK_MISC(label_quality), 0, 0.5); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
446 |
4013
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
447 gtk_table_attach(GTK_TABLE(codec_table), label_format, 0, 1, 0, 1, |
4010
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
448 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
449 (GtkAttachOptions) (0), 0, 0); |
4013
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
450 gtk_table_attach(GTK_TABLE(codec_table), label_format_name, 1, 2, 0, 1, |
4010
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
451 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
452 (GtkAttachOptions) (0), 0, 0); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
453 gtk_table_attach(GTK_TABLE(codec_table), label_quality_label, 0, 1, 1, 2, |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
454 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
455 (GtkAttachOptions) (0), 0, 0); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
456 gtk_table_attach(GTK_TABLE(codec_table), label_quality, 1, 2, 1, 2, |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
457 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
458 (GtkAttachOptions) (0), 0, 0); |
3986 | 459 |
460 label_title = gtk_label_new(_("<span size=\"small\">Title</span>")); | |
461 gtk_box_pack_start(GTK_BOX(vbox2), label_title, FALSE, FALSE, 0); | |
462 gtk_label_set_use_markup(GTK_LABEL(label_title), TRUE); | |
463 gtk_misc_set_alignment(GTK_MISC(label_title), 0, 0); | |
2313 | 464 |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
465 alignment = gtk_alignment_new(0.5, 0.5, 1, 1); |
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
466 gtk_box_pack_start(GTK_BOX(vbox2), alignment, FALSE, FALSE, 0); |
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
467 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0); |
3986 | 468 entry_title = gtk_entry_new(); |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
469 gtk_container_add(GTK_CONTAINER(alignment), entry_title); |
3986 | 470 |
471 label_artist = gtk_label_new(_("<span size=\"small\">Artist</span>")); | |
472 gtk_box_pack_start(GTK_BOX(vbox2), label_artist, FALSE, FALSE, 0); | |
473 gtk_label_set_use_markup(GTK_LABEL(label_artist), TRUE); | |
474 gtk_misc_set_alignment(GTK_MISC(label_artist), 0, 0.5); | |
475 | |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
476 alignment = gtk_alignment_new(0.5, 0.5, 1, 1); |
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
477 gtk_box_pack_start(GTK_BOX(vbox2), alignment, FALSE, FALSE, 0); |
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
478 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0); |
3986 | 479 entry_artist = gtk_entry_new(); |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
480 gtk_container_add(GTK_CONTAINER(alignment), entry_artist); |
3986 | 481 |
482 label_album = gtk_label_new(_("<span size=\"small\">Album</span>")); | |
483 gtk_box_pack_start(GTK_BOX(vbox2), label_album, FALSE, FALSE, 0); | |
484 gtk_label_set_use_markup(GTK_LABEL(label_album), TRUE); | |
485 gtk_misc_set_alignment(GTK_MISC(label_album), 0, 0.5); | |
486 | |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
487 alignment = gtk_alignment_new(0.5, 0.5, 1, 1); |
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
488 gtk_box_pack_start(GTK_BOX(vbox2), alignment, FALSE, FALSE, 0); |
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
489 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0); |
3986 | 490 entry_album = gtk_entry_new(); |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
491 gtk_container_add(GTK_CONTAINER(alignment), entry_album); |
2313 | 492 |
3986 | 493 label_comment = gtk_label_new(_("<span size=\"small\">Comment</span>")); |
494 gtk_box_pack_start(GTK_BOX(vbox2), label_comment, FALSE, FALSE, 0); | |
495 gtk_label_set_use_markup(GTK_LABEL(label_comment), TRUE); | |
496 gtk_misc_set_alignment(GTK_MISC(label_comment), 0, 0.5); | |
497 | |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
498 alignment = gtk_alignment_new(0.5, 0.5, 1, 1); |
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
499 gtk_box_pack_start(GTK_BOX(vbox2), alignment, FALSE, FALSE, 0); |
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
500 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0); |
3986 | 501 entry_comment = gtk_entry_new(); |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
502 gtk_container_add (GTK_CONTAINER(alignment), entry_comment); |
3986 | 503 |
504 label_genre = gtk_label_new(_("<span size=\"small\">Genre</span>")); | |
505 gtk_box_pack_start(GTK_BOX(vbox2), label_genre, FALSE, FALSE, 0); | |
506 gtk_label_set_use_markup(GTK_LABEL(label_genre), TRUE); | |
507 gtk_misc_set_alignment(GTK_MISC(label_genre), 0, 0.5); | |
508 | |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
509 alignment = gtk_alignment_new(0.5, 0.5, 1, 1); |
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
510 gtk_box_pack_start(GTK_BOX(vbox2), alignment, FALSE, FALSE, 0); |
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
511 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0); |
3986 | 512 entry_genre = gtk_entry_new(); |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
513 gtk_container_add(GTK_CONTAINER(alignment), entry_genre); |
3986 | 514 |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
515 alignment = gtk_alignment_new(0.5, 0.5, 1, 1); |
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
516 gtk_box_pack_start(GTK_BOX(vbox2), alignment, FALSE, FALSE, 0); |
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
517 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0); |
3986 | 518 table1 = gtk_table_new(2, 2, FALSE); |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
519 gtk_container_add(GTK_CONTAINER(alignment), table1); |
3986 | 520 gtk_table_set_col_spacings(GTK_TABLE(table1), 6); |
521 | |
522 label_year = gtk_label_new(_("<span size=\"small\">Year</span>")); | |
523 gtk_table_attach(GTK_TABLE(table1), label_year, 0, 1, 0, 1, | |
524 (GtkAttachOptions) (GTK_FILL), | |
525 (GtkAttachOptions) (0), 0, 0); | |
526 gtk_label_set_use_markup(GTK_LABEL(label_year), TRUE); | |
527 gtk_misc_set_alignment(GTK_MISC(label_year), 0, 0.5); | |
2313 | 528 |
3986 | 529 entry_year = gtk_entry_new(); |
530 gtk_table_attach(GTK_TABLE(table1), entry_year, 0, 1, 1, 2, | |
531 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
532 (GtkAttachOptions) (0), 0, 0); | |
533 | |
534 label_track = gtk_label_new(_("<span size=\"small\">Track Number</span>")); | |
535 gtk_table_attach(GTK_TABLE(table1), label_track, 1, 2, 0, 1, | |
536 (GtkAttachOptions) (GTK_FILL), | |
537 (GtkAttachOptions) (0), 0, 0); | |
538 gtk_label_set_use_markup(GTK_LABEL(label_track), TRUE); | |
539 gtk_misc_set_alignment(GTK_MISC(label_track), 0, 0.5); | |
540 | |
541 entry_track = gtk_entry_new(); | |
542 gtk_table_attach(GTK_TABLE(table1), entry_track, 1, 2, 1, 2, | |
543 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
544 (GtkAttachOptions) (0), 0, 0); | |
2313 | 545 |
3986 | 546 label_location = gtk_label_new(_("<span size=\"small\">Location</span>")); |
547 gtk_box_pack_start(GTK_BOX(vbox2), label_location, FALSE, FALSE, 0); | |
548 gtk_label_set_use_markup(GTK_LABEL(label_location), TRUE); | |
549 gtk_misc_set_alignment(GTK_MISC(label_location), 0, 0.5); | |
550 | |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
551 alignment = gtk_alignment_new (0.5, 0.5, 1, 1); |
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
552 gtk_box_pack_start (GTK_BOX (vbox2), alignment, FALSE, FALSE, 0); |
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
553 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 6, 0, 0); |
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
554 |
3986 | 555 entry_location = gtk_entry_new(); |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
556 gtk_container_add(GTK_CONTAINER(alignment), entry_location); |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
557 |
4021
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
558 hbox_status_and_bbox = gtk_hbox_new(FALSE, 0); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
559 gtk_box_pack_start (GTK_BOX (vbox0), hbox_status_and_bbox, FALSE, FALSE, 0); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
560 |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
561 label_mini_status = gtk_label_new("<span size=\"small\"></span>"); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
562 gtk_label_set_use_markup(GTK_LABEL(label_mini_status), TRUE); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
563 gtk_misc_set_alignment(GTK_MISC(label_mini_status), 0, 0.5); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
564 gtk_box_pack_start (GTK_BOX (hbox_status_and_bbox), label_mini_status, TRUE, TRUE, 0); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
565 |
3986 | 566 bbox_close = gtk_hbutton_box_new(); |
4019
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
567 gtk_box_set_spacing(GTK_BOX(bbox_close), 6); |
4021
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
568 gtk_box_pack_start(GTK_BOX(hbox_status_and_bbox), bbox_close, FALSE, FALSE, 0); |
3986 | 569 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox_close), GTK_BUTTONBOX_END); |
570 | |
4019
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
571 btn_apply = gtk_button_new_from_stock("gtk-apply"); |
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
572 gtk_container_add(GTK_CONTAINER(bbox_close), btn_apply); |
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
573 g_signal_connect(G_OBJECT(btn_apply), "clicked", (GCallback) fileinfo_update_tuple, NULL); |
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
574 gtk_widget_set_sensitive(btn_apply, FALSE); |
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
575 |
3986 | 576 btn_close = gtk_button_new_from_stock("gtk-close"); |
577 gtk_container_add(GTK_CONTAINER(bbox_close), btn_close); | |
578 GTK_WIDGET_SET_FLAGS(btn_close, GTK_CAN_DEFAULT); | |
579 g_signal_connect(G_OBJECT(btn_close), "clicked", (GCallback) fileinfo_hide, NULL); | |
580 | |
4021
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
581 gtk_widget_show_all (vbox0); |
2313 | 582 } |
583 | |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
584 void |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
585 fileinfo_show_for_tuple(Tuple *tuple, gboolean updating_enabled) |
2313 | 586 { |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
587 gchar *tmp, *tmp_utf = NULL; |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
588 GdkPixbuf *icon = NULL; |
2313 | 589 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
590 if (tuple == NULL) |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
591 return; |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
592 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
593 if(!updating_enabled) { |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
594 current_ip = NULL; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
595 G_FREE_CLEAR(current_file); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
596 } |
2313 | 597 |
4019
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
598 if(!GTK_WIDGET_REALIZED(fileinfo_win)) gtk_widget_realize(fileinfo_win); |
2313 | 599 |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
600 set_entry_str_from_field(entry_title, tuple, FIELD_TITLE); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
601 set_entry_str_from_field(entry_artist, tuple, FIELD_ARTIST); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
602 set_entry_str_from_field(entry_album, tuple, FIELD_ALBUM); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
603 set_entry_str_from_field(entry_comment, tuple, FIELD_COMMENT); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
604 set_entry_str_from_field(entry_genre, tuple, FIELD_GENRE); |
2313 | 605 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
606 tmp = g_strdup_printf("%s/%s", |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
607 tuple_get_string(tuple, FIELD_FILE_PATH, NULL), |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
608 tuple_get_string(tuple, FIELD_FILE_NAME, NULL)); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
609 if(tmp){ |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
610 tmp_utf = str_to_utf8(tmp); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
611 fileinfo_entry_set_text(entry_location, tmp_utf); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
612 g_free(tmp_utf); |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
613 g_free(tmp); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
614 tmp = NULL; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
615 } |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
616 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
617 /* set empty string if field not availaible. --eugene */ |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
618 set_entry_int_from_field(entry_year, tuple, FIELD_YEAR); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
619 set_entry_int_from_field(entry_track, tuple, FIELD_TRACK_NUMBER); |
2313 | 620 |
4013
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
621 fileinfo_label_set_text(label_format_name, tuple_get_string(tuple, FIELD_CODEC, NULL)); |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
622 fileinfo_label_set_text(label_quality, tuple_get_string(tuple, FIELD_QUALITY, NULL)); |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
623 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
624 tmp = (gchar *)tuple_get_string(tuple, FIELD_MIMETYPE, NULL); |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
625 icon = mime_icon_lookup(48, tmp ? tmp : "audio/x-generic"); |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
626 if (icon) { |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
627 if (image_fileicon) gtk_image_set_from_pixbuf (GTK_IMAGE(image_fileicon), icon); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
628 g_object_unref(icon); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
629 } |
4009
ba6258a39662
icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
3988
diff
changeset
|
630 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
631 tmp = fileinfo_recursive_get_image( |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
632 tuple_get_string(tuple, FIELD_FILE_PATH, NULL), |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
633 tuple_get_string(tuple, FIELD_FILE_NAME, NULL), 0); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
634 |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
635 if(tmp) |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
636 { |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
637 fileinfo_entry_set_image(image_artwork, tmp); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
638 g_free(tmp); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
639 } |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
640 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
641 if(updating_enabled && current_file != NULL && current_ip != NULL && current_ip->update_song_tuple != NULL) |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
642 gtk_widget_set_sensitive(btn_apply, TRUE); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
643 else |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
644 gtk_widget_set_sensitive(btn_apply, FALSE); |
4021
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
645 |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
646 if (label_mini_status != NULL) { |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
647 gtk_label_set_text(GTK_LABEL(label_mini_status), "<span size=\"small\"></span>"); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
648 gtk_label_set_use_markup(GTK_LABEL(label_mini_status), TRUE); |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
649 } |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
650 |
4019
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
651 if(! GTK_WIDGET_VISIBLE(fileinfo_win)) gtk_widget_show(fileinfo_win); |
2313 | 652 } |
653 | |
654 void | |
655 fileinfo_show_for_path(gchar *path) | |
656 { | |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
657 Tuple *tuple = input_get_song_tuple(path); |
2313 | 658 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
659 if (tuple == NULL) |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
660 return input_file_info_box(path); |
2313 | 661 |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
662 fileinfo_show_for_tuple(tuple, FALSE); |
2313 | 663 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
664 mowgli_object_unref(tuple); |
2313 | 665 } |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
666 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
667 void |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
668 fileinfo_show_editor_for_path(gchar *path, InputPlugin *ip) |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
669 { |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
670 G_FREE_CLEAR(current_file); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
671 current_file = g_strdup(path); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
672 current_ip = ip; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
673 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
674 Tuple *tuple = input_get_song_tuple(path); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
675 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
676 if (tuple == NULL) |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
677 return input_file_info_box(path); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
678 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
679 fileinfo_show_for_tuple(tuple, TRUE); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
680 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
681 mowgli_object_unref(tuple); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
682 } |