|
|
|
@ -1399,25 +1399,35 @@ void on_main_delete(GtkWidget *self, main_window *widgets){
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkWidget *cur_tree;
|
|
|
|
GtkWidget *cur_tree;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
|
|
|
dialog_confirmation_data *data=malloc(sizeof(dialog_confirmation_data));
|
|
|
|
|
|
|
|
data->function=NULL;
|
|
|
|
|
|
|
|
data->data=NULL;
|
|
|
|
if (gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->MainNotebook))==0){
|
|
|
|
if (gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->MainNotebook))==0){
|
|
|
|
model = GTK_TREE_MODEL(widgets->UsersList);
|
|
|
|
model = GTK_TREE_MODEL(widgets->UsersList);
|
|
|
|
cur_tree=widgets->UsersTree;
|
|
|
|
cur_tree=widgets->UsersTree;
|
|
|
|
if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(cur_tree)),&model,&iter)){
|
|
|
|
if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(cur_tree)),&model,&iter)){
|
|
|
|
char *name;
|
|
|
|
char *name;
|
|
|
|
gtk_tree_model_get(model,&iter,2,&name,-1);
|
|
|
|
gtk_tree_model_get(model,&iter,2,&name,-1);
|
|
|
|
yon_config_remove_by_key(USERADD(name));
|
|
|
|
data->action_text=DELETE_CONFIRMATION_LABEL("user",name);
|
|
|
|
yon_config_remove_by_key(USERADD_SYNC(name));
|
|
|
|
if (yon_confirmation_dialog_call(self,data)==GTK_RESPONSE_ACCEPT){
|
|
|
|
yon_config_remove_by_key(USERSHADOW(name));
|
|
|
|
yon_config_remove_by_key(USERADD(name));
|
|
|
|
gtk_list_store_remove(GTK_LIST_STORE(model),&iter);
|
|
|
|
yon_config_remove_by_key(USERADD_SYNC(name));
|
|
|
|
}
|
|
|
|
yon_config_remove_by_key(USERSHADOW(name));
|
|
|
|
|
|
|
|
gtk_list_store_remove(GTK_LIST_STORE(model),&iter);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
model = GTK_TREE_MODEL(widgets->GroupsList);
|
|
|
|
model = GTK_TREE_MODEL(widgets->GroupsList);
|
|
|
|
cur_tree=widgets->GroupsTree;
|
|
|
|
cur_tree=widgets->GroupsTree;
|
|
|
|
if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(cur_tree)),&model,&iter)){
|
|
|
|
if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(cur_tree)),&model,&iter)){
|
|
|
|
char *name;
|
|
|
|
char *name;
|
|
|
|
gtk_tree_model_get(model,&iter,1,&name,-1);
|
|
|
|
gtk_tree_model_get(model,&iter,1,&name,-1);
|
|
|
|
yon_config_remove_by_key(GROUPADD(name));
|
|
|
|
data->action_text=DELETE_CONFIRMATION_LABEL("group",name);
|
|
|
|
gtk_list_store_remove(GTK_LIST_STORE(model),&iter);
|
|
|
|
if (yon_confirmation_dialog_call(self,data)==GTK_RESPONSE_ACCEPT){
|
|
|
|
|
|
|
|
yon_config_remove_by_key(GROUPADD(name));
|
|
|
|
|
|
|
|
gtk_list_store_remove(GTK_LIST_STORE(model),&iter);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1580,14 +1590,10 @@ main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
main_config.users_list = widgets->UsersList;
|
|
|
|
main_config.users_list = widgets->UsersList;
|
|
|
|
main_config.groups_list = widgets->GroupsList;
|
|
|
|
main_config.groups_list = widgets->GroupsList;
|
|
|
|
|
|
|
|
|
|
|
|
dialog_confirmation_data *data=malloc(sizeof(dialog_confirmation_data));
|
|
|
|
|
|
|
|
data->function=(void (*)(void*,void*))on_main_delete;
|
|
|
|
|
|
|
|
data->data=widgets;
|
|
|
|
|
|
|
|
data->action_text=DELETE_CONFIRMATION_LABEL;
|
|
|
|
|
|
|
|
/* Signal connection | Присоединение сигналов */
|
|
|
|
/* Signal connection | Присоединение сигналов */
|
|
|
|
g_signal_connect(G_OBJECT(widgets->AddButton),"clicked",G_CALLBACK(on_main_add),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->AddButton),"clicked",G_CALLBACK(on_main_add),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->EditButton),"clicked",G_CALLBACK(on_main_edit),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->EditButton),"clicked",G_CALLBACK(on_main_edit),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->DeleteButton),"clicked",G_CALLBACK(yon_confirmation_dialog_call),data);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->DeleteButton),"clicked",G_CALLBACK(on_main_delete),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->button3),"clicked",G_CALLBACK(on_standard_groups_open),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->button3),"clicked",G_CALLBACK(on_standard_groups_open),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->button2),"clicked",G_CALLBACK(on_ubl_settings_usergroups_additional_settings_open),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->button2),"clicked",G_CALLBACK(on_ubl_settings_usergroups_additional_settings_open),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->button1),"clicked",G_CALLBACK(on_settings_usergroups_system_open),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->button1),"clicked",G_CALLBACK(on_settings_usergroups_system_open),widgets);
|
|
|
|
|