* gnoemoe/gm-app.c: make sure the main view is destroyed (otherwise
the main view still holds references to the opened worlds which then don't get properly finalized). Therefore not properly saving command input history etc. Added proper finalization on SIGINT * gnoemoe/gm-scripts.c: fixed indentation * gnoemoe/dialogs/gm-preferences-dialog.c: added color table saving when dialog gets destroyed
This commit is contained in:
parent
e2d462cc96
commit
49e8351958
|
@ -420,6 +420,7 @@ void
|
||||||
on_gm_preferences_dialog_response(GtkDialog *dialog, gint response,
|
on_gm_preferences_dialog_response(GtkDialog *dialog, gint response,
|
||||||
gpointer user_data) {
|
gpointer user_data) {
|
||||||
gm_options_save(gm_app_options(gm_app_instance()));
|
gm_options_save(gm_app_options(gm_app_instance()));
|
||||||
|
gm_color_table_save(gm_app_color_table(gm_app_instance()));
|
||||||
|
|
||||||
gtk_widget_destroy(GTK_WIDGET(dialog));
|
gtk_widget_destroy(GTK_WIDGET(dialog));
|
||||||
g_object_unref(preferences->xml);
|
g_object_unref(preferences->xml);
|
||||||
|
|
|
@ -44,8 +44,7 @@ struct poptOption poptions[] = {
|
||||||
GM_TYPE_APP, GmAppPrivate))
|
GM_TYPE_APP, GmAppPrivate))
|
||||||
|
|
||||||
static void gm_app_destroy_worlds(GmApp *app);
|
static void gm_app_destroy_worlds(GmApp *app);
|
||||||
static void on_signal_term(int signum);
|
static void on_signal_quit(int signum);
|
||||||
static void on_signal_hup(int signum);
|
|
||||||
|
|
||||||
struct _GmAppPrivate {
|
struct _GmAppPrivate {
|
||||||
gchar *path;
|
gchar *path;
|
||||||
|
@ -115,6 +114,9 @@ gm_app_get_property(GObject *object, guint prop_id, GValue *value,
|
||||||
static void
|
static void
|
||||||
gm_app_finalize(GObject *object) {
|
gm_app_finalize(GObject *object) {
|
||||||
GmApp *app = GM_APP(object);
|
GmApp *app = GM_APP(object);
|
||||||
|
|
||||||
|
if (GTK_IS_WIDGET(app->priv->view))
|
||||||
|
gtk_widget_destroy(GTK_WIDGET(app->priv->view));
|
||||||
|
|
||||||
gnome_vfs_shutdown();
|
gnome_vfs_shutdown();
|
||||||
|
|
||||||
|
@ -416,7 +418,7 @@ gm_app_initialize(GmApp *app) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_RUBY
|
#ifdef HAVE_RUBY
|
||||||
app->priv->scripts = gm_scripts_new();
|
app->priv->scripts = gm_scripts_new();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gm_app_create_settings(app);
|
gm_app_create_settings(app);
|
||||||
|
@ -487,8 +489,7 @@ gm_app_run(GmApp *app) {
|
||||||
|
|
||||||
g_strfreev(wrlds);
|
g_strfreev(wrlds);
|
||||||
}
|
}
|
||||||
|
|
||||||
signal(SIGINT, SIG_DFL);
|
|
||||||
gtk_main();
|
gtk_main();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -628,8 +629,9 @@ main(int argc, char *argv[]) {
|
||||||
application = gm_app_new(argc, argv);
|
application = gm_app_new(argc, argv);
|
||||||
|
|
||||||
if (application) {
|
if (application) {
|
||||||
signal(SIGTERM, on_signal_term);
|
signal(SIGTERM, on_signal_quit);
|
||||||
signal(SIGHUP, on_signal_hup);
|
signal(SIGHUP, on_signal_quit);
|
||||||
|
signal(SIGINT, on_signal_quit);
|
||||||
|
|
||||||
gm_app_run(application);
|
gm_app_run(application);
|
||||||
g_object_unref(application);
|
g_object_unref(application);
|
||||||
|
@ -639,12 +641,7 @@ main(int argc, char *argv[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Signal handlers */
|
/* Signal handlers */
|
||||||
static void
|
static void
|
||||||
on_signal_term(int signum) {
|
on_signal_quit(int signum) {
|
||||||
gtk_main_quit();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
on_signal_hup(int signum) {
|
|
||||||
gtk_main_quit();
|
gtk_main_quit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,7 @@ gm_scripts_class_init(GmScriptsClass *klass) {
|
||||||
|
|
||||||
void
|
void
|
||||||
gm_scripts_rb_init(GmScriptsClass *klass) {
|
gm_scripts_rb_init(GmScriptsClass *klass) {
|
||||||
ruby_init();
|
ruby_init();
|
||||||
|
|
||||||
gm_scripts_rb_world_class_init();
|
gm_scripts_rb_world_class_init();
|
||||||
gm_scripts_rb_client_class_init();
|
gm_scripts_rb_client_class_init();
|
||||||
|
|
Reference in New Issue