Confirmation windows rename

pull/235/head
Ivan Dmitrievich Yartsev 10 months ago
parent 2a7e77b5d2
commit 11de595707

@ -75,7 +75,7 @@ void yon_remove_confirmation_window_accept_clicked(GtkWidget *self,dictionary *d
} }
gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->MainNotebook),0); gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->MainNotebook),0);
yon_delete_confirmation_open(widgets); yon_delete_confirmation_open(widgets);
} else { } else if (self == window->AcceptButton || self == window->SystemAcceptButton) {
GtkTreeIter iter, itar; GtkTreeIter iter, itar;
GtkTreeModel *model; GtkTreeModel *model;
char *target; char *target;

@ -2169,9 +2169,6 @@ void on_main_edit_activate(GtkWidget *self, GtkTreePath *, GtkTreeViewColumn *,
} }
void on_main_delete(GtkWidget *, main_window *widgets){ void on_main_delete(GtkWidget *, main_window *widgets){
dialog_confirmation_data *data=malloc(sizeof(dialog_confirmation_data));
data->function=NULL;
data->data=NULL;
int active = gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->MainNotebook)); int active = gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->MainNotebook));
switch(active){ switch(active){
case 0: case 0:
@ -2187,30 +2184,25 @@ void on_main_delete(GtkWidget *, main_window *widgets){
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->SystemTree)),&model,&iter)){ if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->SystemTree)),&model,&iter)){
char *target; char *target;
gtk_tree_model_get(model,&iter,2,&target,-1); gtk_tree_model_get(model,&iter,2,&target,-1);
if (config(USERADD(target))){
system_remove_confirmation_window *window = yon_system_remove_confirmation_window_new(); system_remove_confirmation_window *window = yon_system_remove_confirmation_window_new();
yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),DELETE_CONFIRMATION_TITLE_LABEL,icon_path,"user-deletion-window");
gtk_label_set_markup(GTK_LABEL(window->HeaderLabel),DELETE_CONFIRMATION_TITLE_LABEL);
gtk_label_set_markup(GTK_LABEL(window->TitleLabel),SYSTEM_USER_CONFIG_REMOVE_CONFIRMATION_LABEL(target));
dictionary *dict = NULL; 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,"widgets",widgets);
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window); yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
if (config(USERADD(target))){
yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),DELETE_CONFIRMATION_TITLE_LABEL,icon_path,"user-deletion-window");
gtk_label_set_markup(GTK_LABEL(window->HeaderLabel),DELETE_CONFIRMATION_TITLE_LABEL);
gtk_label_set_markup(GTK_LABEL(window->TitleLabel),SYSTEM_USER_CONFIG_REMOVE_CONFIRMATION_LABEL(target));
g_signal_connect(G_OBJECT(window->ConfigAcceptButton),"clicked",G_CALLBACK(yon_remove_confirmation_window_accept_clicked),dict); g_signal_connect(G_OBJECT(window->ConfigAcceptButton),"clicked",G_CALLBACK(yon_remove_confirmation_window_accept_clicked),dict);
g_signal_connect(G_OBJECT(window->SystemAcceptButton),"clicked",G_CALLBACK(yon_remove_confirmation_window_accept_clicked),dict); g_signal_connect(G_OBJECT(window->SystemAcceptButton),"clicked",G_CALLBACK(yon_remove_confirmation_window_accept_clicked),dict);
gtk_widget_show(window->Window);
} else { } else {
dialog_confirmation_data data; gtk_label_set_markup(GTK_LABEL(window->HeaderLabel),DELETE_CONFIRMATION_TITLE_LABEL);
data.action_text = SYSTEM_USER_SYSTEM_REMOVE_CONFIRMATION_LABEL(target); gtk_label_set_markup(GTK_LABEL(window->TitleLabel),SYSTEM_USER_SYSTEM_REMOVE_CONFIRMATION_LABEL(target));
data.function=NULL; gtk_widget_show(window->AcceptButton);
data.data=NULL; gtk_widget_hide(window->ConfigAcceptButton);
template_app_information.app_title = DELETE_CONFIRMATION_TITLE_LABEL; gtk_widget_hide(window->SystemAcceptButton);
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(yon_remove_confirmation_window_accept_clicked),dict);
if (yon_confirmation_dialog_call(widgets->Window,&data)!=GTK_RESPONSE_ACCEPT){
return;
}
template_app_information.app_title = TITLE_LABEL;
yon_system_delete_confirmation_open(widgets);
} }
gtk_widget_show(window->Window);
} }
}break; }break;
case 3:{ case 3:{
@ -2219,30 +2211,24 @@ void on_main_delete(GtkWidget *, main_window *widgets){
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->SystemGroupsTree)),&model,&iter)){ if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->SystemGroupsTree)),&model,&iter)){
char *target; char *target;
gtk_tree_model_get(model,&iter,1,&target,-1); gtk_tree_model_get(model,&iter,1,&target,-1);
if (config(GROUPADD(target))){
system_remove_confirmation_window *window = yon_system_remove_confirmation_window_new(); system_remove_confirmation_window *window = yon_system_remove_confirmation_window_new();
yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),DELETE_CONFIRMATION_TITLE_LABEL,icon_path,"group-deletion-window");
gtk_label_set_markup(GTK_LABEL(window->HeaderLabel),DELETE_GROUP_CONFIRMATION_TITLE_LABEL);
gtk_label_set_markup(GTK_LABEL(window->TitleLabel),SYSTEM_GROUP_CONFIG_REMOVE_CONFIRMATION_LABEL(target));
dictionary *dict = NULL; 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,"widgets",widgets);
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window); yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
gtk_label_set_markup(GTK_LABEL(window->HeaderLabel),DELETE_GROUP_CONFIRMATION_TITLE_LABEL);
if (config(GROUPADD(target))){
yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),DELETE_GROUP_CONFIRMATION_TITLE_LABEL,icon_path,"user-deletion-window");
gtk_label_set_markup(GTK_LABEL(window->TitleLabel),SYSTEM_GROUP_CONFIG_REMOVE_CONFIRMATION_LABEL(target));
g_signal_connect(G_OBJECT(window->ConfigAcceptButton),"clicked",G_CALLBACK(yon_remove_confirmation_window_accept_clicked),dict); g_signal_connect(G_OBJECT(window->ConfigAcceptButton),"clicked",G_CALLBACK(yon_remove_confirmation_window_accept_clicked),dict);
g_signal_connect(G_OBJECT(window->SystemAcceptButton),"clicked",G_CALLBACK(yon_remove_confirmation_window_accept_clicked),dict); g_signal_connect(G_OBJECT(window->SystemAcceptButton),"clicked",G_CALLBACK(yon_remove_confirmation_window_accept_clicked),dict);
gtk_widget_show(window->Window);
} else { } else {
dialog_confirmation_data data; gtk_label_set_markup(GTK_LABEL(window->TitleLabel),SYSTEM_GROUP_SYSTEM_REMOVE_CONFIRMATION_LABEL(target));
template_app_information.app_title = DELETE_GROUP_CONFIRMATION_TITLE_LABEL; gtk_widget_show(window->AcceptButton);
data.action_text = SYSTEM_GROUP_SYSTEM_REMOVE_CONFIRMATION_LABEL(target); gtk_widget_hide(window->ConfigAcceptButton);
data.function=NULL; gtk_widget_hide(window->SystemAcceptButton);
data.data=NULL; g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(yon_remove_confirmation_window_accept_clicked),dict);
if (yon_confirmation_dialog_call(widgets->Window,&data)!=GTK_RESPONSE_ACCEPT){
return;
}
template_app_information.app_title = TITLE_LABEL;
yon_system_delete_confirmation_open(widgets);
} }
gtk_widget_show(window->Window);
} }
}break; }break;
} }

Loading…
Cancel
Save