Mercurial > audlegacy
annotate src/audacious/ui_preferences.c @ 4033:ce2f168de9a6
style cleanups:
- gettext_noop() -> N_()
- preferences_widgets -> preferences_widget_t typedef
- remove old legacy code from when we supported GTK 2.4.
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Thu, 29 Nov 2007 09:24:56 -0600 |
parents | a2e724d5bf62 |
children | efd6c22780f9 |
rev | line source |
---|---|
2313 | 1 /* Audacious - Cross-platform multimedia player |
2 * Copyright (C) 2005-2006 Audacious development team. | |
3 * | |
4 * BMP - Cross-platform multimedia player | |
5 * Copyright (C) 2003-2004 BMP development team. | |
6 * | |
7 * This program is free software; you can redistribute it and/or modify | |
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 | 10 * |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
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 | 21 */ |
22 | |
23 #ifdef HAVE_CONFIG_H | |
24 # include "config.h" | |
25 #endif | |
26 | |
27 #include <glib.h> | |
28 #include <glib/gi18n.h> | |
29 #include <gtk/gtk.h> | |
30 #include <string.h> | |
31 #include <stddef.h> | |
32 #include <stdio.h> | |
33 #include <sys/types.h> | |
34 #include <dirent.h> | |
35 #include <unistd.h> | |
36 #include <errno.h> | |
37 #include <sys/types.h> | |
38 #include <sys/stat.h> | |
3993 | 39 #include <gdk/gdkkeysyms.h> |
2313 | 40 |
41 #include "plugin.h" | |
42 #include "pluginenum.h" | |
43 #include "input.h" | |
44 #include "effect.h" | |
45 #include "general.h" | |
46 #include "output.h" | |
47 #include "visualization.h" | |
48 | |
49 #include "main.h" | |
2911 | 50 #include "ui_skinned_textbox.h" |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
51 #include "strings.h" |
2313 | 52 #include "util.h" |
53 #include "dnd.h" | |
2717 | 54 #include "configdb.h" |
2313 | 55 |
56 #include "ui_main.h" | |
57 #include "ui_playlist.h" | |
58 #include "ui_skinselector.h" | |
59 #include "ui_preferences.h" | |
2328 | 60 #include "ui_equalizer.h" |
3217 | 61 #include "ui_skinned_playlist.h" |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3217
diff
changeset
|
62 #include "ui_skinned_window.h" |
2313 | 63 |
64 #include "build_stamp.h" | |
65 | |
66 enum CategoryViewCols { | |
67 CATEGORY_VIEW_COL_ICON, | |
68 CATEGORY_VIEW_COL_NAME, | |
69 CATEGORY_VIEW_COL_ID, | |
70 CATEGORY_VIEW_N_COLS | |
71 }; | |
72 | |
73 enum PluginViewCols { | |
74 PLUGIN_VIEW_COL_ACTIVE, | |
75 PLUGIN_VIEW_COL_DESC, | |
76 PLUGIN_VIEW_COL_FILENAME, | |
77 PLUGIN_VIEW_COL_ID, | |
3439
93584d1b3e7e
Add plugin pointer to the plugin treestore.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
78 PLUGIN_VIEW_COL_PLUGIN_PTR, |
2313 | 79 PLUGIN_VIEW_N_COLS |
80 }; | |
81 | |
3353
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
82 enum PluginViewType { |
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
83 PLUGIN_VIEW_TYPE_INPUT, |
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
84 PLUGIN_VIEW_TYPE_GENERAL, |
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
85 PLUGIN_VIEW_TYPE_VIS, |
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
86 PLUGIN_VIEW_TYPE_EFFECT |
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
87 }; |
2313 | 88 |
89 typedef struct { | |
90 const gchar *icon_path; | |
91 const gchar *name; | |
92 gint id; | |
93 } Category; | |
94 | |
95 typedef struct { | |
96 const gchar *name; | |
97 const gchar *tag; | |
98 } | |
99 TitleFieldTag; | |
100 | |
101 static GtkWidget *prefswin = NULL; | |
102 static GtkWidget *filepopup_settings = NULL; | |
103 static GtkWidget *colorize_settings = NULL; | |
104 static GtkWidget *category_treeview = NULL; | |
105 static GtkWidget *category_notebook = NULL; | |
106 GtkWidget *filepopupbutton = NULL; | |
107 | |
3989
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
108 /* colorize settings scales */ |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
109 GtkWidget *green_scale; |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
110 GtkWidget *red_scale; |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
111 GtkWidget *blue_scale; |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
112 |
3990
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
113 /* filepopup settings widgets */ |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
114 GtkWidget *filepopup_settings_cover_name_include; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
115 GtkWidget *filepopup_settings_cover_name_exclude; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
116 GtkWidget *filepopup_settings_recurse_for_cover; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
117 GtkWidget *filepopup_settings_recurse_for_cover_depth; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
118 GtkWidget *filepopup_settings_recurse_for_cover_depth_box; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
119 GtkWidget *filepopup_settings_use_file_cover; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
120 GtkWidget *filepopup_settings_showprogressbar; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
121 GtkWidget *filepopup_settings_delay; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
122 |
3993 | 123 /* prefswin widgets */ |
124 GtkWidget *titlestring_entry; | |
125 GtkWidget *skin_view; | |
126 GtkWidget *skin_refresh_button; | |
127 GtkWidget *filepopup_for_tuple_settings_button; | |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
128 GtkTooltips *tooltips; |
3993 | 129 |
2313 | 130 static Category categories[] = { |
131 {DATA_DIR "/images/appearance.png", N_("Appearance"), 1}, | |
132 {DATA_DIR "/images/audio.png", N_("Audio"), 6}, | |
133 {DATA_DIR "/images/connectivity.png", N_("Connectivity"), 5}, | |
134 {DATA_DIR "/images/eq.png", N_("Equalizer"), 4}, | |
135 {DATA_DIR "/images/mouse.png", N_("Mouse"), 2}, | |
136 {DATA_DIR "/images/playlist.png", N_("Playlist"), 3}, | |
137 {DATA_DIR "/images/plugins.png", N_("Plugins"), 0}, | |
138 }; | |
139 | |
140 static gint n_categories = G_N_ELEMENTS(categories); | |
141 | |
142 static TitleFieldTag title_field_tags[] = { | |
3441
bd1a68dc9ebb
Change xmms titlestring format values to Tuplez.
William Pitcock <nenolod@atheme.org>
parents:
3439
diff
changeset
|
143 { N_("Artist") , "${artist}" }, |
bd1a68dc9ebb
Change xmms titlestring format values to Tuplez.
William Pitcock <nenolod@atheme.org>
parents:
3439
diff
changeset
|
144 { N_("Album") , "${album}" }, |
bd1a68dc9ebb
Change xmms titlestring format values to Tuplez.
William Pitcock <nenolod@atheme.org>
parents:
3439
diff
changeset
|
145 { N_("Title") , "${title}" }, |
bd1a68dc9ebb
Change xmms titlestring format values to Tuplez.
William Pitcock <nenolod@atheme.org>
parents:
3439
diff
changeset
|
146 { N_("Tracknumber"), "${track-number}" }, |
bd1a68dc9ebb
Change xmms titlestring format values to Tuplez.
William Pitcock <nenolod@atheme.org>
parents:
3439
diff
changeset
|
147 { N_("Genre") , "${genre}" }, |
bd1a68dc9ebb
Change xmms titlestring format values to Tuplez.
William Pitcock <nenolod@atheme.org>
parents:
3439
diff
changeset
|
148 { N_("Filename") , "${file-name}" }, |
bd1a68dc9ebb
Change xmms titlestring format values to Tuplez.
William Pitcock <nenolod@atheme.org>
parents:
3439
diff
changeset
|
149 { N_("Filepath") , "${file-path}" }, |
bd1a68dc9ebb
Change xmms titlestring format values to Tuplez.
William Pitcock <nenolod@atheme.org>
parents:
3439
diff
changeset
|
150 { N_("Date") , "${date}" }, |
bd1a68dc9ebb
Change xmms titlestring format values to Tuplez.
William Pitcock <nenolod@atheme.org>
parents:
3439
diff
changeset
|
151 { N_("Year") , "${year}" }, |
bd1a68dc9ebb
Change xmms titlestring format values to Tuplez.
William Pitcock <nenolod@atheme.org>
parents:
3439
diff
changeset
|
152 { N_("Comment") , "${comment}" }, |
bd1a68dc9ebb
Change xmms titlestring format values to Tuplez.
William Pitcock <nenolod@atheme.org>
parents:
3439
diff
changeset
|
153 { N_("Codec") , "${codec}" }, |
bd1a68dc9ebb
Change xmms titlestring format values to Tuplez.
William Pitcock <nenolod@atheme.org>
parents:
3439
diff
changeset
|
154 { N_("Quality") , "${quality}" }, |
2313 | 155 }; |
156 | |
157 typedef struct { | |
158 void *next; | |
159 GtkWidget *container; | |
160 char *pg_name; | |
161 char *img_url; | |
162 } CategoryQueueEntry; | |
163 | |
164 CategoryQueueEntry *category_queue = NULL; | |
165 | |
166 static const guint n_title_field_tags = G_N_ELEMENTS(title_field_tags); | |
167 | |
4033 | 168 #define N_(String) String |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
169 |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
170 enum WidgetTypes { |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
171 WIDGET_NONE, |
4003 | 172 WIDGET_CHK_BTN, |
4005 | 173 WIDGET_LABEL, |
4006 | 174 WIDGET_RADIO_BTN, |
4007 | 175 WIDGET_SPIN_BTN, |
4006 | 176 WIDGET_CHARDET_TABLE /* 'fixed' widget, not for reuse */ |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
177 }; |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
178 |
4033 | 179 typedef struct preferences_widget_ { |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
180 gint type; /* widget type */ |
4007 | 181 char *label; /* widget title (for SPIN_BTN it's text left to widget)*/ |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
182 gboolean *cfg; /* connected config value */ |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
183 void (*callback) (void); /* this func will be called after value change, can be NULL */ |
4007 | 184 char *tooltip; /* widget tooltip (for SPIN_BTN it's text right to widget), can be NULL */ |
4005 | 185 gboolean child; |
4033 | 186 } preferences_widget_t; |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
187 |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
188 static void playlist_show_pl_separator_numbers_cb(); |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
189 static void show_wm_decorations_cb(); |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
190 |
4033 | 191 static preferences_widget_t apperance_misc_widgets[] = { |
192 {WIDGET_LABEL, N_("<b>_Miscellaneous</b>"), NULL, NULL, NULL, FALSE}, | |
193 {WIDGET_CHK_BTN, N_("Show track numbers in playlist"), &cfg.show_numbers_in_pl, | |
4005 | 194 G_CALLBACK(playlist_show_pl_separator_numbers_cb), NULL, FALSE}, |
4033 | 195 {WIDGET_CHK_BTN, N_("Show separators in playlist"), &cfg.show_separator_in_pl, |
4005 | 196 G_CALLBACK(playlist_show_pl_separator_numbers_cb), NULL, FALSE}, |
4033 | 197 {WIDGET_CHK_BTN, N_("Use custom cursors"), &cfg.custom_cursors, G_CALLBACK(skin_reload_forced), NULL, FALSE}, |
198 {WIDGET_CHK_BTN, N_("Show window manager decoration"), &cfg.show_wm_decorations, G_CALLBACK(show_wm_decorations_cb), | |
199 N_("This enables the window manager to show decorations for windows."), FALSE}, | |
200 {WIDGET_CHK_BTN, N_("Use XMMS-style file selector instead of the default selector"), &cfg.use_xmms_style_fileselector, NULL, | |
201 N_("This enables the XMMS/GTK1-style file selection dialogs. This selector is provided by Audacious itself and is faster than the default GTK2 selector (but sadly not as user-friendly)."), FALSE}, | |
202 {WIDGET_CHK_BTN, N_("Use two-way text scroller"), &cfg.twoway_scroll, NULL, | |
203 N_("If selected, the file information text in the main window will scroll back and forth. If not selected, the text will only scroll in one direction."), FALSE}, | |
4003 | 204 }; |
205 | |
4033 | 206 static preferences_widget_t audio_page_widgets[] = { |
207 {WIDGET_LABEL, N_("<b>Format Detection</b>"), NULL, NULL, NULL, FALSE}, | |
208 {WIDGET_CHK_BTN, N_("Detect file formats on demand, instead of immediately."), &cfg.playlist_detect, NULL, | |
209 N_("When checked, Audacious will detect file formats on demand. This can result in a messier playlist, but delivers a major speed benefit."), FALSE}, | |
210 {WIDGET_CHK_BTN, N_("Detect file formats by extension."), &cfg.use_extension_probing, NULL, | |
211 N_("When checked, Audacious will detect file formats based by extension. Only files with extensions of supported formats will be loaded."), FALSE}, | |
212 {WIDGET_LABEL, N_("<b>Playback</b>"), NULL, NULL, NULL, FALSE}, | |
213 {WIDGET_CHK_BTN, N_("Continue playback on startup"), &cfg.resume_playback_on_startup, NULL, | |
214 N_("When Audacious starts, automatically begin playing from the point where we stopped before."), FALSE}, | |
215 {WIDGET_CHK_BTN, N_("Don't advance in the playlist"), &cfg.no_playlist_advance, NULL, | |
216 N_("When finished playing a song, don't automatically advance to the next."), FALSE}, | |
217 {WIDGET_CHK_BTN, N_("Pause between songs"), &cfg.pause_between_songs, NULL, NULL, FALSE}, | |
218 {WIDGET_SPIN_BTN, N_("Pause for"), &cfg.pause_between_songs_time, NULL, N_("seconds"), TRUE}, | |
4004 | 219 }; |
220 | |
4033 | 221 static preferences_widget_t playlist_page_widgets[] = { |
222 {WIDGET_LABEL, N_("<b>Filename</b>"), NULL, NULL, NULL, FALSE}, | |
223 {WIDGET_CHK_BTN, N_("Convert underscores to blanks"), &cfg.convert_underscore, NULL, NULL, FALSE}, | |
224 {WIDGET_CHK_BTN, N_("Convert %20 to blanks"), &cfg.convert_twenty, NULL, NULL, FALSE}, | |
225 {WIDGET_CHK_BTN, N_("Convert backslash '\\' to forward slash '/'"), &cfg.convert_slash, NULL, NULL, FALSE}, | |
226 {WIDGET_LABEL, N_("<b>Metadata</b>"), NULL, NULL, NULL, FALSE}, | |
227 {WIDGET_CHK_BTN, N_("Load metadata from playlists and files"), &cfg.use_pl_metadata, NULL, N_("Load metadata (tag information) from music files."), FALSE}, | |
228 {WIDGET_RADIO_BTN, N_("On load"), &cfg.get_info_on_load, NULL, N_("Load metadata when adding the file to the playlist or opening it"), TRUE}, | |
229 {WIDGET_RADIO_BTN, N_("On display"), &cfg.get_info_on_demand, NULL, N_("Load metadata on demand when displaying the file in the playlist. You may need to set \"Detect file formats on demand\" in Audio page for full benefit."), TRUE}, | |
230 {WIDGET_CHARDET_TABLE, NULL, NULL, NULL, NULL, TRUE}, | |
231 {WIDGET_LABEL, N_("<b>File Dialog</b>"), NULL, NULL, NULL, FALSE}, | |
232 {WIDGET_CHK_BTN, N_("Always refresh directory when opening file dialog"), &cfg.refresh_file_list, NULL, N_("Always refresh the file dialog (this will slow opening the dialog on large directories, and Gnome VFS should handle automatically)."), FALSE}, | |
4007 | 233 }; |
234 | |
4033 | 235 static preferences_widget_t mouse_page_widgets[] = { |
236 {WIDGET_LABEL, N_("<b>Mouse wheel</b>"), NULL, NULL, NULL, FALSE}, | |
237 {WIDGET_SPIN_BTN, N_("Changes volume by"), &cfg.mouse_change, NULL, N_("percent"), FALSE}, | |
238 {WIDGET_SPIN_BTN, N_("Scrolls playlist by"), &cfg.scroll_pl_by, NULL, N_("lines"), FALSE}, | |
239 }; | |
2313 | 240 |
3991
d6ac99c2be1d
destroy colorize settings upon closing
mf0102 <0102@gmx.at>
parents:
3990
diff
changeset
|
241 static void create_colorize_settings(void); |
2313 | 242 static void prefswin_page_queue_destroy(CategoryQueueEntry *ent); |
243 | |
244 static void | |
245 change_category(GtkNotebook * notebook, | |
246 GtkTreeSelection * selection) | |
247 { | |
248 GtkTreeModel *model; | |
249 GtkTreeIter iter; | |
250 gint index; | |
251 | |
252 if (!gtk_tree_selection_get_selected(selection, &model, &iter)) | |
253 return; | |
254 | |
255 gtk_tree_model_get(model, &iter, CATEGORY_VIEW_COL_ID, &index, -1); | |
256 gtk_notebook_set_current_page(notebook, index); | |
257 } | |
258 | |
259 void | |
260 prefswin_set_category(gint index) | |
261 { | |
262 g_return_if_fail(index >= 0 && index < n_categories); | |
263 | |
3993 | 264 gtk_notebook_set_current_page(GTK_NOTEBOOK(category_treeview), index); |
2313 | 265 } |
266 | |
267 static void | |
268 output_plugin_open_prefs(GtkComboBox * cbox, | |
269 gpointer data) | |
270 { | |
271 output_configure(gtk_combo_box_get_active(cbox)); | |
272 } | |
273 | |
274 static void | |
275 output_plugin_open_info(GtkComboBox * cbox, | |
276 gpointer data) | |
277 { | |
278 output_about(gtk_combo_box_get_active(cbox)); | |
279 } | |
280 | |
281 static void | |
3985
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
282 plugin_toggle(GtkCellRendererToggle * cell, |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
283 const gchar * path_str, |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
284 gpointer data) |
2313 | 285 { |
286 GtkTreeModel *model = GTK_TREE_MODEL(data); | |
287 GtkTreeIter iter; | |
288 GtkTreePath *path = gtk_tree_path_new_from_string(path_str); | |
289 gint pluginnr; | |
3985
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
290 gint plugin_type = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(data), "plugin_type")); |
2313 | 291 |
292 /* get toggled iter */ | |
293 gtk_tree_model_get_iter(model, &iter, path); | |
294 | |
3985
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
295 if (plugin_type == PLUGIN_VIEW_TYPE_INPUT) { |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
296 Plugin *plugin; |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
297 /*GList *diplist, *tmplist; */ |
2313 | 298 |
3985
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
299 gtk_tree_model_get(model, &iter, |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
300 PLUGIN_VIEW_COL_ID, &pluginnr, |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
301 PLUGIN_VIEW_COL_PLUGIN_PTR, &plugin, -1); |
2313 | 302 |
3985
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
303 /* do something with the value */ |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
304 plugin->enabled ^= 1; |
2313 | 305 |
3985
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
306 /* set new value */ |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
307 gtk_list_store_set(GTK_LIST_STORE(model), &iter, |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
308 PLUGIN_VIEW_COL_ACTIVE, plugin->enabled, -1); |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
309 } else { |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
310 gboolean fixed; |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
311 gtk_tree_model_get(model, &iter, |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
312 PLUGIN_VIEW_COL_ACTIVE, &fixed, |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
313 PLUGIN_VIEW_COL_ID, &pluginnr, -1); |
2313 | 314 |
3985
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
315 /* do something with the value */ |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
316 fixed ^= 1; |
2313 | 317 |
3985
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
318 switch (plugin_type) { |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
319 case PLUGIN_VIEW_TYPE_GENERAL: |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
320 enable_general_plugin(pluginnr, fixed); |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
321 break; |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
322 case PLUGIN_VIEW_TYPE_VIS: |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
323 enable_vis_plugin(pluginnr, fixed); |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
324 break; |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
325 case PLUGIN_VIEW_TYPE_EFFECT: |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
326 enable_effect_plugin(pluginnr, fixed); |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
327 break; |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
328 } |
2313 | 329 |
3985
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
330 /* set new value */ |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
331 gtk_list_store_set(GTK_LIST_STORE(model), &iter, |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
332 PLUGIN_VIEW_COL_ACTIVE, fixed, -1); |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
333 } |
2313 | 334 |
335 /* clean up */ | |
336 gtk_tree_path_free(path); | |
337 } | |
338 | |
339 static void | |
340 on_output_plugin_cbox_changed(GtkComboBox * combobox, | |
341 gpointer data) | |
342 { | |
343 gint selected; | |
344 selected = gtk_combo_box_get_active(combobox); | |
345 | |
346 set_current_output_plugin(selected); | |
347 } | |
348 | |
349 static void | |
350 on_output_plugin_cbox_realize(GtkComboBox * cbox, | |
351 gpointer data) | |
352 { | |
353 GList *olist = get_output_list(); | |
354 OutputPlugin *op, *cp = get_current_output_plugin(); | |
355 gint i = 0, selected = 0; | |
356 | |
357 if (!olist) { | |
358 gtk_widget_set_sensitive(GTK_WIDGET(cbox), FALSE); | |
359 return; | |
360 } | |
361 | |
362 for (i = 0; olist; i++, olist = g_list_next(olist)) { | |
363 op = OUTPUT_PLUGIN(olist->data); | |
364 | |
365 if (olist->data == cp) | |
366 selected = i; | |
367 | |
368 gtk_combo_box_append_text(cbox, op->description); | |
369 } | |
370 | |
371 gtk_combo_box_set_active(cbox, selected); | |
372 g_signal_connect(cbox, "changed", | |
373 G_CALLBACK(on_output_plugin_cbox_changed), NULL); | |
374 } | |
375 | |
376 static void | |
3437
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
377 on_plugin_view_realize(GtkTreeView * treeview, |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
378 GCallback callback, |
3985
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
379 gpointer data, |
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
380 gint plugin_type) |
2313 | 381 { |
382 GtkListStore *store; | |
383 GtkTreeIter iter; | |
384 | |
385 GtkCellRenderer *renderer; | |
386 GtkTreeViewColumn *column; | |
387 | |
388 GList *ilist; | |
389 gchar *description[2]; | |
390 gint id = 0; | |
391 | |
3437
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
392 GList *list = (GList *) data; |
2313 | 393 |
394 store = gtk_list_store_new(PLUGIN_VIEW_N_COLS, | |
395 G_TYPE_BOOLEAN, G_TYPE_STRING, | |
3439
93584d1b3e7e
Add plugin pointer to the plugin treestore.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
396 G_TYPE_STRING, G_TYPE_INT, G_TYPE_POINTER); |
3985
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
397 g_object_set_data(G_OBJECT(store), "plugin_type" , GINT_TO_POINTER(plugin_type)); |
2313 | 398 |
399 column = gtk_tree_view_column_new(); | |
400 gtk_tree_view_column_set_title(column, _("Enabled")); | |
401 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED); | |
402 gtk_tree_view_column_set_spacing(column, 4); | |
403 gtk_tree_view_column_set_resizable(column, FALSE); | |
404 gtk_tree_view_column_set_fixed_width(column, 50); | |
405 | |
406 renderer = gtk_cell_renderer_toggle_new(); | |
407 g_signal_connect(renderer, "toggled", | |
3437
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
408 G_CALLBACK(callback), store); |
2313 | 409 gtk_tree_view_column_pack_start(column, renderer, TRUE); |
410 gtk_tree_view_column_set_attributes(column, renderer, "active", | |
411 PLUGIN_VIEW_COL_ACTIVE, NULL); | |
412 | |
413 gtk_tree_view_append_column(treeview, column); | |
414 | |
415 column = gtk_tree_view_column_new(); | |
416 gtk_tree_view_column_set_title(column, _("Description")); | |
417 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); | |
418 gtk_tree_view_column_set_spacing(column, 4); | |
419 gtk_tree_view_column_set_resizable(column, TRUE); | |
420 | |
421 | |
422 renderer = gtk_cell_renderer_text_new(); | |
423 gtk_tree_view_column_pack_start(column, renderer, FALSE); | |
424 gtk_tree_view_column_set_attributes(column, renderer, | |
425 "text", PLUGIN_VIEW_COL_DESC, NULL); | |
426 gtk_tree_view_append_column(treeview, column); | |
427 | |
428 column = gtk_tree_view_column_new(); | |
429 | |
430 gtk_tree_view_column_set_title(column, _("Filename")); | |
431 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); | |
432 gtk_tree_view_column_set_spacing(column, 4); | |
433 gtk_tree_view_column_set_resizable(column, TRUE); | |
434 | |
435 renderer = gtk_cell_renderer_text_new(); | |
436 gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
437 gtk_tree_view_column_set_attributes(column, renderer, "text", | |
438 PLUGIN_VIEW_COL_FILENAME, NULL); | |
439 | |
440 gtk_tree_view_append_column(treeview, column); | |
441 | |
3437
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
442 MOWGLI_ITER_FOREACH(ilist, list) |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
443 { |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
444 Plugin *plugin = PLUGIN(ilist->data); |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
445 |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
446 description[0] = g_strdup(plugin->description); |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
447 description[1] = g_strdup(plugin->filename); |
2313 | 448 |
449 gtk_list_store_append(store, &iter); | |
450 gtk_list_store_set(store, &iter, | |
3437
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
451 PLUGIN_VIEW_COL_ACTIVE, plugin->enabled, |
2313 | 452 PLUGIN_VIEW_COL_DESC, description[0], |
453 PLUGIN_VIEW_COL_FILENAME, description[1], | |
3439
93584d1b3e7e
Add plugin pointer to the plugin treestore.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
454 PLUGIN_VIEW_COL_ID, id++, |
93584d1b3e7e
Add plugin pointer to the plugin treestore.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
455 PLUGIN_VIEW_COL_PLUGIN_PTR, plugin, -1); |
2313 | 456 |
457 g_free(description[1]); | |
458 g_free(description[0]); | |
459 } | |
460 | |
461 gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(store)); | |
462 } | |
463 | |
464 static void | |
3437
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
465 on_input_plugin_view_realize(GtkTreeView * treeview, |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
466 gpointer data) |
2313 | 467 { |
3985
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
468 on_plugin_view_realize(treeview, G_CALLBACK(plugin_toggle), ip_data.input_list, PLUGIN_VIEW_TYPE_INPUT); |
2313 | 469 } |
470 | |
471 static void | |
472 on_effect_plugin_view_realize(GtkTreeView * treeview, | |
473 gpointer data) | |
474 { | |
3985
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
475 on_plugin_view_realize(treeview, G_CALLBACK(plugin_toggle), ep_data.effect_list, PLUGIN_VIEW_TYPE_EFFECT); |
3437
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
476 } |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
477 |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
478 static void |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
479 on_general_plugin_view_realize(GtkTreeView * treeview, |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
480 gpointer data) |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
481 { |
3985
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
482 on_plugin_view_realize(treeview, G_CALLBACK(plugin_toggle), gp_data.general_list, PLUGIN_VIEW_TYPE_GENERAL); |
3437
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
483 } |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
484 |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
485 static void |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
486 on_vis_plugin_view_realize(GtkTreeView * treeview, |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
487 gpointer data) |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
488 { |
3985
ba5af8e85857
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3917
diff
changeset
|
489 on_plugin_view_realize(treeview, G_CALLBACK(plugin_toggle), vp_data.vis_list, PLUGIN_VIEW_TYPE_VIS); |
3437
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
490 } |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
491 |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
492 static void |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
493 editable_insert_text(GtkEditable * editable, |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
494 const gchar * text, |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
495 gint * pos) |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
496 { |
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3357
diff
changeset
|
497 gtk_editable_insert_text(editable, text, strlen(text), pos); |
2313 | 498 } |
499 | |
500 static void | |
501 titlestring_tag_menu_callback(GtkMenuItem * menuitem, | |
502 gpointer data) | |
503 { | |
504 const gchar *separator = " - "; | |
505 gint item = GPOINTER_TO_INT(data); | |
506 gint pos; | |
3993 | 507 |
508 pos = gtk_editable_get_position(GTK_EDITABLE(titlestring_entry)); | |
2313 | 509 |
510 /* insert separator as needed */ | |
3993 | 511 if (g_utf8_strlen(gtk_entry_get_text(GTK_ENTRY(titlestring_entry)), -1) > 0) |
512 editable_insert_text(GTK_EDITABLE(titlestring_entry), separator, &pos); | |
513 | |
514 editable_insert_text(GTK_EDITABLE(titlestring_entry), _(title_field_tags[item].tag), | |
2313 | 515 &pos); |
516 | |
3993 | 517 gtk_editable_set_position(GTK_EDITABLE(titlestring_entry), pos); |
2313 | 518 } |
519 | |
520 static void | |
521 on_titlestring_help_button_clicked(GtkButton * button, | |
522 gpointer data) | |
523 { | |
524 | |
525 GtkMenu *menu; | |
526 MenuPos *pos = g_new0(MenuPos, 1); | |
527 GdkWindow *parent; | |
528 | |
529 gint x_ro, y_ro; | |
530 gint x_widget, y_widget; | |
531 gint x_size, y_size; | |
532 | |
533 g_return_if_fail (button != NULL); | |
534 g_return_if_fail (GTK_IS_MENU (data)); | |
535 | |
536 parent = gtk_widget_get_parent_window(GTK_WIDGET(button)); | |
537 | |
538 gdk_drawable_get_size(parent, &x_size, &y_size); | |
539 gdk_window_get_root_origin(GTK_WIDGET(button)->window, &x_ro, &y_ro); | |
540 gdk_window_get_position(GTK_WIDGET(button)->window, &x_widget, &y_widget); | |
541 | |
542 pos->x = x_size + x_ro; | |
543 pos->y = y_size + y_ro - 100; | |
544 | |
545 menu = GTK_MENU(data); | |
546 gtk_menu_popup (menu, NULL, NULL, util_menu_position, pos, | |
547 0, GDK_CURRENT_TIME); | |
548 } | |
549 | |
550 | |
551 static void | |
552 on_titlestring_entry_realize(GtkWidget * entry, | |
553 gpointer data) | |
554 { | |
555 gtk_entry_set_text(GTK_ENTRY(entry), cfg.gentitle_format); | |
556 } | |
557 | |
558 static void | |
559 on_titlestring_entry_changed(GtkWidget * entry, | |
560 gpointer data) | |
561 { | |
562 g_free(cfg.gentitle_format); | |
563 cfg.gentitle_format = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry))); | |
564 } | |
565 | |
566 static void | |
567 on_titlestring_cbox_realize(GtkWidget * cbox, | |
568 gpointer data) | |
569 { | |
570 gtk_combo_box_set_active(GTK_COMBO_BOX(cbox), cfg.titlestring_preset); | |
571 gtk_widget_set_sensitive(GTK_WIDGET(data), | |
572 (cfg.titlestring_preset == (gint)n_titlestring_presets)); | |
573 } | |
574 | |
575 static void | |
576 on_titlestring_cbox_changed(GtkWidget * cbox, | |
577 gpointer data) | |
578 { | |
579 gint position = gtk_combo_box_get_active(GTK_COMBO_BOX(cbox)); | |
580 | |
581 cfg.titlestring_preset = position; | |
582 gtk_widget_set_sensitive(GTK_WIDGET(data), (position == 6)); | |
583 } | |
584 | |
585 static void | |
586 on_mainwin_font_button_font_set(GtkFontButton * button, | |
587 gpointer data) | |
588 { | |
589 g_free(cfg.mainwin_font); | |
590 cfg.mainwin_font = g_strdup(gtk_font_button_get_font_name(button)); | |
591 | |
2911 | 592 ui_skinned_textbox_set_xfont(mainwin_info, cfg.mainwin_use_xfont, cfg.mainwin_font); |
2313 | 593 } |
594 | |
595 static void | |
596 on_use_bitmap_fonts_realize(GtkToggleButton * button, | |
597 gpointer data) | |
598 { | |
599 gtk_toggle_button_set_active(button, | |
600 cfg.mainwin_use_xfont != FALSE ? FALSE : TRUE); | |
601 } | |
602 | |
603 static void | |
604 on_use_bitmap_fonts_toggled(GtkToggleButton * button, | |
605 gpointer data) | |
606 { | |
607 gboolean useit = gtk_toggle_button_get_active(button); | |
608 cfg.mainwin_use_xfont = useit != FALSE ? FALSE : TRUE; | |
2911 | 609 ui_skinned_textbox_set_xfont(mainwin_info, cfg.mainwin_use_xfont, cfg.mainwin_font); |
2313 | 610 playlistwin_set_sinfo_font(cfg.playlist_font); |
611 | |
612 if (cfg.playlist_shaded) { | |
613 playlistwin_update_list(playlist_get_active()); | |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3217
diff
changeset
|
614 ui_skinned_window_draw_all(playlistwin); |
2313 | 615 } |
616 } | |
617 | |
618 static void | |
619 on_mainwin_font_button_realize(GtkFontButton * button, | |
620 gpointer data) | |
621 { | |
622 gtk_font_button_set_font_name(button, cfg.mainwin_font); | |
623 } | |
624 | |
625 static void | |
626 on_playlist_font_button_font_set(GtkFontButton * button, | |
627 gpointer data) | |
628 { | |
629 g_free(cfg.playlist_font); | |
630 cfg.playlist_font = g_strdup(gtk_font_button_get_font_name(button)); | |
631 | |
3217 | 632 ui_skinned_playlist_set_font(cfg.playlist_font); |
2313 | 633 playlistwin_set_sinfo_font(cfg.playlist_font); /* propagate font setting to playlistwin_sinfo */ |
634 playlistwin_update_list(playlist_get_active()); | |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3217
diff
changeset
|
635 gtk_widget_queue_draw(playlistwin_list); |
2313 | 636 } |
637 | |
638 static void | |
639 on_playlist_font_button_realize(GtkFontButton * button, | |
640 gpointer data) | |
641 { | |
642 gtk_font_button_set_font_name(button, cfg.playlist_font); | |
643 } | |
644 | |
645 static void | |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
646 playlist_show_pl_separator_numbers_cb() |
2313 | 647 { |
648 playlistwin_update_list(playlist_get_active()); | |
3221
9583cd62231f
implement ui_skinned_window_expose
Tomasz Mon <desowin@gmail.com>
parents:
3217
diff
changeset
|
649 gtk_widget_queue_draw(playlistwin_list); |
2313 | 650 } |
651 | |
652 /* proxy */ | |
653 static void | |
4000
a0bb67450552
more code duplication removal
Tomasz Mon <desowin@gmail.com>
parents:
3999
diff
changeset
|
654 on_proxy_button_realize(GtkToggleButton *button, gchar *cfg) |
2313 | 655 { |
4000
a0bb67450552
more code duplication removal
Tomasz Mon <desowin@gmail.com>
parents:
3999
diff
changeset
|
656 g_return_if_fail(cfg != NULL); |
a0bb67450552
more code duplication removal
Tomasz Mon <desowin@gmail.com>
parents:
3999
diff
changeset
|
657 |
2313 | 658 ConfigDb *db; |
659 gboolean ret; | |
660 | |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
661 db = cfg_db_open(); |
2313 | 662 |
4000
a0bb67450552
more code duplication removal
Tomasz Mon <desowin@gmail.com>
parents:
3999
diff
changeset
|
663 if (cfg_db_get_bool(db, NULL, cfg, &ret) != FALSE) |
2313 | 664 gtk_toggle_button_set_active(button, ret); |
665 | |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
666 cfg_db_close(db); |
2313 | 667 } |
668 | |
669 static void | |
4000
a0bb67450552
more code duplication removal
Tomasz Mon <desowin@gmail.com>
parents:
3999
diff
changeset
|
670 on_proxy_button_toggled(GtkToggleButton *button, gchar *cfg) |
2313 | 671 { |
4000
a0bb67450552
more code duplication removal
Tomasz Mon <desowin@gmail.com>
parents:
3999
diff
changeset
|
672 g_return_if_fail(cfg != NULL); |
a0bb67450552
more code duplication removal
Tomasz Mon <desowin@gmail.com>
parents:
3999
diff
changeset
|
673 |
2313 | 674 ConfigDb *db; |
675 gboolean ret = gtk_toggle_button_get_active(button); | |
676 | |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
677 db = cfg_db_open(); |
4000
a0bb67450552
more code duplication removal
Tomasz Mon <desowin@gmail.com>
parents:
3999
diff
changeset
|
678 cfg_db_set_bool(db, NULL, cfg, ret); |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
679 cfg_db_close(db); |
2313 | 680 } |
681 | |
682 static void | |
3999
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
683 on_proxy_entry_changed(GtkEntry *entry, gchar *cfg) |
2313 | 684 { |
3999
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
685 g_return_if_fail(cfg != NULL); |
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
686 |
2313 | 687 ConfigDb *db; |
688 gchar *ret = g_strdup(gtk_entry_get_text(entry)); | |
689 | |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
690 db = cfg_db_open(); |
3999
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
691 cfg_db_set_string(db, NULL, cfg, ret); |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
692 cfg_db_close(db); |
2313 | 693 |
694 g_free(ret); | |
695 } | |
696 | |
697 static void | |
3999
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
698 on_proxy_entry_realize(GtkEntry *entry, gchar *cfg) |
2313 | 699 { |
3999
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
700 g_return_if_fail(cfg != NULL); |
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
701 |
2313 | 702 ConfigDb *db; |
703 gchar *ret; | |
704 | |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
705 db = cfg_db_open(); |
2313 | 706 |
3999
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
707 if (cfg_db_get_string(db, NULL, cfg, &ret) != FALSE) |
2313 | 708 gtk_entry_set_text(entry, ret); |
709 | |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
710 cfg_db_close(db); |
2313 | 711 } |
712 | |
713 static void | |
3356 | 714 plugin_treeview_open_prefs(GtkTreeView *treeview) |
3353
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
715 { |
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
716 GtkTreeSelection *selection; |
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
717 GtkTreeModel *model; |
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
718 GtkTreeIter iter; |
3442
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
719 Plugin *plugin = NULL; |
3353
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
720 |
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
721 selection = gtk_tree_view_get_selection(treeview); |
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
722 if (!gtk_tree_selection_get_selected(selection, &model, &iter)) |
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
723 return; |
3442
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
724 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_PLUGIN_PTR, &plugin, -1); |
3353
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
725 |
3442
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
726 g_return_if_fail(plugin != NULL); |
3542
f8880f2e0501
Fix crash on calling plugin->configure() in preferences when plugin->configure==NULL
Sascha Hlusiak <contact@saschahlusiak.de>
parents:
3442
diff
changeset
|
727 g_return_if_fail(plugin->configure != NULL); |
3442
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
728 |
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
729 plugin->configure(); |
3353
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
730 } |
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
731 |
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
732 static void |
3357 | 733 plugin_treeview_open_info(GtkTreeView *treeview) |
734 { | |
735 GtkTreeSelection *selection; | |
736 GtkTreeModel *model; | |
737 GtkTreeIter iter; | |
3442
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
738 Plugin *plugin = NULL; |
3357 | 739 |
740 selection = gtk_tree_view_get_selection(treeview); | |
741 if (!gtk_tree_selection_get_selected(selection, &model, &iter)) | |
742 return; | |
3442
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
743 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_PLUGIN_PTR, &plugin, -1); |
3357 | 744 |
3442
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
745 g_return_if_fail(plugin != NULL); |
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
746 |
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
747 plugin->about(); |
3357 | 748 } |
749 | |
750 static void | |
3355
31ecb89e871c
introduce plugin_treeview_enable_prefs and plugin_treeview_enable_info
Tomasz Mon <desowin@gmail.com>
parents:
3353
diff
changeset
|
751 plugin_treeview_enable_prefs(GtkTreeView * treeview, GtkButton * button) |
2313 | 752 { |
753 GtkTreeSelection *selection; | |
754 GtkTreeModel *model; | |
755 GtkTreeIter iter; | |
3442
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
756 Plugin *plugin = NULL; |
2313 | 757 |
758 selection = gtk_tree_view_get_selection(treeview); | |
759 if (!gtk_tree_selection_get_selected(selection, &model, &iter)) | |
760 return; | |
761 | |
3442
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
762 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_PLUGIN_PTR, &plugin, -1); |
2313 | 763 |
3442
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
764 g_return_if_fail(plugin != NULL); |
2313 | 765 |
3442
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
766 gtk_widget_set_sensitive(GTK_WIDGET(button), plugin->configure != NULL); |
2313 | 767 } |
768 | |
769 static void | |
3355
31ecb89e871c
introduce plugin_treeview_enable_prefs and plugin_treeview_enable_info
Tomasz Mon <desowin@gmail.com>
parents:
3353
diff
changeset
|
770 plugin_treeview_enable_info(GtkTreeView * treeview, GtkButton * button) |
2313 | 771 { |
772 GtkTreeSelection *selection; | |
773 GtkTreeModel *model; | |
774 GtkTreeIter iter; | |
3442
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
775 Plugin *plugin = NULL; |
2313 | 776 |
777 selection = gtk_tree_view_get_selection(treeview); | |
778 if (!gtk_tree_selection_get_selected(selection, &model, &iter)) | |
779 return; | |
780 | |
3442
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
781 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_PLUGIN_PTR, &plugin, -1); |
2313 | 782 |
3442
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
783 g_return_if_fail(plugin != NULL); |
2313 | 784 |
3442
b0f4ab42dd3b
Rework configuration and about calls.
William Pitcock <nenolod@atheme.org>
parents:
3441
diff
changeset
|
785 gtk_widget_set_sensitive(GTK_WIDGET(button), plugin->about != NULL); |
2313 | 786 } |
787 | |
788 | |
789 static void | |
790 output_plugin_enable_info(GtkComboBox * cbox, GtkButton * button) | |
791 { | |
792 GList *plist; | |
793 | |
794 gint id = gtk_combo_box_get_active(cbox); | |
795 | |
796 plist = get_output_list(); | |
797 plist = g_list_nth(plist, id); | |
798 | |
799 gtk_widget_set_sensitive(GTK_WIDGET(button), | |
800 OUTPUT_PLUGIN(plist->data)->about != NULL); | |
801 } | |
802 | |
803 static void | |
804 output_plugin_enable_prefs(GtkComboBox * cbox, GtkButton * button) | |
805 { | |
806 GList *plist; | |
807 gint id = gtk_combo_box_get_active(cbox); | |
808 | |
809 plist = get_output_list(); | |
810 plist = g_list_nth(plist, id); | |
811 | |
812 gtk_widget_set_sensitive(GTK_WIDGET(button), | |
813 OUTPUT_PLUGIN(plist->data)->configure != NULL); | |
814 } | |
815 | |
816 static void | |
817 on_output_plugin_bufsize_realize(GtkSpinButton *button, | |
818 gpointer data) | |
819 { | |
820 gtk_spin_button_set_value(button, cfg.output_buffer_size); | |
821 } | |
822 | |
823 static void | |
824 on_output_plugin_bufsize_value_changed(GtkSpinButton *button, | |
825 gpointer data) | |
826 { | |
827 cfg.output_buffer_size = gtk_spin_button_get_value_as_int(button); | |
828 } | |
829 | |
830 static void | |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
831 on_enable_src_realize(GtkToggleButton * button, |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
832 gpointer data) |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
833 { |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
834 #ifdef USE_SRC |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
835 ConfigDb *db; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
836 gboolean ret; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
837 |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
838 db = cfg_db_open(); |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
839 |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
840 if (cfg_db_get_bool(db, NULL, "enable_src", &ret) != FALSE) |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
841 gtk_toggle_button_set_active(button, ret); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
842 |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
843 cfg_db_close(db); |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
844 #else |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
845 gtk_toggle_button_set_active(button, FALSE); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
846 gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
847 #endif |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
848 } |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
849 |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
850 static void |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
851 on_enable_src_toggled(GtkToggleButton * button, |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
852 gpointer data) |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
853 { |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
854 ConfigDb *db; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
855 gboolean ret = gtk_toggle_button_get_active(button); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
856 |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
857 db = cfg_db_open(); |
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
858 cfg_db_set_bool(db, NULL, "enable_src", ret); |
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
859 cfg_db_close(db); |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
860 } |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
861 |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
862 static void |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
863 on_src_rate_realize(GtkSpinButton * button, |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
864 gpointer data) |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
865 { |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
866 #ifdef USE_SRC |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
867 ConfigDb *db; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
868 gint value; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
869 |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
870 db = cfg_db_open(); |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
871 |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
872 if (cfg_db_get_int(db, NULL, "src_rate", &value) != FALSE) |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
873 gtk_spin_button_set_value(button, (gdouble)value); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
874 |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
875 cfg_db_close(db); |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
876 #else |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
877 gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
878 #endif |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
879 } |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
880 |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
881 static void |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
882 on_src_rate_value_changed(GtkSpinButton * button, |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
883 gpointer data) |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
884 { |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
885 ConfigDb *db; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
886 gint value = gtk_spin_button_get_value_as_int(button); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
887 |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
888 db = cfg_db_open(); |
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
889 cfg_db_set_int(db, NULL, "src_rate", value); |
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
890 cfg_db_close(db); |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
891 } |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
892 |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
893 static void |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
894 on_src_converter_type_realize(GtkComboBox * box, |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
895 gpointer data) |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
896 { |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
897 #ifdef USE_SRC |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
898 ConfigDb *db; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
899 gint value; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
900 |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
901 db = cfg_db_open(); |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
902 |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
903 if (cfg_db_get_int(db, NULL, "src_type", &value) != FALSE) |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
904 gtk_combo_box_set_active(box, value); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
905 else |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
906 gtk_combo_box_set_active(box, 0); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
907 |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
908 cfg_db_close(db); |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
909 #else |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
910 gtk_widget_set_sensitive(GTK_WIDGET(box), FALSE); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
911 #endif |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
912 } |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
913 |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
914 static void |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
915 on_src_converter_type_changed(GtkComboBox * box, |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
916 gpointer data) |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
917 { |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
918 ConfigDb *db; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
919 gint value = gtk_combo_box_get_active(box); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
920 |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
921 db = cfg_db_open(); |
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
922 cfg_db_set_int(db, NULL, "src_type", value); |
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
923 cfg_db_close(db); |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
924 } |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
925 |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2468
diff
changeset
|
926 static void |
4007 | 927 on_spin_btn_realize(GtkSpinButton *button, gboolean *cfg) |
2313 | 928 { |
4007 | 929 gtk_spin_button_set_value(button, *cfg); |
2313 | 930 } |
931 | |
932 static void | |
4007 | 933 on_spin_btn_changed(GtkSpinButton *button, gboolean *cfg) |
2313 | 934 { |
4007 | 935 *cfg = gtk_spin_button_get_value_as_int(button); |
2313 | 936 } |
937 | |
938 static void | |
3544
e235357029ba
Add preferences option.
William Pitcock <nenolod@atheme.org>
parents:
3442
diff
changeset
|
939 on_software_volume_control_toggled(GtkToggleButton * button, gpointer data) |
e235357029ba
Add preferences option.
William Pitcock <nenolod@atheme.org>
parents:
3442
diff
changeset
|
940 { |
e235357029ba
Add preferences option.
William Pitcock <nenolod@atheme.org>
parents:
3442
diff
changeset
|
941 cfg.software_volume_control = gtk_toggle_button_get_active(button); |
e235357029ba
Add preferences option.
William Pitcock <nenolod@atheme.org>
parents:
3442
diff
changeset
|
942 } |
e235357029ba
Add preferences option.
William Pitcock <nenolod@atheme.org>
parents:
3442
diff
changeset
|
943 |
e235357029ba
Add preferences option.
William Pitcock <nenolod@atheme.org>
parents:
3442
diff
changeset
|
944 static void |
e235357029ba
Add preferences option.
William Pitcock <nenolod@atheme.org>
parents:
3442
diff
changeset
|
945 on_software_volume_control_realize(GtkToggleButton * button, gpointer data) |
e235357029ba
Add preferences option.
William Pitcock <nenolod@atheme.org>
parents:
3442
diff
changeset
|
946 { |
e235357029ba
Add preferences option.
William Pitcock <nenolod@atheme.org>
parents:
3442
diff
changeset
|
947 gtk_toggle_button_set_active(button, cfg.software_volume_control); |
e235357029ba
Add preferences option.
William Pitcock <nenolod@atheme.org>
parents:
3442
diff
changeset
|
948 } |
e235357029ba
Add preferences option.
William Pitcock <nenolod@atheme.org>
parents:
3442
diff
changeset
|
949 |
e235357029ba
Add preferences option.
William Pitcock <nenolod@atheme.org>
parents:
3442
diff
changeset
|
950 static void |
2313 | 951 on_eq_dir_preset_entry_realize(GtkEntry * entry, |
952 gpointer data) | |
953 { | |
954 gtk_entry_set_text(entry, cfg.eqpreset_default_file); | |
955 } | |
956 | |
957 static void | |
958 on_eq_dir_preset_entry_changed(GtkEntry * entry, | |
959 gpointer data) | |
960 { | |
961 g_free(cfg.eqpreset_default_file); | |
962 cfg.eqpreset_default_file = g_strdup(gtk_entry_get_text(entry)); | |
963 } | |
964 | |
965 static void | |
966 on_eq_file_preset_entry_realize(GtkEntry * entry, | |
967 gpointer data) | |
968 { | |
969 gtk_entry_set_text(entry, cfg.eqpreset_extension); | |
970 } | |
971 | |
972 static void | |
973 on_eq_file_preset_entry_changed(GtkEntry * entry, gpointer data) | |
974 { | |
975 const gchar *text = gtk_entry_get_text(entry); | |
976 | |
977 while (*text == '.') | |
978 text++; | |
979 | |
980 g_free(cfg.eqpreset_extension); | |
981 cfg.eqpreset_extension = g_strdup(text); | |
982 } | |
983 | |
984 | |
985 static void | |
986 on_skin_refresh_button_clicked(GtkButton * button, | |
987 gpointer data) | |
988 { | |
989 const mode_t mode755 = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; | |
990 | |
991 del_directory(bmp_paths[BMP_PATH_SKIN_THUMB_DIR]); | |
992 make_directory(bmp_paths[BMP_PATH_SKIN_THUMB_DIR], mode755); | |
993 | |
3993 | 994 skin_view_update(GTK_TREE_VIEW(skin_view), GTK_WIDGET(skin_refresh_button)); |
2313 | 995 } |
996 | |
997 static gboolean | |
998 on_skin_view_realize(GtkTreeView * treeview, | |
999 gpointer data) | |
1000 { | |
1001 skin_view_realize(treeview); | |
1002 | |
1003 return TRUE; | |
1004 } | |
1005 | |
1006 static void | |
3993 | 1007 on_category_treeview_realize(GtkTreeView * treeview, |
2313 | 1008 GtkNotebook * notebook) |
1009 { | |
1010 GtkListStore *store; | |
1011 GtkCellRenderer *renderer; | |
1012 GtkTreeViewColumn *column; | |
1013 GtkTreeSelection *selection; | |
1014 GtkTreeIter iter; | |
1015 GdkPixbuf *img; | |
1016 CategoryQueueEntry *qlist; | |
1017 gint i; | |
1018 | |
1019 column = gtk_tree_view_column_new(); | |
1020 gtk_tree_view_column_set_title(column, _("Category")); | |
1021 gtk_tree_view_append_column(treeview, column); | |
1022 gtk_tree_view_column_set_spacing(column, 2); | |
1023 | |
1024 renderer = gtk_cell_renderer_pixbuf_new(); | |
1025 gtk_tree_view_column_pack_start(column, renderer, FALSE); | |
1026 gtk_tree_view_column_set_attributes(column, renderer, "pixbuf", 0, NULL); | |
1027 | |
1028 renderer = gtk_cell_renderer_text_new(); | |
1029 gtk_tree_view_column_pack_start(column, renderer, FALSE); | |
1030 gtk_tree_view_column_set_attributes(column, renderer, "text", 1, NULL); | |
1031 | |
1032 store = gtk_list_store_new(CATEGORY_VIEW_N_COLS, | |
1033 GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
1034 gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(store)); | |
1035 | |
1036 for (i = 0; i < n_categories; i++) { | |
1037 img = gdk_pixbuf_new_from_file(categories[i].icon_path, NULL); | |
1038 gtk_list_store_append(store, &iter); | |
1039 gtk_list_store_set(store, &iter, | |
1040 CATEGORY_VIEW_COL_ICON, img, | |
1041 CATEGORY_VIEW_COL_NAME, | |
1042 gettext(categories[i].name), CATEGORY_VIEW_COL_ID, | |
1043 categories[i].id, -1); | |
1044 g_object_unref(img); | |
1045 } | |
1046 | |
1047 selection = gtk_tree_view_get_selection(treeview); | |
1048 | |
1049 g_signal_connect_swapped(selection, "changed", | |
1050 G_CALLBACK(change_category), notebook); | |
1051 | |
1052 /* mark the treeview widget as available to third party plugins */ | |
1053 category_treeview = GTK_WIDGET(treeview); | |
1054 | |
1055 /* prefswin_page_queue_destroy already pops the queue forward for us. */ | |
1056 for (qlist = category_queue; qlist != NULL; qlist = category_queue) | |
1057 { | |
1058 CategoryQueueEntry *ent = (CategoryQueueEntry *) qlist; | |
1059 | |
1060 prefswin_page_new(ent->container, ent->pg_name, ent->img_url); | |
1061 prefswin_page_queue_destroy(ent); | |
1062 } | |
1063 } | |
1064 | |
1065 static void | |
1066 on_skin_view_drag_data_received(GtkWidget * widget, | |
1067 GdkDragContext * context, | |
1068 gint x, gint y, | |
1069 GtkSelectionData * selection_data, | |
1070 guint info, guint time, | |
1071 gpointer user_data) | |
1072 { | |
1073 ConfigDb *db; | |
1074 gchar *path; | |
1075 | |
1076 if (!selection_data->data) { | |
1077 g_warning("DND data string is NULL"); | |
1078 return; | |
1079 } | |
1080 | |
1081 path = (gchar *) selection_data->data; | |
1082 | |
1083 /* FIXME: use a real URL validator/parser */ | |
1084 | |
1085 if (str_has_prefix_nocase(path, "file:///")) { | |
1086 path[strlen(path) - 2] = 0; /* Why the hell a CR&LF? */ | |
1087 path += 7; | |
1088 } | |
1089 else if (str_has_prefix_nocase(path, "file:")) { | |
1090 path += 5; | |
1091 } | |
1092 | |
1093 if (file_is_archive(path)) { | |
1094 bmp_active_skin_load(path); | |
1095 skin_install_skin(path); | |
3993 | 1096 skin_view_update(GTK_TREE_VIEW(widget), GTK_WIDGET(skin_refresh_button)); |
2313 | 1097 /* Change skin name in the config file */ |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
1098 db = cfg_db_open(); |
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
1099 cfg_db_set_string(db, NULL, "skin", path); |
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
1100 cfg_db_close(db); |
2313 | 1101 } |
1102 | |
1103 } | |
1104 | |
1105 static void | |
1106 on_chardet_detector_cbox_changed(GtkComboBox * combobox, gpointer data) | |
1107 { | |
1108 ConfigDb *db; | |
1109 gint position = 0; | |
1110 | |
1111 position = gtk_combo_box_get_active(GTK_COMBO_BOX(combobox)); | |
1112 cfg.chardet_detector = (char *)chardet_detector_presets[position]; | |
1113 | |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
1114 db = cfg_db_open(); |
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
1115 cfg_db_set_string(db, NULL, "chardet_detector", cfg.chardet_detector); |
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
1116 cfg_db_close(db); |
2313 | 1117 if (data != NULL) |
1118 gtk_widget_set_sensitive(GTK_WIDGET(data), 1); | |
1119 } | |
1120 | |
1121 static void | |
1122 on_chardet_detector_cbox_realize(GtkComboBox *combobox, gpointer data) | |
1123 { | |
1124 ConfigDb *db; | |
1125 gchar *ret=NULL; | |
1126 guint i=0,index=0; | |
1127 | |
1128 for(i=0; i<n_chardet_detector_presets; i++) { | |
1129 gtk_combo_box_append_text(combobox, chardet_detector_presets[i]); | |
1130 } | |
1131 | |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
1132 db = cfg_db_open(); |
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
1133 if(cfg_db_get_string(db, NULL, "chardet_detector", &ret) != FALSE) { |
2313 | 1134 for(i=0; i<n_chardet_detector_presets; i++) { |
1135 if(!strcmp(chardet_detector_presets[i], ret)) { | |
1136 cfg.chardet_detector = (char *)chardet_detector_presets[i]; | |
1137 index = i; | |
1138 } | |
1139 } | |
1140 } | |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
1141 cfg_db_close(db); |
2313 | 1142 |
1143 #ifdef USE_CHARDET | |
1144 gtk_combo_box_set_active(GTK_COMBO_BOX(combobox), index); | |
1145 | |
1146 if (data != NULL) | |
1147 gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); | |
1148 | |
1149 g_signal_connect(combobox, "changed", | |
1150 G_CALLBACK(on_chardet_detector_cbox_changed), NULL); | |
1151 #else | |
1152 gtk_combo_box_set_active(GTK_COMBO_BOX(combobox), -1); | |
1153 gtk_widget_set_sensitive(GTK_WIDGET(combobox), 0); | |
1154 #endif | |
1155 if(ret) | |
1156 g_free(ret); | |
1157 } | |
1158 | |
1159 static void | |
1160 on_chardet_fallback_realize(GtkEntry *entry, gpointer data) | |
1161 { | |
1162 ConfigDb *db; | |
1163 gchar *ret = NULL; | |
1164 | |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
1165 db = cfg_db_open(); |
2313 | 1166 |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
1167 if (cfg_db_get_string(db, NULL, "chardet_fallback", &ret) != FALSE) { |
2313 | 1168 if(cfg.chardet_fallback) |
1169 g_free(cfg.chardet_fallback); | |
1170 | |
1171 if(ret && strncasecmp(ret, "None", sizeof("None"))) { | |
1172 cfg.chardet_fallback = ret; | |
1173 } else { | |
1174 cfg.chardet_fallback = g_strdup(""); | |
1175 } | |
1176 gtk_entry_set_text(entry, cfg.chardet_fallback); | |
1177 } | |
1178 | |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
1179 cfg_db_close(db); |
2313 | 1180 } |
1181 | |
1182 static void | |
1183 on_chardet_fallback_changed(GtkEntry *entry, gpointer data) | |
1184 { | |
1185 ConfigDb *db; | |
1186 gchar *ret = NULL; | |
1187 | |
1188 if(cfg.chardet_fallback) | |
1189 g_free(cfg.chardet_fallback); | |
1190 | |
1191 ret = g_strdup(gtk_entry_get_text(entry)); | |
1192 | |
1193 if(ret == NULL) | |
1194 cfg.chardet_fallback = g_strdup(""); | |
1195 else | |
1196 cfg.chardet_fallback = ret; | |
1197 | |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
1198 db = cfg_db_open(); |
2313 | 1199 |
1200 if(cfg.chardet_fallback == NULL || !strcmp(cfg.chardet_fallback, "")) | |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
1201 cfg_db_set_string(db, NULL, "chardet_fallback", "None"); |
2313 | 1202 else |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
1203 cfg_db_set_string(db, NULL, "chardet_fallback", cfg.chardet_fallback); |
2313 | 1204 |
3686
259b7d3e0976
sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents:
3664
diff
changeset
|
1205 cfg_db_close(db); |
2313 | 1206 } |
1207 | |
1208 static void | |
1209 on_show_filepopup_for_tuple_realize(GtkToggleButton * button, gpointer data) | |
1210 { | |
1211 gtk_toggle_button_set_active(button, cfg.show_filepopup_for_tuple); | |
3993 | 1212 filepopupbutton = GTK_WIDGET(button); |
1213 | |
1214 gtk_widget_set_sensitive(filepopup_for_tuple_settings_button, cfg.show_filepopup_for_tuple); | |
2313 | 1215 } |
1216 | |
1217 static void | |
1218 on_show_filepopup_for_tuple_toggled(GtkToggleButton * button, gpointer data) | |
1219 { | |
1220 cfg.show_filepopup_for_tuple = gtk_toggle_button_get_active(button); | |
1221 | |
3993 | 1222 gtk_widget_set_sensitive(filepopup_for_tuple_settings_button, cfg.show_filepopup_for_tuple); |
2313 | 1223 } |
1224 | |
1225 static void | |
1226 on_recurse_for_cover_toggled(GtkToggleButton *button, gpointer data) | |
1227 { | |
1228 gtk_widget_set_sensitive(GTK_WIDGET(data), | |
1229 gtk_toggle_button_get_active(button)); | |
1230 } | |
1231 | |
1232 static void | |
1233 on_colorize_button_clicked(GtkButton *button, gpointer data) | |
1234 { | |
3992
50bf02b4f048
correct mf0102's commit a bit
Tomasz Mon <desowin@gmail.com>
parents:
3991
diff
changeset
|
1235 if (colorize_settings) |
50bf02b4f048
correct mf0102's commit a bit
Tomasz Mon <desowin@gmail.com>
parents:
3991
diff
changeset
|
1236 gtk_window_present(GTK_WINDOW(colorize_settings)); |
50bf02b4f048
correct mf0102's commit a bit
Tomasz Mon <desowin@gmail.com>
parents:
3991
diff
changeset
|
1237 else |
50bf02b4f048
correct mf0102's commit a bit
Tomasz Mon <desowin@gmail.com>
parents:
3991
diff
changeset
|
1238 create_colorize_settings(); |
2313 | 1239 } |
1240 | |
1241 static void | |
3856
de26ea4a42fc
fixed bugs in interface color changing (that was TOTALLY BROKEN and
mf0102 <0102@gmx.at>
parents:
3712
diff
changeset
|
1242 reload_skin() |
de26ea4a42fc
fixed bugs in interface color changing (that was TOTALLY BROKEN and
mf0102 <0102@gmx.at>
parents:
3712
diff
changeset
|
1243 { |
de26ea4a42fc
fixed bugs in interface color changing (that was TOTALLY BROKEN and
mf0102 <0102@gmx.at>
parents:
3712
diff
changeset
|
1244 /* reload the skin to apply the change */ |
de26ea4a42fc
fixed bugs in interface color changing (that was TOTALLY BROKEN and
mf0102 <0102@gmx.at>
parents:
3712
diff
changeset
|
1245 skin_reload_forced(); |
de26ea4a42fc
fixed bugs in interface color changing (that was TOTALLY BROKEN and
mf0102 <0102@gmx.at>
parents:
3712
diff
changeset
|
1246 ui_skinned_window_draw_all(mainwin); |
de26ea4a42fc
fixed bugs in interface color changing (that was TOTALLY BROKEN and
mf0102 <0102@gmx.at>
parents:
3712
diff
changeset
|
1247 ui_skinned_window_draw_all(equalizerwin); |
de26ea4a42fc
fixed bugs in interface color changing (that was TOTALLY BROKEN and
mf0102 <0102@gmx.at>
parents:
3712
diff
changeset
|
1248 ui_skinned_window_draw_all(playlistwin); |
de26ea4a42fc
fixed bugs in interface color changing (that was TOTALLY BROKEN and
mf0102 <0102@gmx.at>
parents:
3712
diff
changeset
|
1249 } |
de26ea4a42fc
fixed bugs in interface color changing (that was TOTALLY BROKEN and
mf0102 <0102@gmx.at>
parents:
3712
diff
changeset
|
1250 |
de26ea4a42fc
fixed bugs in interface color changing (that was TOTALLY BROKEN and
mf0102 <0102@gmx.at>
parents:
3712
diff
changeset
|
1251 static void |
2313 | 1252 on_red_scale_value_changed(GtkHScale *scale, gpointer data) |
1253 { | |
3856
de26ea4a42fc
fixed bugs in interface color changing (that was TOTALLY BROKEN and
mf0102 <0102@gmx.at>
parents:
3712
diff
changeset
|
1254 cfg.colorize_r = gtk_range_get_value(GTK_RANGE(scale)); |
de26ea4a42fc
fixed bugs in interface color changing (that was TOTALLY BROKEN and
mf0102 <0102@gmx.at>
parents:
3712
diff
changeset
|
1255 reload_skin(); |
2313 | 1256 } |
1257 | |
1258 static void | |
1259 on_green_scale_value_changed(GtkHScale *scale, gpointer data) | |
1260 { | |
3856
de26ea4a42fc
fixed bugs in interface color changing (that was TOTALLY BROKEN and
mf0102 <0102@gmx.at>
parents:
3712
diff
changeset
|
1261 cfg.colorize_g = gtk_range_get_value(GTK_RANGE(scale)); |
de26ea4a42fc
fixed bugs in interface color changing (that was TOTALLY BROKEN and
mf0102 <0102@gmx.at>
parents:
3712
diff
changeset
|
1262 reload_skin(); |
2313 | 1263 } |
1264 | |
1265 static void | |
1266 on_blue_scale_value_changed(GtkHScale *scale, gpointer data) | |
1267 { | |
3856
de26ea4a42fc
fixed bugs in interface color changing (that was TOTALLY BROKEN and
mf0102 <0102@gmx.at>
parents:
3712
diff
changeset
|
1268 cfg.colorize_b = gtk_range_get_value(GTK_RANGE(scale)); |
de26ea4a42fc
fixed bugs in interface color changing (that was TOTALLY BROKEN and
mf0102 <0102@gmx.at>
parents:
3712
diff
changeset
|
1269 reload_skin(); |
2313 | 1270 } |
1271 | |
1272 static void | |
1273 on_colorize_close_clicked(GtkButton *button, gpointer data) | |
1274 { | |
3992
50bf02b4f048
correct mf0102's commit a bit
Tomasz Mon <desowin@gmail.com>
parents:
3991
diff
changeset
|
1275 gtk_widget_destroy(colorize_settings); |
50bf02b4f048
correct mf0102's commit a bit
Tomasz Mon <desowin@gmail.com>
parents:
3991
diff
changeset
|
1276 colorize_settings = NULL; |
2313 | 1277 } |
1278 | |
1279 static void | |
1280 on_filepopup_for_tuple_settings_clicked(GtkButton *button, gpointer data) | |
1281 { | |
3990
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1282 gtk_entry_set_text(GTK_ENTRY(filepopup_settings_cover_name_include), cfg.cover_name_include); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1283 gtk_entry_set_text(GTK_ENTRY(filepopup_settings_cover_name_exclude), cfg.cover_name_exclude); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1284 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filepopup_settings_recurse_for_cover), cfg.recurse_for_cover); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1285 gtk_spin_button_set_value(GTK_SPIN_BUTTON(filepopup_settings_recurse_for_cover_depth), cfg.recurse_for_cover_depth); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1286 on_recurse_for_cover_toggled(GTK_TOGGLE_BUTTON(filepopup_settings_recurse_for_cover), filepopup_settings_recurse_for_cover_depth_box); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1287 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filepopup_settings_use_file_cover), cfg.use_file_cover); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1288 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filepopup_settings_showprogressbar), cfg.filepopup_showprogressbar); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1289 gtk_spin_button_set_value(GTK_SPIN_BUTTON(filepopup_settings_delay), cfg.filepopup_delay); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1290 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1291 gtk_widget_show(filepopup_settings); |
2313 | 1292 } |
1293 | |
1294 static void | |
1295 on_filepopup_settings_ok_clicked(GtkButton *button, gpointer data) | |
1296 { | |
3990
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1297 g_free(cfg.cover_name_include); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1298 cfg.cover_name_include = g_strdup(gtk_entry_get_text(GTK_ENTRY(filepopup_settings_cover_name_include))); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1299 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1300 g_free(cfg.cover_name_exclude); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1301 cfg.cover_name_exclude = g_strdup(gtk_entry_get_text(GTK_ENTRY(filepopup_settings_cover_name_exclude))); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1302 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1303 cfg.recurse_for_cover = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filepopup_settings_recurse_for_cover)); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1304 cfg.recurse_for_cover_depth = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(filepopup_settings_recurse_for_cover_depth)); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1305 cfg.use_file_cover = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filepopup_settings_use_file_cover)); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1306 cfg.filepopup_showprogressbar = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filepopup_settings_showprogressbar)); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1307 cfg.filepopup_delay = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(filepopup_settings_delay)); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1308 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1309 gtk_widget_hide(filepopup_settings); |
2313 | 1310 } |
1311 | |
1312 static void | |
1313 on_filepopup_settings_cancel_clicked(GtkButton *button, gpointer data) | |
1314 { | |
1315 gtk_widget_hide(filepopup_settings); | |
1316 } | |
1317 | |
1318 static void | |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1319 on_toggle_button_toggled(GtkToggleButton * button, gboolean *cfg) |
2313 | 1320 { |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1321 *cfg = gtk_toggle_button_get_active(button); |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1322 void (*callback) (void) = g_object_get_data(G_OBJECT(button), "callback"); |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1323 if (callback) callback(); |
4005 | 1324 GtkWidget *child = g_object_get_data(G_OBJECT(button), "child"); |
1325 if (child) gtk_widget_set_sensitive(GTK_WIDGET(child), *cfg); | |
2313 | 1326 } |
1327 | |
1328 static void | |
4001
733820bc7744
some more duplicate code removal
Tomasz Mon <desowin@gmail.com>
parents:
4000
diff
changeset
|
1329 on_toggle_button_realize(GtkToggleButton * button, gboolean *cfg) |
2313 | 1330 { |
4001
733820bc7744
some more duplicate code removal
Tomasz Mon <desowin@gmail.com>
parents:
4000
diff
changeset
|
1331 gtk_toggle_button_set_active(button, *cfg); |
4005 | 1332 GtkWidget *child = g_object_get_data(G_OBJECT(button), "child"); |
1333 if (child) gtk_widget_set_sensitive(GTK_WIDGET(child), *cfg); | |
2313 | 1334 } |
1335 | |
1336 static void | |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1337 show_wm_decorations_cb() |
2313 | 1338 { |
1339 gtk_window_set_decorated(GTK_WINDOW(mainwin), cfg.show_wm_decorations); | |
1340 gtk_window_set_decorated(GTK_WINDOW(playlistwin), cfg.show_wm_decorations); | |
1341 gtk_window_set_decorated(GTK_WINDOW(equalizerwin), cfg.show_wm_decorations); | |
2623 | 1342 } |
1343 | |
1344 static void | |
1345 on_reload_plugins_clicked(GtkButton * button, gpointer data) | |
1346 { | |
1347 /* TBD: should every playlist entry have to be reprobed? | |
1348 * Pointers could come back stale if new plugins are added or | |
1349 * symbol sizes change. - nenolod | |
1350 */ | |
1351 | |
2682
c3cd6e47faf6
[svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents:
2635
diff
changeset
|
1352 bmp_config_save(); |
2623 | 1353 plugin_system_cleanup(); |
2682
c3cd6e47faf6
[svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents:
2635
diff
changeset
|
1354 bmp_config_free(); |
c3cd6e47faf6
[svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents:
2635
diff
changeset
|
1355 bmp_config_load(); |
2623 | 1356 plugin_system_init(); |
2313 | 1357 } |
1358 | |
1359 void | |
3989
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1360 create_colorize_settings(void) |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1361 { |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1362 GtkWidget *vbox; |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1363 GtkWidget *label; |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1364 GtkWidget *table; |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1365 GtkWidget *hbuttonbox; |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1366 GtkWidget *colorize_close; |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1367 |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1368 GtkWidget *green_label; |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1369 GtkWidget *red_label; |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1370 GtkWidget *blue_label; |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1371 |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1372 colorize_settings = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1373 gtk_container_set_border_width(GTK_CONTAINER(colorize_settings), 12); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1374 gtk_window_set_title(GTK_WINDOW(colorize_settings), _("Color Adjustment")); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1375 gtk_window_set_type_hint(GTK_WINDOW(colorize_settings), GDK_WINDOW_TYPE_HINT_DIALOG); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1376 gtk_window_set_transient_for(GTK_WINDOW(colorize_settings), GTK_WINDOW(prefswin)); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1377 |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1378 vbox = gtk_vbox_new(FALSE, 12); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1379 gtk_container_add(GTK_CONTAINER(colorize_settings), vbox); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1380 |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1381 label = gtk_label_new(_("Audacious allows you to alter the color balance of the skinned UI. The sliders below will allow you to do this.")); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1382 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1383 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1384 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1385 |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1386 table = gtk_table_new(3, 2, FALSE); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1387 gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1388 gtk_table_set_row_spacings(GTK_TABLE(table), 6); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1389 gtk_table_set_col_spacings(GTK_TABLE(table), 12); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1390 |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1391 blue_label = gtk_label_new(_("Blue")); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1392 gtk_table_attach(GTK_TABLE(table), blue_label, 0, 1, 2, 3, |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1393 (GtkAttachOptions) (0), |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1394 (GtkAttachOptions) (0), 0, 0); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1395 gtk_label_set_justify(GTK_LABEL(blue_label), GTK_JUSTIFY_RIGHT); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1396 gtk_misc_set_alignment(GTK_MISC(blue_label), 1, 0.5); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1397 |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1398 green_label = gtk_label_new(_("Green")); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1399 gtk_table_attach(GTK_TABLE(table), green_label, 0, 1, 1, 2, |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1400 (GtkAttachOptions) (0), |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1401 (GtkAttachOptions) (0), 0, 0); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1402 gtk_label_set_justify(GTK_LABEL(green_label), GTK_JUSTIFY_RIGHT); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1403 gtk_misc_set_alignment(GTK_MISC(green_label), 1, 0.5); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1404 |
3990
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1405 red_label = gtk_label_new(_("Red")); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1406 gtk_table_attach(GTK_TABLE(table), red_label, 0, 1, 0, 1, |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1407 (GtkAttachOptions) (0), |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1408 (GtkAttachOptions) (0), 0, 0); |
3989
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1409 gtk_label_set_justify(GTK_LABEL(red_label), GTK_JUSTIFY_RIGHT); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1410 gtk_misc_set_alignment(GTK_MISC(red_label), 1, 0.5); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1411 |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1412 red_scale = gtk_hscale_new(GTK_ADJUSTMENT(gtk_adjustment_new(0, 0, 255, 0, 0, 0))); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1413 gtk_table_attach(GTK_TABLE(table), red_scale, 1, 2, 0, 1, |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1414 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1415 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1416 gtk_scale_set_draw_value(GTK_SCALE(red_scale), FALSE); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1417 gtk_scale_set_digits(GTK_SCALE(red_scale), 3); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1418 |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1419 green_scale = gtk_hscale_new(GTK_ADJUSTMENT(gtk_adjustment_new(0, 0, 255, 0, 0, 0))); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1420 gtk_table_attach(GTK_TABLE(table), green_scale, 1, 2, 1, 2, |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1421 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1422 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1423 gtk_scale_set_draw_value(GTK_SCALE(green_scale), FALSE); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1424 gtk_scale_set_digits(GTK_SCALE(green_scale), 3); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1425 |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1426 blue_scale = gtk_hscale_new(GTK_ADJUSTMENT(gtk_adjustment_new(0, 0, 255, 0, 0, 0))); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1427 gtk_table_attach(GTK_TABLE(table), blue_scale, 1, 2, 2, 3, |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1428 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1429 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1430 gtk_scale_set_draw_value(GTK_SCALE(blue_scale), FALSE); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1431 gtk_scale_set_digits(GTK_SCALE(blue_scale), 3); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1432 |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1433 hbuttonbox = gtk_hbutton_box_new(); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1434 gtk_box_pack_start(GTK_BOX(vbox), hbuttonbox, FALSE, FALSE, 0); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1435 gtk_button_box_set_layout(GTK_BUTTON_BOX(hbuttonbox), GTK_BUTTONBOX_END); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1436 gtk_box_set_spacing(GTK_BOX(hbuttonbox), 6); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1437 |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1438 colorize_close = gtk_button_new_from_stock("gtk-close"); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1439 gtk_container_add(GTK_CONTAINER(hbuttonbox), colorize_close); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1440 GTK_WIDGET_SET_FLAGS(colorize_close, GTK_CAN_DEFAULT); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1441 |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1442 g_signal_connect((gpointer) red_scale, "value_changed", |
3993 | 1443 G_CALLBACK(on_red_scale_value_changed), |
3989
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1444 NULL); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1445 g_signal_connect((gpointer) green_scale, "value_changed", |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1446 G_CALLBACK(on_green_scale_value_changed), |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1447 NULL); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1448 g_signal_connect((gpointer) blue_scale, "value_changed", |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1449 G_CALLBACK(on_blue_scale_value_changed), |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1450 NULL); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1451 g_signal_connect((gpointer) colorize_close, "clicked", |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1452 G_CALLBACK(on_colorize_close_clicked), |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1453 NULL); |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1454 |
3991
d6ac99c2be1d
destroy colorize settings upon closing
mf0102 <0102@gmx.at>
parents:
3990
diff
changeset
|
1455 gtk_range_set_value(GTK_RANGE(red_scale), cfg.colorize_r); |
d6ac99c2be1d
destroy colorize settings upon closing
mf0102 <0102@gmx.at>
parents:
3990
diff
changeset
|
1456 gtk_range_set_value(GTK_RANGE(green_scale), cfg.colorize_g); |
d6ac99c2be1d
destroy colorize settings upon closing
mf0102 <0102@gmx.at>
parents:
3990
diff
changeset
|
1457 gtk_range_set_value(GTK_RANGE(blue_scale), cfg.colorize_b); |
d6ac99c2be1d
destroy colorize settings upon closing
mf0102 <0102@gmx.at>
parents:
3990
diff
changeset
|
1458 |
3989
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1459 gtk_widget_grab_default(colorize_close); |
3991
d6ac99c2be1d
destroy colorize settings upon closing
mf0102 <0102@gmx.at>
parents:
3990
diff
changeset
|
1460 gtk_widget_show_all(colorize_settings); |
3989
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1461 } |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1462 |
6faed0cdc276
colorize_popup is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3985
diff
changeset
|
1463 void |
3990
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1464 create_filepopup_settings(void) |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1465 { |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1466 GtkWidget *vbox; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1467 GtkWidget *table; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1468 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1469 GtkWidget *label_cover_retrieve; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1470 GtkWidget *label_cover_search; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1471 GtkWidget *label_exclude; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1472 GtkWidget *label_include; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1473 GtkWidget *label_search_depth; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1474 GtkWidget *label_misc; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1475 GtkWidget *label_delay; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1476 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1477 GtkObject *recurse_for_cover_depth_adj; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1478 GtkObject *delay_adj; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1479 GtkWidget *alignment; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1480 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1481 GtkWidget *hbox; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1482 GtkWidget *hbuttonbox; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1483 GtkWidget *btn_cancel; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1484 GtkWidget *btn_ok; |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1485 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1486 filepopup_settings = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1487 gtk_container_set_border_width(GTK_CONTAINER(filepopup_settings), 12); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1488 gtk_window_set_title(GTK_WINDOW(filepopup_settings), _("Popup Information Settings")); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1489 gtk_window_set_position(GTK_WINDOW(filepopup_settings), GTK_WIN_POS_CENTER_ON_PARENT); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1490 gtk_window_set_skip_taskbar_hint(GTK_WINDOW(filepopup_settings), TRUE); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1491 gtk_window_set_type_hint(GTK_WINDOW(filepopup_settings), GDK_WINDOW_TYPE_HINT_DIALOG); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1492 gtk_window_set_transient_for(GTK_WINDOW(filepopup_settings), GTK_WINDOW(prefswin)); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1493 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1494 vbox = gtk_vbox_new(FALSE, 12); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1495 gtk_container_add(GTK_CONTAINER(filepopup_settings), vbox); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1496 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1497 label_cover_retrieve = gtk_label_new(_("<b>Cover image retrieve</b>")); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1498 gtk_box_pack_start(GTK_BOX(vbox), label_cover_retrieve, FALSE, FALSE, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1499 gtk_label_set_use_markup(GTK_LABEL(label_cover_retrieve), TRUE); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1500 gtk_misc_set_alignment(GTK_MISC(label_cover_retrieve), 0, 0.5); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1501 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1502 label_cover_search = gtk_label_new(_("While searching for the album's cover, Audacious looks for certain words in the filename. You can specify those words in the lists below, separated using commas.")); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1503 gtk_box_pack_start(GTK_BOX(vbox), label_cover_search, FALSE, FALSE, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1504 gtk_label_set_line_wrap(GTK_LABEL(label_cover_search), TRUE); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1505 gtk_misc_set_alignment(GTK_MISC(label_cover_search), 0, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1506 gtk_misc_set_padding(GTK_MISC(label_cover_search), 12, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1507 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1508 table = gtk_table_new(2, 2, FALSE); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1509 gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1510 gtk_table_set_row_spacings(GTK_TABLE(table), 4); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1511 gtk_table_set_col_spacings(GTK_TABLE(table), 4); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1512 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1513 filepopup_settings_cover_name_include = gtk_entry_new(); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1514 gtk_table_attach(GTK_TABLE(table), filepopup_settings_cover_name_include, 1, 2, 0, 1, |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1515 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1516 (GtkAttachOptions) (0), 0, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1517 gtk_entry_set_activates_default(GTK_ENTRY(filepopup_settings_cover_name_include), TRUE); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1518 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1519 label_exclude = gtk_label_new(_("Exclude:")); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1520 gtk_table_attach(GTK_TABLE(table), label_exclude, 0, 1, 1, 2, |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1521 (GtkAttachOptions) (0), |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1522 (GtkAttachOptions) (0), 0, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1523 gtk_misc_set_alignment(GTK_MISC(label_exclude), 0, 0.5); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1524 gtk_misc_set_padding(GTK_MISC(label_exclude), 12, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1525 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1526 label_include = gtk_label_new(_("Include:")); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1527 gtk_table_attach(GTK_TABLE(table), label_include, 0, 1, 0, 1, |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1528 (GtkAttachOptions) (0), |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1529 (GtkAttachOptions) (0), 0, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1530 gtk_misc_set_alignment(GTK_MISC(label_include), 0, 0.5); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1531 gtk_misc_set_padding(GTK_MISC(label_include), 12, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1532 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1533 filepopup_settings_cover_name_exclude = gtk_entry_new(); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1534 gtk_table_attach(GTK_TABLE(table), filepopup_settings_cover_name_exclude, 1, 2, 1, 2, |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1535 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1536 (GtkAttachOptions) (0), 0, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1537 gtk_entry_set_activates_default(GTK_ENTRY(filepopup_settings_cover_name_exclude), TRUE); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1538 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1539 alignment = gtk_alignment_new(0.5, 0.5, 1, 1); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1540 gtk_box_pack_start(GTK_BOX(vbox), alignment, TRUE, TRUE, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1541 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, 12, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1542 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1543 filepopup_settings_recurse_for_cover = gtk_check_button_new_with_mnemonic(_("Recursively search for cover")); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1544 gtk_container_add(GTK_CONTAINER(alignment), filepopup_settings_recurse_for_cover); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1545 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1546 alignment = gtk_alignment_new(0.5, 0.5, 1, 1); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1547 gtk_box_pack_start(GTK_BOX(vbox), alignment, FALSE, FALSE, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1548 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, 45, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1549 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1550 filepopup_settings_recurse_for_cover_depth_box = gtk_hbox_new(FALSE, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1551 gtk_container_add(GTK_CONTAINER(alignment), filepopup_settings_recurse_for_cover_depth_box); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1552 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1553 label_search_depth = gtk_label_new(_("Search depth: ")); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1554 gtk_box_pack_start(GTK_BOX(filepopup_settings_recurse_for_cover_depth_box), label_search_depth, TRUE, TRUE, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1555 gtk_misc_set_padding(GTK_MISC(label_search_depth), 4, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1556 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1557 recurse_for_cover_depth_adj = gtk_adjustment_new(0, 0, 100, 1, 10, 10); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1558 filepopup_settings_recurse_for_cover_depth = gtk_spin_button_new(GTK_ADJUSTMENT(recurse_for_cover_depth_adj), 1, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1559 gtk_box_pack_start(GTK_BOX(filepopup_settings_recurse_for_cover_depth_box), filepopup_settings_recurse_for_cover_depth, TRUE, TRUE, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1560 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(filepopup_settings_recurse_for_cover_depth), TRUE); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1561 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1562 alignment = gtk_alignment_new(0.5, 0.5, 1, 1); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1563 gtk_box_pack_start(GTK_BOX(vbox), alignment, TRUE, TRUE, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1564 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, 12, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1565 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1566 filepopup_settings_use_file_cover = gtk_check_button_new_with_mnemonic(_("Use per-file cover")); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1567 gtk_container_add(GTK_CONTAINER(alignment), filepopup_settings_use_file_cover); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1568 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1569 label_misc = gtk_label_new(_("<b>Miscellaneous</b>")); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1570 gtk_box_pack_start(GTK_BOX(vbox), label_misc, FALSE, FALSE, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1571 gtk_label_set_use_markup(GTK_LABEL(label_misc), TRUE); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1572 gtk_misc_set_alignment(GTK_MISC(label_misc), 0, 0.5); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1573 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1574 alignment = gtk_alignment_new(0.5, 0.5, 1, 1); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1575 gtk_box_pack_start(GTK_BOX(vbox), alignment, FALSE, FALSE, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1576 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, 12, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1577 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1578 filepopup_settings_showprogressbar = gtk_check_button_new_with_mnemonic(_("Show Progress bar for the current track")); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1579 gtk_container_add(GTK_CONTAINER(alignment), filepopup_settings_showprogressbar); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1580 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1581 alignment = gtk_alignment_new(0, 0.5, 1, 1); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1582 gtk_box_pack_start(GTK_BOX(vbox), alignment, TRUE, TRUE, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1583 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, 12, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1584 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1585 hbox = gtk_hbox_new(FALSE, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1586 gtk_container_add(GTK_CONTAINER(alignment), hbox); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1587 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1588 label_delay = gtk_label_new(_("Delay until filepopup comes up: ")); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1589 gtk_box_pack_start(GTK_BOX(hbox), label_delay, TRUE, TRUE, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1590 gtk_misc_set_alignment(GTK_MISC(label_delay), 0, 0.5); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1591 gtk_misc_set_padding(GTK_MISC(label_delay), 12, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1592 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1593 delay_adj = gtk_adjustment_new(0, 0, 100, 1, 10, 10); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1594 filepopup_settings_delay = gtk_spin_button_new(GTK_ADJUSTMENT(delay_adj), 1, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1595 gtk_box_pack_start(GTK_BOX(hbox), filepopup_settings_delay, TRUE, TRUE, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1596 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(filepopup_settings_delay), TRUE); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1597 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1598 hbuttonbox = gtk_hbutton_box_new(); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1599 gtk_box_pack_start(GTK_BOX(vbox), hbuttonbox, FALSE, FALSE, 0); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1600 gtk_button_box_set_layout(GTK_BUTTON_BOX(hbuttonbox), GTK_BUTTONBOX_END); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1601 gtk_box_set_spacing(GTK_BOX(hbuttonbox), 6); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1602 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1603 btn_cancel = gtk_button_new_from_stock("gtk-cancel"); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1604 gtk_container_add(GTK_CONTAINER(hbuttonbox), btn_cancel); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1605 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1606 btn_ok = gtk_button_new_from_stock("gtk-ok"); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1607 gtk_container_add(GTK_CONTAINER(hbuttonbox), btn_ok); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1608 GTK_WIDGET_SET_FLAGS(btn_ok, GTK_CAN_DEFAULT); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1609 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1610 g_signal_connect(G_OBJECT(filepopup_settings), "delete_event", |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1611 G_CALLBACK(gtk_widget_hide_on_delete), |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1612 NULL); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1613 g_signal_connect(G_OBJECT(btn_cancel), "clicked", |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1614 G_CALLBACK(on_filepopup_settings_cancel_clicked), |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1615 NULL); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1616 g_signal_connect(G_OBJECT(btn_ok), "clicked", |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1617 G_CALLBACK(on_filepopup_settings_ok_clicked), |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1618 NULL); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1619 g_signal_connect(G_OBJECT(filepopup_settings_recurse_for_cover), "toggled", |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1620 G_CALLBACK(on_recurse_for_cover_toggled), |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1621 filepopup_settings_recurse_for_cover_depth_box); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1622 |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1623 gtk_widget_grab_default(btn_ok); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1624 gtk_widget_show_all(vbox); |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1625 } |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1626 |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1627 /* it's at early stage */ |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1628 static void |
4033 | 1629 create_widgets(GtkBox *box, preferences_widget_t* widgets, gint amt) |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1630 { |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1631 int x; |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1632 GtkWidget *alignment = NULL, *widget = NULL; |
4005 | 1633 GtkWidget *child_box = NULL; |
1634 GSList *radio_btn_group = NULL; | |
4007 | 1635 int table_line=0; /* used for WIDGET_SPIN_BTN */ |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1636 |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1637 for (x = 0; x < amt; ++x) { |
4005 | 1638 if (widgets[x].child) { /* perhaps this logic can be better */ |
1639 if (!child_box) { | |
1640 child_box = gtk_vbox_new(FALSE, 0); | |
1641 g_object_set_data(G_OBJECT(widget), "child", child_box); | |
1642 alignment = gtk_alignment_new (0.5, 0.5, 1, 1); | |
1643 gtk_box_pack_start(box, alignment, FALSE, FALSE, 0); | |
1644 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 24, 0); | |
1645 gtk_container_add (GTK_CONTAINER (alignment), child_box); | |
4007 | 1646 } |
4005 | 1647 } else |
1648 child_box = NULL; | |
1649 | |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1650 alignment = gtk_alignment_new (0.5, 0.5, 1, 1); |
4007 | 1651 gtk_box_pack_start(child_box ? GTK_BOX(child_box) : box, alignment, FALSE, FALSE, 0); |
4005 | 1652 |
1653 if (radio_btn_group && widgets[x].type != WIDGET_RADIO_BTN) | |
1654 radio_btn_group = NULL; | |
4003 | 1655 |
1656 switch(widgets[x].type) { | |
1657 case WIDGET_CHK_BTN: | |
1658 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, 12, 0); | |
4008 | 1659 widget = gtk_check_button_new_with_mnemonic(_(widgets[x].label)); |
4003 | 1660 g_object_set_data(G_OBJECT(widget), "callback", widgets[x].callback); |
1661 g_signal_connect(G_OBJECT(widget), "toggled", | |
1662 G_CALLBACK(on_toggle_button_toggled), | |
1663 widgets[x].cfg); | |
1664 g_signal_connect(G_OBJECT(widget), "realize", | |
1665 G_CALLBACK(on_toggle_button_realize), | |
1666 widgets[x].cfg); | |
1667 break; | |
1668 case WIDGET_LABEL: | |
1669 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 12, 6, 0, 0); | |
4008 | 1670 widget = gtk_label_new_with_mnemonic(_(widgets[x].label)); |
4003 | 1671 gtk_label_set_use_markup(GTK_LABEL(widget), TRUE); |
1672 gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5); | |
1673 break; | |
4005 | 1674 case WIDGET_RADIO_BTN: |
4008 | 1675 widget = gtk_radio_button_new_with_mnemonic(radio_btn_group, _(widgets[x].label)); |
4005 | 1676 radio_btn_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (widget)); |
1677 g_signal_connect(G_OBJECT(widget), "toggled", | |
1678 G_CALLBACK(on_toggle_button_toggled), | |
1679 widgets[x].cfg); | |
1680 g_signal_connect(G_OBJECT(widget), "realize", | |
1681 G_CALLBACK(on_toggle_button_realize), | |
1682 widgets[x].cfg); | |
1683 break; | |
4007 | 1684 case WIDGET_SPIN_BTN: |
1685 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 12, 0); | |
1686 | |
1687 if (x > 1 && widgets[x-1].type == WIDGET_SPIN_BTN) { | |
1688 table_line++; | |
1689 } else { | |
1690 /* check how many WIDGET_SPIN_BTNs are there */ | |
1691 gint lines = 0, i; | |
1692 for (i=x; i<amt && widgets[i].type == WIDGET_SPIN_BTN; i++) | |
1693 lines++; | |
1694 | |
1695 widget = gtk_table_new(lines, 3, FALSE); | |
1696 gtk_table_set_row_spacings(GTK_TABLE(widget), 6); | |
1697 table_line=0; | |
1698 } | |
1699 | |
4008 | 1700 GtkWidget *label_pre = gtk_label_new(_(widgets[x].label)); |
4007 | 1701 gtk_table_attach(GTK_TABLE (widget), label_pre, 0, 1, table_line, table_line+1, |
1702 (GtkAttachOptions) (0), | |
1703 (GtkAttachOptions) (0), 0, 0); | |
1704 gtk_misc_set_alignment(GTK_MISC(label_pre), 0, 0.5); | |
1705 gtk_misc_set_padding(GTK_MISC(label_pre), 4, 0); | |
1706 | |
1707 GtkObject *adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10); | |
1708 GtkWidget *spin_btn = gtk_spin_button_new(GTK_ADJUSTMENT(adj), 1, 0); | |
1709 gtk_table_attach(GTK_TABLE(widget), spin_btn, 1, 2, table_line, table_line+1, | |
1710 (GtkAttachOptions) (0), | |
1711 (GtkAttachOptions) (0), 4, 0); | |
1712 | |
1713 if (widgets[x].tooltip) { | |
4008 | 1714 GtkWidget *label_past = gtk_label_new(_(widgets[x].tooltip)); |
4007 | 1715 gtk_table_attach(GTK_TABLE(widget), label_past, 2, 3, table_line, table_line+1, |
1716 (GtkAttachOptions) (0), | |
1717 (GtkAttachOptions) (0), 0, 0); | |
1718 gtk_misc_set_alignment(GTK_MISC(label_past), 0, 0.5); | |
1719 gtk_misc_set_padding(GTK_MISC(label_past), 4, 0); | |
1720 } | |
1721 | |
1722 g_signal_connect(G_OBJECT(spin_btn), "value_changed", | |
1723 G_CALLBACK(on_spin_btn_changed), | |
1724 widgets[x].cfg); | |
1725 g_signal_connect(G_OBJECT(spin_btn), "realize", | |
1726 G_CALLBACK(on_spin_btn_realize), | |
1727 widgets[x].cfg); | |
1728 break; | |
4006 | 1729 case WIDGET_CHARDET_TABLE: |
1730 widget = gtk_table_new(2, 2, FALSE); | |
1731 GtkWidget *label; | |
1732 | |
1733 label = gtk_label_new(_("Auto character encoding detector for:")); | |
1734 gtk_table_attach(GTK_TABLE(widget), label, 0, 1, 0, 1, | |
1735 (GtkAttachOptions) (0), | |
1736 (GtkAttachOptions) (0), 0, 0); | |
1737 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT); | |
1738 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); | |
1739 | |
1740 GtkWidget *combobox = gtk_combo_box_new_text(); | |
1741 gtk_table_attach(GTK_TABLE(widget), combobox, 1, 2, 0, 1, | |
1742 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
1743 (GtkAttachOptions) (0), 0, 0); | |
1744 g_signal_connect_after(G_OBJECT(combobox), "realize", | |
1745 G_CALLBACK(on_chardet_detector_cbox_realize), | |
1746 NULL); | |
1747 | |
1748 GtkWidget *entry = gtk_entry_new(); | |
1749 gtk_table_attach(GTK_TABLE(widget), entry, 1, 2, 1, 2, | |
1750 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
1751 (GtkAttachOptions) (0), 0, 0); | |
1752 gtk_tooltips_set_tip (tooltips, entry, _("List of character encodings used for fall back conversion of metadata. If automatic character encoding detector failed or has been disabled, encodings in this list would be treated as candidates of the encoding of metadata, and fall back conversion from these encodings to UTF-8 would be attempted."), NULL); | |
1753 | |
1754 label = gtk_label_new(_("Fallback character encodings:")); | |
1755 gtk_table_attach(GTK_TABLE(widget), label, 0, 1, 1, 2, | |
1756 (GtkAttachOptions) (0), | |
1757 (GtkAttachOptions) (0), 0, 0); | |
1758 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT); | |
1759 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); | |
1760 | |
1761 g_signal_connect(G_OBJECT(entry), "changed", | |
1762 G_CALLBACK(on_chardet_fallback_changed), | |
1763 NULL); | |
1764 g_signal_connect_after(G_OBJECT(entry), "realize", | |
1765 G_CALLBACK(on_chardet_fallback_realize), | |
1766 NULL); | |
1767 | |
1768 break; | |
4003 | 1769 default: |
4006 | 1770 /* shouldn't ever happen - expect things to break */ |
4003 | 1771 continue; |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1772 } |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1773 |
4007 | 1774 if (widget && !gtk_widget_get_parent(widget)) |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1775 gtk_container_add(GTK_CONTAINER(alignment), widget); |
4007 | 1776 if (widgets[x].tooltip && widgets[x].type != WIDGET_SPIN_BTN) |
4008 | 1777 gtk_tooltips_set_tip(tooltips, widget, _(widgets[x].tooltip), NULL); |
4002
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1778 } |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1779 |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1780 } |
d203c51d94bb
you might like it or not, beginning of making preferences more friendly
Tomasz Mon <desowin@gmail.com>
parents:
4001
diff
changeset
|
1781 |
3990
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
1782 void |
2313 | 1783 create_prefs_window(void) |
1784 { | |
2467 | 1785 gchar *aud_version_string; |
2313 | 1786 |
1787 GtkWidget *titlestring_tag_menu, *menu_item; | |
1788 guint i; | |
3993 | 1789 |
1790 GtkWidget *vbox; | |
1791 GtkWidget *hbox1; | |
1792 GtkWidget *scrolledwindow6; | |
1793 GtkWidget *plugin_page_vbox; | |
1794 GtkWidget *plugin_notebook; | |
1795 GtkWidget *plugin_input_vbox; | |
1796 GtkWidget *alignment43; | |
1797 GtkWidget *input_plugin_list_label; | |
1798 GtkWidget *scrolledwindow3; | |
1799 GtkWidget *input_plugin_view; | |
1800 GtkWidget *input_plugin_button_box; | |
1801 GtkWidget *input_plugin_prefs; | |
1802 GtkWidget *input_plugin_info; | |
1803 GtkWidget *plugin_input_label; | |
1804 GtkWidget *plugin_general_vbox; | |
1805 GtkWidget *alignment45; | |
1806 GtkWidget *label11; | |
1807 GtkWidget *scrolledwindow5; | |
1808 GtkWidget *general_plugin_view; | |
1809 GtkWidget *general_plugin_button_box; | |
1810 GtkWidget *general_plugin_prefs; | |
1811 GtkWidget *general_plugin_info; | |
1812 GtkWidget *plugin_general_label; | |
1813 GtkWidget *vbox21; | |
1814 GtkWidget *alignment46; | |
1815 GtkWidget *label53; | |
1816 GtkWidget *scrolledwindow7; | |
1817 GtkWidget *vis_plugin_view; | |
1818 GtkWidget *hbuttonbox6; | |
1819 GtkWidget *vis_plugin_prefs; | |
1820 GtkWidget *vis_plugin_info; | |
1821 GtkWidget *vis_label; | |
1822 GtkWidget *vbox25; | |
1823 GtkWidget *alignment58; | |
1824 GtkWidget *label64; | |
1825 GtkWidget *scrolledwindow9; | |
1826 GtkWidget *effect_plugin_view; | |
1827 GtkWidget *hbuttonbox9; | |
1828 GtkWidget *effect_plugin_prefs; | |
1829 GtkWidget *effect_plugin_info; | |
1830 GtkWidget *effects_label; | |
1831 GtkWidget *plugin_label; | |
1832 GtkWidget *appearance_page_vbox; | |
1833 GtkWidget *vbox37; | |
1834 GtkWidget *vbox38; | |
1835 GtkWidget *hbox12; | |
1836 GtkWidget *alignment94; | |
1837 GtkWidget *hbox13; | |
1838 GtkWidget *label103; | |
1839 GtkWidget *colorspace_button; | |
1840 GtkWidget *image11; | |
1841 GtkWidget *image12; | |
1842 GtkWidget *alignment95; | |
1843 GtkWidget *skin_view_scrolled_window; | |
1844 GtkWidget *vbox39; | |
1845 GtkWidget *alignment96; | |
1846 GtkWidget *label104; | |
1847 GtkWidget *table14; | |
1848 GtkWidget *alignment97; | |
1849 GtkWidget *label105; | |
1850 GtkWidget *alignment98; | |
1851 GtkWidget *label106; | |
1852 GtkWidget *fontbutton1; | |
1853 GtkWidget *fontbutton2; | |
1854 GtkWidget *alignment99; | |
1855 GtkWidget *checkbutton11; | |
1856 GtkWidget *vbox40; | |
1857 GtkWidget *appearance_label; | |
1858 GtkWidget *mouse_page_vbox; | |
1859 GtkWidget *vbox20; | |
1860 GtkWidget *mouse_label; | |
1861 GtkWidget *playlist_page_vbox; | |
1862 GtkWidget *vbox5; | |
1863 GtkWidget *alignment55; | |
1864 GtkWidget *label60; | |
1865 GtkWidget *alignment56; | |
1866 GtkWidget *table6; | |
1867 GtkWidget *titlestring_help_button; | |
1868 GtkWidget *image1; | |
1869 GtkWidget *titlestring_cbox; | |
1870 GtkWidget *label62; | |
1871 GtkWidget *label61; | |
1872 GtkWidget *alignment85; | |
1873 GtkWidget *label84; | |
1874 GtkWidget *alignment86; | |
1875 GtkWidget *hbox9; | |
1876 GtkWidget *vbox34; | |
1877 GtkWidget *checkbutton10; | |
1878 GtkWidget *image8; | |
1879 GtkWidget *playlist_label; | |
1880 GtkWidget *equalizer_page_vbox; | |
1881 GtkWidget *alignment28; | |
1882 GtkWidget *vbox22; | |
1883 GtkWidget *alignment30; | |
1884 GtkWidget *equalizer_page_label; | |
1885 GtkWidget *vbox23; | |
1886 GtkWidget *alignment33; | |
1887 GtkWidget *table5; | |
1888 GtkWidget *label58; | |
1889 GtkWidget *label57; | |
1890 GtkWidget *eq_file_preset_entry; | |
1891 GtkWidget *eq_dir_preset_entry; | |
1892 GtkWidget *equalizer_label; | |
1893 GtkWidget *connectivity_page_vbox; | |
1894 GtkWidget *vbox29; | |
1895 GtkWidget *alignment63; | |
1896 GtkWidget *connectivity_page_label; | |
1897 GtkWidget *alignment68; | |
1898 GtkWidget *vbox30; | |
1899 GtkWidget *alignment65; | |
1900 GtkWidget *proxy_use; | |
1901 GtkWidget *table8; | |
1902 GtkWidget *proxy_port; | |
1903 GtkWidget *proxy_host; | |
1904 GtkWidget *label69; | |
1905 GtkWidget *label68; | |
1906 GtkWidget *alignment67; | |
1907 GtkWidget *proxy_auth; | |
1908 GtkWidget *table9; | |
1909 GtkWidget *proxy_pass; | |
1910 GtkWidget *proxy_user; | |
1911 GtkWidget *label71; | |
1912 GtkWidget *label70; | |
1913 GtkWidget *alignment72; | |
1914 GtkWidget *hbox6; | |
1915 GtkWidget *image4; | |
1916 GtkWidget *label75; | |
1917 GtkWidget *label95; | |
1918 GtkWidget *empty_notebook_page; | |
1919 GtkWidget *label96; | |
1920 GtkWidget *audio_scrolled_window; | |
1921 GtkWidget *audio_page_viewport; | |
1922 GtkWidget *audio_page_vbox; | |
1923 GtkWidget *alignment74; | |
1924 GtkWidget *label77; | |
1925 GtkWidget *alignment73; | |
1926 GtkWidget *vbox33; | |
1927 GtkWidget *table11; | |
1928 GtkWidget *image7; | |
1929 GtkWidget *label79; | |
1930 GtkWidget *label82; | |
1931 GtkObject *output_plugin_bufsize_adj; | |
1932 GtkWidget *output_plugin_bufsize; | |
1933 GtkWidget *output_plugin_cbox; | |
1934 GtkWidget *label78; | |
1935 GtkWidget *alignment82; | |
1936 GtkWidget *output_plugin_button_box; | |
1937 GtkWidget *output_plugin_prefs; | |
1938 GtkWidget *alignment76; | |
1939 GtkWidget *hbox7; | |
1940 GtkWidget *image5; | |
1941 GtkWidget *label80; | |
1942 GtkWidget *output_plugin_info; | |
1943 GtkWidget *alignment77; | |
1944 GtkWidget *hbox8; | |
1945 GtkWidget *image6; | |
1946 GtkWidget *label81; | |
1947 GtkWidget *alignment90; | |
1948 GtkWidget *label93; | |
1949 GtkWidget *alignment92; | |
1950 GtkWidget *enable_src; | |
1951 GtkWidget *alignment91; | |
1952 GtkWidget *vbox36; | |
1953 GtkWidget *table13; | |
1954 GtkWidget *src_converter_type; | |
1955 GtkWidget *label94; | |
1956 GtkWidget *label92; | |
1957 GtkWidget *image9; | |
1958 GtkObject *src_rate_adj; | |
1959 GtkWidget *src_rate; | |
1960 GtkWidget *label91; | |
1961 GtkWidget *alignment4; | |
1962 GtkWidget *label2; | |
1963 GtkWidget *alignment7; | |
1964 GtkWidget *software_volume_control; | |
1965 GtkWidget *hseparator1; | |
1966 GtkWidget *hbox4; | |
1967 GtkWidget *audversionlabel; | |
1968 GtkWidget *prefswin_button_box; | |
1969 GtkWidget *reload_plugins; | |
1970 GtkWidget *alignment93; | |
1971 GtkWidget *hbox11; | |
1972 GtkWidget *image10; | |
1973 GtkWidget *label102; | |
1974 GtkWidget *close; | |
1975 GtkAccelGroup *accel_group; | |
1976 | |
1977 tooltips = gtk_tooltips_new (); | |
1978 | |
1979 accel_group = gtk_accel_group_new (); | |
1980 | |
1981 prefswin = gtk_window_new (GTK_WINDOW_TOPLEVEL); | |
1982 gtk_container_set_border_width (GTK_CONTAINER (prefswin), 12); | |
1983 gtk_window_set_title (GTK_WINDOW (prefswin), _("Audacious Preferences")); | |
1984 gtk_window_set_position (GTK_WINDOW (prefswin), GTK_WIN_POS_CENTER); | |
1985 gtk_window_set_default_size (GTK_WINDOW (prefswin), 680, 400); | |
1986 | |
1987 vbox = gtk_vbox_new (FALSE, 0); | |
1988 gtk_container_add (GTK_CONTAINER (prefswin), vbox); | |
1989 | |
1990 hbox1 = gtk_hbox_new (FALSE, 8); | |
1991 gtk_box_pack_start (GTK_BOX (vbox), hbox1, TRUE, TRUE, 0); | |
1992 | |
1993 scrolledwindow6 = gtk_scrolled_window_new (NULL, NULL); | |
1994 gtk_box_pack_start (GTK_BOX (hbox1), scrolledwindow6, TRUE, TRUE, 0); | |
1995 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow6), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1996 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow6), GTK_SHADOW_IN); | |
1997 | |
1998 category_treeview = gtk_tree_view_new (); | |
1999 gtk_container_add (GTK_CONTAINER (scrolledwindow6), category_treeview); | |
2000 gtk_widget_set_size_request (category_treeview, 172, -1); | |
2001 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (category_treeview), FALSE); | |
2002 | |
2003 category_notebook = gtk_notebook_new (); | |
2004 gtk_box_pack_start (GTK_BOX (hbox1), category_notebook, TRUE, TRUE, 0); | |
2005 GTK_WIDGET_UNSET_FLAGS (category_notebook, GTK_CAN_FOCUS); | |
2006 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (category_notebook), FALSE); | |
2007 gtk_notebook_set_show_border (GTK_NOTEBOOK (category_notebook), FALSE); | |
2008 gtk_notebook_set_scrollable (GTK_NOTEBOOK (category_notebook), TRUE); | |
2009 | |
2010 plugin_page_vbox = gtk_vbox_new (FALSE, 0); | |
2011 gtk_container_add (GTK_CONTAINER (category_notebook), plugin_page_vbox); | |
2012 | |
2013 plugin_notebook = gtk_notebook_new (); | |
2014 gtk_box_pack_start (GTK_BOX (plugin_page_vbox), plugin_notebook, TRUE, TRUE, 0); | |
2015 gtk_notebook_set_show_border (GTK_NOTEBOOK (plugin_notebook), FALSE); | |
2016 | |
2017 plugin_input_vbox = gtk_vbox_new (FALSE, 0); | |
2018 gtk_container_add (GTK_CONTAINER (plugin_notebook), plugin_input_vbox); | |
2019 gtk_container_set_border_width (GTK_CONTAINER (plugin_input_vbox), 12); | |
2020 | |
2021 alignment43 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2022 gtk_box_pack_start (GTK_BOX (plugin_input_vbox), alignment43, FALSE, FALSE, 4); | |
2023 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment43), 0, 6, 0, 0); | |
2024 | |
2025 input_plugin_list_label = gtk_label_new_with_mnemonic (_("_Decoder list:")); | |
2026 gtk_container_add (GTK_CONTAINER (alignment43), input_plugin_list_label); | |
2027 gtk_label_set_use_markup (GTK_LABEL (input_plugin_list_label), TRUE); | |
2028 gtk_misc_set_alignment (GTK_MISC (input_plugin_list_label), 0, 0.5); | |
2029 | |
2030 scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL); | |
2031 gtk_box_pack_start (GTK_BOX (plugin_input_vbox), scrolledwindow3, TRUE, TRUE, 0); | |
2032 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
2033 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_SHADOW_IN); | |
2034 | |
2035 input_plugin_view = gtk_tree_view_new (); | |
2036 gtk_container_add (GTK_CONTAINER (scrolledwindow3), input_plugin_view); | |
2037 gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (input_plugin_view), TRUE); | |
2038 gtk_tree_view_set_reorderable (GTK_TREE_VIEW (input_plugin_view), TRUE); | |
2039 | |
2040 input_plugin_button_box = gtk_hbutton_box_new (); | |
2041 gtk_box_pack_start (GTK_BOX (plugin_input_vbox), input_plugin_button_box, FALSE, FALSE, 8); | |
2042 gtk_button_box_set_layout (GTK_BUTTON_BOX (input_plugin_button_box), GTK_BUTTONBOX_START); | |
2043 gtk_box_set_spacing (GTK_BOX (input_plugin_button_box), 8); | |
2044 | |
2045 input_plugin_prefs = gtk_button_new_from_stock ("gtk-preferences"); | |
2046 gtk_container_add (GTK_CONTAINER (input_plugin_button_box), input_plugin_prefs); | |
2047 gtk_widget_set_sensitive (input_plugin_prefs, FALSE); | |
2048 GTK_WIDGET_SET_FLAGS (input_plugin_prefs, GTK_CAN_DEFAULT); | |
2049 | |
2050 input_plugin_info = gtk_button_new_from_stock ("gtk-dialog-info"); | |
2051 gtk_container_add (GTK_CONTAINER (input_plugin_button_box), input_plugin_info); | |
2052 gtk_widget_set_sensitive (input_plugin_info, FALSE); | |
2053 GTK_WIDGET_SET_FLAGS (input_plugin_info, GTK_CAN_DEFAULT); | |
2054 | |
2055 plugin_input_label = gtk_label_new (_("<span size=\"medium\"><b>Decoders</b></span>")); | |
2056 gtk_notebook_set_tab_label (GTK_NOTEBOOK (plugin_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (plugin_notebook), 0), plugin_input_label); | |
2057 gtk_label_set_use_markup (GTK_LABEL (plugin_input_label), TRUE); | |
2058 gtk_misc_set_alignment (GTK_MISC (plugin_input_label), 0, 0); | |
2059 | |
2060 plugin_general_vbox = gtk_vbox_new (FALSE, 0); | |
2061 gtk_container_add (GTK_CONTAINER (plugin_notebook), plugin_general_vbox); | |
2062 gtk_container_set_border_width (GTK_CONTAINER (plugin_general_vbox), 12); | |
2063 | |
2064 alignment45 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2065 gtk_box_pack_start (GTK_BOX (plugin_general_vbox), alignment45, FALSE, FALSE, 4); | |
2066 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment45), 0, 6, 0, 0); | |
2067 | |
2068 label11 = gtk_label_new_with_mnemonic (_("_General plugin list:")); | |
2069 gtk_container_add (GTK_CONTAINER (alignment45), label11); | |
2070 gtk_label_set_use_markup (GTK_LABEL (label11), TRUE); | |
2071 gtk_misc_set_alignment (GTK_MISC (label11), 0, 0.5); | |
2072 | |
2073 scrolledwindow5 = gtk_scrolled_window_new (NULL, NULL); | |
2074 gtk_box_pack_start (GTK_BOX (plugin_general_vbox), scrolledwindow5, TRUE, TRUE, 0); | |
2075 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow5), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
2076 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow5), GTK_SHADOW_IN); | |
2077 | |
2078 general_plugin_view = gtk_tree_view_new (); | |
2079 gtk_container_add (GTK_CONTAINER (scrolledwindow5), general_plugin_view); | |
2080 gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (general_plugin_view), TRUE); | |
2081 gtk_tree_view_set_reorderable (GTK_TREE_VIEW (general_plugin_view), TRUE); | |
2082 | |
2083 general_plugin_button_box = gtk_hbutton_box_new (); | |
2084 gtk_box_pack_start (GTK_BOX (plugin_general_vbox), general_plugin_button_box, FALSE, FALSE, 8); | |
2085 gtk_button_box_set_layout (GTK_BUTTON_BOX (general_plugin_button_box), GTK_BUTTONBOX_START); | |
2086 gtk_box_set_spacing (GTK_BOX (general_plugin_button_box), 8); | |
2087 | |
2088 general_plugin_prefs = gtk_button_new_from_stock ("gtk-preferences"); | |
2089 gtk_container_add (GTK_CONTAINER (general_plugin_button_box), general_plugin_prefs); | |
2090 gtk_widget_set_sensitive (general_plugin_prefs, FALSE); | |
2091 GTK_WIDGET_SET_FLAGS (general_plugin_prefs, GTK_CAN_DEFAULT); | |
2092 | |
2093 general_plugin_info = gtk_button_new_from_stock ("gtk-dialog-info"); | |
2094 gtk_container_add (GTK_CONTAINER (general_plugin_button_box), general_plugin_info); | |
2095 gtk_widget_set_sensitive (general_plugin_info, FALSE); | |
2096 GTK_WIDGET_SET_FLAGS (general_plugin_info, GTK_CAN_DEFAULT); | |
2097 | |
2098 plugin_general_label = gtk_label_new (_("<span size=\"medium\"><b>General</b></span>")); | |
2099 gtk_notebook_set_tab_label (GTK_NOTEBOOK (plugin_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (plugin_notebook), 1), plugin_general_label); | |
2100 gtk_label_set_use_markup (GTK_LABEL (plugin_general_label), TRUE); | |
2101 | |
2102 vbox21 = gtk_vbox_new (FALSE, 0); | |
2103 gtk_container_add (GTK_CONTAINER (plugin_notebook), vbox21); | |
2104 gtk_container_set_border_width (GTK_CONTAINER (vbox21), 12); | |
2105 | |
2106 alignment46 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2107 gtk_box_pack_start (GTK_BOX (vbox21), alignment46, FALSE, FALSE, 4); | |
2108 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment46), 0, 6, 0, 0); | |
2109 | |
2110 label53 = gtk_label_new_with_mnemonic (_("_Visualization plugin list:")); | |
2111 gtk_container_add (GTK_CONTAINER (alignment46), label53); | |
2112 gtk_label_set_use_markup (GTK_LABEL (label53), TRUE); | |
2113 gtk_misc_set_alignment (GTK_MISC (label53), 0, 0.5); | |
2114 | |
2115 scrolledwindow7 = gtk_scrolled_window_new (NULL, NULL); | |
2116 gtk_box_pack_start (GTK_BOX (vbox21), scrolledwindow7, TRUE, TRUE, 0); | |
2117 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow7), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
2118 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow7), GTK_SHADOW_IN); | |
2119 | |
2120 vis_plugin_view = gtk_tree_view_new (); | |
2121 gtk_container_add (GTK_CONTAINER (scrolledwindow7), vis_plugin_view); | |
2122 gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (vis_plugin_view), TRUE); | |
2123 gtk_tree_view_set_reorderable (GTK_TREE_VIEW (vis_plugin_view), TRUE); | |
2124 | |
2125 hbuttonbox6 = gtk_hbutton_box_new (); | |
2126 gtk_box_pack_start (GTK_BOX (vbox21), hbuttonbox6, FALSE, FALSE, 8); | |
2127 gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox6), GTK_BUTTONBOX_START); | |
2128 gtk_box_set_spacing (GTK_BOX (hbuttonbox6), 8); | |
2129 | |
2130 vis_plugin_prefs = gtk_button_new_from_stock ("gtk-preferences"); | |
2131 gtk_container_add (GTK_CONTAINER (hbuttonbox6), vis_plugin_prefs); | |
2132 gtk_widget_set_sensitive (vis_plugin_prefs, FALSE); | |
2133 GTK_WIDGET_SET_FLAGS (vis_plugin_prefs, GTK_CAN_DEFAULT); | |
2134 | |
2135 vis_plugin_info = gtk_button_new_from_stock ("gtk-dialog-info"); | |
2136 gtk_container_add (GTK_CONTAINER (hbuttonbox6), vis_plugin_info); | |
2137 gtk_widget_set_sensitive (vis_plugin_info, FALSE); | |
2138 GTK_WIDGET_SET_FLAGS (vis_plugin_info, GTK_CAN_DEFAULT); | |
2139 | |
2140 vis_label = gtk_label_new (_("<b>Visualization</b>")); | |
2141 gtk_notebook_set_tab_label (GTK_NOTEBOOK (plugin_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (plugin_notebook), 2), vis_label); | |
2142 gtk_label_set_use_markup (GTK_LABEL (vis_label), TRUE); | |
2143 | |
2144 vbox25 = gtk_vbox_new (FALSE, 0); | |
2145 gtk_container_add (GTK_CONTAINER (plugin_notebook), vbox25); | |
2146 gtk_container_set_border_width (GTK_CONTAINER (vbox25), 12); | |
2147 | |
2148 alignment58 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2149 gtk_box_pack_start (GTK_BOX (vbox25), alignment58, FALSE, FALSE, 4); | |
2150 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment58), 0, 6, 0, 0); | |
2151 | |
2152 label64 = gtk_label_new_with_mnemonic (_("_Effect plugin list:")); | |
2153 gtk_container_add (GTK_CONTAINER (alignment58), label64); | |
2154 gtk_label_set_use_markup (GTK_LABEL (label64), TRUE); | |
2155 gtk_misc_set_alignment (GTK_MISC (label64), 0, 0.5); | |
2156 | |
2157 scrolledwindow9 = gtk_scrolled_window_new (NULL, NULL); | |
2158 gtk_box_pack_start (GTK_BOX (vbox25), scrolledwindow9, TRUE, TRUE, 0); | |
2159 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow9), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
2160 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow9), GTK_SHADOW_IN); | |
2161 | |
2162 effect_plugin_view = gtk_tree_view_new (); | |
2163 gtk_container_add (GTK_CONTAINER (scrolledwindow9), effect_plugin_view); | |
2164 gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (effect_plugin_view), TRUE); | |
2165 gtk_tree_view_set_reorderable (GTK_TREE_VIEW (effect_plugin_view), TRUE); | |
2166 | |
2167 hbuttonbox9 = gtk_hbutton_box_new (); | |
2168 gtk_box_pack_start (GTK_BOX (vbox25), hbuttonbox9, FALSE, FALSE, 8); | |
2169 gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox9), GTK_BUTTONBOX_START); | |
2170 gtk_box_set_spacing (GTK_BOX (hbuttonbox9), 8); | |
2171 | |
2172 effect_plugin_prefs = gtk_button_new_from_stock ("gtk-preferences"); | |
2173 gtk_container_add (GTK_CONTAINER (hbuttonbox9), effect_plugin_prefs); | |
2174 gtk_widget_set_sensitive (effect_plugin_prefs, FALSE); | |
2175 GTK_WIDGET_SET_FLAGS (effect_plugin_prefs, GTK_CAN_DEFAULT); | |
2176 | |
2177 effect_plugin_info = gtk_button_new_from_stock ("gtk-dialog-info"); | |
2178 gtk_container_add (GTK_CONTAINER (hbuttonbox9), effect_plugin_info); | |
2179 gtk_widget_set_sensitive (effect_plugin_info, FALSE); | |
2180 GTK_WIDGET_SET_FLAGS (effect_plugin_info, GTK_CAN_DEFAULT); | |
2181 | |
2182 effects_label = gtk_label_new (_("<b>Effects</b>")); | |
2183 gtk_notebook_set_tab_label (GTK_NOTEBOOK (plugin_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (plugin_notebook), 3), effects_label); | |
2184 gtk_label_set_use_markup (GTK_LABEL (effects_label), TRUE); | |
2185 | |
2186 plugin_label = gtk_label_new (_("Plugins")); | |
2187 gtk_notebook_set_tab_label (GTK_NOTEBOOK (category_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (category_notebook), 0), plugin_label); | |
2188 | |
2189 appearance_page_vbox = gtk_vbox_new (FALSE, 0); | |
2190 gtk_container_add (GTK_CONTAINER (category_notebook), appearance_page_vbox); | |
2191 | |
2192 vbox37 = gtk_vbox_new (FALSE, 0); | |
2193 gtk_box_pack_start (GTK_BOX (appearance_page_vbox), vbox37, TRUE, TRUE, 0); | |
2194 | |
2195 vbox38 = gtk_vbox_new (FALSE, 0); | |
2196 gtk_box_pack_start (GTK_BOX (vbox37), vbox38, FALSE, TRUE, 0); | |
2197 | |
2198 hbox12 = gtk_hbox_new (FALSE, 0); | |
2199 gtk_box_pack_start (GTK_BOX (vbox38), hbox12, TRUE, TRUE, 0); | |
2200 | |
2201 alignment94 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2202 gtk_box_pack_start (GTK_BOX (hbox12), alignment94, TRUE, TRUE, 0); | |
2203 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment94), 0, 4, 0, 0); | |
2204 | |
2205 hbox13 = gtk_hbox_new (FALSE, 0); | |
2206 gtk_container_add (GTK_CONTAINER (alignment94), hbox13); | |
2207 | |
2208 label103 = gtk_label_new_with_mnemonic (_("<b>_Skin</b>")); | |
2209 gtk_box_pack_start (GTK_BOX (hbox13), label103, TRUE, TRUE, 0); | |
2210 gtk_label_set_use_markup (GTK_LABEL (label103), TRUE); | |
2211 gtk_misc_set_alignment (GTK_MISC (label103), 0, 0); | |
2212 | |
2213 colorspace_button = gtk_button_new (); | |
2214 gtk_box_pack_start (GTK_BOX (hbox13), colorspace_button, FALSE, FALSE, 0); | |
2215 | |
2216 image11 = gtk_image_new_from_stock ("gtk-properties", GTK_ICON_SIZE_BUTTON); | |
2217 gtk_container_add (GTK_CONTAINER (colorspace_button), image11); | |
2218 | |
2219 skin_refresh_button = gtk_button_new (); | |
2220 gtk_box_pack_start (GTK_BOX (hbox13), skin_refresh_button, FALSE, FALSE, 0); | |
2221 GTK_WIDGET_UNSET_FLAGS (skin_refresh_button, GTK_CAN_FOCUS); | |
2222 gtk_tooltips_set_tip (tooltips, skin_refresh_button, _("Refresh skin list"), NULL); | |
2223 gtk_button_set_relief (GTK_BUTTON (skin_refresh_button), GTK_RELIEF_HALF); | |
2224 gtk_button_set_focus_on_click (GTK_BUTTON (skin_refresh_button), FALSE); | |
2225 | |
2226 image12 = gtk_image_new_from_stock ("gtk-refresh", GTK_ICON_SIZE_BUTTON); | |
2227 gtk_container_add (GTK_CONTAINER (skin_refresh_button), image12); | |
2228 | |
2229 alignment95 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2230 gtk_box_pack_start (GTK_BOX (vbox38), alignment95, TRUE, TRUE, 0); | |
2231 gtk_widget_set_size_request (alignment95, -1, 172); | |
2232 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment95), 0, 0, 12, 0); | |
2233 | |
2234 skin_view_scrolled_window = gtk_scrolled_window_new (NULL, NULL); | |
2235 gtk_container_add (GTK_CONTAINER (alignment95), skin_view_scrolled_window); | |
2236 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (skin_view_scrolled_window), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
2237 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (skin_view_scrolled_window), GTK_SHADOW_IN); | |
2238 | |
2239 skin_view = gtk_tree_view_new (); | |
2240 gtk_container_add (GTK_CONTAINER (skin_view_scrolled_window), skin_view); | |
2241 gtk_widget_set_size_request (skin_view, -1, 100); | |
2242 | |
2243 vbox39 = gtk_vbox_new (FALSE, 0); | |
2244 gtk_box_pack_start (GTK_BOX (vbox37), vbox39, FALSE, TRUE, 0); | |
2245 | |
2246 alignment96 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2247 gtk_box_pack_start (GTK_BOX (vbox39), alignment96, TRUE, TRUE, 0); | |
2248 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment96), 12, 6, 0, 0); | |
2249 | |
2250 label104 = gtk_label_new_with_mnemonic (_("<b>_Fonts</b>")); | |
2251 gtk_container_add (GTK_CONTAINER (alignment96), label104); | |
2252 gtk_label_set_use_markup (GTK_LABEL (label104), TRUE); | |
2253 gtk_misc_set_alignment (GTK_MISC (label104), 0, 0.5); | |
2254 | |
2255 table14 = gtk_table_new (2, 2, FALSE); | |
2256 gtk_box_pack_start (GTK_BOX (vbox39), table14, TRUE, TRUE, 0); | |
2257 gtk_table_set_row_spacings (GTK_TABLE (table14), 8); | |
2258 gtk_table_set_col_spacings (GTK_TABLE (table14), 2); | |
2259 | |
2260 alignment97 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2261 gtk_table_attach (GTK_TABLE (table14), alignment97, 0, 1, 0, 1, | |
2262 (GtkAttachOptions) (0), | |
2263 (GtkAttachOptions) (0), 0, 0); | |
2264 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment97), 0, 0, 12, 6); | |
2265 | |
2266 label105 = gtk_label_new_with_mnemonic (_("_Player:")); | |
2267 gtk_container_add (GTK_CONTAINER (alignment97), label105); | |
2268 gtk_label_set_use_markup (GTK_LABEL (label105), TRUE); | |
2269 gtk_misc_set_alignment (GTK_MISC (label105), 1, 0.5); | |
2270 | |
2271 alignment98 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2272 gtk_table_attach (GTK_TABLE (table14), alignment98, 0, 1, 1, 2, | |
2273 (GtkAttachOptions) (0), | |
2274 (GtkAttachOptions) (0), 0, 0); | |
2275 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment98), 0, 0, 12, 6); | |
2276 | |
2277 label106 = gtk_label_new_with_mnemonic (_("_Playlist:")); | |
2278 gtk_container_add (GTK_CONTAINER (alignment98), label106); | |
2279 gtk_label_set_use_markup (GTK_LABEL (label106), TRUE); | |
2280 gtk_label_set_justify (GTK_LABEL (label106), GTK_JUSTIFY_RIGHT); | |
2281 gtk_misc_set_alignment (GTK_MISC (label106), 1, 0.5); | |
2282 | |
2283 fontbutton1 = gtk_font_button_new (); | |
2284 gtk_table_attach (GTK_TABLE (table14), fontbutton1, 1, 2, 0, 1, | |
2285 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
2286 (GtkAttachOptions) (0), 0, 0); | |
2287 gtk_font_button_set_title (GTK_FONT_BUTTON (fontbutton1), _("Select main player window font:")); | |
2288 gtk_font_button_set_use_font (GTK_FONT_BUTTON (fontbutton1), TRUE); | |
2289 gtk_font_button_set_use_size (GTK_FONT_BUTTON (fontbutton1), TRUE); | |
2290 | |
2291 fontbutton2 = gtk_font_button_new (); | |
2292 gtk_table_attach (GTK_TABLE (table14), fontbutton2, 1, 2, 1, 2, | |
2293 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
2294 (GtkAttachOptions) (0), 0, 0); | |
2295 gtk_font_button_set_title (GTK_FONT_BUTTON (fontbutton2), _("Select playlist font:")); | |
2296 gtk_font_button_set_use_font (GTK_FONT_BUTTON (fontbutton2), TRUE); | |
2297 gtk_font_button_set_use_size (GTK_FONT_BUTTON (fontbutton2), TRUE); | |
2298 | |
2299 alignment99 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2300 gtk_box_pack_start (GTK_BOX (vbox39), alignment99, TRUE, TRUE, 0); | |
2301 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment99), 4, 0, 12, 0); | |
2302 | |
2303 checkbutton11 = gtk_check_button_new_with_mnemonic (_("Use Bitmap fonts if available")); | |
2304 gtk_container_add (GTK_CONTAINER (alignment99), checkbutton11); | |
2305 gtk_tooltips_set_tip (tooltips, checkbutton11, _("Use bitmap fonts if they are available. Bitmap fonts do not support Unicode strings."), NULL); | |
2306 | |
2307 vbox40 = gtk_vbox_new (FALSE, 0); | |
2308 gtk_box_pack_start (GTK_BOX (vbox37), vbox40, FALSE, TRUE, 0); | |
2309 | |
4003 | 2310 create_widgets(GTK_BOX(vbox40), apperance_misc_widgets, G_N_ELEMENTS(apperance_misc_widgets)); |
3993 | 2311 |
2312 appearance_label = gtk_label_new (_("Appearance")); | |
2313 gtk_notebook_set_tab_label (GTK_NOTEBOOK (category_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (category_notebook), 1), appearance_label); | |
2314 | |
2315 mouse_page_vbox = gtk_vbox_new (FALSE, 0); | |
2316 gtk_container_add (GTK_CONTAINER (category_notebook), mouse_page_vbox); | |
2317 | |
2318 vbox20 = gtk_vbox_new (FALSE, 0); | |
2319 gtk_box_pack_start (GTK_BOX (mouse_page_vbox), vbox20, TRUE, TRUE, 0); | |
2320 | |
4007 | 2321 create_widgets(GTK_BOX(vbox20), mouse_page_widgets, G_N_ELEMENTS(mouse_page_widgets)); |
3993 | 2322 |
2323 mouse_label = gtk_label_new (_("Mouse")); | |
2324 gtk_notebook_set_tab_label (GTK_NOTEBOOK (category_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (category_notebook), 2), mouse_label); | |
2325 | |
2326 playlist_page_vbox = gtk_vbox_new (FALSE, 0); | |
2327 gtk_container_add (GTK_CONTAINER (category_notebook), playlist_page_vbox); | |
2328 | |
2329 vbox5 = gtk_vbox_new (FALSE, 0); | |
2330 gtk_box_pack_start (GTK_BOX (playlist_page_vbox), vbox5, TRUE, TRUE, 0); | |
2331 | |
4004 | 2332 create_widgets(GTK_BOX(vbox5), playlist_page_widgets, G_N_ELEMENTS(playlist_page_widgets)); |
3993 | 2333 |
2334 alignment55 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2335 gtk_box_pack_start (GTK_BOX (vbox5), alignment55, FALSE, FALSE, 0); | |
2336 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment55), 12, 12, 0, 0); | |
2337 | |
2338 label60 = gtk_label_new (_("<b>Song Display</b>")); | |
2339 gtk_container_add (GTK_CONTAINER (alignment55), label60); | |
2340 gtk_label_set_use_markup (GTK_LABEL (label60), TRUE); | |
2341 gtk_misc_set_alignment (GTK_MISC (label60), 0, 0.5); | |
2342 | |
2343 alignment56 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2344 gtk_box_pack_start (GTK_BOX (vbox5), alignment56, FALSE, FALSE, 0); | |
2345 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment56), 0, 0, 12, 0); | |
2346 | |
2347 table6 = gtk_table_new (2, 3, FALSE); | |
2348 gtk_container_add (GTK_CONTAINER (alignment56), table6); | |
2349 gtk_table_set_row_spacings (GTK_TABLE (table6), 4); | |
2350 gtk_table_set_col_spacings (GTK_TABLE (table6), 12); | |
2351 | |
2352 titlestring_help_button = gtk_button_new (); | |
2353 gtk_table_attach (GTK_TABLE (table6), titlestring_help_button, 2, 3, 1, 2, | |
2354 (GtkAttachOptions) (0), | |
2355 (GtkAttachOptions) (0), 0, 0); | |
2356 GTK_WIDGET_UNSET_FLAGS (titlestring_help_button, GTK_CAN_FOCUS); | |
2357 gtk_tooltips_set_tip (tooltips, titlestring_help_button, _("Show information about titlestring format"), NULL); | |
2358 gtk_button_set_relief (GTK_BUTTON (titlestring_help_button), GTK_RELIEF_HALF); | |
2359 gtk_button_set_focus_on_click (GTK_BUTTON (titlestring_help_button), FALSE); | |
2360 | |
2361 image1 = gtk_image_new_from_stock ("gtk-index", GTK_ICON_SIZE_BUTTON); | |
2362 gtk_container_add (GTK_CONTAINER (titlestring_help_button), image1); | |
2363 | |
2364 titlestring_cbox = gtk_combo_box_new_text (); | |
2365 gtk_table_attach (GTK_TABLE (table6), titlestring_cbox, 1, 3, 0, 1, | |
2366 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
2367 (GtkAttachOptions) (0), 0, 0); | |
2368 gtk_combo_box_append_text (GTK_COMBO_BOX (titlestring_cbox), _("TITLE")); | |
2369 gtk_combo_box_append_text (GTK_COMBO_BOX (titlestring_cbox), _("ARTIST - TITLE")); | |
2370 gtk_combo_box_append_text (GTK_COMBO_BOX (titlestring_cbox), _("ARTIST - ALBUM - TITLE")); | |
2371 gtk_combo_box_append_text (GTK_COMBO_BOX (titlestring_cbox), _("ARTIST - ALBUM - TRACK. TITLE")); | |
2372 gtk_combo_box_append_text (GTK_COMBO_BOX (titlestring_cbox), _("ARTIST [ ALBUM ] - TRACK. TITLE")); | |
2373 gtk_combo_box_append_text (GTK_COMBO_BOX (titlestring_cbox), _("ALBUM - TITLE")); | |
2374 gtk_combo_box_append_text (GTK_COMBO_BOX (titlestring_cbox), _("Custom")); | |
2375 | |
2376 titlestring_entry = gtk_entry_new (); | |
2377 gtk_table_attach (GTK_TABLE (table6), titlestring_entry, 1, 2, 1, 2, | |
2378 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
2379 (GtkAttachOptions) (0), 0, 0); | |
2380 | |
2381 label62 = gtk_label_new (_("Custom string:")); | |
2382 gtk_table_attach (GTK_TABLE (table6), label62, 0, 1, 1, 2, | |
2383 (GtkAttachOptions) (0), | |
2384 (GtkAttachOptions) (0), 0, 0); | |
2385 gtk_label_set_justify (GTK_LABEL (label62), GTK_JUSTIFY_RIGHT); | |
2386 gtk_misc_set_alignment (GTK_MISC (label62), 1, 0.5); | |
2387 | |
2388 label61 = gtk_label_new (_("Title format:")); | |
2389 gtk_table_attach (GTK_TABLE (table6), label61, 0, 1, 0, 1, | |
2390 (GtkAttachOptions) (0), | |
2391 (GtkAttachOptions) (0), 0, 0); | |
2392 gtk_label_set_justify (GTK_LABEL (label61), GTK_JUSTIFY_RIGHT); | |
2393 gtk_misc_set_alignment (GTK_MISC (label61), 1, 0.5); | |
2394 | |
2395 alignment85 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2396 gtk_box_pack_start (GTK_BOX (vbox5), alignment85, FALSE, FALSE, 0); | |
2397 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment85), 12, 12, 0, 0); | |
2398 | |
2399 label84 = gtk_label_new (_("<b>Popup Information</b>")); | |
2400 gtk_container_add (GTK_CONTAINER (alignment85), label84); | |
2401 gtk_label_set_use_markup (GTK_LABEL (label84), TRUE); | |
2402 gtk_misc_set_alignment (GTK_MISC (label84), 0, 0.5); | |
2403 | |
2404 alignment86 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2405 gtk_box_pack_start (GTK_BOX (vbox5), alignment86, FALSE, FALSE, 0); | |
2406 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment86), 0, 0, 12, 0); | |
2407 | |
2408 hbox9 = gtk_hbox_new (FALSE, 12); | |
2409 gtk_container_add (GTK_CONTAINER (alignment86), hbox9); | |
2410 | |
2411 vbox34 = gtk_vbox_new (FALSE, 0); | |
2412 gtk_box_pack_start (GTK_BOX (hbox9), vbox34, TRUE, TRUE, 0); | |
2413 | |
2414 checkbutton10 = gtk_check_button_new_with_mnemonic (_("Show popup information for playlist entries")); | |
2415 gtk_box_pack_start (GTK_BOX (vbox34), checkbutton10, TRUE, FALSE, 0); | |
2416 gtk_tooltips_set_tip (tooltips, checkbutton10, _("Toggles popup information window for the pointed entry in the playlist. The window shows title of song, name of album, genre, year of publish, track number, track length, and artwork."), NULL); | |
2417 | |
2418 filepopup_for_tuple_settings_button = gtk_button_new (); | |
2419 gtk_box_pack_start (GTK_BOX (hbox9), filepopup_for_tuple_settings_button, FALSE, FALSE, 0); | |
2420 GTK_WIDGET_UNSET_FLAGS (filepopup_for_tuple_settings_button, GTK_CAN_FOCUS); | |
2421 gtk_tooltips_set_tip (tooltips, filepopup_for_tuple_settings_button, _("Edit settings for popup information"), NULL); | |
2422 gtk_button_set_relief (GTK_BUTTON (filepopup_for_tuple_settings_button), GTK_RELIEF_HALF); | |
2423 | |
2424 image8 = gtk_image_new_from_stock ("gtk-properties", GTK_ICON_SIZE_BUTTON); | |
2425 gtk_container_add (GTK_CONTAINER (filepopup_for_tuple_settings_button), image8); | |
2426 | |
2427 playlist_label = gtk_label_new (_("Playlist")); | |
2428 gtk_notebook_set_tab_label (GTK_NOTEBOOK (category_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (category_notebook), 3), playlist_label); | |
2429 | |
2430 equalizer_page_vbox = gtk_vbox_new (FALSE, 0); | |
2431 gtk_container_add (GTK_CONTAINER (category_notebook), equalizer_page_vbox); | |
2432 | |
2433 alignment28 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2434 gtk_box_pack_start (GTK_BOX (equalizer_page_vbox), alignment28, TRUE, TRUE, 0); | |
2435 | |
2436 vbox22 = gtk_vbox_new (FALSE, 0); | |
2437 gtk_container_add (GTK_CONTAINER (alignment28), vbox22); | |
2438 | |
2439 alignment30 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2440 gtk_box_pack_start (GTK_BOX (vbox22), alignment30, FALSE, FALSE, 0); | |
2441 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment30), 0, 12, 0, 0); | |
2442 | |
2443 equalizer_page_label = gtk_label_new (_("<b>Presets</b>")); | |
2444 gtk_container_add (GTK_CONTAINER (alignment30), equalizer_page_label); | |
2445 gtk_label_set_use_markup (GTK_LABEL (equalizer_page_label), TRUE); | |
2446 gtk_misc_set_alignment (GTK_MISC (equalizer_page_label), 0, 0.5); | |
2447 | |
2448 vbox23 = gtk_vbox_new (FALSE, 0); | |
2449 gtk_box_pack_start (GTK_BOX (vbox22), vbox23, TRUE, TRUE, 0); | |
2450 | |
2451 alignment33 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2452 gtk_box_pack_start (GTK_BOX (vbox23), alignment33, FALSE, FALSE, 0); | |
2453 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment33), 0, 12, 0, 0); | |
2454 | |
2455 table5 = gtk_table_new (2, 2, FALSE); | |
2456 gtk_container_add (GTK_CONTAINER (alignment33), table5); | |
2457 gtk_table_set_row_spacings (GTK_TABLE (table5), 6); | |
2458 gtk_table_set_col_spacings (GTK_TABLE (table5), 6); | |
2459 | |
2460 label58 = gtk_label_new (_("File preset extension:")); | |
2461 gtk_table_attach (GTK_TABLE (table5), label58, 0, 1, 1, 2, | |
2462 (GtkAttachOptions) (0), | |
2463 (GtkAttachOptions) (0), 0, 0); | |
2464 gtk_misc_set_alignment (GTK_MISC (label58), 0, 0.5); | |
2465 | |
2466 label57 = gtk_label_new (_("Directory preset file:")); | |
2467 gtk_table_attach (GTK_TABLE (table5), label57, 0, 1, 0, 1, | |
2468 (GtkAttachOptions) (0), | |
2469 (GtkAttachOptions) (0), 0, 0); | |
2470 gtk_misc_set_alignment (GTK_MISC (label57), 0, 0.5); | |
2471 | |
2472 eq_file_preset_entry = gtk_entry_new (); | |
2473 gtk_table_attach (GTK_TABLE (table5), eq_file_preset_entry, 1, 2, 1, 2, | |
2474 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
2475 (GtkAttachOptions) (0), 0, 0); | |
2476 | |
2477 eq_dir_preset_entry = gtk_entry_new (); | |
2478 gtk_table_attach (GTK_TABLE (table5), eq_dir_preset_entry, 1, 2, 0, 1, | |
2479 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
2480 (GtkAttachOptions) (0), 0, 0); | |
2481 | |
2482 equalizer_label = gtk_label_new (_("Equalizer")); | |
2483 gtk_notebook_set_tab_label (GTK_NOTEBOOK (category_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (category_notebook), 4), equalizer_label); | |
2484 | |
2485 connectivity_page_vbox = gtk_vbox_new (FALSE, 0); | |
2486 gtk_container_add (GTK_CONTAINER (category_notebook), connectivity_page_vbox); | |
2487 | |
2488 vbox29 = gtk_vbox_new (FALSE, 0); | |
2489 gtk_box_pack_start (GTK_BOX (connectivity_page_vbox), vbox29, TRUE, TRUE, 0); | |
2490 | |
2491 alignment63 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2492 gtk_box_pack_start (GTK_BOX (vbox29), alignment63, FALSE, FALSE, 0); | |
2493 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment63), 0, 12, 0, 0); | |
2494 | |
2495 connectivity_page_label = gtk_label_new (_("<b>Proxy Configuration</b>")); | |
2496 gtk_container_add (GTK_CONTAINER (alignment63), connectivity_page_label); | |
2497 gtk_label_set_use_markup (GTK_LABEL (connectivity_page_label), TRUE); | |
2498 gtk_misc_set_alignment (GTK_MISC (connectivity_page_label), 0, 0.5); | |
2499 | |
2500 alignment68 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2501 gtk_box_pack_start (GTK_BOX (vbox29), alignment68, TRUE, TRUE, 0); | |
2502 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment68), 0, 0, 12, 0); | |
2503 | |
2504 vbox30 = gtk_vbox_new (FALSE, 0); | |
2505 gtk_container_add (GTK_CONTAINER (alignment68), vbox30); | |
2506 | |
2507 alignment65 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2508 gtk_box_pack_start (GTK_BOX (vbox30), alignment65, FALSE, FALSE, 0); | |
2509 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment65), 0, 12, 0, 0); | |
2510 | |
2511 proxy_use = gtk_check_button_new_with_mnemonic (_("Enable proxy usage")); | |
2512 gtk_container_add (GTK_CONTAINER (alignment65), proxy_use); | |
2513 | |
2514 table8 = gtk_table_new (2, 2, FALSE); | |
2515 gtk_box_pack_start (GTK_BOX (vbox30), table8, FALSE, FALSE, 0); | |
2516 gtk_table_set_row_spacings (GTK_TABLE (table8), 6); | |
2517 gtk_table_set_col_spacings (GTK_TABLE (table8), 6); | |
2518 | |
2519 proxy_port = gtk_entry_new (); | |
2520 gtk_table_attach (GTK_TABLE (table8), proxy_port, 1, 2, 1, 2, | |
2521 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
2522 (GtkAttachOptions) (0), 0, 0); | |
2523 | |
2524 proxy_host = gtk_entry_new (); | |
2525 gtk_table_attach (GTK_TABLE (table8), proxy_host, 1, 2, 0, 1, | |
2526 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
2527 (GtkAttachOptions) (0), 0, 0); | |
2528 | |
2529 label69 = gtk_label_new (_("Proxy port:")); | |
2530 gtk_table_attach (GTK_TABLE (table8), label69, 0, 1, 1, 2, | |
2531 (GtkAttachOptions) (0), | |
2532 (GtkAttachOptions) (0), 0, 0); | |
2533 gtk_misc_set_alignment (GTK_MISC (label69), 0, 0.5); | |
2534 | |
2535 label68 = gtk_label_new (_("Proxy hostname:")); | |
2536 gtk_table_attach (GTK_TABLE (table8), label68, 0, 1, 0, 1, | |
2537 (GtkAttachOptions) (0), | |
2538 (GtkAttachOptions) (0), 0, 0); | |
2539 gtk_misc_set_alignment (GTK_MISC (label68), 0, 0); | |
2540 | |
2541 alignment67 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2542 gtk_box_pack_start (GTK_BOX (vbox30), alignment67, FALSE, FALSE, 0); | |
2543 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment67), 12, 12, 0, 0); | |
2544 | |
2545 proxy_auth = gtk_check_button_new_with_mnemonic (_("Use authentication with proxy")); | |
2546 gtk_container_add (GTK_CONTAINER (alignment67), proxy_auth); | |
2547 | |
2548 table9 = gtk_table_new (2, 2, FALSE); | |
2549 gtk_box_pack_start (GTK_BOX (vbox30), table9, FALSE, FALSE, 0); | |
2550 gtk_table_set_row_spacings (GTK_TABLE (table9), 6); | |
2551 gtk_table_set_col_spacings (GTK_TABLE (table9), 6); | |
2552 | |
2553 proxy_pass = gtk_entry_new (); | |
2554 gtk_table_attach (GTK_TABLE (table9), proxy_pass, 1, 2, 1, 2, | |
2555 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
2556 (GtkAttachOptions) (0), 0, 0); | |
2557 gtk_entry_set_visibility (GTK_ENTRY (proxy_pass), FALSE); | |
2558 | |
2559 proxy_user = gtk_entry_new (); | |
2560 gtk_table_attach (GTK_TABLE (table9), proxy_user, 1, 2, 0, 1, | |
2561 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
2562 (GtkAttachOptions) (0), 0, 0); | |
2563 | |
2564 label71 = gtk_label_new (_("Proxy password:")); | |
2565 gtk_table_attach (GTK_TABLE (table9), label71, 0, 1, 1, 2, | |
2566 (GtkAttachOptions) (0), | |
2567 (GtkAttachOptions) (0), 0, 0); | |
2568 gtk_misc_set_alignment (GTK_MISC (label71), 0, 0.5); | |
2569 | |
2570 label70 = gtk_label_new (_("Proxy username:")); | |
2571 gtk_table_attach (GTK_TABLE (table9), label70, 0, 1, 0, 1, | |
2572 (GtkAttachOptions) (0), | |
2573 (GtkAttachOptions) (0), 0, 0); | |
2574 gtk_misc_set_alignment (GTK_MISC (label70), 0, 0); | |
2575 | |
2576 alignment72 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2577 gtk_box_pack_start (GTK_BOX (vbox30), alignment72, FALSE, FALSE, 0); | |
2578 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment72), 6, 0, 0, 0); | |
2579 | |
2580 hbox6 = gtk_hbox_new (FALSE, 0); | |
2581 gtk_container_add (GTK_CONTAINER (alignment72), hbox6); | |
2582 | |
2583 image4 = gtk_image_new_from_stock ("gtk-dialog-warning", GTK_ICON_SIZE_BUTTON); | |
2584 gtk_box_pack_start (GTK_BOX (hbox6), image4, FALSE, FALSE, 0); | |
2585 gtk_misc_set_padding (GTK_MISC (image4), 3, 0); | |
2586 | |
2587 label75 = gtk_label_new (_("<span size=\"small\">Changing these settings will require a restart of Audacious.</span>")); | |
2588 gtk_box_pack_start (GTK_BOX (hbox6), label75, FALSE, FALSE, 0); | |
2589 gtk_label_set_use_markup (GTK_LABEL (label75), TRUE); | |
2590 | |
2591 label95 = gtk_label_new (""); | |
2592 gtk_notebook_set_tab_label (GTK_NOTEBOOK (category_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (category_notebook), 5), label95); | |
2593 | |
2594 empty_notebook_page = gtk_vbox_new (FALSE, 0); | |
2595 gtk_container_add (GTK_CONTAINER (category_notebook), empty_notebook_page); | |
2596 | |
2597 label96 = gtk_label_new (""); | |
2598 gtk_notebook_set_tab_label (GTK_NOTEBOOK (category_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (category_notebook), 6), label96); | |
2599 | |
2600 audio_scrolled_window = gtk_scrolled_window_new (NULL, NULL); | |
2601 gtk_container_add (GTK_CONTAINER (empty_notebook_page), audio_scrolled_window); | |
2602 gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK (category_notebook), audio_scrolled_window, | |
2603 TRUE, TRUE, GTK_PACK_START); | |
2604 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (audio_scrolled_window), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
2605 | |
2606 audio_page_viewport = gtk_viewport_new (NULL, NULL); | |
2607 gtk_container_add (GTK_CONTAINER (audio_scrolled_window), audio_page_viewport); | |
2608 gtk_widget_set_events (audio_page_viewport, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); | |
2609 gtk_viewport_set_shadow_type (GTK_VIEWPORT (audio_page_viewport), GTK_SHADOW_NONE); | |
2610 | |
2611 audio_page_vbox = gtk_vbox_new (FALSE, 0); | |
2612 gtk_container_add (GTK_CONTAINER (audio_page_viewport), audio_page_vbox); | |
2613 | |
2614 alignment74 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2615 gtk_box_pack_start (GTK_BOX (audio_page_vbox), alignment74, FALSE, FALSE, 0); | |
2616 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment74), 0, 12, 0, 0); | |
2617 | |
2618 label77 = gtk_label_new (_("<b>Audio System</b>")); | |
2619 gtk_container_add (GTK_CONTAINER (alignment74), label77); | |
2620 gtk_label_set_use_markup (GTK_LABEL (label77), TRUE); | |
2621 gtk_misc_set_alignment (GTK_MISC (label77), 0, 0.5); | |
2622 | |
2623 alignment73 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2624 gtk_box_pack_start (GTK_BOX (audio_page_vbox), alignment73, FALSE, FALSE, 0); | |
2625 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment73), 0, 6, 12, 0); | |
2626 | |
2627 vbox33 = gtk_vbox_new (FALSE, 0); | |
2628 gtk_container_add (GTK_CONTAINER (alignment73), vbox33); | |
2629 | |
2630 table11 = gtk_table_new (3, 2, FALSE); | |
2631 gtk_box_pack_start (GTK_BOX (vbox33), table11, FALSE, FALSE, 0); | |
2632 gtk_table_set_row_spacings (GTK_TABLE (table11), 6); | |
2633 gtk_table_set_col_spacings (GTK_TABLE (table11), 6); | |
2634 | |
2635 image7 = gtk_image_new_from_stock ("gtk-info", GTK_ICON_SIZE_BUTTON); | |
2636 gtk_table_attach (GTK_TABLE (table11), image7, 0, 1, 2, 3, | |
2637 (GtkAttachOptions) (0), | |
2638 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); | |
2639 gtk_misc_set_alignment (GTK_MISC (image7), 1, 0); | |
2640 | |
2641 label79 = gtk_label_new (_("Buffer size:")); | |
2642 gtk_table_attach (GTK_TABLE (table11), label79, 0, 1, 1, 2, | |
2643 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
2644 (GtkAttachOptions) (0), 0, 0); | |
2645 gtk_misc_set_alignment (GTK_MISC (label79), 1, 0.5); | |
2646 | |
2647 label82 = gtk_label_new (_("<span size=\"small\">This is the amount of time to prebuffer audio streams by, in milliseconds.\nIncrease this value if you are experiencing audio skipping.\nPlease note however, that high values will result in Audacious performing poorly.</span>")); | |
2648 gtk_table_attach (GTK_TABLE (table11), label82, 1, 2, 2, 3, | |
2649 (GtkAttachOptions) (0), | |
2650 (GtkAttachOptions) (0), 0, 0); | |
2651 gtk_label_set_use_markup (GTK_LABEL (label82), TRUE); | |
2652 gtk_label_set_line_wrap (GTK_LABEL (label82), TRUE); | |
2653 gtk_misc_set_alignment (GTK_MISC (label82), 0, 0.5); | |
2654 | |
2655 output_plugin_bufsize_adj = gtk_adjustment_new (0, 0, 600000, 100, 1000, 1000); | |
2656 output_plugin_bufsize = gtk_spin_button_new (GTK_ADJUSTMENT (output_plugin_bufsize_adj), 1, 0); | |
2657 gtk_table_attach (GTK_TABLE (table11), output_plugin_bufsize, 1, 2, 1, 2, | |
2658 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
2659 (GtkAttachOptions) (0), 0, 0); | |
2660 | |
2661 output_plugin_cbox = gtk_combo_box_new_text (); | |
2662 gtk_table_attach (GTK_TABLE (table11), output_plugin_cbox, 1, 2, 0, 1, | |
2663 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
2664 (GtkAttachOptions) (0), 0, 0); | |
2665 | |
2666 label78 = gtk_label_new (_("Current output plugin:")); | |
2667 gtk_table_attach (GTK_TABLE (table11), label78, 0, 1, 0, 1, | |
2668 (GtkAttachOptions) (0), | |
2669 (GtkAttachOptions) (0), 0, 0); | |
2670 gtk_misc_set_alignment (GTK_MISC (label78), 0, 0.5); | |
2671 | |
2672 alignment82 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2673 gtk_box_pack_start (GTK_BOX (audio_page_vbox), alignment82, FALSE, FALSE, 0); | |
2674 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment82), 0, 0, 12, 0); | |
2675 | |
2676 output_plugin_button_box = gtk_hbutton_box_new (); | |
2677 gtk_container_add (GTK_CONTAINER (alignment82), output_plugin_button_box); | |
2678 gtk_button_box_set_layout (GTK_BUTTON_BOX (output_plugin_button_box), GTK_BUTTONBOX_START); | |
2679 gtk_box_set_spacing (GTK_BOX (output_plugin_button_box), 8); | |
2680 | |
2681 output_plugin_prefs = gtk_button_new (); | |
2682 gtk_container_add (GTK_CONTAINER (output_plugin_button_box), output_plugin_prefs); | |
2683 gtk_widget_set_sensitive (output_plugin_prefs, FALSE); | |
2684 GTK_WIDGET_SET_FLAGS (output_plugin_prefs, GTK_CAN_DEFAULT); | |
2685 | |
2686 alignment76 = gtk_alignment_new (0.5, 0.5, 0, 0); | |
2687 gtk_container_add (GTK_CONTAINER (output_plugin_prefs), alignment76); | |
2688 | |
2689 hbox7 = gtk_hbox_new (FALSE, 2); | |
2690 gtk_container_add (GTK_CONTAINER (alignment76), hbox7); | |
2691 | |
2692 image5 = gtk_image_new_from_stock ("gtk-preferences", GTK_ICON_SIZE_BUTTON); | |
2693 gtk_box_pack_start (GTK_BOX (hbox7), image5, FALSE, FALSE, 0); | |
2694 | |
2695 label80 = gtk_label_new_with_mnemonic (_("Output Plugin Preferences")); | |
2696 gtk_box_pack_start (GTK_BOX (hbox7), label80, FALSE, FALSE, 0); | |
2697 | |
2698 output_plugin_info = gtk_button_new (); | |
2699 gtk_container_add (GTK_CONTAINER (output_plugin_button_box), output_plugin_info); | |
2700 gtk_widget_set_sensitive (output_plugin_info, FALSE); | |
2701 GTK_WIDGET_SET_FLAGS (output_plugin_info, GTK_CAN_DEFAULT); | |
2702 | |
2703 alignment77 = gtk_alignment_new (0.5, 0.5, 0, 0); | |
2704 gtk_container_add (GTK_CONTAINER (output_plugin_info), alignment77); | |
2705 | |
2706 hbox8 = gtk_hbox_new (FALSE, 2); | |
2707 gtk_container_add (GTK_CONTAINER (alignment77), hbox8); | |
2708 | |
2709 image6 = gtk_image_new_from_stock ("gtk-about", GTK_ICON_SIZE_BUTTON); | |
2710 gtk_box_pack_start (GTK_BOX (hbox8), image6, FALSE, FALSE, 0); | |
2711 | |
2712 label81 = gtk_label_new_with_mnemonic (_("Output Plugin Information")); | |
2713 gtk_box_pack_start (GTK_BOX (hbox8), label81, FALSE, FALSE, 0); | |
2714 | |
4003 | 2715 create_widgets(GTK_BOX(audio_page_vbox), audio_page_widgets, G_N_ELEMENTS(audio_page_widgets)); |
3993 | 2716 |
2717 alignment90 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2718 gtk_box_pack_start (GTK_BOX (audio_page_vbox), alignment90, FALSE, FALSE, 0); | |
2719 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment90), 12, 12, 0, 0); | |
2720 | |
2721 label93 = gtk_label_new (_("<b>Sampling Rate Converter</b>")); | |
2722 gtk_container_add (GTK_CONTAINER (alignment90), label93); | |
2723 gtk_label_set_use_markup (GTK_LABEL (label93), TRUE); | |
2724 gtk_misc_set_alignment (GTK_MISC (label93), 0, 0.5); | |
2725 | |
2726 alignment92 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2727 gtk_box_pack_start (GTK_BOX (audio_page_vbox), alignment92, FALSE, FALSE, 0); | |
2728 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment92), 0, 0, 12, 0); | |
2729 | |
2730 enable_src = gtk_check_button_new_with_mnemonic (_("Enable Sampling Rate Converter")); | |
2731 gtk_container_add (GTK_CONTAINER (alignment92), enable_src); | |
2732 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (enable_src), TRUE); | |
2733 | |
2734 alignment91 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2735 gtk_box_pack_start (GTK_BOX (audio_page_vbox), alignment91, FALSE, FALSE, 0); | |
2736 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment91), 0, 6, 12, 0); | |
2737 | |
2738 vbox36 = gtk_vbox_new (FALSE, 0); | |
2739 gtk_container_add (GTK_CONTAINER (alignment91), vbox36); | |
2740 | |
2741 table13 = gtk_table_new (3, 2, FALSE); | |
2742 gtk_box_pack_start (GTK_BOX (vbox36), table13, FALSE, FALSE, 0); | |
2743 gtk_table_set_row_spacings (GTK_TABLE (table13), 6); | |
2744 gtk_table_set_col_spacings (GTK_TABLE (table13), 6); | |
2745 | |
2746 src_converter_type = gtk_combo_box_new_text (); | |
2747 gtk_table_attach (GTK_TABLE (table13), src_converter_type, 1, 2, 1, 2, | |
2748 (GtkAttachOptions) (0), | |
2749 (GtkAttachOptions) (0), 0, 0); | |
2750 gtk_combo_box_append_text (GTK_COMBO_BOX (src_converter_type), _("Best Sinc Interpolation")); | |
2751 gtk_combo_box_append_text (GTK_COMBO_BOX (src_converter_type), _("Medium Sinc Interpolation")); | |
2752 gtk_combo_box_append_text (GTK_COMBO_BOX (src_converter_type), _("Fastest Sinc Interpolation")); | |
2753 gtk_combo_box_append_text (GTK_COMBO_BOX (src_converter_type), _("ZOH Interpolation")); | |
2754 gtk_combo_box_append_text (GTK_COMBO_BOX (src_converter_type), _("Linear Interpolation")); | |
2755 | |
2756 label94 = gtk_label_new (_("Interpolation Engine:")); | |
2757 gtk_table_attach (GTK_TABLE (table13), label94, 0, 1, 1, 2, | |
2758 (GtkAttachOptions) (0), | |
2759 (GtkAttachOptions) (0), 0, 0); | |
2760 gtk_misc_set_alignment (GTK_MISC (label94), 0, 0.5); | |
2761 | |
2762 label92 = gtk_label_new (_("<span size=\"small\">All streams will be converted to this sampling rate.\nThis should be the max supported sampling rate of\nthe sound card or output plugin.</span>")); | |
2763 gtk_table_attach (GTK_TABLE (table13), label92, 1, 2, 2, 3, | |
2764 (GtkAttachOptions) (0), | |
2765 (GtkAttachOptions) (0), 0, 0); | |
2766 gtk_label_set_use_markup (GTK_LABEL (label92), TRUE); | |
2767 gtk_label_set_line_wrap (GTK_LABEL (label92), TRUE); | |
2768 gtk_misc_set_alignment (GTK_MISC (label92), 0, 0.5); | |
2769 | |
2770 image9 = gtk_image_new_from_stock ("gtk-info", GTK_ICON_SIZE_BUTTON); | |
2771 gtk_table_attach (GTK_TABLE (table13), image9, 0, 1, 2, 3, | |
2772 (GtkAttachOptions) (0), | |
2773 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); | |
2774 gtk_misc_set_alignment (GTK_MISC (image9), 1, 0); | |
2775 | |
2776 src_rate_adj = gtk_adjustment_new (96000, 1000, 768000, 1000, 1000, 1000); | |
2777 src_rate = gtk_spin_button_new (GTK_ADJUSTMENT (src_rate_adj), 1, 0); | |
2778 gtk_table_attach (GTK_TABLE (table13), src_rate, 1, 2, 0, 1, | |
2779 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), | |
2780 (GtkAttachOptions) (0), 0, 0); | |
2781 | |
2782 label91 = gtk_label_new (_("Sampling Rate [Hz]:")); | |
2783 gtk_table_attach (GTK_TABLE (table13), label91, 0, 1, 0, 1, | |
2784 (GtkAttachOptions) (0), | |
2785 (GtkAttachOptions) (0), 0, 0); | |
2786 gtk_misc_set_alignment (GTK_MISC (label91), 0, 0.5); | |
2787 | |
2788 alignment4 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2789 gtk_box_pack_start (GTK_BOX (audio_page_vbox), alignment4, FALSE, FALSE, 0); | |
2790 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment4), 12, 12, 0, 0); | |
2791 | |
2792 label2 = gtk_label_new (_("<b>Volume Control</b>")); | |
2793 gtk_container_add (GTK_CONTAINER (alignment4), label2); | |
2794 gtk_label_set_use_markup (GTK_LABEL (label2), TRUE); | |
2795 gtk_misc_set_alignment (GTK_MISC (label2), 0, 0.5); | |
2796 | |
2797 alignment7 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
2798 gtk_box_pack_start (GTK_BOX (audio_page_vbox), alignment7, FALSE, FALSE, 0); | |
2799 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment7), 0, 0, 12, 0); | |
2800 | |
2801 software_volume_control = gtk_check_button_new_with_mnemonic (_("Use software volume control")); | |
2802 gtk_container_add (GTK_CONTAINER (alignment7), software_volume_control); | |
2803 gtk_tooltips_set_tip (tooltips, software_volume_control, _("Use software volume control. This may be useful for situations where your audio system does not support controlling the playback volume."), NULL); | |
2804 | |
2805 empty_notebook_page = gtk_vbox_new (FALSE, 0); | |
2806 gtk_container_add (GTK_CONTAINER (category_notebook), empty_notebook_page); | |
2807 | |
2808 hseparator1 = gtk_hseparator_new (); | |
2809 gtk_box_pack_start (GTK_BOX (vbox), hseparator1, FALSE, FALSE, 6); | |
2810 | |
2811 hbox4 = gtk_hbox_new (FALSE, 0); | |
2812 gtk_box_pack_start (GTK_BOX (vbox), hbox4, FALSE, FALSE, 0); | |
2813 | |
2814 audversionlabel = gtk_label_new (""); | |
2815 gtk_box_pack_start (GTK_BOX (hbox4), audversionlabel, FALSE, FALSE, 0); | |
2816 gtk_label_set_use_markup (GTK_LABEL (audversionlabel), TRUE); | |
2817 | |
2818 prefswin_button_box = gtk_hbutton_box_new (); | |
2819 gtk_box_pack_start (GTK_BOX (hbox4), prefswin_button_box, TRUE, TRUE, 0); | |
2820 gtk_button_box_set_layout (GTK_BUTTON_BOX (prefswin_button_box), GTK_BUTTONBOX_END); | |
2821 gtk_box_set_spacing (GTK_BOX (prefswin_button_box), 6); | |
2822 | |
2823 reload_plugins = gtk_button_new (); | |
2824 gtk_container_add (GTK_CONTAINER (prefswin_button_box), reload_plugins); | |
2825 GTK_WIDGET_SET_FLAGS (reload_plugins, GTK_CAN_DEFAULT); | |
2826 | |
2827 alignment93 = gtk_alignment_new (0.5, 0.5, 0, 0); | |
2828 gtk_container_add (GTK_CONTAINER (reload_plugins), alignment93); | |
2829 | |
2830 hbox11 = gtk_hbox_new (FALSE, 2); | |
2831 gtk_container_add (GTK_CONTAINER (alignment93), hbox11); | |
2832 | |
2833 image10 = gtk_image_new_from_stock ("gtk-refresh", GTK_ICON_SIZE_BUTTON); | |
2834 gtk_box_pack_start (GTK_BOX (hbox11), image10, FALSE, FALSE, 0); | |
2835 | |
2836 label102 = gtk_label_new_with_mnemonic (_("Reload Plugins")); | |
2837 gtk_box_pack_start (GTK_BOX (hbox11), label102, FALSE, FALSE, 0); | |
2838 | |
2839 close = gtk_button_new_from_stock ("gtk-close"); | |
2840 gtk_container_add (GTK_CONTAINER (prefswin_button_box), close); | |
2841 GTK_WIDGET_SET_FLAGS (close, GTK_CAN_DEFAULT); | |
2842 gtk_widget_add_accelerator (close, "clicked", accel_group, | |
2843 GDK_Escape, (GdkModifierType) 0, | |
2844 GTK_ACCEL_VISIBLE); | |
2845 | |
2846 | |
2847 gtk_label_set_mnemonic_widget (GTK_LABEL (input_plugin_list_label), category_notebook); | |
2848 gtk_label_set_mnemonic_widget (GTK_LABEL (label11), category_notebook); | |
2849 gtk_label_set_mnemonic_widget (GTK_LABEL (label53), category_notebook); | |
2850 gtk_label_set_mnemonic_widget (GTK_LABEL (label64), category_notebook); | |
2851 gtk_label_set_mnemonic_widget (GTK_LABEL (label103), category_notebook); | |
2852 gtk_label_set_mnemonic_widget (GTK_LABEL (label104), category_notebook); | |
2853 gtk_label_set_mnemonic_widget (GTK_LABEL (label105), fontbutton1); | |
2854 gtk_label_set_mnemonic_widget (GTK_LABEL (label106), fontbutton2); | |
2855 | |
2856 gtk_window_add_accel_group (GTK_WINDOW (prefswin), accel_group); | |
2857 | |
2858 /* connect signals */ | |
2859 g_signal_connect(G_OBJECT(prefswin), "delete_event", | |
2860 G_CALLBACK(gtk_widget_hide_on_delete), | |
2861 NULL); | |
2862 g_signal_connect_after(G_OBJECT(input_plugin_view), "realize", | |
2863 G_CALLBACK(on_input_plugin_view_realize), | |
2864 NULL); | |
2865 g_signal_connect_after(G_OBJECT(general_plugin_view), "realize", | |
2866 G_CALLBACK(on_general_plugin_view_realize), | |
2867 NULL); | |
2868 g_signal_connect_after(G_OBJECT(vis_plugin_view), "realize", | |
2869 G_CALLBACK(on_vis_plugin_view_realize), | |
2870 NULL); | |
2871 g_signal_connect_after(G_OBJECT(effect_plugin_view), "realize", | |
2872 G_CALLBACK(on_effect_plugin_view_realize), | |
2873 NULL); | |
2874 g_signal_connect(G_OBJECT(colorspace_button), "clicked", | |
2875 G_CALLBACK(on_colorize_button_clicked), | |
2876 NULL); | |
2877 g_signal_connect_swapped(G_OBJECT(skin_refresh_button), "clicked", | |
2878 G_CALLBACK(on_skin_refresh_button_clicked), | |
2879 prefswin); | |
2880 g_signal_connect_after(G_OBJECT(skin_view), "realize", | |
2881 G_CALLBACK(on_skin_view_realize), | |
2882 NULL); | |
2883 g_signal_connect_after(G_OBJECT(fontbutton1), "realize", | |
2884 G_CALLBACK(on_mainwin_font_button_realize), | |
2885 NULL); | |
2886 g_signal_connect(G_OBJECT(fontbutton1), "font_set", | |
2887 G_CALLBACK(on_mainwin_font_button_font_set), | |
2888 NULL); | |
2889 g_signal_connect_after(G_OBJECT(fontbutton2), "realize", | |
2890 G_CALLBACK(on_playlist_font_button_realize), | |
2891 NULL); | |
2892 g_signal_connect(G_OBJECT(fontbutton2), "font_set", | |
2893 G_CALLBACK(on_playlist_font_button_font_set), | |
2894 NULL); | |
2895 g_signal_connect(G_OBJECT(checkbutton11), "toggled", | |
2896 G_CALLBACK(on_use_bitmap_fonts_toggled), | |
2897 NULL); | |
2898 g_signal_connect_after(G_OBJECT(checkbutton11), "realize", | |
2899 G_CALLBACK(on_use_bitmap_fonts_realize), | |
2900 NULL); | |
2901 g_signal_connect(G_OBJECT(titlestring_entry), "changed", | |
2902 G_CALLBACK(on_titlestring_entry_changed), | |
2903 NULL); | |
2904 g_signal_connect_after(G_OBJECT(titlestring_entry), "realize", | |
2905 G_CALLBACK(on_titlestring_entry_realize), | |
2906 NULL); | |
2907 g_signal_connect(G_OBJECT(checkbutton10), "toggled", | |
2908 G_CALLBACK(on_show_filepopup_for_tuple_toggled), | |
2909 NULL); | |
2910 g_signal_connect_after(G_OBJECT(checkbutton10), "realize", | |
2911 G_CALLBACK(on_show_filepopup_for_tuple_realize), | |
2912 NULL); | |
2913 g_signal_connect(G_OBJECT(filepopup_for_tuple_settings_button), "clicked", | |
2914 G_CALLBACK(on_filepopup_for_tuple_settings_clicked), | |
2915 NULL); | |
2916 g_signal_connect(G_OBJECT(eq_file_preset_entry), "changed", | |
2917 G_CALLBACK(on_eq_file_preset_entry_changed), | |
2918 NULL); | |
2919 g_signal_connect(G_OBJECT(eq_file_preset_entry), "realize", | |
2920 G_CALLBACK(on_eq_file_preset_entry_realize), | |
2921 NULL); | |
2922 g_signal_connect(G_OBJECT(eq_dir_preset_entry), "changed", | |
2923 G_CALLBACK(on_eq_dir_preset_entry_changed), | |
2924 NULL); | |
2925 g_signal_connect(G_OBJECT(eq_dir_preset_entry), "realize", | |
2926 G_CALLBACK(on_eq_dir_preset_entry_realize), | |
2927 NULL); | |
2928 g_signal_connect(G_OBJECT(proxy_use), "toggled", | |
4000
a0bb67450552
more code duplication removal
Tomasz Mon <desowin@gmail.com>
parents:
3999
diff
changeset
|
2929 G_CALLBACK(on_proxy_button_toggled), |
a0bb67450552
more code duplication removal
Tomasz Mon <desowin@gmail.com>
parents:
3999
diff
changeset
|
2930 "use_proxy"); |
3993 | 2931 g_signal_connect(G_OBJECT(proxy_use), "realize", |
4000
a0bb67450552
more code duplication removal
Tomasz Mon <desowin@gmail.com>
parents:
3999
diff
changeset
|
2932 G_CALLBACK(on_proxy_button_realize), |
a0bb67450552
more code duplication removal
Tomasz Mon <desowin@gmail.com>
parents:
3999
diff
changeset
|
2933 "use_proxy"); |
3993 | 2934 g_signal_connect(G_OBJECT(proxy_port), "changed", |
3999
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
2935 G_CALLBACK(on_proxy_entry_changed), |
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
2936 "proxy_port"); |
3993 | 2937 g_signal_connect(G_OBJECT(proxy_port), "realize", |
3999
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
2938 G_CALLBACK(on_proxy_entry_realize), |
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
2939 "proxy_port"); |
3993 | 2940 g_signal_connect(G_OBJECT(proxy_host), "changed", |
3999
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
2941 G_CALLBACK(on_proxy_entry_changed), |
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
2942 "proxy_host"); |
3993 | 2943 g_signal_connect(G_OBJECT(proxy_host), "realize", |
3999
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
2944 G_CALLBACK(on_proxy_entry_realize), |
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
2945 "proxy_host"); |
3993 | 2946 g_signal_connect(G_OBJECT(proxy_auth), "toggled", |
4000
a0bb67450552
more code duplication removal
Tomasz Mon <desowin@gmail.com>
parents:
3999
diff
changeset
|
2947 G_CALLBACK(on_proxy_button_toggled), |
a0bb67450552
more code duplication removal
Tomasz Mon <desowin@gmail.com>
parents:
3999
diff
changeset
|
2948 "proxy_use_auth"); |
3993 | 2949 g_signal_connect(G_OBJECT(proxy_auth), "realize", |
4000
a0bb67450552
more code duplication removal
Tomasz Mon <desowin@gmail.com>
parents:
3999
diff
changeset
|
2950 G_CALLBACK(on_proxy_button_realize), |
a0bb67450552
more code duplication removal
Tomasz Mon <desowin@gmail.com>
parents:
3999
diff
changeset
|
2951 "proxy_use_auth"); |
3993 | 2952 g_signal_connect(G_OBJECT(proxy_pass), "changed", |
3999
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
2953 G_CALLBACK(on_proxy_entry_changed), |
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
2954 "proxy_pass"); |
3993 | 2955 g_signal_connect(G_OBJECT(proxy_pass), "realize", |
3999
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
2956 G_CALLBACK(on_proxy_entry_realize), |
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
2957 "proxy_pass"); |
3993 | 2958 g_signal_connect(G_OBJECT(proxy_user), "changed", |
3999
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
2959 G_CALLBACK(on_proxy_entry_changed), |
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
2960 "proxy_user"); |
3993 | 2961 g_signal_connect(G_OBJECT(proxy_user), "realize", |
3999
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
2962 G_CALLBACK(on_proxy_entry_realize), |
fa3d61ea0a6e
remove some duplicated code
Tomasz Mon <desowin@gmail.com>
parents:
3995
diff
changeset
|
2963 "proxy_user"); |
3993 | 2964 g_signal_connect(G_OBJECT(output_plugin_bufsize), "value_changed", |
2965 G_CALLBACK(on_output_plugin_bufsize_value_changed), | |
2966 NULL); | |
2967 g_signal_connect_after(G_OBJECT(output_plugin_bufsize), "realize", | |
2968 G_CALLBACK(on_output_plugin_bufsize_realize), | |
2969 NULL); | |
2970 g_signal_connect_after(G_OBJECT(output_plugin_cbox), "realize", | |
2971 G_CALLBACK(on_output_plugin_cbox_realize), | |
2972 NULL); | |
2973 g_signal_connect(G_OBJECT(enable_src), "toggled", | |
2974 G_CALLBACK(on_enable_src_toggled), | |
2975 NULL); | |
2976 g_signal_connect(G_OBJECT(enable_src), "realize", | |
2977 G_CALLBACK(on_enable_src_realize), | |
2978 NULL); | |
2979 g_signal_connect(G_OBJECT(src_converter_type), "changed", | |
2980 G_CALLBACK(on_src_converter_type_changed), | |
2981 NULL); | |
2982 g_signal_connect_after(G_OBJECT(src_converter_type), "realize", | |
2983 G_CALLBACK(on_src_converter_type_realize), | |
2984 NULL); | |
2985 g_signal_connect(G_OBJECT(src_rate), "value_changed", | |
2986 G_CALLBACK(on_src_rate_value_changed), | |
2987 NULL); | |
2988 g_signal_connect(G_OBJECT(src_rate), "realize", | |
2989 G_CALLBACK(on_src_rate_realize), | |
2990 NULL); | |
2991 g_signal_connect(G_OBJECT(software_volume_control), "toggled", | |
2992 G_CALLBACK(on_software_volume_control_toggled), | |
2993 NULL); | |
2994 g_signal_connect(G_OBJECT(software_volume_control), "realize", | |
2995 G_CALLBACK(on_software_volume_control_realize), | |
2996 NULL); | |
2997 g_signal_connect(G_OBJECT(reload_plugins), "clicked", | |
2998 G_CALLBACK(on_reload_plugins_clicked), | |
2999 NULL); | |
3000 g_signal_connect_swapped(G_OBJECT(close), "clicked", | |
3001 G_CALLBACK(gtk_widget_hide), | |
3002 GTK_OBJECT (prefswin)); | |
2313 | 3003 |
3004 /* create category view */ | |
3993 | 3005 g_signal_connect_after(G_OBJECT(category_treeview), "realize", |
3006 G_CALLBACK(on_category_treeview_realize), | |
3007 category_notebook); | |
2313 | 3008 |
3009 /* plugin->input page */ | |
3993 | 3010 g_object_set_data(G_OBJECT(input_plugin_view), "plugin_type" , GINT_TO_POINTER(PLUGIN_VIEW_TYPE_INPUT)); |
3011 g_signal_connect(G_OBJECT(input_plugin_view), "row-activated", | |
3356 | 3012 G_CALLBACK(plugin_treeview_open_prefs), |
3353
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
3013 NULL); |
3993 | 3014 g_signal_connect(G_OBJECT(input_plugin_view), "cursor-changed", |
3355
31ecb89e871c
introduce plugin_treeview_enable_prefs and plugin_treeview_enable_info
Tomasz Mon <desowin@gmail.com>
parents:
3353
diff
changeset
|
3015 G_CALLBACK(plugin_treeview_enable_prefs), |
3993 | 3016 input_plugin_prefs); |
3017 | |
3018 g_signal_connect_swapped(G_OBJECT(input_plugin_prefs), "clicked", | |
3356 | 3019 G_CALLBACK(plugin_treeview_open_prefs), |
3993 | 3020 input_plugin_view); |
3021 | |
3022 g_signal_connect(G_OBJECT(input_plugin_view), "cursor-changed", | |
3355
31ecb89e871c
introduce plugin_treeview_enable_prefs and plugin_treeview_enable_info
Tomasz Mon <desowin@gmail.com>
parents:
3353
diff
changeset
|
3023 G_CALLBACK(plugin_treeview_enable_info), |
3993 | 3024 input_plugin_info); |
3025 g_signal_connect_swapped(G_OBJECT(input_plugin_info), "clicked", | |
3357 | 3026 G_CALLBACK(plugin_treeview_open_info), |
3993 | 3027 input_plugin_view); |
2313 | 3028 |
3029 /* plugin->output page */ | |
3030 | |
3993 | 3031 g_signal_connect(G_OBJECT(output_plugin_cbox), "changed", |
2313 | 3032 G_CALLBACK(output_plugin_enable_prefs), |
3993 | 3033 output_plugin_prefs); |
3034 g_signal_connect_swapped(G_OBJECT(output_plugin_prefs), "clicked", | |
2313 | 3035 G_CALLBACK(output_plugin_open_prefs), |
3993 | 3036 output_plugin_cbox); |
3037 | |
3038 g_signal_connect(G_OBJECT(output_plugin_cbox), "changed", | |
2313 | 3039 G_CALLBACK(output_plugin_enable_info), |
3993 | 3040 output_plugin_info); |
3041 g_signal_connect_swapped(G_OBJECT(output_plugin_info), "clicked", | |
2313 | 3042 G_CALLBACK(output_plugin_open_info), |
3993 | 3043 output_plugin_cbox); |
2313 | 3044 |
3045 /* plugin->general page */ | |
3046 | |
3993 | 3047 g_object_set_data(G_OBJECT(general_plugin_view), "plugin_type" , GINT_TO_POINTER(PLUGIN_VIEW_TYPE_GENERAL)); |
3048 g_signal_connect(G_OBJECT(general_plugin_view), "row-activated", | |
3356 | 3049 G_CALLBACK(plugin_treeview_open_prefs), |
3353
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
3050 NULL); |
2313 | 3051 |
3993 | 3052 g_signal_connect(G_OBJECT(general_plugin_view), "cursor-changed", |
3355
31ecb89e871c
introduce plugin_treeview_enable_prefs and plugin_treeview_enable_info
Tomasz Mon <desowin@gmail.com>
parents:
3353
diff
changeset
|
3053 G_CALLBACK(plugin_treeview_enable_prefs), |
3993 | 3054 general_plugin_prefs); |
3055 | |
3056 g_signal_connect_swapped(G_OBJECT(general_plugin_prefs), "clicked", | |
3356 | 3057 G_CALLBACK(plugin_treeview_open_prefs), |
3993 | 3058 general_plugin_view); |
3059 | |
3060 g_signal_connect(G_OBJECT(general_plugin_view), "cursor-changed", | |
3355
31ecb89e871c
introduce plugin_treeview_enable_prefs and plugin_treeview_enable_info
Tomasz Mon <desowin@gmail.com>
parents:
3353
diff
changeset
|
3061 G_CALLBACK(plugin_treeview_enable_info), |
3993 | 3062 general_plugin_info); |
3063 g_signal_connect_swapped(G_OBJECT(general_plugin_info), "clicked", | |
3357 | 3064 G_CALLBACK(plugin_treeview_open_info), |
3993 | 3065 general_plugin_view); |
2313 | 3066 |
3067 | |
3068 /* plugin->vis page */ | |
3069 | |
3993 | 3070 g_object_set_data(G_OBJECT(vis_plugin_view), "plugin_type" , GINT_TO_POINTER(PLUGIN_VIEW_TYPE_VIS)); |
3071 g_signal_connect(G_OBJECT(vis_plugin_view), "row-activated", | |
3356 | 3072 G_CALLBACK(plugin_treeview_open_prefs), |
3353
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
3073 NULL); |
3993 | 3074 g_signal_connect_swapped(G_OBJECT(vis_plugin_prefs), "clicked", |
3356 | 3075 G_CALLBACK(plugin_treeview_open_prefs), |
3993 | 3076 vis_plugin_view); |
3077 g_signal_connect(G_OBJECT(vis_plugin_view), "cursor-changed", | |
3078 G_CALLBACK(plugin_treeview_enable_prefs), vis_plugin_prefs); | |
3079 | |
3080 g_signal_connect(G_OBJECT(vis_plugin_view), "cursor-changed", | |
3081 G_CALLBACK(plugin_treeview_enable_info), vis_plugin_info); | |
3082 g_signal_connect_swapped(G_OBJECT(vis_plugin_info), "clicked", | |
3357 | 3083 G_CALLBACK(plugin_treeview_open_info), |
3993 | 3084 vis_plugin_view); |
2313 | 3085 |
3086 | |
3087 /* plugin->effects page */ | |
3088 | |
3993 | 3089 g_object_set_data(G_OBJECT(effect_plugin_view), "plugin_type" , GINT_TO_POINTER(PLUGIN_VIEW_TYPE_EFFECT)); |
3090 g_signal_connect(G_OBJECT(effect_plugin_view), "row-activated", | |
3356 | 3091 G_CALLBACK(plugin_treeview_open_prefs), |
3353
1cd5fb04e05b
double click on plugin row opens plugin config (if available)
Tomasz Mon <desowin@gmail.com>
parents:
3251
diff
changeset
|
3092 NULL); |
3993 | 3093 g_signal_connect_swapped(G_OBJECT(effect_plugin_prefs), "clicked", |
3356 | 3094 G_CALLBACK(plugin_treeview_open_prefs), |
3993 | 3095 effect_plugin_view); |
3096 g_signal_connect(G_OBJECT(effect_plugin_view), "cursor-changed", | |
3097 G_CALLBACK(plugin_treeview_enable_prefs), effect_plugin_prefs); | |
3098 | |
3099 g_signal_connect(G_OBJECT(effect_plugin_view), "cursor-changed", | |
3100 G_CALLBACK(plugin_treeview_enable_info), effect_plugin_info); | |
3101 g_signal_connect_swapped(G_OBJECT(effect_plugin_info), "clicked", | |
3357 | 3102 G_CALLBACK(plugin_treeview_open_info), |
3993 | 3103 effect_plugin_view); |
2313 | 3104 |
3105 /* playlist page */ | |
3106 | |
3993 | 3107 g_signal_connect(skin_view, "drag-data-received", |
2313 | 3108 G_CALLBACK(on_skin_view_drag_data_received), |
3109 NULL); | |
3993 | 3110 bmp_drag_dest_set(skin_view); |
2313 | 3111 |
3112 g_signal_connect(mainwin, "drag-data-received", | |
3113 G_CALLBACK(mainwin_drag_data_received), | |
3993 | 3114 skin_view); |
3115 | |
3116 g_signal_connect(skin_refresh_button, "clicked", | |
2313 | 3117 G_CALLBACK(on_skin_refresh_button_clicked), |
3118 NULL); | |
3119 | |
3120 g_signal_connect(mainwin, "drag-data-received", | |
2975 | 3121 G_CALLBACK(mainwin_drag_data_received), |
3993 | 3122 fontbutton2); |
3123 | |
3124 g_signal_connect(titlestring_cbox, "realize", | |
2313 | 3125 G_CALLBACK(on_titlestring_cbox_realize), |
3993 | 3126 titlestring_entry); |
3127 g_signal_connect(titlestring_cbox, "changed", | |
2313 | 3128 G_CALLBACK(on_titlestring_cbox_changed), |
3993 | 3129 titlestring_entry); |
2313 | 3130 |
3131 /* FIXME: move this into a function */ | |
3132 /* create tag menu */ | |
3133 titlestring_tag_menu = gtk_menu_new(); | |
3134 for(i = 0; i < n_title_field_tags; i++) { | |
3991
d6ac99c2be1d
destroy colorize settings upon closing
mf0102 <0102@gmx.at>
parents:
3990
diff
changeset
|
3135 menu_item = gtk_menu_item_new_with_label(_(title_field_tags[i].name)); |
d6ac99c2be1d
destroy colorize settings upon closing
mf0102 <0102@gmx.at>
parents:
3990
diff
changeset
|
3136 gtk_menu_shell_append(GTK_MENU_SHELL(titlestring_tag_menu), menu_item); |
2313 | 3137 g_signal_connect(menu_item, "activate", |
3138 G_CALLBACK(titlestring_tag_menu_callback), | |
3139 GINT_TO_POINTER(i)); | |
3140 }; | |
3141 gtk_widget_show_all(titlestring_tag_menu); | |
3993 | 3142 |
3143 g_signal_connect(titlestring_cbox, "changed", | |
2313 | 3144 G_CALLBACK(on_titlestring_cbox_changed), |
3993 | 3145 titlestring_help_button); |
3146 g_signal_connect(titlestring_help_button, "clicked", | |
2313 | 3147 G_CALLBACK(on_titlestring_help_button_clicked), |
3148 titlestring_tag_menu); | |
3149 | |
3150 /* audacious version label */ | |
2467 | 3151 |
2468
5206f4ef02f7
[svn] - the svn_stamp is no longer an svn revision, but a serial number
nenolod
parents:
2467
diff
changeset
|
3152 aud_version_string = g_strdup_printf("<span size='small'>%s (%s) (%s@%s)</span>", |
3991
d6ac99c2be1d
destroy colorize settings upon closing
mf0102 <0102@gmx.at>
parents:
3990
diff
changeset
|
3153 "Audacious " PACKAGE_VERSION , |
d6ac99c2be1d
destroy colorize settings upon closing
mf0102 <0102@gmx.at>
parents:
3990
diff
changeset
|
3154 svn_stamp , |
d6ac99c2be1d
destroy colorize settings upon closing
mf0102 <0102@gmx.at>
parents:
3990
diff
changeset
|
3155 g_get_user_name() , g_get_host_name() ); |
2313 | 3156 |
3993 | 3157 gtk_label_set_markup( GTK_LABEL(audversionlabel) , aud_version_string ); |
2467 | 3158 g_free(aud_version_string); |
3993 | 3159 gtk_widget_show_all(vbox); |
2313 | 3160 |
3990
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
3161 /* Create window for filepopup settings */ |
14c2d0729563
filepopup_settings is no longer in prefswin.glade
Tomasz Mon <desowin@gmail.com>
parents:
3989
diff
changeset
|
3162 create_filepopup_settings(); |
2313 | 3163 } |
3164 | |
3165 void | |
3166 show_prefs_window(void) | |
3167 { | |
2628
85acf3f98ed0
[svn] - prevent skin list overlap when it's populated for the first time and user quickly switchs to other tabs in the prefswin
giacomo
parents:
2623
diff
changeset
|
3168 static gboolean skinlist_filled = FALSE; |
85acf3f98ed0
[svn] - prevent skin list overlap when it's populated for the first time and user quickly switchs to other tabs in the prefswin
giacomo
parents:
2623
diff
changeset
|
3169 |
2635 | 3170 gtk_window_present(GTK_WINDOW(prefswin)); /* show or raise prefs window */ |
2628
85acf3f98ed0
[svn] - prevent skin list overlap when it's populated for the first time and user quickly switchs to other tabs in the prefswin
giacomo
parents:
2623
diff
changeset
|
3171 |
85acf3f98ed0
[svn] - prevent skin list overlap when it's populated for the first time and user quickly switchs to other tabs in the prefswin
giacomo
parents:
2623
diff
changeset
|
3172 if ( !skinlist_filled ) |
85acf3f98ed0
[svn] - prevent skin list overlap when it's populated for the first time and user quickly switchs to other tabs in the prefswin
giacomo
parents:
2623
diff
changeset
|
3173 { |
3993 | 3174 skin_view_update(GTK_TREE_VIEW(skin_view), GTK_WIDGET(skin_refresh_button)); |
2628
85acf3f98ed0
[svn] - prevent skin list overlap when it's populated for the first time and user quickly switchs to other tabs in the prefswin
giacomo
parents:
2623
diff
changeset
|
3175 skinlist_filled = TRUE; |
85acf3f98ed0
[svn] - prevent skin list overlap when it's populated for the first time and user quickly switchs to other tabs in the prefswin
giacomo
parents:
2623
diff
changeset
|
3176 } |
2313 | 3177 } |
3178 | |
3917 | 3179 void |
3180 hide_prefs_window(void) | |
3181 { | |
3182 g_return_if_fail(prefswin); | |
3183 gtk_widget_hide(GTK_WIDGET(prefswin)); | |
3184 } | |
3185 | |
2313 | 3186 static void |
3187 prefswin_page_queue_new(GtkWidget *container, gchar *name, gchar *imgurl) | |
3188 { | |
3189 CategoryQueueEntry *ent = g_malloc0(sizeof(CategoryQueueEntry)); | |
3190 | |
3191 ent->container = container; | |
3192 ent->pg_name = name; | |
3193 ent->img_url = imgurl; | |
3194 | |
3195 if (category_queue) | |
3196 ent->next = category_queue; | |
3197 | |
3198 category_queue = ent; | |
3199 } | |
3200 | |
3201 static void | |
3202 prefswin_page_queue_destroy(CategoryQueueEntry *ent) | |
3203 { | |
3204 category_queue = ent->next; | |
3205 g_free(ent); | |
3206 } | |
3207 | |
3208 /* | |
3209 * Public APIs for adding new pages to the prefs window. | |
3210 * | |
3211 * Basically, the concept here is that third party components can register themselves in the root | |
3212 * preferences window. | |
3213 * | |
3214 * From a usability standpoint this makes the application look more "united", instead of cluttered | |
3215 * and malorganised. Hopefully this option will be used further in the future. | |
3216 * | |
3217 * - nenolod | |
3218 */ | |
3219 gint | |
3220 prefswin_page_new(GtkWidget *container, gchar *name, gchar *imgurl) | |
3221 { | |
3222 GtkTreeModel *model; | |
3223 GtkTreeIter iter; | |
3224 GdkPixbuf *img = NULL; | |
3225 GtkTreeView *treeview = GTK_TREE_VIEW(category_treeview); | |
3226 gint id; | |
3227 | |
3228 if (treeview == NULL || category_notebook == NULL) | |
3229 { | |
3230 prefswin_page_queue_new(container, name, imgurl); | |
3231 return -1; | |
3232 } | |
3233 | |
3234 model = gtk_tree_view_get_model(treeview); | |
3235 | |
3236 if (model == NULL) | |
3237 { | |
3238 prefswin_page_queue_new(container, name, imgurl); | |
3239 return -1; | |
3240 } | |
3241 | |
3242 /* Make sure the widgets are visible. */ | |
3243 gtk_widget_show(container); | |
3244 id = gtk_notebook_append_page(GTK_NOTEBOOK(category_notebook), container, NULL); | |
3245 | |
3246 if (id == -1) | |
3247 return -1; | |
3248 | |
3249 if (imgurl != NULL) | |
3250 img = gdk_pixbuf_new_from_file(imgurl, NULL); | |
3251 | |
3252 gtk_list_store_append(GTK_LIST_STORE(model), &iter); | |
3253 gtk_list_store_set(GTK_LIST_STORE(model), &iter, | |
3254 CATEGORY_VIEW_COL_ICON, img, | |
3255 CATEGORY_VIEW_COL_NAME, | |
3256 name, CATEGORY_VIEW_COL_ID, id, -1); | |
3257 | |
3258 if (img != NULL) | |
3259 g_object_unref(img); | |
3260 | |
3261 return id; | |
3262 } | |
3263 | |
3264 void | |
3265 prefswin_page_destroy(GtkWidget *container) | |
3266 { | |
3267 GtkTreeModel *model; | |
3268 GtkTreeIter iter; | |
3269 GtkTreeView *treeview = GTK_TREE_VIEW(category_treeview); | |
3270 gboolean ret; | |
3271 gint id; | |
3272 gint index = -1; | |
3273 | |
3274 if (category_notebook == NULL || treeview == NULL || container == NULL) | |
3275 return; | |
3276 | |
3277 id = gtk_notebook_page_num(GTK_NOTEBOOK(category_notebook), container); | |
3278 | |
3279 if (id == -1) | |
3280 return; | |
3281 | |
3282 gtk_notebook_remove_page(GTK_NOTEBOOK(category_notebook), id); | |
3283 | |
3284 model = gtk_tree_view_get_model(treeview); | |
3285 | |
3286 if (model == NULL) | |
3287 return; | |
3288 | |
3289 ret = gtk_tree_model_get_iter_first(model, &iter); | |
3290 | |
3291 while (ret == TRUE) | |
3292 { | |
3293 gtk_tree_model_get(model, &iter, CATEGORY_VIEW_COL_ID, &index, -1); | |
3294 | |
3295 if (index == id) | |
3296 { | |
3297 gtk_list_store_remove(GTK_LIST_STORE(model), &iter); | |
3298 ret = gtk_tree_model_get_iter_first(model, &iter); | |
3299 } | |
3300 | |
3301 if (index > id) | |
3302 { | |
3303 index--; | |
3304 gtk_list_store_set(GTK_LIST_STORE(model), &iter, CATEGORY_VIEW_COL_ID, index, -1); | |
3305 } | |
3306 | |
3307 ret = gtk_tree_model_iter_next(model, &iter); | |
3308 } | |
3309 } |