diff --git a/src/pw3270/colors.c b/src/pw3270/colors.c index 6d88221..f84b062 100644 --- a/src/pw3270/colors.c +++ b/src/pw3270/colors.c @@ -240,6 +240,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) GdkColor * table = g_new0(GdkColor,(len*V3270_COLOR_COUNT)); int pos = 0; int g; + gboolean found = FALSE; g_signal_connect(G_OBJECT(widget),"changed",G_CALLBACK(color_scheme_changed),0); @@ -265,15 +266,40 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) // It's the same color, select iter trace("Current color scheme is \"%s\"",group[g]); gtk_combo_box_set_active_iter(GTK_COMBO_BOX(widget),&iter); + found = TRUE; } // move to next color list pos += V3270_COLOR_COUNT; } - g_strfreev(group); + if(!found) + { + // Custom color table, save it as a new dropdown entry. + + GdkColor * clr = g_new0(GdkColor,V3270_COLOR_COUNT); + int f; + + for(f=0;f