diff --git a/gnoemoe/gm-color-table.c b/gnoemoe/gm-color-table.c index 1bdbd76..5d6c50a 100644 --- a/gnoemoe/gm-color-table.c +++ b/gnoemoe/gm-color-table.c @@ -238,7 +238,7 @@ gm_color_table_fill_from_options(GmColorTable *table) { gm_color_table_set_use_system_font(table, TRUE); } else { value = gm_options_get(options, "font_family"); - + if (!value || *value == '\0') { font = gm_color_table_default_font(table); gm_options_set(options, "font_family", font); @@ -471,9 +471,9 @@ gm_color_table_load_scheme(GmColorTable *table, void gm_color_table_set_from_scheme_name(GmColorTable *table, gchar const *scheme) { - int i = 0; + gint i = 0; - while (scheme_names[i].name != NULL) { + while (scheme_names[i].name) { if (strcasecmp(scheme_names[i].name, scheme) == 0) { gm_color_table_load_scheme(table, scheme_names[i].scheme); break; @@ -492,6 +492,20 @@ gm_color_table_set_from_scheme_name(GmColorTable *table, gchar const *scheme) { } } +gchar const * +gm_color_table_get_scheme_name(GmColorTable *table) { + gint i = 0; + + while (scheme_names[i].name) { + if (scheme_names[i].scheme == table->priv->scheme) { + return scheme_names[i].name; + } + ++i; + } + + return NULL; +} + /* Callbacks */ static void on_gm_color_table_monospace_font_change_notify(GConfClient *client, diff --git a/gnoemoe/gm-color-table.h b/gnoemoe/gm-color-table.h index 62929ab..bcbb195 100644 --- a/gnoemoe/gm-color-table.h +++ b/gnoemoe/gm-color-table.h @@ -82,6 +82,8 @@ void gm_color_table_load_scheme(GmColorTable *table, GmColorTableScheme scheme); void gm_color_table_set_from_scheme_name(GmColorTable *table, gchar const *name); +gchar const *gm_color_table_get_scheme_name(GmColorTable *table); + void gm_color_table_set_from_options(GmColorTable *table, GmOptions *options); G_END_DECLS