From 05ea7fd98e7d039b9289f696a7a8f9fd9f9a4e1c Mon Sep 17 00:00:00 2001 From: Jesse van den Kieboom Date: Sun, 6 Nov 2005 16:03:22 +0000 Subject: [PATCH] Removed signals from font,bold and color changes in options, these are now managed by colortable --- src/gm-app.c | 45 ++++++++++----------------------------------- 1 file changed, 10 insertions(+), 35 deletions(-) diff --git a/src/gm-app.c b/src/gm-app.c index 6cd039e..4e0f92f 100644 --- a/src/gm-app.c +++ b/src/gm-app.c @@ -1,5 +1,5 @@ #ifdef HAVE_CONFIG_H -# include +#include "../config.h" #endif #include @@ -31,12 +31,6 @@ static GmApp *application; //gboolean on_gm_app_tray_destroy(GtkWidget *widget, gpointer user_data); void on_gm_app_view_size_allocate(GmAppView *view, GtkAllocation *allocation, GmApp *app); -void on_gm_app_color_table_color_changed(GmColorTable *color_table, - const gchar *color, GmApp *app); -void on_gm_app_color_table_bold_toggled(GmColorTable *color_table, - gboolean bold, GmApp *app); -void on_gm_app_color_table_font_changed(GmColorTable *color_table, - const gchar *font, GmApp *app); struct poptOption poptions[] = { { @@ -112,7 +106,7 @@ struct _GmAppPrivate { enum { WORLD_ADDED, WORLD_REMOVED, - NUM_SIGNALS + NUM_SIGNALS }; static guint app_signals[NUM_SIGNALS] = {0}; @@ -137,6 +131,8 @@ gm_app_finalize(GObject *object) { gm_options_save(app->priv->options); g_object_unref(app->priv->options); + + gm_color_table_save(app->priv->color_table); g_object_unref(app->priv->color_table); g_free(app->priv->path); @@ -325,6 +321,8 @@ gm_app_load_worlds(GmApp *app, gboolean autoload) { void gm_app_initialize(GmApp *app) { + gchar *colors_path; + debug_set_level(debug_level); app->priv->worlds_path = g_strconcat(app->priv->path, G_DIR_SEPARATOR_S, @@ -345,15 +343,10 @@ gm_app_initialize(GmApp *app) { gm_options_load(app->priv->options, app->priv->options_path); // Load color table - app->priv->color_table = - gm_color_table_new_from_options(app->priv->options); - // Add color table signals - g_signal_connect(app->priv->color_table, "color_changed", - G_CALLBACK(on_gm_app_color_table_color_changed), app); - g_signal_connect(app->priv->color_table, "font_changed", - G_CALLBACK(on_gm_app_color_table_font_changed), app); - g_signal_connect(app->priv->color_table, "bold_toggled", - G_CALLBACK(on_gm_app_color_table_bold_toggled), app); + colors_path = g_strconcat(app->priv->path, G_DIR_SEPARATOR_S, "colors", + NULL); + app->priv->color_table = gm_color_table_new_from_options(colors_path); + g_free(colors_path); } void @@ -559,24 +552,6 @@ on_gm_app_view_size_allocate(GmAppView *view, GtkAllocation *allocation, gm_options_set_int(app->priv->options, "height", allocation->height); } -void -on_gm_app_color_table_color_changed(GmColorTable *color_table, - const gchar *color, GmApp *app) { - gm_options_set(app->priv->options, color, - gm_color_table_get_hex(color_table, color)); -} - -void -on_gm_app_color_table_bold_toggled(GmColorTable *color_table, - gboolean bold, GmApp *app) { - gm_options_set_int(app->priv->options, "bold-colors", bold); -} - -void on_gm_app_color_table_font_changed(GmColorTable *color_table, - const gchar *font, GmApp *app) { - gm_options_set(app->priv->options, "font-family", font); -} - /*gboolean on_gm_app_tray_button_press(GtkWidget *widget, GdkEventButton *event, gpointer user_data) {