.network_read_flag = FALSE,
};
+int _emulator_condition = 0;
PHONEMODELINFO PHONE;
GtkWidget *g_main_window;
int device_count = 0;
GIOChannel *channel=NULL;
+int get_emulator_condition(void)
+{
+ return _emulator_condition;
+}
+
+void set_emulator_condition(int state)
+{
+ _emulator_condition = state;
+}
+
struct _arglist {
char *argv[QEMUARGC];
int argc;
*/
void exit_emulator(void)
{
+ set_emulator_condition(EMUL_SHUTTING_DOWN);
#if 1 /* graceful shutdown */
g_signal_connect (G_OBJECT(g_main_window), "button_release_event", G_CALLBACK(motion_notify_event_handler), NULL);
g_signal_connect (G_OBJECT(g_main_window), "key_press_event", G_CALLBACK(key_event_handler), NULL);
g_signal_connect (G_OBJECT(g_main_window), "key_release_event", G_CALLBACK(key_event_handler), NULL);
- g_signal_connect (G_OBJECT(g_main_window), "delete-event", G_CALLBACK(exit_emulator), NULL);
+ //g_signal_connect (G_OBJECT(g_main_window), "delete-event", G_CALLBACK(exit_emulator), NULL);
g_signal_connect (G_OBJECT(g_main_window), "configure_event", G_CALLBACK(configure_event), NULL);
//g_object_set (g_main_window, "has-tooltip", TRUE, NULL);
void append_argvlist(arglist* al, const char *fmt, ...) __attribute((__format__(__printf__,2,3)));
+enum {
+ EMUL_BOOTING = 0, //not used yet
+ EMUL_NORMAL, //not used yet
+ EMUL_SHUTTING_DOWN,
+};
+
extern void save_emulator_state(void);
extern void exit_emulator(void);
extern gboolean update_progress_bar(GIOChannel *, GIOCondition , gpointer);
extern GtkWidget *EventItem1;
extern GtkWidget *EventItem2;
+int get_emulator_condition(void);
+void set_emulator_condition(int state);
int emul_create_process(const gchar cmd[]);
void emul_kill_all_process(void);
extern int qemu_arch_is_arm(void); /* hack */
/* 2. if clicked right mouse button, create popup_menu */
GtkWidget *popup_menu = get_widget(EMULATOR_ID, POPUP_MENU);
- if (event->button == 3) {
+ if (event->button == 3 && get_emulator_condition() != EMUL_SHUTTING_DOWN) {
color.pixel = gdk_rgb_xpixel_from_rgb(0x3f3f3f); /* gray:0f */
gdk_gc_set_foreground(widget->style->fg_gc[GTK_STATE_NORMAL], &color);
gtk_menu_popup (GTK_MENU (popup_menu), NULL, NULL, NULL, NULL, event->button, event->time);
#include "qemu_gtk_widget.h"
#include "ui_imageid.h"
#include "defines.h"
+#include "emulator.h"
/* generic keyboard conversion */
#include "../../ui/sdl_keysym.h"