annotate src/audacious/ui_fileinfo.c @ 4164:2a6d9dd09ec1

More prettying.
author William Pitcock <nenolod@atheme.org>
date Thu, 10 Jan 2008 05:44:38 -0600
parents a12876b41f01
children d4b13079f476
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.
4162
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
5 * Copyright (c) 2008 Eugene Zagidullin
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
6 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
8 * 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
9 * the Free Software Foundation; under version 3 of the License.
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
10 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
14 * GNU General Public License for more details.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
15 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
16 * 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
17 * 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
18 *
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
19 * 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
20 * Audacious or using our public API to be a derived work.
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
21 */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
22
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
23 #ifdef HAVE_CONFIG_H
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
24 # include "config.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
25 #endif
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
26
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
27 #include <glib.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
28 #include <glib/gi18n.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
29 #include <gtk/gtk.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
30 #include <string.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
31 #include <stddef.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
32 #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
33 #include <stdarg.h>
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
34 #include <sys/types.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
35 #include <dirent.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
36 #include <unistd.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
37 #include <errno.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
38 #include <sys/types.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
39 #include <sys/stat.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
40
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
41 #include "plugin.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
42 #include "pluginenum.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
43 #include "input.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
44 #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
45 #include "strings.h"
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
46 #include "general.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
47 #include "output.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
48 #include "visualization.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
49
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
50 #include "main.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
51 #include "util.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
52 #include "dnd.h"
3298
f985357757e0 audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
53 #include "tuple.h"
4019
29650db2d5f2 added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4013
diff changeset
54 #include "vfs.h"
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
55
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
56 #include "playlist.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
57
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
58 #include "ui_main.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
59 #include "ui_playlist.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
60 #include "build_stamp.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
61 #include "ui_fileinfo.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
62 #include "ui_playlist.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
63
4162
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
64 #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
65 #define STATUS_TIMEOUT 3*1000
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
66
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
67 GtkWidget *fileinfo_win;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
68
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
69 GtkWidget *entry_location;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
70 GtkWidget *entry_title;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
71 GtkWidget *entry_artist;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
72 GtkWidget *entry_album;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
73 GtkWidget *entry_comment;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
74 GtkWidget *entry_year;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
75 GtkWidget *entry_track;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
76 GtkWidget *entry_genre;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
77
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
78 GtkWidget *image_artwork;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
79
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
80 GtkWidget *image_fileicon;
4013
2e80ee28c7cc Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4012
diff changeset
81 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
82 GtkWidget *label_quality;
4061
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
83 GtkWidget *label_bitrate;
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
84 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
85 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
86
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
87 static gchar *current_file = NULL;
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
88 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
89 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
90
4163
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
91 /* stolen from Audacious 1.4 vorbis plugin. --nenolod */
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
92 static const gchar *genre_table[] = {
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
93 N_("Blues"), N_("Classic Rock"), N_("Country"), N_("Dance"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
94 N_("Disco"), N_("Funk"), N_("Grunge"), N_("Hip-Hop"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
95 N_("Jazz"), N_("Metal"), N_("New Age"), N_("Oldies"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
96 N_("Other"), N_("Pop"), N_("R&B"), N_("Rap"), N_("Reggae"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
97 N_("Rock"), N_("Techno"), N_("Industrial"), N_("Alternative"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
98 N_("Ska"), N_("Death Metal"), N_("Pranks"), N_("Soundtrack"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
99 N_("Euro-Techno"), N_("Ambient"), N_("Trip-Hop"), N_("Vocal"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
100 N_("Jazz+Funk"), N_("Fusion"), N_("Trance"), N_("Classical"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
101 N_("Instrumental"), N_("Acid"), N_("House"), N_("Game"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
102 N_("Sound Clip"), N_("Gospel"), N_("Noise"), N_("AlternRock"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
103 N_("Bass"), N_("Soul"), N_("Punk"), N_("Space"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
104 N_("Meditative"), N_("Instrumental Pop"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
105 N_("Instrumental Rock"), N_("Ethnic"), N_("Gothic"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
106 N_("Darkwave"), N_("Techno-Industrial"), N_("Electronic"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
107 N_("Pop-Folk"), N_("Eurodance"), N_("Dream"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
108 N_("Southern Rock"), N_("Comedy"), N_("Cult"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
109 N_("Gangsta Rap"), N_("Top 40"), N_("Christian Rap"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
110 N_("Pop/Funk"), N_("Jungle"), N_("Native American"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
111 N_("Cabaret"), N_("New Wave"), N_("Psychedelic"), N_("Rave"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
112 N_("Showtunes"), N_("Trailer"), N_("Lo-Fi"), N_("Tribal"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
113 N_("Acid Punk"), N_("Acid Jazz"), N_("Polka"), N_("Retro"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
114 N_("Musical"), N_("Rock & Roll"), N_("Hard Rock"), N_("Folk"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
115 N_("Folk/Rock"), N_("National Folk"), N_("Swing"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
116 N_("Fast-Fusion"), N_("Bebob"), N_("Latin"), N_("Revival"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
117 N_("Celtic"), N_("Bluegrass"), N_("Avantgarde"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
118 N_("Gothic Rock"), N_("Progressive Rock"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
119 N_("Psychedelic Rock"), N_("Symphonic Rock"), N_("Slow Rock"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
120 N_("Big Band"), N_("Chorus"), N_("Easy Listening"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
121 N_("Acoustic"), N_("Humour"), N_("Speech"), N_("Chanson"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
122 N_("Opera"), N_("Chamber Music"), N_("Sonata"), N_("Symphony"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
123 N_("Booty Bass"), N_("Primus"), N_("Porn Groove"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
124 N_("Satire"), N_("Slow Jam"), N_("Club"), N_("Tango"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
125 N_("Samba"), N_("Folklore"), N_("Ballad"), N_("Power Ballad"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
126 N_("Satire"), N_("Slow Jam"), N_("Club"), N_("Tango"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
127 N_("Samba"), N_("Folklore"), N_("Ballad"), N_("Power Ballad"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
128 N_("Rhythmic Soul"), N_("Freestyle"), N_("Duet"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
129 N_("Punk Rock"), N_("Drum Solo"), N_("A Cappella"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
130 N_("Euro-House"), N_("Dance Hall"), N_("Goa"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
131 N_("Drum & Bass"), N_("Club-House"), N_("Hardcore"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
132 N_("Terror"), N_("Indie"), N_("BritPop"), N_("Negerpunk"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
133 N_("Polsk Punk"), N_("Beat"), N_("Christian Gangsta Rap"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
134 N_("Heavy Metal"), N_("Black Metal"), N_("Crossover"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
135 N_("Contemporary Christian"), N_("Christian Rock"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
136 N_("Merengue"), N_("Salsa"), N_("Thrash Metal"),
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
137 N_("Anime"), N_("JPop"), N_("Synthpop")
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
138 };
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
139
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
140 static GList *genre_list = NULL;
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
141
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
142 static void
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
143 fileinfo_entry_set_text(GtkWidget *widget, const char *text)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
144 {
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
145 if (widget == NULL)
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
146 return;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
147
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
148 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
149 }
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
150
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
151 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
152 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
153 {
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
154 gchar *text;
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
155
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
156 if(widget != NULL) {
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
157 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
158 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
159 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
160 }
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
161 }
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
162
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
163 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
164 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
165 {
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
166 gchar *text;
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
167
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
168 if(widget == NULL) return;
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
169
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
170 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
171 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
172 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
173 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
174 g_free(text);
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
175 } else {
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
176 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
177 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
178 }
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
179 }
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
180
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
181 static void
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
182 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
183 {
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
184 if(widget == NULL) return;
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
185 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
186 }
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
187
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
188 static void
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
189 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
190 {
4022
85315c67252d fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4021
diff changeset
191 gchar *tmp;
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
192 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
193
85315c67252d fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4021
diff changeset
194 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
195 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
196 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
197 else
85315c67252d fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4021
diff changeset
198 tuple_associate_int(tuple, fieldn, NULL, -1);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
199 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
200
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
201 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
202 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
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 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
205
ba6258a39662 icon, codec and quality info added 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 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
207 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
208
ba6258a39662 icon, codec and quality info added 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 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
210 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
211 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
212 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
213 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
214 } else {
4012
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
215 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
216 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
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 }
ba6258a39662 icon, codec and quality info added 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
ba6258a39662 icon, codec and quality info added 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 static void
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
221 fileinfo_entry_set_image(GtkWidget *widget, const char *text)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
222 {
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
223 GdkPixbuf *pixbuf;
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
224 int width, height;
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
225 double aspect;
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
226 GdkPixbuf *pixbuf2;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
227
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
228 if (widget == NULL)
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
229 return;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
230
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
231 pixbuf = gdk_pixbuf_new_from_file(text, NULL);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
232
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
233 if (pixbuf == NULL)
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
234 return;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
235
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
236 width = gdk_pixbuf_get_width(GDK_PIXBUF(pixbuf));
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
237 height = gdk_pixbuf_get_height(GDK_PIXBUF(pixbuf));
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
238
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
239 if (strcmp(DATA_DIR "/images/audio.png", text)) {
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
240 if (width == 0)
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
241 width = 1;
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
242 aspect = (double)height / (double)width;
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
243
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
244 if (aspect > 1.0) {
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
245 height = (int)(cfg.filepopup_pixelsize * aspect);
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
246 width = cfg.filepopup_pixelsize;
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
247 } else {
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
248 height = cfg.filepopup_pixelsize;
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
249 width = (int)(cfg.filepopup_pixelsize / aspect);
4012
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
250 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
251
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
252 pixbuf2 = gdk_pixbuf_scale_simple(GDK_PIXBUF(pixbuf), width, height, GDK_INTERP_BILINEAR);
4012
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
253 g_object_unref(G_OBJECT(pixbuf));
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
254 pixbuf = pixbuf2;
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
255 }
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
256
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
257 gtk_image_set_from_pixbuf(GTK_IMAGE(widget), GDK_PIXBUF(pixbuf));
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
258 g_object_unref(G_OBJECT(pixbuf));
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
259 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
260
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
261 void fileinfo_hide(gpointer unused)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
262 {
4019
29650db2d5f2 added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4013
diff changeset
263 if(GTK_WIDGET_VISIBLE(fileinfo_win)) gtk_widget_hide(fileinfo_win);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
264
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
265 /* Clear it out. */
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
266 fileinfo_entry_set_text(entry_title, "");
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
267 fileinfo_entry_set_text(entry_artist, "");
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
268 fileinfo_entry_set_text(entry_album, "");
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
269 fileinfo_entry_set_text(entry_comment, "");
4163
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
270 fileinfo_entry_set_text(gtk_bin_get_child(GTK_BIN(entry_genre)), "");
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
271 fileinfo_entry_set_text(entry_year, "");
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
272 fileinfo_entry_set_text(entry_track, "");
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
273 fileinfo_entry_set_text(entry_location, "");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
274
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
275 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
276 fileinfo_label_set_text(label_quality, NULL);
4061
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
277 fileinfo_label_set_text(label_bitrate, 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
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 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
280 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
281 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
282 }
4023
0f3cd542f23a be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4022
diff changeset
283
0f3cd542f23a be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4022
diff changeset
284 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
285 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
286
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
287 current_ip = NULL;
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
288 G_FREE_CLEAR(current_file);
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
289
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
290 fileinfo_entry_set_image(image_artwork, DATA_DIR "/images/audio.png");
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
291 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
292
4023
0f3cd542f23a be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4022
diff changeset
293 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
294 {
0f3cd542f23a be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4022
diff changeset
295 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
296 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
297 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
298 }
0f3cd542f23a be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4022
diff changeset
299 }
0f3cd542f23a be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4022
diff changeset
300
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 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
302 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
303 {
d79fd54de4fa added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4020
diff changeset
304 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
305 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
306 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
307
d79fd54de4fa added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4020
diff changeset
308 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
309 }
d79fd54de4fa added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4020
diff changeset
310
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 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
312 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
313 {
d79fd54de4fa added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4020
diff changeset
314 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
315 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
316 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
317 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
318 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
319 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
320 }
d79fd54de4fa added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4020
diff changeset
321 }
d79fd54de4fa added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4020
diff changeset
322
d79fd54de4fa added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4020
diff changeset
323 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
324 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
325 {
d79fd54de4fa added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4020
diff changeset
326 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
327 }
d79fd54de4fa added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4020
diff changeset
328
d79fd54de4fa added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4020
diff changeset
329 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
330 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
331 {
d79fd54de4fa added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4020
diff changeset
332 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
333 }
d79fd54de4fa added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4020
diff changeset
334
d79fd54de4fa added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4020
diff changeset
335 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
336 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
337 {
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
338 Tuple *tuple;
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
339 VFSFile *fd;
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
340
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
341 if (current_file != NULL && current_ip != NULL && current_ip->update_song_tuple != NULL && something_changed) {
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
342 tuple = tuple_new();
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
343 fd = vfs_fopen(current_file, "r+b");
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
344
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
345 if (fd != NULL) {
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
346 set_field_str_from_entry(tuple, FIELD_TITLE, entry_title);
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
347 set_field_str_from_entry(tuple, FIELD_ARTIST, entry_artist);
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
348 set_field_str_from_entry(tuple, FIELD_ALBUM, entry_album);
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
349 set_field_str_from_entry(tuple, FIELD_COMMENT, entry_comment);
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
350 set_field_str_from_entry(tuple, FIELD_GENRE, gtk_bin_get_child(GTK_BIN(entry_genre)));
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
351
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
352 set_field_int_from_entry(tuple, FIELD_YEAR, entry_year);
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
353 set_field_int_from_entry(tuple, FIELD_TRACK_NUMBER, entry_track);
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
354
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
355 if (current_ip->update_song_tuple(tuple, fd)) {
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
356 message_update_successfull();
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
357 something_changed = FALSE;
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
358 gtk_widget_set_sensitive(btn_apply, FALSE);
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
359 } else
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
360 message_update_failed();
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
361
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
362 vfs_fclose(fd);
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
363
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
364 } else
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
365 message_update_failed();
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
366
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
367 mowgli_object_unref(tuple);
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
368 }
4019
29650db2d5f2 added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4013
diff changeset
369 }
29650db2d5f2 added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4013
diff changeset
370
4162
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
371 /**
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
372 * Looks up an icon from a NULL-terminated list of icon names.
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
373 *
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
374 * size: the requested size
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
375 * name: the default name
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
376 * ... : a NULL-terminated list of alternates
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
377 */
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
378 GdkPixbuf *
4162
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
379 themed_icon_lookup(gint size, const gchar *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
380 {
ba6258a39662 icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 3988
diff changeset
381 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
382 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
383 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
384 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
385 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
386
ba6258a39662 icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 3988
diff changeset
387 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
388 pixbuf = gtk_icon_theme_load_icon (icon_theme, name, size, 0, &error);
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
389
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
390 if (pixbuf != NULL)
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
391 return pixbuf;
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
392
4164
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
393 if (error != NULL)
2a6d9dd09ec1 More prettying.
William Pitcock <nenolod@atheme.org>
parents: 4163
diff changeset
394 g_error_free(error);
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
395
ba6258a39662 icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 3988
diff changeset
396 /* 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
397 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
398 while((n = (gchar*)va_arg(par, gchar *)) != NULL) {
4012
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
399 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
400 pixbuf = gtk_icon_theme_load_icon (icon_theme, n, size, 0, &error);
4162
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
401
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
402 if (pixbuf) {
4012
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
403 va_end(par);
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
404 return pixbuf;
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
405 }
4162
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
406
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
407 if (error != NULL)
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
408 g_error_free(error);
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
409 }
ba6258a39662 icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 3988
diff changeset
410
ba6258a39662 icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 3988
diff changeset
411 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
412 }
ba6258a39662 icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 3988
diff changeset
413
4162
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
414 /**
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
415 * Intelligently looks up an icon for a mimetype. Supports
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
416 * HIDEOUSLY BROKEN gnome icon naming scheme too.
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
417 *
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
418 * size : the requested size
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
419 * mime_type: the mime type.
0b00f1d21270 Prettify theme-icon util functions.
William Pitcock <nenolod@atheme.org>
parents: 4061
diff changeset
420 */
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
421 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
422 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
423 {
ba6258a39662 icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 3988
diff changeset
424 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
425 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
426 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
427 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
428
ba6258a39662 icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 3988
diff changeset
429 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
430
ba6258a39662 icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 3988
diff changeset
431 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
432 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
433 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
434 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
435 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
436 mime_gnome_generic = g_strdup_printf("gnome-mime-%s", s[0]);
4012
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
437 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
438 g_free(mime_gnome_generic);
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
439 g_free(mime_generic);
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
440 g_free(mime_gnome);
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
441 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
442 }
ba6258a39662 icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 3988
diff changeset
443 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
444
ba6258a39662 icon, codec and quality info added 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 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
446 }
ba6258a39662 icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 3988
diff changeset
447
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
448 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
449 create_fileinfo_window(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
450 {
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
451 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
452 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
453 GtkWidget *vbox0;
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
454 GtkWidget *vbox1;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
455 GtkWidget *vbox2;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
456 GtkWidget *label_title;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
457 GtkWidget *label_artist;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
458 GtkWidget *label_album;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
459 GtkWidget *label_comment;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
460 GtkWidget *label_genre;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
461 GtkWidget *label_year;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
462 GtkWidget *label_track;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
463 GtkWidget *label_location;
4013
2e80ee28c7cc Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4012
diff changeset
464 GtkWidget *label_general;
2e80ee28c7cc Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4012
diff changeset
465 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
466 GtkWidget *label_quality_label;
4061
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
467 GtkWidget *label_bitrate_label;
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
468 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
469 GtkWidget *codec_table;
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
470 GtkWidget *table1;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
471 GtkWidget *bbox_close;
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
472 GtkWidget *btn_close;
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
473 GtkWidget *alignment;
4011
c19c8d47e221 vseparator in fileinfo came back
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4010
diff changeset
474 GtkWidget *separator;
4163
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
475 gint i;
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
476
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
477 fileinfo_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
478 gtk_container_set_border_width(GTK_CONTAINER(fileinfo_win), 6);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
479 gtk_window_set_title(GTK_WINDOW(fileinfo_win), _("Track Information"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
480 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
481 gtk_window_set_resizable(GTK_WINDOW(fileinfo_win), FALSE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
482 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
483 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
484
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
485 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
486 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
487
4011
c19c8d47e221 vseparator in fileinfo came back
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4010
diff changeset
488 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
489 gtk_box_pack_start(GTK_BOX(vbox0), hbox, TRUE, TRUE, 0);
2313
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 image_artwork = gtk_image_new();
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
492 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
493 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
494 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
495 separator = gtk_vseparator_new();
c19c8d47e221 vseparator in fileinfo came back
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4010
diff changeset
496 gtk_box_pack_start(GTK_BOX(hbox), separator, FALSE, FALSE, 0);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
497
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
498 vbox1 = gtk_vbox_new(FALSE, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
499 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
500
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
501 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
502 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
503 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
504 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
505
4013
2e80ee28c7cc Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4012
diff changeset
506 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
507 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
508 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
509 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
510
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
511 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
512 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
513 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
514
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
515 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
516 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
517
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
518 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
519 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
520
4061
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
521 codec_table = gtk_table_new(3, 2, FALSE);
4010
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
522 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
523 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
524 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
525
4013
2e80ee28c7cc Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4012
diff changeset
526 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
527 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
528 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
529 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
530 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
531 gtk_misc_set_alignment(GTK_MISC(label_quality_label), 0, 0.5);
4061
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
532 label_bitrate_label = gtk_label_new(_("<span size=\"small\">Bitrate:</span>"));
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
533 gtk_label_set_use_markup(GTK_LABEL(label_bitrate_label), TRUE);
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
534 gtk_misc_set_alignment(GTK_MISC(label_bitrate_label), 0, 0.5);
4010
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
535
4013
2e80ee28c7cc Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4012
diff changeset
536 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
537 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
538 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
539 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
540 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
541 gtk_misc_set_alignment(GTK_MISC(label_quality), 0, 0.5);
4061
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
542 label_bitrate = gtk_label_new(_("<span size=\"small\">n/a</span>"));
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
543 gtk_label_set_use_markup(GTK_LABEL(label_bitrate), TRUE);
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
544 gtk_misc_set_alignment(GTK_MISC(label_bitrate), 0, 0.5);
4010
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
545
4013
2e80ee28c7cc Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4012
diff changeset
546 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
547 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
548 (GtkAttachOptions) (0), 0, 0);
4013
2e80ee28c7cc Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4012
diff changeset
549 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
550 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
551 (GtkAttachOptions) (0), 0, 0);
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
552 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
553 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
554 (GtkAttachOptions) (0), 0, 0);
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
555 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
556 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
ce791ae274aa Codec info in fileinfo box moved to top
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
557 (GtkAttachOptions) (0), 0, 0);
4061
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
558 gtk_table_attach(GTK_TABLE(codec_table), label_bitrate_label, 0, 1, 2, 3,
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
559 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
560 (GtkAttachOptions) (0), 0, 0);
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
561 gtk_table_attach(GTK_TABLE(codec_table), label_bitrate, 1, 2, 2, 3,
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
562 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
563 (GtkAttachOptions) (0), 0, 0);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
564
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
565 label_title = gtk_label_new(_("<span size=\"small\">Title</span>"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
566 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
567 gtk_label_set_use_markup(GTK_LABEL(label_title), TRUE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
568 gtk_misc_set_alignment(GTK_MISC(label_title), 0, 0);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
569
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
570 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
571 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
572 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
573 entry_title = gtk_entry_new();
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
574 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
575 g_signal_connect(G_OBJECT(entry_title), "changed", (GCallback) entry_changed, NULL);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
576
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
577 label_artist = gtk_label_new(_("<span size=\"small\">Artist</span>"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
578 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
579 gtk_label_set_use_markup(GTK_LABEL(label_artist), TRUE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
580 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
581
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
582 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
583 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
584 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
585 entry_artist = 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_artist);
4023
0f3cd542f23a be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4022
diff changeset
587 g_signal_connect(G_OBJECT(entry_artist), "changed", (GCallback) entry_changed, NULL);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
588
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
589 label_album = gtk_label_new(_("<span size=\"small\">Album</span>"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
590 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
591 gtk_label_set_use_markup(GTK_LABEL(label_album), TRUE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
592 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
593
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
594 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
595 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
596 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
597 entry_album = gtk_entry_new();
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
598 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
599 g_signal_connect(G_OBJECT(entry_album), "changed", (GCallback) entry_changed, NULL);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
600
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
601 label_comment = gtk_label_new(_("<span size=\"small\">Comment</span>"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
602 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
603 gtk_label_set_use_markup(GTK_LABEL(label_comment), TRUE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
604 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
605
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
606 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
607 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
608 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
609 entry_comment = gtk_entry_new();
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
610 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
611 g_signal_connect(G_OBJECT(entry_comment), "changed", (GCallback) entry_changed, NULL);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
612
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
613 label_genre = gtk_label_new(_("<span size=\"small\">Genre</span>"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
614 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
615 gtk_label_set_use_markup(GTK_LABEL(label_genre), TRUE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
616 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
617
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
618 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
619 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
620 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 6, 0, 0);
4163
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
621 entry_genre = gtk_combo_box_entry_new_text();
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
622
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
623 if (!genre_list) {
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
624 GList *iter;
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
625
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
626 for (i = 0; i < G_N_ELEMENTS(genre_table); i++)
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
627 genre_list = g_list_prepend(genre_list, _(genre_table[i]));
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
628 genre_list = g_list_sort(genre_list, (GCompareFunc) g_ascii_strcasecmp);
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
629
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
630 MOWGLI_ITER_FOREACH(iter, genre_list)
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
631 gtk_combo_box_append_text(GTK_COMBO_BOX(entry_genre), iter->data);
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
632 }
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
633
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
634 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
635 g_signal_connect(G_OBJECT(entry_genre), "changed", (GCallback) entry_changed, NULL);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
636
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
637 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
638 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
639 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
640 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
641 gtk_container_add(GTK_CONTAINER(alignment), table1);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
642 gtk_table_set_col_spacings(GTK_TABLE(table1), 6);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
643
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
644 label_year = gtk_label_new(_("<span size=\"small\">Year</span>"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
645 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
646 (GtkAttachOptions) (GTK_FILL),
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
647 (GtkAttachOptions) (0), 0, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
648 gtk_label_set_use_markup(GTK_LABEL(label_year), TRUE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
649 gtk_misc_set_alignment(GTK_MISC(label_year), 0, 0.5);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
650
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
651 entry_year = gtk_entry_new();
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
652 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
653 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
654 (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
655 g_signal_connect(G_OBJECT(entry_year), "changed", (GCallback) entry_changed, NULL);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
656
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
657 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
658 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
659 (GtkAttachOptions) (GTK_FILL),
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
660 (GtkAttachOptions) (0), 0, 0);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
661 gtk_label_set_use_markup(GTK_LABEL(label_track), TRUE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
662 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
663
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
664 entry_track = gtk_entry_new();
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
665 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
666 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
667 (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
668 g_signal_connect(G_OBJECT(entry_track), "changed", (GCallback) entry_changed, NULL);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
669
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
670 label_location = gtk_label_new(_("<span size=\"small\">Location</span>"));
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
671 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
672 gtk_label_set_use_markup(GTK_LABEL(label_location), TRUE);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
673 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
674
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
675 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
676 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
677 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
678
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
679 entry_location = gtk_entry_new();
3988
ce1ce0a6cc74 bring back alignments - it looks nicer with those
Tomasz Mon <desowin@gmail.com>
parents: 3986
diff changeset
680 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
681 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
682
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
683 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
684 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
685
d79fd54de4fa added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4020
diff changeset
686 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
687 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
688 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
689 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
690
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
691 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
692 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
693 gtk_box_pack_start(GTK_BOX(hbox_status_and_bbox), bbox_close, FALSE, FALSE, 0);
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
694 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
695
4035
db2e900fdb62 "Apply" button in fileinfo changed to "Save"
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4023
diff changeset
696 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
697 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
698 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
699 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
700
3986
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
701 btn_close = gtk_button_new_from_stock("gtk-close");
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
702 gtk_container_add(GTK_CONTAINER(bbox_close), btn_close);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
703 GTK_WIDGET_SET_FLAGS(btn_close, GTK_CAN_DEFAULT);
a77a1b3f493f drop glade on fileinfo
Tomasz Mon <desowin@gmail.com>
parents: 3490
diff changeset
704 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
705
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
706 gtk_widget_show_all (vbox0);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
707 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
708
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
709 void
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
710 fileinfo_show_for_tuple(Tuple *tuple, gboolean updating_enabled)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
711 {
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
712 gchar *tmp, *tmp_utf = NULL;
4012
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
713 GdkPixbuf *icon = NULL;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
714
4012
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
715 if (tuple == NULL)
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
716 return;
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
717
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
718 if(!updating_enabled) {
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
719 current_ip = NULL;
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
720 G_FREE_CLEAR(current_file);
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
721 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
722
4023
0f3cd542f23a be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4022
diff changeset
723 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
724
4019
29650db2d5f2 added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4013
diff changeset
725 if(!GTK_WIDGET_REALIZED(fileinfo_win)) gtk_widget_realize(fileinfo_win);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
726
4022
85315c67252d fields in fileinfo dialog now non-editable when tag updating is impossible
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4021
diff changeset
727 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
728 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
729 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
730 set_entry_str_from_field(entry_comment, tuple, FIELD_COMMENT, updating_enabled);
4163
a12876b41f01 Turn the genre box into an editable dropdown list.
William Pitcock <nenolod@atheme.org>
parents: 4162
diff changeset
731 set_entry_str_from_field(gtk_bin_get_child(GTK_BIN(entry_genre)), tuple, FIELD_GENRE, updating_enabled);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
732
4012
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
733 tmp = g_strdup_printf("%s/%s",
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
734 tuple_get_string(tuple, FIELD_FILE_PATH, NULL),
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
735 tuple_get_string(tuple, FIELD_FILE_NAME, NULL));
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
736 if(tmp){
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
737 tmp_utf = str_to_utf8(tmp);
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
738 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
739 g_free(tmp_utf);
4012
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
740 g_free(tmp);
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
741 tmp = NULL;
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
742 }
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
743
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
744 /* 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
745 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
746 set_entry_int_from_field(entry_track, tuple, FIELD_TRACK_NUMBER, updating_enabled);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
747
4013
2e80ee28c7cc Changed lables in file info box
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4012
diff changeset
748 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
749 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
750
4061
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
751 if (tuple_get_value_type(tuple, FIELD_BITRATE, NULL) == TUPLE_INT) {
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
752 tmp = g_strdup_printf(_("%d kb/s"), tuple_get_int(tuple, FIELD_BITRATE, NULL));
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
753 fileinfo_label_set_text(label_bitrate, tmp);
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
754 g_free(tmp);
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
755 } else {
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
756 fileinfo_label_set_text(label_bitrate, NULL);
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
757 }
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4057
diff changeset
758
4012
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
759 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
760 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
761 if (icon) {
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
762 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
763 g_object_unref(icon);
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
764 }
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
765
4012
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
766 tmp = fileinfo_recursive_get_image(
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
767 tuple_get_string(tuple, FIELD_FILE_PATH, NULL),
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
768 tuple_get_string(tuple, FIELD_FILE_NAME, NULL), 0);
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
769
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
770 if(tmp)
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
771 {
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
772 fileinfo_entry_set_image(image_artwork, tmp);
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
773 g_free(tmp);
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
774 }
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
775
4023
0f3cd542f23a be more robust: tag updating enabled only if some field changed
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4022
diff changeset
776 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
777
d79fd54de4fa added mini statusbar to fileinfo dialog. looks like version string in prefs dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4020
diff changeset
778 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
779 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
780 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
781 }
4012
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
782
4019
29650db2d5f2 added update button (currently disabled) to file info dialog
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4013
diff changeset
783 if(! GTK_WIDGET_VISIBLE(fileinfo_win)) gtk_widget_show(fileinfo_win);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
784 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
785
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
786 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
787 fileinfo_show_for_path(gchar *path)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
788 {
4012
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
789 Tuple *tuple = input_get_song_tuple(path);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
790
4057
91dabb7c78d2 disabled editing remote tags: 2nd attempt :)
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4041
diff changeset
791 if (tuple == NULL) {
91dabb7c78d2 disabled editing remote tags: 2nd attempt :)
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4041
diff changeset
792 input_file_info_box(path);
91dabb7c78d2 disabled editing remote tags: 2nd attempt :)
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4041
diff changeset
793 return;
91dabb7c78d2 disabled editing remote tags: 2nd attempt :)
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4041
diff changeset
794 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
795
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
796 fileinfo_show_for_tuple(tuple, FALSE);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
797
4012
197352fd6b3e Replaced tabs with spaces
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4011
diff changeset
798 mowgli_object_unref(tuple);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
799 }
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
800
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
801 void
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
802 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
803 {
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
804 G_FREE_CLEAR(current_file);
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
805 current_file = g_strdup(path);
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
806 current_ip = ip;
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
807
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
808 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
809
4057
91dabb7c78d2 disabled editing remote tags: 2nd attempt :)
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4041
diff changeset
810 if (tuple == NULL) {
91dabb7c78d2 disabled editing remote tags: 2nd attempt :)
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4041
diff changeset
811 input_file_info_box(path);
91dabb7c78d2 disabled editing remote tags: 2nd attempt :)
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4041
diff changeset
812 return;
91dabb7c78d2 disabled editing remote tags: 2nd attempt :)
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4041
diff changeset
813 }
4020
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
814
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
815 fileinfo_show_for_tuple(tuple, TRUE);
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
816
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
817 mowgli_object_unref(tuple);
66529edae49d added tag editing capabilities, maybe raw yet
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4019
diff changeset
818 }