|
|
|
|
@ -283,6 +283,7 @@ GList *yon_get_all_selected(GtkTreeView *tree, int column){
|
|
|
|
|
void on_layouts_accept(GtkWidget *self, dictionary *dict){
|
|
|
|
|
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
|
|
|
|
|
layouts_window *window = yon_dictionary_get_data(dict->first->next,layouts_window*);
|
|
|
|
|
gtk_list_store_clear(widgets->layoutsList);
|
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(window->list);
|
|
|
|
|
GList *list = yon_get_all_selected(GTK_TREE_VIEW(window->MainTree),2);
|
|
|
|
|
char *name;
|
|
|
|
|
@ -320,6 +321,8 @@ void on_layouts_add(GtkWidget *, main_window *widgets){
|
|
|
|
|
gtk_tree_view_set_model(GTK_TREE_VIEW(window->MainTree), GTK_TREE_MODEL(window->list));
|
|
|
|
|
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(window->MainTree)),GTK_SELECTION_MULTIPLE);
|
|
|
|
|
|
|
|
|
|
yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),TITLE_LABEL,icon_path,"layout_window");
|
|
|
|
|
|
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
|
|
|
|
|
@ -327,6 +330,25 @@ void on_layouts_add(GtkWidget *, main_window *widgets){
|
|
|
|
|
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_layouts_accept),dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->ChosenCell),"toggled",G_CALLBACK(on_layouts_chosen),window);
|
|
|
|
|
char *languages = config(keyboard_layout_parameter);
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(languages,&size,",");
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
for_iter(window->list,&iter){
|
|
|
|
|
int found = 0;
|
|
|
|
|
char *id;
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,0,&id,-1);
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
if (!strcmp(id,parsed[i])){
|
|
|
|
|
gtk_list_store_set(window->list,&iter,2,1,-1);
|
|
|
|
|
found=1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!found) {
|
|
|
|
|
gtk_list_store_set(window->list,&iter,2,0,-1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_layouts_remove(GtkWidget *, main_window *widgets){
|
|
|
|
|
|