Remove dynamic update of GUI layout
authorHugo Villeneuve <hugo@hugovil.com>
Tue, 21 Jan 2014 05:05:32 +0000 (00:05 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Thu, 23 Jan 2014 05:18:35 +0000 (00:18 -0500)
The application must restarted for the changes to take effect.

Added a message for telling this to the user.

src/gtk/emugtk.c
src/gtk/emugtk.h
src/gtk/viewmenu.c

index 0377ddc..d2fc533 100644 (file)
@@ -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");
 
index a1101ed..a590fab 100644 (file)
@@ -33,9 +33,6 @@ emugtk_new_file(char *file);
 void
 emugtk_UpdateDisplay(void);
 
-void
-emugtk_restart_gui(void);
-
 void
 emugtk_quit_gui(void);
 
index 04fca27..b4ce153 100644 (file)
@@ -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);
        }
 }