]> Untitled Git - emu8051.git/commitdiff
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 0377ddcba605de3b1012a2ff44889335acb88854..d2fc5330ba6f3988709b7275d413996cf770bbdd 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 a1101ed9c355caf5f8afd3a1aa0a7c8869342ea9..a590fab68dd8e5e146c5d63c8935919797bf1fea 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 04fca27c69646e7e5b51da7a4a7617e02e530489..b4ce153c82caf50a27ba9d3b4c84011048b42c82 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);
        }
 }