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
45
src/gm-app.c
45
src/gm-app.c
|
@ -1,5 +1,5 @@
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include <config.h>
|
#include "../config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
@ -31,12 +31,6 @@ static GmApp *application;
|
||||||
//gboolean on_gm_app_tray_destroy(GtkWidget *widget, gpointer user_data);
|
//gboolean on_gm_app_tray_destroy(GtkWidget *widget, gpointer user_data);
|
||||||
void on_gm_app_view_size_allocate(GmAppView *view, GtkAllocation *allocation,
|
void on_gm_app_view_size_allocate(GmAppView *view, GtkAllocation *allocation,
|
||||||
GmApp *app);
|
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[] = {
|
struct poptOption poptions[] = {
|
||||||
{
|
{
|
||||||
|
@ -112,7 +106,7 @@ struct _GmAppPrivate {
|
||||||
enum {
|
enum {
|
||||||
WORLD_ADDED,
|
WORLD_ADDED,
|
||||||
WORLD_REMOVED,
|
WORLD_REMOVED,
|
||||||
NUM_SIGNALS
|
NUM_SIGNALS
|
||||||
};
|
};
|
||||||
|
|
||||||
static guint app_signals[NUM_SIGNALS] = {0};
|
static guint app_signals[NUM_SIGNALS] = {0};
|
||||||
|
@ -137,6 +131,8 @@ gm_app_finalize(GObject *object) {
|
||||||
|
|
||||||
gm_options_save(app->priv->options);
|
gm_options_save(app->priv->options);
|
||||||
g_object_unref(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_object_unref(app->priv->color_table);
|
||||||
|
|
||||||
g_free(app->priv->path);
|
g_free(app->priv->path);
|
||||||
|
@ -325,6 +321,8 @@ gm_app_load_worlds(GmApp *app, gboolean autoload) {
|
||||||
|
|
||||||
void
|
void
|
||||||
gm_app_initialize(GmApp *app) {
|
gm_app_initialize(GmApp *app) {
|
||||||
|
gchar *colors_path;
|
||||||
|
|
||||||
debug_set_level(debug_level);
|
debug_set_level(debug_level);
|
||||||
|
|
||||||
app->priv->worlds_path = g_strconcat(app->priv->path, G_DIR_SEPARATOR_S,
|
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);
|
gm_options_load(app->priv->options, app->priv->options_path);
|
||||||
|
|
||||||
// Load color table
|
// Load color table
|
||||||
app->priv->color_table =
|
colors_path = g_strconcat(app->priv->path, G_DIR_SEPARATOR_S, "colors",
|
||||||
gm_color_table_new_from_options(app->priv->options);
|
NULL);
|
||||||
// Add color table signals
|
app->priv->color_table = gm_color_table_new_from_options(colors_path);
|
||||||
g_signal_connect(app->priv->color_table, "color_changed",
|
g_free(colors_path);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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);
|
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
|
/*gboolean
|
||||||
on_gm_app_tray_button_press(GtkWidget *widget, GdkEventButton *event,
|
on_gm_app_tray_button_press(GtkWidget *widget, GdkEventButton *event,
|
||||||
gpointer user_data) {
|
gpointer user_data) {
|
||||||
|
|
Reference in a new issue