From: Hugo Villeneuve Date: Tue, 21 Jan 2014 05:05:32 +0000 (-0500) Subject: Remove dynamic update of GUI layout X-Git-Tag: v2.0.0~1 X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=5e7b849e7d9263ea7e4b06ea95e989fbff251b97;p=emu8051.git Remove dynamic update of GUI layout The application must restarted for the changes to take effect. Added a message for telling this to the user. --- diff --git a/src/gtk/emugtk.c b/src/gtk/emugtk.c index 0377ddc..d2fc533 100644 --- a/src/gtk/emugtk.c +++ b/src/gtk/emugtk.c @@ -51,7 +51,6 @@ static int running; static int running_function_tag; -static int restart_gui = true; static int emugtk_window_init_complete; static GtkWidget *vpaned1; @@ -320,22 +319,10 @@ main_paned_notify_event(GtkWindow *window, GdkEvent *event, gpointer data) cfg->main_pane_pos = gtk_paned_get_position(GTK_PANED(paned)); } -void -emugtk_restart_gui(void) -{ - emugtk_stop_running(); - - gtk_widget_destroy(mainwin); - - restart_gui = true; -} - void emugtk_quit_gui(void) { gtk_main_quit(); - - restart_gui = false; } static void @@ -612,13 +599,10 @@ main(int argc, char **argv) cpu8051_Reset(); - while (restart_gui == true) { - log_info("Init GUI"); - - emugtk_window_init(); - emugtk_UpdateDisplay(); - gtk_main(); - } + log_info("Init GUI"); + emugtk_window_init(); + emugtk_UpdateDisplay(); + gtk_main(); log_info("Terminate"); diff --git a/src/gtk/emugtk.h b/src/gtk/emugtk.h index a1101ed..a590fab 100644 --- a/src/gtk/emugtk.h +++ b/src/gtk/emugtk.h @@ -33,9 +33,6 @@ emugtk_new_file(char *file); void emugtk_UpdateDisplay(void); -void -emugtk_restart_gui(void); - void emugtk_quit_gui(void); diff --git a/src/gtk/viewmenu.c b/src/gtk/viewmenu.c index 04fca27..b4ce153 100644 --- a/src/gtk/viewmenu.c +++ b/src/gtk/viewmenu.c @@ -42,7 +42,10 @@ void toggle_layout(GtkWidget *widget, gpointer data) if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { log_info(" Switching to layout %d", id); cfg->layout = id; - emugtk_restart_gui(); + + ShowMessage("Notice", + "You must restart for the changes to take effect", + GTK_JUSTIFY_LEFT, MESSAGE_DIALOG_NORMAL_FONT); } }