Commit e6f7ad6bf030d3696ff8a389dc5ab1c001f77546
1 parent
42b4cc3f
Exists in
master
and in
1 other branch
Adjustments in the settings dialogs.
Showing
7 changed files
with
34 additions
and
8 deletions
Show diff stats
src/dialogs/settings/clipboard.c
| @@ -300,6 +300,7 @@ static void V3270ClipboardSettings_init(V3270ClipboardSettings *widget) { | @@ -300,6 +300,7 @@ static void V3270ClipboardSettings_init(V3270ClipboardSettings *widget) { | ||
| 300 | } | 300 | } |
| 301 | 301 | ||
| 302 | // Load color schemes | 302 | // Load color schemes |
| 303 | +#ifdef DEBUG | ||
| 303 | { | 304 | { |
| 304 | lib3270_autoptr(char) filename = lib3270_build_data_filename("colors.conf",NULL); | 305 | lib3270_autoptr(char) filename = lib3270_build_data_filename("colors.conf",NULL); |
| 305 | if(g_file_test(filename,G_FILE_TEST_IS_REGULAR)) { | 306 | if(g_file_test(filename,G_FILE_TEST_IS_REGULAR)) { |
| @@ -342,6 +343,7 @@ static void V3270ClipboardSettings_init(V3270ClipboardSettings *widget) { | @@ -342,6 +343,7 @@ static void V3270ClipboardSettings_init(V3270ClipboardSettings *widget) { | ||
| 342 | g_key_file_free(keyfile); | 343 | g_key_file_free(keyfile); |
| 343 | } | 344 | } |
| 344 | } | 345 | } |
| 346 | +#endif // DEBUG | ||
| 345 | 347 | ||
| 346 | // Copy format combo | 348 | // Copy format combo |
| 347 | static const gchar * copy_formats[] = { | 349 | static const gchar * copy_formats[] = { |
| @@ -485,10 +487,6 @@ static void load(GtkWidget *w, GtkWidget *t) { | @@ -485,10 +487,6 @@ static void load(GtkWidget *w, GtkWidget *t) { | ||
| 485 | 487 | ||
| 486 | } | 488 | } |
| 487 | 489 | ||
| 488 | -#ifndef DEBUG | ||
| 489 | - gtk_widget_set_sensitive(GTK_WIDGET(widget->input.combos[1]),FALSE); | ||
| 490 | -#endif // DEBUG | ||
| 491 | - | ||
| 492 | } | 490 | } |
| 493 | 491 | ||
| 494 | static gchar get_active_id(V3270ClipboardSettings *widget, size_t combo) { | 492 | static gchar get_active_id(V3270ClipboardSettings *widget, size_t combo) { |
src/dialogs/settings/host.c
| @@ -75,18 +75,20 @@ | @@ -75,18 +75,20 @@ | ||
| 75 | { | 75 | { |
| 76 | .left = 6, | 76 | .left = 6, |
| 77 | .top = 1, | 77 | .top = 1, |
| 78 | - .width = 1, | 78 | + .width = 2, |
| 79 | .grid = EMULATION, | 79 | .grid = EMULATION, |
| 80 | .id = LIB3270_TOGGLE_ALTSCREEN, | 80 | .id = LIB3270_TOGGLE_ALTSCREEN, |
| 81 | }, | 81 | }, |
| 82 | 82 | ||
| 83 | + /* | ||
| 83 | { | 84 | { |
| 84 | - .left = 7, | ||
| 85 | - .top = 1, | 85 | + .left = 1, |
| 86 | + .top = 3, | ||
| 86 | .width = 1, | 87 | .width = 1, |
| 87 | .grid = EMULATION, | 88 | .grid = EMULATION, |
| 88 | .id = LIB3270_TOGGLE_MONOCASE, | 89 | .id = LIB3270_TOGGLE_MONOCASE, |
| 89 | }, | 90 | }, |
| 91 | + */ | ||
| 90 | 92 | ||
| 91 | }; | 93 | }; |
| 92 | 94 |
src/include/terminal.h
| @@ -174,6 +174,7 @@ G_BEGIN_DECLS | @@ -174,6 +174,7 @@ G_BEGIN_DECLS | ||
| 174 | 174 | ||
| 175 | struct { | 175 | struct { |
| 176 | gchar * scheme; ///< @brief Name of the selection color scheme | 176 | gchar * scheme; ///< @brief Name of the selection color scheme |
| 177 | + gchar * value; ///< @brief List of colors for selection. | ||
| 177 | } color; | 178 | } color; |
| 178 | 179 | ||
| 179 | } selection; | 180 | } selection; |
src/selection/selection.c
| @@ -163,11 +163,16 @@ void v3270_selection_set_color_scheme(GtkWidget *widget, const gchar *name) { | @@ -163,11 +163,16 @@ void v3270_selection_set_color_scheme(GtkWidget *widget, const gchar *name) { | ||
| 163 | 163 | ||
| 164 | v3270 * terminal = GTK_V3270(widget); | 164 | v3270 * terminal = GTK_V3270(widget); |
| 165 | 165 | ||
| 166 | - if(terminal->selection.font_family) { | 166 | + if(terminal->selection.color.scheme) { |
| 167 | g_free(terminal->selection.color.scheme); | 167 | g_free(terminal->selection.color.scheme); |
| 168 | terminal->selection.color.scheme = NULL; | 168 | terminal->selection.color.scheme = NULL; |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | + if(terminal->selection.color.scheme) { | ||
| 172 | + g_free(terminal->selection.color.value); | ||
| 173 | + terminal->selection.color.value = NULL; | ||
| 174 | + } | ||
| 175 | + | ||
| 171 | if(name) { | 176 | if(name) { |
| 172 | terminal->selection.color.scheme = g_strdup(name); | 177 | terminal->selection.color.scheme = g_strdup(name); |
| 173 | } | 178 | } |
src/terminal/keyfile.c
| @@ -302,6 +302,7 @@ | @@ -302,6 +302,7 @@ | ||
| 302 | 302 | ||
| 303 | // Save internal properties | 303 | // Save internal properties |
| 304 | save_string(key_file, group_name, "selection-font-family", terminal->selection.font_family); | 304 | save_string(key_file, group_name, "selection-font-family", terminal->selection.font_family); |
| 305 | + save_string(key_file, group_name, "selection-color-scheme", terminal->selection.color.scheme); | ||
| 305 | 306 | ||
| 306 | // Save Toggles | 307 | // Save Toggles |
| 307 | for(ix = 0; ix < G_N_ELEMENTS(klass->properties.toggle); ix++) | 308 | for(ix = 0; ix < G_N_ELEMENTS(klass->properties.toggle); ix++) |
| @@ -335,6 +336,12 @@ | @@ -335,6 +336,12 @@ | ||
| 335 | 336 | ||
| 336 | // Load internal properties. | 337 | // Load internal properties. |
| 337 | load_string(key_file, group_name, "selection-font-family", &terminal->selection.font_family); | 338 | load_string(key_file, group_name, "selection-font-family", &terminal->selection.font_family); |
| 339 | + load_string(key_file, group_name, "selection-color-scheme", &terminal->selection.color.scheme); | ||
| 340 | + | ||
| 341 | + if(terminal->selection.color.value) { | ||
| 342 | + g_free(terminal->selection.color.value); | ||
| 343 | + terminal->selection.color.value = NULL; | ||
| 344 | + } | ||
| 338 | 345 | ||
| 339 | // Load session_name | 346 | // Load session_name |
| 340 | if(g_key_file_has_key(key_file,group_name,"session-name",NULL)) { | 347 | if(g_key_file_has_key(key_file,group_name,"session-name",NULL)) { |
src/terminal/widget.c
| @@ -193,6 +193,11 @@ static void finalize(GObject *object) { | @@ -193,6 +193,11 @@ static void finalize(GObject *object) { | ||
| 193 | terminal->selection.color.scheme = NULL; | 193 | terminal->selection.color.scheme = NULL; |
| 194 | } | 194 | } |
| 195 | 195 | ||
| 196 | + if(terminal->selection.color.value) { | ||
| 197 | + g_free(terminal->selection.color.value); | ||
| 198 | + terminal->selection.color.value = NULL; | ||
| 199 | + } | ||
| 200 | + | ||
| 196 | G_OBJECT_CLASS(v3270_parent_class)->finalize(object); | 201 | G_OBJECT_CLASS(v3270_parent_class)->finalize(object); |
| 197 | } | 202 | } |
| 198 | 203 |
src/terminal/windows/registry.c
| @@ -257,6 +257,7 @@ | @@ -257,6 +257,7 @@ | ||
| 257 | 257 | ||
| 258 | // Save internal properties | 258 | // Save internal properties |
| 259 | save_string(hKey, "selection-font-family", terminal->selection.font_family); | 259 | save_string(hKey, "selection-font-family", terminal->selection.font_family); |
| 260 | + save_string(hKey, "selection-color-scheme", &terminal->selection.color.scheme); | ||
| 260 | 261 | ||
| 261 | // Save Toggles | 262 | // Save Toggles |
| 262 | for(ix = 0; ix < G_N_ELEMENTS(klass->properties.toggle); ix++) | 263 | for(ix = 0; ix < G_N_ELEMENTS(klass->properties.toggle); ix++) |
| @@ -315,6 +316,13 @@ | @@ -315,6 +316,13 @@ | ||
| 315 | 316 | ||
| 316 | // Load internal properties. | 317 | // Load internal properties. |
| 317 | load_string(hKey, "selection-font-family", &terminal->selection.font_family); | 318 | load_string(hKey, "selection-font-family", &terminal->selection.font_family); |
| 319 | + load_string(hKey, "selection-color-scheme", &terminal->selection.color.scheme); | ||
| 320 | + | ||
| 321 | + if(terminal->selection.color.value) { | ||
| 322 | + g_free(terminal->selection.color.value); | ||
| 323 | + terminal->selection.color.value = NULL; | ||
| 324 | + } | ||
| 325 | + | ||
| 318 | 326 | ||
| 319 | // Load Toggles | 327 | // Load Toggles |
| 320 | for(ix = 0; ix < G_N_ELEMENTS(klass->properties.toggle); ix++) | 328 | for(ix = 0; ix < G_N_ELEMENTS(klass->properties.toggle); ix++) |