annotate src/audacious/ui_fileinfo.c @ 4010:ce791ae274aa

Codec info in fileinfo box moved to top
author Eugene Zagidullin <e.asphyx@gmail.com>
date Sun, 25 Nov 2007 04:32:09 +0300
parents ba6258a39662
children c19c8d47e221
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1 /*
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
2 * Audacious: A cross-platform multimedia player
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
3 * Copyright (c) 2006 William Pitcock, Tony Vroon, George Averill,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
4 * Giacomo Lozito, Derek Pomery and Yoshiki Yazawa.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
5 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
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
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
9 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
13 * GNU General Public License for more details.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
14 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
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
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
20 */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
21
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
22 #ifdef HAVE_CONFIG_H
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
23 # include "config.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
24 #endif
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
25
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
26 #include <glib.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
27 #include <glib/gi18n.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
28 #include <gtk/gtk.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
29 #include <string.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
30 #include <stddef.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
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
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
33 #include <sys/types.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
34 #include <dirent.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
35 #include <unistd.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
36 #include <errno.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
37 #include <sys/types.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
38 #include <sys/stat.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
39
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
40 #include "plugin.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
41 #include "pluginenum.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
42 #include "input.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
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
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
45 #include "general.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
46 #include "output.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
47 #include "visualization.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
48
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
49 #include "main.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
50 #include "util.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
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"
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
53
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
54 #include "playlist.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
55
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
56 #include "ui_main.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
57 #include "ui_playlist.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
58 #include "build_stamp.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
59 #include "ui_fileinfo.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
60 #include "ui_playlist.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
61
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
62 GtkWidget *fileinfo_win;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
63
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
64 GtkWidget *entry_location;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
65 GtkWidget *entry_title;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
66 GtkWidget *entry_artist;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
67 GtkWidget *entry_album;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
68 GtkWidget *entry_comment;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
69 GtkWidget *entry_year;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
70 GtkWidget *entry_track;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
71 GtkWidget *entry_genre;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
72
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
73 GtkWidget *image_artwork;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
74
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
75 GtkWidget *image_fileicon;
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
76 GtkWidget *label_codec_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
77 GtkWidget *label_quality;
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
78
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
79 static void
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
80 fileinfo_entry_set_text(GtkWidget *widget, const char *text)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
81 {
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
82 if (widget == NULL)
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
83 return;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
84
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
85 gtk_entry_set_text(GTK_ENTRY(widget), text);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
86 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
87
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
88 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
89 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
90 {
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
91 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
92
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
93 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
94 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
95
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
96 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
97 tmp = g_strdup_printf("<span size=\"small\">%s</span>", 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
98 gtk_label_set_text(GTK_LABEL(widget), 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
99 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
100 g_free(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
101 } else {
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
102 gtk_label_set_text(GTK_LABEL(widget), _("<span size=\"small\">n/a</span>"));
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
103 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
104 }
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
105 }
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
106
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
107 static void
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
108 fileinfo_entry_set_text_free(GtkWidget *widget, char *text)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
109 {
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
110 if (widget == NULL)
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
111 return;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
112
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
113 gtk_entry_set_text(GTK_ENTRY(widget), text);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
114
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
115 g_free(text);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
116 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
117
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
118 static void
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
119 fileinfo_entry_set_image(GtkWidget *widget, const char *text)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
120 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
121 GdkPixbuf *pixbuf;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
122 int width, height;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
123 double aspect;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
124 GdkPixbuf *pixbuf2;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
125
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
126 if (widget == NULL)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
127 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
128
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
129 pixbuf = gdk_pixbuf_new_from_file(text, NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
130
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
131 if (pixbuf == NULL)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
132 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
133
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
134 width = gdk_pixbuf_get_width(GDK_PIXBUF(pixbuf));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
135 height = gdk_pixbuf_get_height(GDK_PIXBUF(pixbuf));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
136
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
137 if(strcmp(DATA_DIR "/images/audio.png", text))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
138 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
139 if(width == 0)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
140 width = 1;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
141 aspect = (double)height / (double)width;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
142 if(aspect > 1.0) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
143 height = (int)(cfg.filepopup_pixelsize * aspect);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
144 width = cfg.filepopup_pixelsize;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
145 } else {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
146 height = cfg.filepopup_pixelsize;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
147 width = (int)(cfg.filepopup_pixelsize / aspect);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
148 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
149 pixbuf2 = gdk_pixbuf_scale_simple(GDK_PIXBUF(pixbuf), width, height, GDK_INTERP_BILINEAR);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
150 g_object_unref(G_OBJECT(pixbuf));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
151 pixbuf = pixbuf2;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
152 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
153
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
154 gtk_image_set_from_pixbuf(GTK_IMAGE(widget), GDK_PIXBUF(pixbuf));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
155 g_object_unref(G_OBJECT(pixbuf));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
156 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
157
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
158 void fileinfo_hide(gpointer unused)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
159 {
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
160 gtk_widget_hide(fileinfo_win);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
161
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
162 /* Clear it out. */
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
163 fileinfo_entry_set_text(entry_title, "");
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
164 fileinfo_entry_set_text(entry_artist, "");
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
165 fileinfo_entry_set_text(entry_album, "");
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
166 fileinfo_entry_set_text(entry_comment, "");
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
167 fileinfo_entry_set_text(entry_genre, "");
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
168 fileinfo_entry_set_text(entry_year, "");
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
169 fileinfo_entry_set_text(entry_track, "");
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
170 fileinfo_entry_set_text(entry_location, "");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
171
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
172 fileinfo_entry_set_image(image_artwork, DATA_DIR "/images/audio.png");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
173 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
174
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
175 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
176 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
177 {
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
178 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
179 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
180 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
181 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
182 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
183
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
184 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
185 //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
186 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
187 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
188
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
189 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
190
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
191 /* 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
192 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
193 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
194 //fprintf(stderr, "looking for %s\n", 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
195 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
196 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
197 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
198 //fprintf(stderr, "%s is ok\n", 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
199 va_end(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
200 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
201 }
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
202 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
203 }
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
204
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
205 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
206 }
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
207
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
208 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
209 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
210 {
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
211 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
212 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
213 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
214 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
215
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
216 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
217
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
218 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
219 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
220 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
221 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
222 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
223 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
224 //fprintf(stderr, "will look for %s, %s, %s, %s, %s\n", mime_as_is, mime_gnome, mime_generic, mime_gnome_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
225 icon = themed_icon_lookup(size, mime_as_is, mime_gnome, mime_generic, mime_gnome_generic, s[0], NULL); /* s[0] is category */
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
226 g_free(mime_gnome_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
227 g_free(mime_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
228 g_free(mime_gnome);
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
229 g_free(mime_as_is);
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
230 }
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
231 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
232
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
233 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
234 }
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
235
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
236 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
237 create_fileinfo_window(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
238 {
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
239 GtkWidget *hbox;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
240 GtkWidget *vbox1;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
241 GtkWidget *vbox2;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
242 GtkWidget *label_title;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
243 GtkWidget *label_artist;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
244 GtkWidget *label_album;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
245 GtkWidget *label_comment;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
246 GtkWidget *label_genre;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
247 GtkWidget *label_year;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
248 GtkWidget *label_track;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
249 GtkWidget *label_location;
4009
ba6258a39662 icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 3988
diff changeset
250 GtkWidget *label_codec;
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
251 GtkWidget *label_codec_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
252 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
253 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
254 GtkWidget *codec_table;
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
255 GtkWidget *table1;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
256 GtkWidget *bbox_close;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
257 GtkWidget *btn_close;
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
258 GtkWidget *alignment;
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
259
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
260 fileinfo_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
261 gtk_container_set_border_width(GTK_CONTAINER(fileinfo_win), 6);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
262 gtk_window_set_title(GTK_WINDOW(fileinfo_win), _("Track Information"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
263 gtk_window_set_position(GTK_WINDOW(fileinfo_win), GTK_WIN_POS_CENTER);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
264 gtk_window_set_resizable(GTK_WINDOW(fileinfo_win), FALSE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
265 gtk_window_set_type_hint(GTK_WINDOW(fileinfo_win), GDK_WINDOW_TYPE_HINT_DIALOG);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
266 gtk_window_set_transient_for(GTK_WINDOW(fileinfo_win), GTK_WINDOW(mainwin));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
267
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
268 hbox = gtk_hbox_new(FALSE, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
269 gtk_container_add(GTK_CONTAINER(fileinfo_win), hbox);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
270
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
271 image_artwork = gtk_image_new();
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
272 gtk_box_pack_start(GTK_BOX(hbox), image_artwork, FALSE, FALSE, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
273 gtk_misc_set_alignment(GTK_MISC(image_artwork), 0.5, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
274 gtk_image_set_from_file(GTK_IMAGE(image_artwork), DATA_DIR "/images/audio.png");
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
275
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
276 vbox1 = gtk_vbox_new(FALSE, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
277 gtk_box_pack_start(GTK_BOX(hbox), vbox1, TRUE, TRUE, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
278
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
279 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
280 gtk_box_pack_start(GTK_BOX(vbox1), alignment, TRUE, TRUE, 0);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
281 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
282 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
283
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
284 label_codec = gtk_label_new(_("<span size=\"small\">Codec</span>"));
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
285 gtk_box_pack_start (GTK_BOX (vbox2), label_codec, FALSE, FALSE, 0);
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
286 gtk_label_set_use_markup(GTK_LABEL(label_codec), TRUE);
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
287 gtk_misc_set_alignment(GTK_MISC(label_codec), 0, 0.5);
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
288
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
289 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
290 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
291 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
292
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
293 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
294 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
295
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
296 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
297 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
298
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
299 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
300 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
301 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
302 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
303
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
304 label_codec_label = gtk_label_new(_("<span size=\"small\">Codec name:</span>"));
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
305 gtk_label_set_use_markup(GTK_LABEL(label_codec_label), TRUE);
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
306 gtk_misc_set_alignment(GTK_MISC(label_codec_label), 0, 0.5);
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
307 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
308 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
309 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
310
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
311 label_codec_name = 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
312 gtk_label_set_use_markup(GTK_LABEL(label_codec_name), TRUE);
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
313 gtk_misc_set_alignment(GTK_MISC(label_codec_name), 0, 0.5);
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
314 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
315 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
316 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
317
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
318 gtk_table_attach(GTK_TABLE(codec_table), label_codec_label, 0, 1, 0, 1,
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
319 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
320 (GtkAttachOptions) (0), 0, 0);
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
321 gtk_table_attach(GTK_TABLE(codec_table), label_codec_name, 1, 2, 0, 1,
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
322 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
323 (GtkAttachOptions) (0), 0, 0);
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
324 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
325 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
326 (GtkAttachOptions) (0), 0, 0);
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
327 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
328 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
329 (GtkAttachOptions) (0), 0, 0);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
330
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
331 label_title = gtk_label_new(_("<span size=\"small\">Title</span>"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
332 gtk_box_pack_start(GTK_BOX(vbox2), label_title, FALSE, FALSE, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
333 gtk_label_set_use_markup(GTK_LABEL(label_title), TRUE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
334 gtk_misc_set_alignment(GTK_MISC(label_title), 0, 0);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
335
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
336 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
337 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
338 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
339 entry_title = gtk_entry_new();
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
340 gtk_container_add(GTK_CONTAINER(alignment), entry_title);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
341
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
342 label_artist = gtk_label_new(_("<span size=\"small\">Artist</span>"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
343 gtk_box_pack_start(GTK_BOX(vbox2), label_artist, FALSE, FALSE, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
344 gtk_label_set_use_markup(GTK_LABEL(label_artist), TRUE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
345 gtk_misc_set_alignment(GTK_MISC(label_artist), 0, 0.5);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
346
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
347 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
348 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
349 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
350 entry_artist = gtk_entry_new();
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
351 gtk_container_add(GTK_CONTAINER(alignment), entry_artist);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
352
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
353 label_album = gtk_label_new(_("<span size=\"small\">Album</span>"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
354 gtk_box_pack_start(GTK_BOX(vbox2), label_album, FALSE, FALSE, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
355 gtk_label_set_use_markup(GTK_LABEL(label_album), TRUE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
356 gtk_misc_set_alignment(GTK_MISC(label_album), 0, 0.5);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
357
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
358 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
359 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
360 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
361 entry_album = gtk_entry_new();
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
362 gtk_container_add(GTK_CONTAINER(alignment), entry_album);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
363
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
364 label_comment = gtk_label_new(_("<span size=\"small\">Comment</span>"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
365 gtk_box_pack_start(GTK_BOX(vbox2), label_comment, FALSE, FALSE, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
366 gtk_label_set_use_markup(GTK_LABEL(label_comment), TRUE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
367 gtk_misc_set_alignment(GTK_MISC(label_comment), 0, 0.5);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
368
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
369 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
370 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
371 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
372 entry_comment = gtk_entry_new();
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
373 gtk_container_add (GTK_CONTAINER(alignment), entry_comment);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
374
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
375 label_genre = gtk_label_new(_("<span size=\"small\">Genre</span>"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
376 gtk_box_pack_start(GTK_BOX(vbox2), label_genre, FALSE, FALSE, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
377 gtk_label_set_use_markup(GTK_LABEL(label_genre), TRUE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
378 gtk_misc_set_alignment(GTK_MISC(label_genre), 0, 0.5);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
379
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
380 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
381 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
382 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
383 entry_genre = gtk_entry_new();
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
384 gtk_container_add(GTK_CONTAINER(alignment), entry_genre);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
385
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
386 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
387 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
388 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
389 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
390 gtk_container_add(GTK_CONTAINER(alignment), table1);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
391 gtk_table_set_col_spacings(GTK_TABLE(table1), 6);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
392
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
393 label_year = gtk_label_new(_("<span size=\"small\">Year</span>"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
394 gtk_table_attach(GTK_TABLE(table1), label_year, 0, 1, 0, 1,
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
395 (GtkAttachOptions) (GTK_FILL),
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
396 (GtkAttachOptions) (0), 0, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
397 gtk_label_set_use_markup(GTK_LABEL(label_year), TRUE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
398 gtk_misc_set_alignment(GTK_MISC(label_year), 0, 0.5);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
399
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
400 entry_year = gtk_entry_new();
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
401 gtk_table_attach(GTK_TABLE(table1), entry_year, 0, 1, 1, 2,
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
402 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
403 (GtkAttachOptions) (0), 0, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
404
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
405 label_track = gtk_label_new(_("<span size=\"small\">Track Number</span>"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
406 gtk_table_attach(GTK_TABLE(table1), label_track, 1, 2, 0, 1,
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
407 (GtkAttachOptions) (GTK_FILL),
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
408 (GtkAttachOptions) (0), 0, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
409 gtk_label_set_use_markup(GTK_LABEL(label_track), TRUE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
410 gtk_misc_set_alignment(GTK_MISC(label_track), 0, 0.5);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
411
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
412 entry_track = gtk_entry_new();
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
413 gtk_table_attach(GTK_TABLE(table1), entry_track, 1, 2, 1, 2,
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
414 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
415 (GtkAttachOptions) (0), 0, 0);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
416
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
417 label_location = gtk_label_new(_("<span size=\"small\">Location</span>"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
418 gtk_box_pack_start(GTK_BOX(vbox2), label_location, FALSE, FALSE, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
419 gtk_label_set_use_markup(GTK_LABEL(label_location), TRUE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
420 gtk_misc_set_alignment(GTK_MISC(label_location), 0, 0.5);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
421
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
422 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
423 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
424 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
425
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
426 entry_location = gtk_entry_new();
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
427 gtk_container_add(GTK_CONTAINER(alignment), entry_location);
4009
ba6258a39662 icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 3988
diff changeset
428
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
429 bbox_close = gtk_hbutton_box_new();
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
430 gtk_box_pack_start(GTK_BOX(vbox1), bbox_close, FALSE, FALSE, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
431 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox_close), GTK_BUTTONBOX_END);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
432
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
433 btn_close = gtk_button_new_from_stock("gtk-close");
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
434 gtk_container_add(GTK_CONTAINER(bbox_close), btn_close);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
435 GTK_WIDGET_SET_FLAGS(btn_close, GTK_CAN_DEFAULT);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
436 g_signal_connect(G_OBJECT(btn_close), "clicked", (GCallback) fileinfo_hide, NULL);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
437
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
438 gtk_widget_show_all (hbox);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
439 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
440
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
441 void
3298
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
442 fileinfo_show_for_tuple(Tuple *tuple)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
443 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
444 gchar *tmp = 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
445 GdkPixbuf *icon = NULL;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
446
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
447 if (tuple == NULL)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
448 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
449
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
450 gtk_widget_realize(fileinfo_win);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
451
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
452 fileinfo_entry_set_text(entry_title, tuple_get_string(tuple, FIELD_TITLE, NULL));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
453 fileinfo_entry_set_text(entry_artist, tuple_get_string(tuple, FIELD_ARTIST, NULL));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
454 fileinfo_entry_set_text(entry_album, tuple_get_string(tuple, FIELD_ALBUM, NULL));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
455 fileinfo_entry_set_text(entry_comment, tuple_get_string(tuple, FIELD_COMMENT, NULL));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
456 fileinfo_entry_set_text(entry_genre, tuple_get_string(tuple, FIELD_GENRE, NULL));
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
457
3490
602ec8c40d0d Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3298
diff changeset
458 tmp = g_strdup_printf("%s/%s",
602ec8c40d0d Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3298
diff changeset
459 tuple_get_string(tuple, FIELD_FILE_PATH, NULL),
602ec8c40d0d Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3298
diff changeset
460 tuple_get_string(tuple, FIELD_FILE_NAME, NULL));
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
461 if(tmp){
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
462 fileinfo_entry_set_text_free(entry_location, str_to_utf8(tmp));
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
463 g_free(tmp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
464 tmp = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
465 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
466
3490
602ec8c40d0d Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3298
diff changeset
467 if (tuple_get_int(tuple, FIELD_YEAR, NULL))
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
468 fileinfo_entry_set_text_free(entry_year,
3490
602ec8c40d0d Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3298
diff changeset
469 g_strdup_printf("%d", tuple_get_int(tuple, FIELD_YEAR, NULL)));
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
470
3490
602ec8c40d0d Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3298
diff changeset
471 if (tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL))
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
472 fileinfo_entry_set_text_free(entry_track,
3490
602ec8c40d0d Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3298
diff changeset
473 g_strdup_printf("%d", tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL)));
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
474
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
475 fileinfo_label_set_text(label_codec_name, tuple_get_string(tuple, FIELD_CODEC, 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
476 fileinfo_label_set_text(label_quality, tuple_get_string(tuple, FIELD_QUALITY, 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
477
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
478 tmp = (gchar *)tuple_get_string(tuple, FIELD_MIMETYPE, 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
479 icon = mime_icon_lookup(48, tmp ? tmp : "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
480 if (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
481 if (image_fileicon) gtk_image_set_from_pixbuf (GTK_IMAGE(image_fileicon), 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
482 g_object_unref(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
483 }
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
484
3490
602ec8c40d0d Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3298
diff changeset
485 tmp = fileinfo_recursive_get_image(
602ec8c40d0d Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3298
diff changeset
486 tuple_get_string(tuple, FIELD_FILE_PATH, NULL),
602ec8c40d0d Fixed to comply with the Tuple API changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3298
diff changeset
487 tuple_get_string(tuple, FIELD_FILE_NAME, NULL), 0);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
488
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
489 if(tmp)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
490 {
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
491 fileinfo_entry_set_image(image_artwork, tmp);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
492 g_free(tmp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
493 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
494
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
495 gtk_widget_show(fileinfo_win);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
496 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
497
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
498 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
499 fileinfo_show_for_path(gchar *path)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
500 {
3298
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
501 Tuple *tuple = input_get_song_tuple(path);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
502
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
503 if (tuple == NULL)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
504 return input_file_info_box(path);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
505
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
506 fileinfo_show_for_tuple(tuple);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
507
3298
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
508 mowgli_object_unref(tuple);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
509 }