comparison src/audacious/ui_main.c @ 3165:8775dfc57ead trunk

Remove mainwin_set_info_text() craq. Still some work to do.
author William Pitcock <nenolod@atheme-project.org>
date Wed, 25 Jul 2007 15:46:00 -0500
parents f9d34bc5079f
children b1964057a1a0
comparison
equal deleted inserted replaced
3160:03ff51c6412f 3165:8775dfc57ead
89 #include "ui_skinned_menurow.h" 89 #include "ui_skinned_menurow.h"
90 #include "ui_skinned_playstatus.h" 90 #include "ui_skinned_playstatus.h"
91 #include "ui_skinned_monostereo.h" 91 #include "ui_skinned_monostereo.h"
92 #include "ui_jumptotrack.h" 92 #include "ui_jumptotrack.h"
93 93
94 #include "ui_main_evlisteners.h"
95
94 static GTimeVal cb_time; /* click delay for tristate is defined by TRISTATE_THRESHOLD */ 96 static GTimeVal cb_time; /* click delay for tristate is defined by TRISTATE_THRESHOLD */
95 97
96 #define ITEM_SEPARATOR {"/-", NULL, NULL, 0, "<Separator>"} 98 #define ITEM_SEPARATOR {"/-", NULL, NULL, 0, "<Separator>"}
97 #define TRISTATE_THRESHOLD 200 99 #define TRISTATE_THRESHOLD 200
98 100
584 gdk_flush(); 586 gdk_flush();
585 } 587 }
586 } 588 }
587 589
588 590
589 void
590 mainwin_set_info_text(void)
591 {
592 gchar *text;
593
594 if (mainwin_info_text_locked)
595 return;
596
597 if ((text = input_get_info_text()) != NULL) {
598 ui_skinned_textbox_set_text(mainwin_info, text);
599 g_free(text);
600 }
601 else if ((text = playlist_get_info_text(playlist_get_active())) != NULL) {
602 ui_skinned_textbox_set_text(mainwin_info, text);
603 g_free(text);
604 }
605 }
606
607 static gchar *mainwin_tb_old_text = NULL; 591 static gchar *mainwin_tb_old_text = NULL;
608 592
609 void 593 void
610 mainwin_lock_info_text(const gchar * text) 594 mainwin_lock_info_text(const gchar * text)
611 { 595 {
632 else 616 else
633 ui_skinned_textbox_set_text(mainwin_info, mainwin_tb_old_text); 617 ui_skinned_textbox_set_text(mainwin_info, mainwin_tb_old_text);
634 g_free(mainwin_tb_old_text); 618 g_free(mainwin_tb_old_text);
635 mainwin_tb_old_text = NULL; 619 mainwin_tb_old_text = NULL;
636 } 620 }
637 else
638 mainwin_set_info_text(); /* XXX: best we can do */
639 } 621 }
640 622
641 623
642 static gchar * 624 static gchar *
643 make_mainwin_title(const gchar * title) 625 make_mainwin_title(const gchar * title)
2136 2118
2137 static void 2119 static void
2138 mainwin_mr_change(GtkWidget *widget, MenuRowItem i) 2120 mainwin_mr_change(GtkWidget *widget, MenuRowItem i)
2139 { 2121 {
2140 switch (i) { 2122 switch (i) {
2141 case MENUROW_NONE:
2142 mainwin_set_info_text();
2143 break;
2144 case MENUROW_OPTIONS: 2123 case MENUROW_OPTIONS:
2145 mainwin_lock_info_text(_("Options Menu")); 2124 mainwin_lock_info_text(_("Options Menu"));
2146 break; 2125 break;
2147 case MENUROW_ALWAYS: 2126 case MENUROW_ALWAYS:
2148 if (UI_SKINNED_MENUROW(mainwin_menurow)->always_selected) 2127 if (UI_SKINNED_MENUROW(mainwin_menurow)->always_selected)
2159 else 2138 else
2160 mainwin_lock_info_text(_("Enable 'Doublesize'")); 2139 mainwin_lock_info_text(_("Enable 'Doublesize'"));
2161 break; 2140 break;
2162 case MENUROW_VISUALIZATION: 2141 case MENUROW_VISUALIZATION:
2163 mainwin_lock_info_text(_("Visualization Menu")); 2142 mainwin_lock_info_text(_("Visualization Menu"));
2143 break;
2144 case MENUROW_NONE:
2164 break; 2145 break;
2165 } 2146 }
2166 } 2147 }
2167 2148
2168 static void 2149 static void
2884 2865
2885 bmp_drag_dest_set(mainwin); 2866 bmp_drag_dest_set(mainwin);
2886 2867
2887 g_signal_connect(mainwin, "key_press_event", 2868 g_signal_connect(mainwin, "key_press_event",
2888 G_CALLBACK(mainwin_keypress), NULL); 2869 G_CALLBACK(mainwin_keypress), NULL);
2870
2871 ui_main_evlistener_init();
2889 } 2872 }
2890 2873
2891 void 2874 void
2892 mainwin_create(void) 2875 mainwin_create(void)
2893 { 2876 {
3023 gtk_window_set_title(GTK_WINDOW(mainwin), mainwin_title_text); 3006 gtk_window_set_title(GTK_WINDOW(mainwin), mainwin_title_text);
3024 g_free(mainwin_title_text); 3007 g_free(mainwin_title_text);
3025 mainwin_title_text = NULL; 3008 mainwin_title_text = NULL;
3026 G_UNLOCK(mainwin_title); 3009 G_UNLOCK(mainwin_title);
3027 3010
3028 mainwin_set_info_text();
3029 playlistwin_update_list(playlist_get_active()); 3011 playlistwin_update_list(playlist_get_active());
3030 } 3012 }
3031 3013
3032 /* tristate buttons seek */ 3014 /* tristate buttons seek */
3033 if ( seek_state != MAINWIN_SEEK_NIL ) 3015 if ( seek_state != MAINWIN_SEEK_NIL )