* 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:
Jesse van den Kieboom 2006-09-29 12:26:16 +00:00
parent e2d462cc96
commit 49e8351958
3 changed files with 13 additions and 15 deletions

View File

@ -420,6 +420,7 @@ void
on_gm_preferences_dialog_response(GtkDialog *dialog, gint response,
gpointer user_data) {
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));
g_object_unref(preferences->xml);

View File

@ -44,8 +44,7 @@ struct poptOption poptions[] = {
GM_TYPE_APP, GmAppPrivate))
static void gm_app_destroy_worlds(GmApp *app);
static void on_signal_term(int signum);
static void on_signal_hup(int signum);
static void on_signal_quit(int signum);
struct _GmAppPrivate {
gchar *path;
@ -115,6 +114,9 @@ gm_app_get_property(GObject *object, guint prop_id, GValue *value,
static void
gm_app_finalize(GObject *object) {
GmApp *app = GM_APP(object);
if (GTK_IS_WIDGET(app->priv->view))
gtk_widget_destroy(GTK_WIDGET(app->priv->view));
gnome_vfs_shutdown();
@ -416,7 +418,7 @@ gm_app_initialize(GmApp *app) {
}
#ifdef HAVE_RUBY
app->priv->scripts = gm_scripts_new();
app->priv->scripts = gm_scripts_new();
#endif
gm_app_create_settings(app);
@ -487,8 +489,7 @@ gm_app_run(GmApp *app) {
g_strfreev(wrlds);
}
signal(SIGINT, SIG_DFL);
gtk_main();
}
@ -628,8 +629,9 @@ main(int argc, char *argv[]) {
application = gm_app_new(argc, argv);
if (application) {
signal(SIGTERM, on_signal_term);
signal(SIGHUP, on_signal_hup);
signal(SIGTERM, on_signal_quit);
signal(SIGHUP, on_signal_quit);
signal(SIGINT, on_signal_quit);
gm_app_run(application);
g_object_unref(application);
@ -639,12 +641,7 @@ main(int argc, char *argv[]) {
}
/* Signal handlers */
static void
on_signal_term(int signum) {
gtk_main_quit();
}
static void
on_signal_hup(int signum) {
static void
on_signal_quit(int signum) {
gtk_main_quit();
}

View File

@ -173,7 +173,7 @@ gm_scripts_class_init(GmScriptsClass *klass) {
void
gm_scripts_rb_init(GmScriptsClass *klass) {
ruby_init();
ruby_init();
gm_scripts_rb_world_class_init();
gm_scripts_rb_client_class_init();