Mercurial > audlegacy
annotate src/audacious/ui_fileinfo.c @ 4042:e8066e91388a
Automated merge with ssh://hg.atheme.org//hg/audacious
author | Eugene Zagidullin <e.asphyx@gmail.com> |
---|---|
date | Sat, 01 Dec 2007 01:57:03 +0300 |
parents | 554f7170712b |
children | 91dabb7c78d2 |
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; |
4023
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
87 static gboolean something_changed = FALSE; |
4019
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
88 |
2313 | 89 static void |
3986 | 90 fileinfo_entry_set_text(GtkWidget *widget, const char *text) |
2313 | 91 { |
3986 | 92 if (widget == NULL) |
93 return; | |
2313 | 94 |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
95 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
|
96 } |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
97 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
98 static void |
4022
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
99 set_entry_str_from_field(GtkWidget *widget, Tuple *tuple, gint fieldn, gboolean editable) |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
100 { |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
101 gchar *text; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
102 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
103 if(widget != NULL) { |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
104 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
|
105 gtk_entry_set_text(GTK_ENTRY(widget), text != NULL ? text : ""); |
4022
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
106 gtk_editable_set_editable(GTK_EDITABLE(widget), editable); |
4020
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 } |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
109 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
110 static void |
4022
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
111 set_entry_int_from_field(GtkWidget *widget, Tuple *tuple, gint fieldn, gboolean editable) |
4020
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 gchar *text; |
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(widget == NULL) return; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
116 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
117 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
|
118 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
|
119 gtk_entry_set_text(GTK_ENTRY(widget), text); |
4022
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
120 gtk_editable_set_editable(GTK_EDITABLE(widget), editable); |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
121 g_free(text); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
122 } else { |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
123 gtk_entry_set_text(GTK_ENTRY(widget), ""); |
4022
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
124 gtk_editable_set_editable(GTK_EDITABLE(widget), editable); |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
125 } |
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 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
128 static void |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
129 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
|
130 { |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
131 if(widget == NULL) return; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
132 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
|
133 } |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
134 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
135 static void |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
136 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
|
137 { |
4022
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
138 gchar *tmp; |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
139 if(widget == NULL) return; |
4022
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
140 |
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
141 tmp = (gchar*)gtk_entry_get_text(GTK_ENTRY(widget)); |
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
142 if(*tmp != '\0') |
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
143 tuple_associate_int(tuple, fieldn, NULL, atoi(tmp)); |
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
144 else |
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
145 tuple_associate_int(tuple, fieldn, NULL, -1); |
2313 | 146 } |
147 | |
148 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
|
149 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
|
150 { |
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 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
|
152 |
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 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
|
154 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
|
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 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
|
157 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
|
158 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
|
159 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
|
160 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
|
161 } else { |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
162 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
|
163 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
|
164 } |
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
|
165 } |
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
|
166 |
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
|
167 static void |
3986 | 168 fileinfo_entry_set_image(GtkWidget *widget, const char *text) |
2313 | 169 { |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
170 GdkPixbuf *pixbuf; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
171 int width, height; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
172 double aspect; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
173 GdkPixbuf *pixbuf2; |
2313 | 174 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
175 if (widget == NULL) |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
176 return; |
2313 | 177 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
178 pixbuf = gdk_pixbuf_new_from_file(text, NULL); |
2313 | 179 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
180 if (pixbuf == NULL) |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
181 return; |
2313 | 182 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
183 width = gdk_pixbuf_get_width(GDK_PIXBUF(pixbuf)); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
184 height = gdk_pixbuf_get_height(GDK_PIXBUF(pixbuf)); |
2313 | 185 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
186 if(strcmp(DATA_DIR "/images/audio.png", text)) |
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 if(width == 0) |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
189 width = 1; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
190 aspect = (double)height / (double)width; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
191 if(aspect > 1.0) { |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
192 height = (int)(cfg.filepopup_pixelsize * aspect); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
193 width = cfg.filepopup_pixelsize; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
194 } else { |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
195 height = cfg.filepopup_pixelsize; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
196 width = (int)(cfg.filepopup_pixelsize / aspect); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
197 } |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
198 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
|
199 g_object_unref(G_OBJECT(pixbuf)); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
200 pixbuf = pixbuf2; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
201 } |
2313 | 202 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
203 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
|
204 g_object_unref(G_OBJECT(pixbuf)); |
2313 | 205 } |
206 | |
207 void fileinfo_hide(gpointer unused) | |
208 { | |
4019
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
209 if(GTK_WIDGET_VISIBLE(fileinfo_win)) gtk_widget_hide(fileinfo_win); |
2313 | 210 |
3986 | 211 /* Clear it out. */ |
212 fileinfo_entry_set_text(entry_title, ""); | |
213 fileinfo_entry_set_text(entry_artist, ""); | |
214 fileinfo_entry_set_text(entry_album, ""); | |
215 fileinfo_entry_set_text(entry_comment, ""); | |
216 fileinfo_entry_set_text(entry_genre, ""); | |
217 fileinfo_entry_set_text(entry_year, ""); | |
218 fileinfo_entry_set_text(entry_track, ""); | |
219 fileinfo_entry_set_text(entry_location, ""); | |
2313 | 220 |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
221 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
|
222 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
|
223 |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
224 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
|
225 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
|
226 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
|
227 } |
4023
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
228 |
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
229 something_changed = FALSE; |
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
230 gtk_widget_set_sensitive(btn_apply, FALSE); |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
231 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
232 current_ip = NULL; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
233 G_FREE_CLEAR(current_file); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
234 |
3986 | 235 fileinfo_entry_set_image(image_artwork, DATA_DIR "/images/audio.png"); |
2313 | 236 } |
237 | |
4023
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
238 static void entry_changed (GtkEditable *editable, gpointer user_data) |
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
239 { |
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
240 if(current_file != NULL && current_ip != NULL && current_ip->update_song_tuple != NULL) { |
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
241 something_changed = TRUE; |
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
242 gtk_widget_set_sensitive(btn_apply, TRUE); |
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
243 } |
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
244 } |
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
245 |
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
|
246 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
|
247 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
|
248 { |
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 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
|
250 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
|
251 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
|
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 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
|
254 } |
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 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
|
257 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
|
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 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
|
260 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
|
261 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
|
262 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
|
263 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
|
264 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
|
265 } |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
266 } |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
267 |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
268 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
|
269 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
|
270 { |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
271 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
|
272 } |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
273 |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
274 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
|
275 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
|
276 { |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
277 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
|
278 } |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
279 |
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 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
|
281 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
|
282 { |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
283 Tuple *tuple; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
284 VFSFile *fd; |
4023
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
285 if(current_file != NULL && current_ip != NULL && current_ip->update_song_tuple != NULL && something_changed) { |
4020
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 tuple = tuple_new(); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
288 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
|
289 |
4041
554f7170712b
disabled tag wrtiting for sreams
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4035
diff
changeset
|
290 if (fd != NULL && !vfs_is_streaming(fd)) { |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
291 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
|
292 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
|
293 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
|
294 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
|
295 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
|
296 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
297 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
|
298 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
|
299 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
300 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
|
301 message_update_successfull(); |
4023
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
302 something_changed = FALSE; |
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
303 gtk_widget_set_sensitive(btn_apply, FALSE); |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
304 } 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
|
305 message_update_failed(); |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
306 } |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
307 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
308 vfs_fclose(fd); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
309 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
310 } 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
|
311 message_update_failed(); |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
312 } |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
313 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
314 mowgli_object_unref(tuple); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
315 } |
4019
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
316 } |
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
317 |
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
318 |
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
|
319 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
|
320 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
|
321 { |
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
|
322 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
|
323 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
|
324 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
|
325 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
|
326 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
|
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 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
|
329 //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
|
330 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
|
331 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
|
332 |
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 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
|
334 |
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 /* 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
|
336 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
|
337 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
|
338 //fprintf(stderr, "looking for %s\n", n); |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
339 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
|
340 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
|
341 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
|
342 //fprintf(stderr, "%s is ok\n", n); |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
343 va_end(par); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
344 return pixbuf; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
345 } |
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
|
346 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
|
347 } |
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
|
348 |
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
|
349 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
|
350 } |
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 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
|
353 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
|
354 { |
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 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
|
356 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
|
357 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
|
358 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
|
359 |
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
|
360 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
|
361 |
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
|
362 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
|
363 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
|
364 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
|
365 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
|
366 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
|
367 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
|
368 //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
|
369 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
|
370 g_free(mime_gnome_generic); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
371 g_free(mime_generic); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
372 g_free(mime_gnome); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
373 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
|
374 } |
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 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
|
376 |
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 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
|
378 } |
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
|
379 |
2313 | 380 void |
381 create_fileinfo_window(void) | |
382 { | |
3986 | 383 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
|
384 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
|
385 GtkWidget *vbox0; |
3986 | 386 GtkWidget *vbox1; |
387 GtkWidget *vbox2; | |
388 GtkWidget *label_title; | |
389 GtkWidget *label_artist; | |
390 GtkWidget *label_album; | |
391 GtkWidget *label_comment; | |
392 GtkWidget *label_genre; | |
393 GtkWidget *label_year; | |
394 GtkWidget *label_track; | |
395 GtkWidget *label_location; | |
4013
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
396 GtkWidget *label_general; |
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
397 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
|
398 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
|
399 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
|
400 GtkWidget *codec_table; |
3986 | 401 GtkWidget *table1; |
402 GtkWidget *bbox_close; | |
403 GtkWidget *btn_close; | |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
404 GtkWidget *alignment; |
4011
c19c8d47e221
vseparator in fileinfo came back
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4010
diff
changeset
|
405 GtkWidget *separator; |
3986 | 406 |
407 fileinfo_win = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
408 gtk_container_set_border_width(GTK_CONTAINER(fileinfo_win), 6); | |
409 gtk_window_set_title(GTK_WINDOW(fileinfo_win), _("Track Information")); | |
410 gtk_window_set_position(GTK_WINDOW(fileinfo_win), GTK_WIN_POS_CENTER); | |
411 gtk_window_set_resizable(GTK_WINDOW(fileinfo_win), FALSE); | |
412 gtk_window_set_type_hint(GTK_WINDOW(fileinfo_win), GDK_WINDOW_TYPE_HINT_DIALOG); | |
413 gtk_window_set_transient_for(GTK_WINDOW(fileinfo_win), GTK_WINDOW(mainwin)); | |
414 | |
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
|
415 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
|
416 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
|
417 |
4011
c19c8d47e221
vseparator in fileinfo came back
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4010
diff
changeset
|
418 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
|
419 gtk_box_pack_start(GTK_BOX(vbox0), hbox, TRUE, TRUE, 0); |
2313 | 420 |
3986 | 421 image_artwork = gtk_image_new(); |
422 gtk_box_pack_start(GTK_BOX(hbox), image_artwork, FALSE, FALSE, 0); | |
423 gtk_misc_set_alignment(GTK_MISC(image_artwork), 0.5, 0); | |
424 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
|
425 separator = gtk_vseparator_new(); |
c19c8d47e221
vseparator in fileinfo came back
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4010
diff
changeset
|
426 gtk_box_pack_start(GTK_BOX(hbox), separator, FALSE, FALSE, 0); |
3986 | 427 |
428 vbox1 = gtk_vbox_new(FALSE, 0); | |
429 gtk_box_pack_start(GTK_BOX(hbox), vbox1, TRUE, TRUE, 0); | |
430 | |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
431 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
|
432 gtk_box_pack_start(GTK_BOX(vbox1), alignment, TRUE, TRUE, 0); |
3986 | 433 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
|
434 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
|
435 |
4013
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
436 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
|
437 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
|
438 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
|
439 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
|
440 |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
441 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
|
442 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
|
443 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
|
444 |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
445 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
|
446 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
|
447 |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
448 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
|
449 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
|
450 |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
451 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
|
452 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
|
453 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
|
454 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
|
455 |
4013
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
456 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
|
457 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
|
458 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
|
459 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
|
460 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
|
461 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
|
462 |
4013
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
463 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
|
464 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
|
465 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
|
466 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
|
467 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
|
468 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
|
469 |
4013
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
470 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
|
471 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
472 (GtkAttachOptions) (0), 0, 0); |
4013
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
473 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
|
474 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
475 (GtkAttachOptions) (0), 0, 0); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
476 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
|
477 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
478 (GtkAttachOptions) (0), 0, 0); |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
479 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
|
480 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), |
ce791ae274aa
Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4009
diff
changeset
|
481 (GtkAttachOptions) (0), 0, 0); |
3986 | 482 |
483 label_title = gtk_label_new(_("<span size=\"small\">Title</span>")); | |
484 gtk_box_pack_start(GTK_BOX(vbox2), label_title, FALSE, FALSE, 0); | |
485 gtk_label_set_use_markup(GTK_LABEL(label_title), TRUE); | |
486 gtk_misc_set_alignment(GTK_MISC(label_title), 0, 0); | |
2313 | 487 |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
488 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
|
489 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
|
490 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0); |
3986 | 491 entry_title = gtk_entry_new(); |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
492 gtk_container_add(GTK_CONTAINER(alignment), entry_title); |
4023
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
493 g_signal_connect(G_OBJECT(entry_title), "changed", (GCallback) entry_changed, NULL); |
3986 | 494 |
495 label_artist = gtk_label_new(_("<span size=\"small\">Artist</span>")); | |
496 gtk_box_pack_start(GTK_BOX(vbox2), label_artist, FALSE, FALSE, 0); | |
497 gtk_label_set_use_markup(GTK_LABEL(label_artist), TRUE); | |
498 gtk_misc_set_alignment(GTK_MISC(label_artist), 0, 0.5); | |
499 | |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
500 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
|
501 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
|
502 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0); |
3986 | 503 entry_artist = gtk_entry_new(); |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
504 gtk_container_add(GTK_CONTAINER(alignment), entry_artist); |
4023
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
505 g_signal_connect(G_OBJECT(entry_artist), "changed", (GCallback) entry_changed, NULL); |
3986 | 506 |
507 label_album = gtk_label_new(_("<span size=\"small\">Album</span>")); | |
508 gtk_box_pack_start(GTK_BOX(vbox2), label_album, FALSE, FALSE, 0); | |
509 gtk_label_set_use_markup(GTK_LABEL(label_album), TRUE); | |
510 gtk_misc_set_alignment(GTK_MISC(label_album), 0, 0.5); | |
511 | |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
512 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
|
513 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
|
514 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0); |
3986 | 515 entry_album = gtk_entry_new(); |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
516 gtk_container_add(GTK_CONTAINER(alignment), entry_album); |
4023
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
517 g_signal_connect(G_OBJECT(entry_album), "changed", (GCallback) entry_changed, NULL); |
2313 | 518 |
3986 | 519 label_comment = gtk_label_new(_("<span size=\"small\">Comment</span>")); |
520 gtk_box_pack_start(GTK_BOX(vbox2), label_comment, FALSE, FALSE, 0); | |
521 gtk_label_set_use_markup(GTK_LABEL(label_comment), TRUE); | |
522 gtk_misc_set_alignment(GTK_MISC(label_comment), 0, 0.5); | |
523 | |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
524 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
|
525 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
|
526 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0); |
3986 | 527 entry_comment = gtk_entry_new(); |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
528 gtk_container_add (GTK_CONTAINER(alignment), entry_comment); |
4023
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
529 g_signal_connect(G_OBJECT(entry_comment), "changed", (GCallback) entry_changed, NULL); |
3986 | 530 |
531 label_genre = gtk_label_new(_("<span size=\"small\">Genre</span>")); | |
532 gtk_box_pack_start(GTK_BOX(vbox2), label_genre, FALSE, FALSE, 0); | |
533 gtk_label_set_use_markup(GTK_LABEL(label_genre), TRUE); | |
534 gtk_misc_set_alignment(GTK_MISC(label_genre), 0, 0.5); | |
535 | |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
536 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
|
537 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
|
538 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0); |
3986 | 539 entry_genre = gtk_entry_new(); |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
540 gtk_container_add(GTK_CONTAINER(alignment), entry_genre); |
4023
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
541 g_signal_connect(G_OBJECT(entry_genre), "changed", (GCallback) entry_changed, NULL); |
3986 | 542 |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
543 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
|
544 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
|
545 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0); |
3986 | 546 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
|
547 gtk_container_add(GTK_CONTAINER(alignment), table1); |
3986 | 548 gtk_table_set_col_spacings(GTK_TABLE(table1), 6); |
549 | |
550 label_year = gtk_label_new(_("<span size=\"small\">Year</span>")); | |
551 gtk_table_attach(GTK_TABLE(table1), label_year, 0, 1, 0, 1, | |
552 (GtkAttachOptions) (GTK_FILL), | |
553 (GtkAttachOptions) (0), 0, 0); | |
554 gtk_label_set_use_markup(GTK_LABEL(label_year), TRUE); | |
555 gtk_misc_set_alignment(GTK_MISC(label_year), 0, 0.5); | |
2313 | 556 |
3986 | 557 entry_year = gtk_entry_new(); |
558 gtk_table_attach(GTK_TABLE(table1), entry_year, 0, 1, 1, 2, | |
559 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
560 (GtkAttachOptions) (0), 0, 0); | |
4023
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
561 g_signal_connect(G_OBJECT(entry_year), "changed", (GCallback) entry_changed, NULL); |
3986 | 562 |
563 label_track = gtk_label_new(_("<span size=\"small\">Track Number</span>")); | |
564 gtk_table_attach(GTK_TABLE(table1), label_track, 1, 2, 0, 1, | |
565 (GtkAttachOptions) (GTK_FILL), | |
566 (GtkAttachOptions) (0), 0, 0); | |
567 gtk_label_set_use_markup(GTK_LABEL(label_track), TRUE); | |
568 gtk_misc_set_alignment(GTK_MISC(label_track), 0, 0.5); | |
569 | |
570 entry_track = gtk_entry_new(); | |
571 gtk_table_attach(GTK_TABLE(table1), entry_track, 1, 2, 1, 2, | |
572 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
573 (GtkAttachOptions) (0), 0, 0); | |
4023
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
574 g_signal_connect(G_OBJECT(entry_track), "changed", (GCallback) entry_changed, NULL); |
2313 | 575 |
3986 | 576 label_location = gtk_label_new(_("<span size=\"small\">Location</span>")); |
577 gtk_box_pack_start(GTK_BOX(vbox2), label_location, FALSE, FALSE, 0); | |
578 gtk_label_set_use_markup(GTK_LABEL(label_location), TRUE); | |
579 gtk_misc_set_alignment(GTK_MISC(label_location), 0, 0.5); | |
580 | |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
581 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
|
582 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
|
583 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
|
584 |
3986 | 585 entry_location = gtk_entry_new(); |
3988
ce1ce0a6cc74
bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents:
3986
diff
changeset
|
586 gtk_container_add(GTK_CONTAINER(alignment), entry_location); |
4022
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
587 gtk_editable_set_editable(GTK_EDITABLE(entry_location), FALSE); |
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
|
588 |
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
|
589 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
|
590 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
|
591 |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
592 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
|
593 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
|
594 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
|
595 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
|
596 |
3986 | 597 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
|
598 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
|
599 gtk_box_pack_start(GTK_BOX(hbox_status_and_bbox), bbox_close, FALSE, FALSE, 0); |
3986 | 600 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox_close), GTK_BUTTONBOX_END); |
601 | |
4035
db2e900fdb62
"Apply" button in fileinfo changed to "Save"
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4023
diff
changeset
|
602 btn_apply = gtk_button_new_from_stock("gtk-save"); |
4019
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
603 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
|
604 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
|
605 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
|
606 |
3986 | 607 btn_close = gtk_button_new_from_stock("gtk-close"); |
608 gtk_container_add(GTK_CONTAINER(bbox_close), btn_close); | |
609 GTK_WIDGET_SET_FLAGS(btn_close, GTK_CAN_DEFAULT); | |
610 g_signal_connect(G_OBJECT(btn_close), "clicked", (GCallback) fileinfo_hide, NULL); | |
611 | |
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
|
612 gtk_widget_show_all (vbox0); |
2313 | 613 } |
614 | |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
615 void |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
616 fileinfo_show_for_tuple(Tuple *tuple, gboolean updating_enabled) |
2313 | 617 { |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
618 gchar *tmp, *tmp_utf = NULL; |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
619 GdkPixbuf *icon = NULL; |
2313 | 620 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
621 if (tuple == NULL) |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
622 return; |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
623 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
624 if(!updating_enabled) { |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
625 current_ip = NULL; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
626 G_FREE_CLEAR(current_file); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
627 } |
2313 | 628 |
4023
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
629 something_changed = FALSE; |
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
630 |
4019
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
631 if(!GTK_WIDGET_REALIZED(fileinfo_win)) gtk_widget_realize(fileinfo_win); |
2313 | 632 |
4022
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
633 set_entry_str_from_field(entry_title, tuple, FIELD_TITLE, updating_enabled); |
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
634 set_entry_str_from_field(entry_artist, tuple, FIELD_ARTIST, updating_enabled); |
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
635 set_entry_str_from_field(entry_album, tuple, FIELD_ALBUM, updating_enabled); |
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
636 set_entry_str_from_field(entry_comment, tuple, FIELD_COMMENT, updating_enabled); |
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
637 set_entry_str_from_field(entry_genre, tuple, FIELD_GENRE, updating_enabled); |
2313 | 638 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
639 tmp = g_strdup_printf("%s/%s", |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
640 tuple_get_string(tuple, FIELD_FILE_PATH, NULL), |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
641 tuple_get_string(tuple, FIELD_FILE_NAME, NULL)); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
642 if(tmp){ |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
643 tmp_utf = str_to_utf8(tmp); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
644 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
|
645 g_free(tmp_utf); |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
646 g_free(tmp); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
647 tmp = NULL; |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
648 } |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
649 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
650 /* set empty string if field not availaible. --eugene */ |
4022
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
651 set_entry_int_from_field(entry_year, tuple, FIELD_YEAR, updating_enabled); |
85315c67252d
fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4021
diff
changeset
|
652 set_entry_int_from_field(entry_track, tuple, FIELD_TRACK_NUMBER, updating_enabled); |
2313 | 653 |
4013
2e80ee28c7cc
Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4012
diff
changeset
|
654 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
|
655 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
|
656 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
657 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
|
658 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
|
659 if (icon) { |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
660 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
|
661 g_object_unref(icon); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
662 } |
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
|
663 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
664 tmp = fileinfo_recursive_get_image( |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
665 tuple_get_string(tuple, FIELD_FILE_PATH, NULL), |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
666 tuple_get_string(tuple, FIELD_FILE_NAME, NULL), 0); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
667 |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
668 if(tmp) |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
669 { |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
670 fileinfo_entry_set_image(image_artwork, tmp); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
671 g_free(tmp); |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
672 } |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
673 |
4023
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
674 /*if(updating_enabled && current_file != NULL && current_ip != NULL && current_ip->update_song_tuple != NULL) |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
675 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
|
676 else |
4023
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
677 gtk_widget_set_sensitive(btn_apply, FALSE);*/ |
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
678 |
0f3cd542f23a
be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4022
diff
changeset
|
679 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
|
680 |
d79fd54de4fa
added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4020
diff
changeset
|
681 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
|
682 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
|
683 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
|
684 } |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
685 |
4019
29650db2d5f2
added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4013
diff
changeset
|
686 if(! GTK_WIDGET_VISIBLE(fileinfo_win)) gtk_widget_show(fileinfo_win); |
2313 | 687 } |
688 | |
689 void | |
690 fileinfo_show_for_path(gchar *path) | |
691 { | |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
692 Tuple *tuple = input_get_song_tuple(path); |
2313 | 693 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
694 if (tuple == NULL) |
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
695 return input_file_info_box(path); |
2313 | 696 |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
697 fileinfo_show_for_tuple(tuple, FALSE); |
2313 | 698 |
4012
197352fd6b3e
Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4011
diff
changeset
|
699 mowgli_object_unref(tuple); |
2313 | 700 } |
4020
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
701 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
702 void |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
703 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
|
704 { |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
705 G_FREE_CLEAR(current_file); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
706 current_file = g_strdup(path); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
707 current_ip = ip; |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
708 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
709 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
|
710 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
711 if (tuple == NULL) |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
712 return input_file_info_box(path); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
713 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
714 fileinfo_show_for_tuple(tuple, TRUE); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
715 |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
716 mowgli_object_unref(tuple); |
66529edae49d
added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
4019
diff
changeset
|
717 } |