Fixed update adter deleting user or group from system

pull/235/head
Ivan Dmitrievich Yartsev 10 months ago
parent 03fb1bc06b
commit 39827e0e42

@ -1,6 +1,8 @@
#include "ubl-settings-usergroups.h"
void on_delete_system_user(GtkWidget *, yon_confirmation_window *dialog){
void on_delete_system_user(GtkWidget *, dictionary *dict){
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
yon_confirmation_window *dialog = yon_dictionary_get_data(dict->first->next,yon_confirmation_window*);
GtkTreeModel *model = GTK_TREE_MODEL(dialog->list);
GtkTreeIter iter;
char *command=NULL;
@ -15,9 +17,12 @@ void on_delete_system_user(GtkWidget *, yon_confirmation_window *dialog){
yon_launch(yon_debug_output("%s\n",command));
}
on_subwindow_close(dialog->Window);
yon_system_load(widgets);
}
void on_delete_system_group(GtkWidget *, yon_confirmation_window *dialog){
void on_delete_system_group(GtkWidget *, dictionary *dict){
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
yon_confirmation_window *dialog = yon_dictionary_get_data(dict->first->next,yon_confirmation_window*);
GtkTreeModel *model = GTK_TREE_MODEL(dialog->list);
GtkTreeIter iter;
char *command=NULL;
@ -32,6 +37,7 @@ void on_delete_system_group(GtkWidget *, yon_confirmation_window *dialog){
yon_launch(yon_debug_output("%s\n",command));
}
on_subwindow_close(dialog->Window);
yon_system_load(widgets);
}
void yon_remove_confirmation_window_accept_clicked(GtkWidget *self,dictionary *dict){
@ -75,9 +81,12 @@ void yon_remove_confirmation_window_accept_clicked(GtkWidget *self,dictionary *d
}
} else {
yon_confirmation_window *dialog = yon_delete_confirmation_new();
dictionary *dact = NULL;
yon_dictionary_add_or_create_if_exists_with_data(dact,"widgets",widgets);
yon_dictionary_add_or_create_if_exists_with_data(dact,"dialog",dialog);
gtk_window_set_transient_for(GTK_WINDOW(dialog->Window),GTK_WINDOW(widgets->Window));
if (gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->MainNotebook))==2){
g_signal_connect(G_OBJECT(dialog->AcceptButton),"clicked",G_CALLBACK(on_delete_system_user),dialog);
g_signal_connect(G_OBJECT(dialog->AcceptButton),"clicked",G_CALLBACK(on_delete_system_user),dact);
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(widgets->SystemTree));
GtkTreeIter iter;
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->SystemTree)),&model,&iter)){
@ -94,7 +103,7 @@ void yon_remove_confirmation_window_accept_clicked(GtkWidget *self,dictionary *d
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->SystemGroupsTree)),&model,&iter)){
yon_confirmation_window *dialog = yon_delete_confirmation_new();
gtk_window_set_transient_for(GTK_WINDOW(dialog->Window),GTK_WINDOW(widgets->Window));
g_signal_connect(G_OBJECT(dialog->AcceptButton),"clicked",G_CALLBACK(on_delete_system_group),dialog);
g_signal_connect(G_OBJECT(dialog->AcceptButton),"clicked",G_CALLBACK(on_delete_system_group),dact);
gtk_widget_show(window->AcceptButton);
gtk_widget_hide(window->ConfigAcceptButton);
gtk_widget_hide(window->SystemAcceptButton);

@ -505,6 +505,6 @@ gboolean on_menu_open(GtkWidget *self,GdkEventButton *event, rmb_menu_window *wi
main_window *yon_main_window_complete(main_window *widgets);
void yon_remove_confirmation_window_accept_clicked(GtkWidget *self,dictionary *dict);
system_remove_confirmation_window *yon_system_remove_confirmation_window_new();
void on_delete_system_user(GtkWidget *, yon_confirmation_window *dialog);
void on_delete_system_group(GtkWidget *, yon_confirmation_window *dialog);
void on_delete_system_user(GtkWidget *, dictionary *dict);
void on_delete_system_group(GtkWidget *, dictionary *dict);
#endif
Loading…
Cancel
Save