Removed signals from font,bold and color changes in options, these are now managed by colortable
This commit is contained in:
parent
cd49e06a1a
commit
05ea7fd98e
1 changed files with 10 additions and 35 deletions
43
src/gm-app.c
43
src/gm-app.c
|
@ -1,5 +1,5 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#include "../config.h"
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
@ -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[] = {
|
||||
{
|
||||
|
@ -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) {
|
||||
|
|
Reference in a new issue