Mercurial > audlegacy
comparison src/audacious/ui_fileinfo.c @ 4019:29650db2d5f2
added update button (currently disabled) to file info dialog
author | Eugene Zagidullin <e.asphyx@gmail.com> |
---|---|
date | Tue, 27 Nov 2007 01:58:26 +0300 |
parents | 2e80ee28c7cc |
children | 66529edae49d |
comparison
equal
deleted
inserted
replaced
4018:918ccb2644fb | 4019:29650db2d5f2 |
---|---|
48 | 48 |
49 #include "main.h" | 49 #include "main.h" |
50 #include "util.h" | 50 #include "util.h" |
51 #include "dnd.h" | 51 #include "dnd.h" |
52 #include "tuple.h" | 52 #include "tuple.h" |
53 #include "vfs.h" | |
53 | 54 |
54 #include "playlist.h" | 55 #include "playlist.h" |
55 | 56 |
56 #include "ui_main.h" | 57 #include "ui_main.h" |
57 #include "ui_playlist.h" | 58 #include "ui_playlist.h" |
73 GtkWidget *image_artwork; | 74 GtkWidget *image_artwork; |
74 | 75 |
75 GtkWidget *image_fileicon; | 76 GtkWidget *image_fileicon; |
76 GtkWidget *label_format_name; | 77 GtkWidget *label_format_name; |
77 GtkWidget *label_quality; | 78 GtkWidget *label_quality; |
79 | |
80 //static gchar *current_file = NULL; | |
81 //static InputPlugin *current_ip = NULL; | |
78 | 82 |
79 static void | 83 static void |
80 fileinfo_entry_set_text(GtkWidget *widget, const char *text) | 84 fileinfo_entry_set_text(GtkWidget *widget, const char *text) |
81 { | 85 { |
82 if (widget == NULL) | 86 if (widget == NULL) |
155 g_object_unref(G_OBJECT(pixbuf)); | 159 g_object_unref(G_OBJECT(pixbuf)); |
156 } | 160 } |
157 | 161 |
158 void fileinfo_hide(gpointer unused) | 162 void fileinfo_hide(gpointer unused) |
159 { | 163 { |
160 gtk_widget_hide(fileinfo_win); | 164 if(GTK_WIDGET_VISIBLE(fileinfo_win)) gtk_widget_hide(fileinfo_win); |
161 | 165 |
162 /* Clear it out. */ | 166 /* Clear it out. */ |
163 fileinfo_entry_set_text(entry_title, ""); | 167 fileinfo_entry_set_text(entry_title, ""); |
164 fileinfo_entry_set_text(entry_artist, ""); | 168 fileinfo_entry_set_text(entry_artist, ""); |
165 fileinfo_entry_set_text(entry_album, ""); | 169 fileinfo_entry_set_text(entry_album, ""); |
169 fileinfo_entry_set_text(entry_track, ""); | 173 fileinfo_entry_set_text(entry_track, ""); |
170 fileinfo_entry_set_text(entry_location, ""); | 174 fileinfo_entry_set_text(entry_location, ""); |
171 | 175 |
172 fileinfo_entry_set_image(image_artwork, DATA_DIR "/images/audio.png"); | 176 fileinfo_entry_set_image(image_artwork, DATA_DIR "/images/audio.png"); |
173 } | 177 } |
178 | |
179 void fileinfo_update_tuple(gpointer data) | |
180 { | |
181 /* TODO */ | |
182 } | |
183 | |
174 | 184 |
175 GdkPixbuf * | 185 GdkPixbuf * |
176 themed_icon_lookup(gint size, const gchar *name, ...) /* NULL-terminated list of icon names */ | 186 themed_icon_lookup(gint size, const gchar *name, ...) /* NULL-terminated list of icon names */ |
177 { | 187 { |
178 GtkIconTheme *icon_theme; | 188 GtkIconTheme *icon_theme; |
253 GtkWidget *codec_hbox; | 263 GtkWidget *codec_hbox; |
254 GtkWidget *codec_table; | 264 GtkWidget *codec_table; |
255 GtkWidget *table1; | 265 GtkWidget *table1; |
256 GtkWidget *bbox_close; | 266 GtkWidget *bbox_close; |
257 GtkWidget *btn_close; | 267 GtkWidget *btn_close; |
268 GtkWidget *btn_apply; | |
258 GtkWidget *alignment; | 269 GtkWidget *alignment; |
259 GtkWidget *separator; | 270 GtkWidget *separator; |
260 | 271 |
261 fileinfo_win = gtk_window_new(GTK_WINDOW_TOPLEVEL); | 272 fileinfo_win = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
262 gtk_container_set_border_width(GTK_CONTAINER(fileinfo_win), 6); | 273 gtk_container_set_border_width(GTK_CONTAINER(fileinfo_win), 6); |
428 | 439 |
429 entry_location = gtk_entry_new(); | 440 entry_location = gtk_entry_new(); |
430 gtk_container_add(GTK_CONTAINER(alignment), entry_location); | 441 gtk_container_add(GTK_CONTAINER(alignment), entry_location); |
431 | 442 |
432 bbox_close = gtk_hbutton_box_new(); | 443 bbox_close = gtk_hbutton_box_new(); |
444 gtk_box_set_spacing(GTK_BOX(bbox_close), 6); | |
433 gtk_box_pack_start(GTK_BOX(vbox1), bbox_close, FALSE, FALSE, 0); | 445 gtk_box_pack_start(GTK_BOX(vbox1), bbox_close, FALSE, FALSE, 0); |
434 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox_close), GTK_BUTTONBOX_END); | 446 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox_close), GTK_BUTTONBOX_END); |
447 | |
448 btn_apply = gtk_button_new_from_stock("gtk-apply"); | |
449 gtk_container_add(GTK_CONTAINER(bbox_close), btn_apply); | |
450 g_signal_connect(G_OBJECT(btn_apply), "clicked", (GCallback) fileinfo_update_tuple, NULL); | |
451 gtk_widget_set_sensitive(btn_apply, FALSE); | |
435 | 452 |
436 btn_close = gtk_button_new_from_stock("gtk-close"); | 453 btn_close = gtk_button_new_from_stock("gtk-close"); |
437 gtk_container_add(GTK_CONTAINER(bbox_close), btn_close); | 454 gtk_container_add(GTK_CONTAINER(bbox_close), btn_close); |
438 GTK_WIDGET_SET_FLAGS(btn_close, GTK_CAN_DEFAULT); | 455 GTK_WIDGET_SET_FLAGS(btn_close, GTK_CAN_DEFAULT); |
439 g_signal_connect(G_OBJECT(btn_close), "clicked", (GCallback) fileinfo_hide, NULL); | 456 g_signal_connect(G_OBJECT(btn_close), "clicked", (GCallback) fileinfo_hide, NULL); |
448 GdkPixbuf *icon = NULL; | 465 GdkPixbuf *icon = NULL; |
449 | 466 |
450 if (tuple == NULL) | 467 if (tuple == NULL) |
451 return; | 468 return; |
452 | 469 |
453 gtk_widget_realize(fileinfo_win); | 470 if(!GTK_WIDGET_REALIZED(fileinfo_win)) gtk_widget_realize(fileinfo_win); |
454 | 471 |
455 fileinfo_entry_set_text(entry_title, tuple_get_string(tuple, FIELD_TITLE, NULL)); | 472 fileinfo_entry_set_text(entry_title, tuple_get_string(tuple, FIELD_TITLE, NULL)); |
456 fileinfo_entry_set_text(entry_artist, tuple_get_string(tuple, FIELD_ARTIST, NULL)); | 473 fileinfo_entry_set_text(entry_artist, tuple_get_string(tuple, FIELD_ARTIST, NULL)); |
457 fileinfo_entry_set_text(entry_album, tuple_get_string(tuple, FIELD_ALBUM, NULL)); | 474 fileinfo_entry_set_text(entry_album, tuple_get_string(tuple, FIELD_ALBUM, NULL)); |
458 fileinfo_entry_set_text(entry_comment, tuple_get_string(tuple, FIELD_COMMENT, NULL)); | 475 fileinfo_entry_set_text(entry_comment, tuple_get_string(tuple, FIELD_COMMENT, NULL)); |
493 { | 510 { |
494 fileinfo_entry_set_image(image_artwork, tmp); | 511 fileinfo_entry_set_image(image_artwork, tmp); |
495 g_free(tmp); | 512 g_free(tmp); |
496 } | 513 } |
497 | 514 |
498 gtk_widget_show(fileinfo_win); | 515 if(! GTK_WIDGET_VISIBLE(fileinfo_win)) gtk_widget_show(fileinfo_win); |
499 } | 516 } |
500 | 517 |
501 void | 518 void |
502 fileinfo_show_for_path(gchar *path) | 519 fileinfo_show_for_path(gchar *path) |
503 { | 520 { |