Fixed multiple interface updates

pull/17/head
parent 0c79d95dab
commit 8c27a3c0c9
No known key found for this signature in database
GPG Key ID: FF1D842BF4DDE92B

@ -24,6 +24,18 @@ void on_save_done(main_window *, config_str output, int size){
void yon_interface_save(main_window *widgets){ void yon_interface_save(main_window *widgets){
if (gtk_switch_get_active(GTK_SWITCH(widgets->DefaultLayoutsSwitch))){ if (gtk_switch_get_active(GTK_SWITCH(widgets->DefaultLayoutsSwitch))){
yon_config_remove_by_key(keyboard_layout_parameter); yon_config_remove_by_key(keyboard_layout_parameter);
} else if (yon_config_check_ignore(keyboard_layout_parameter)){
GtkTreeModel *model = GTK_TREE_MODEL(widgets->LayoutsList);
GtkTreeIter iter;
int parameters_size;
config_str parameters = NULL;
for_iter(model,&iter){
char *target;
gtk_tree_model_get(model,&iter,0,&target,-1);
yon_char_parsed_add_or_create_if_exists(parameters,&parameters_size,target);
}
char *final = yon_char_parsed_to_string(parameters,parameters_size,",");
yon_config_register(keyboard_layout_parameter,keyboard_layout_parameter_command,final);
} }
} }

@ -8,6 +8,8 @@ gboolean yon_interface_update(main_window *widgets){
g_signal_handlers_block_by_func(G_OBJECT(widgets->OptionsEditButton),G_CALLBACK(on_options_open),widgets); g_signal_handlers_block_by_func(G_OBJECT(widgets->OptionsEditButton),G_CALLBACK(on_options_open),widgets);
g_signal_handlers_block_by_func(G_OBJECT(widgets->NumLockCombo),G_CALLBACK(on_num_lock_changed),widgets); g_signal_handlers_block_by_func(G_OBJECT(widgets->NumLockCombo),G_CALLBACK(on_num_lock_changed),widgets);
g_signal_handlers_block_by_func(G_OBJECT(widgets->LayoutChangingCombo),G_CALLBACK(on_options_save),widgets); g_signal_handlers_block_by_func(G_OBJECT(widgets->LayoutChangingCombo),G_CALLBACK(on_options_save),widgets);
g_signal_handlers_block_by_func(G_OBJECT(widgets->ScrollLockSwitch),G_CALLBACK(on_scroll_lock_switch),widgets);
g_signal_handlers_block_by_func(G_OBJECT(widgets->ComposeSwitch),G_CALLBACK(on_compose_switch),widgets);
// g_signal_handlers_block_by_func(G_OBJECT(widgets->TTYLayoutCombo),G_CALLBACK(on_tty_changed),widgets); // g_signal_handlers_block_by_func(G_OBJECT(widgets->TTYLayoutCombo),G_CALLBACK(on_tty_changed),widgets);
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->KeyboardModelCombo),0); gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->KeyboardModelCombo),0);
@ -116,6 +118,8 @@ gboolean yon_interface_update(main_window *widgets){
g_signal_handlers_unblock_by_func(G_OBJECT(widgets->OptionsEditButton),G_CALLBACK(on_options_open),widgets); g_signal_handlers_unblock_by_func(G_OBJECT(widgets->OptionsEditButton),G_CALLBACK(on_options_open),widgets);
g_signal_handlers_unblock_by_func(G_OBJECT(widgets->NumLockCombo),G_CALLBACK(on_num_lock_changed),widgets); g_signal_handlers_unblock_by_func(G_OBJECT(widgets->NumLockCombo),G_CALLBACK(on_num_lock_changed),widgets);
g_signal_handlers_unblock_by_func(G_OBJECT(widgets->LayoutChangingCombo),G_CALLBACK(on_options_save),widgets); g_signal_handlers_unblock_by_func(G_OBJECT(widgets->LayoutChangingCombo),G_CALLBACK(on_options_save),widgets);
g_signal_handlers_unblock_by_func(G_OBJECT(widgets->ScrollLockSwitch),G_CALLBACK(on_scroll_lock_switch),widgets);
g_signal_handlers_unblock_by_func(G_OBJECT(widgets->ComposeSwitch),G_CALLBACK(on_compose_switch),widgets);
// g_signal_handlers_unblock_by_func(G_OBJECT(widgets->TTYLayoutCombo),G_CALLBACK(on_tty_changed),widgets); // g_signal_handlers_unblock_by_func(G_OBJECT(widgets->TTYLayoutCombo),G_CALLBACK(on_tty_changed),widgets);
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
} }

Loading…
Cancel
Save