pull/193/head
Ivan Dmitrievich Yartsev 10 months ago
parent 76f0de818f
commit e681880e68

@ -715,6 +715,20 @@ yon_confirmation_window *yon_delete_confirmation_new(){
return window; return window;
} }
void yon_system_delete_confirmation_open(main_window *widgets){
yon_confirmation_window *window = yon_delete_confirmation_new();
gtk_window_set_transient_for(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window));
GtkTreeIter iter,itar;
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);
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(yon_delete_confirmation_save),dict);
GtkTreeModel *model = GTK_TREE_MODEL(widgets->liststore1);
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->SystemTree)),&model,&iter)){
gtk_tree_model_get(model,&iter,1,,2,,)
}
}
void yon_delete_confirmation_open(main_window *widgets){ void yon_delete_confirmation_open(main_window *widgets){
yon_confirmation_window *window = yon_delete_confirmation_new(); yon_confirmation_window *window = yon_delete_confirmation_new();
gtk_window_set_transient_for(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window)); gtk_window_set_transient_for(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window));
@ -1329,7 +1343,7 @@ void on_GID_update(GtkWidget *, ubl_settings_usergroups_group_creation_window *w
for (int i=0;i<final_size;i++){ for (int i=0;i<final_size;i++){
int parsed_size; int parsed_size;
config_str parsed = yon_char_parse(final[i],&parsed_size,":"); config_str parsed = yon_char_parse(final[i],&parsed_size,":");
if (minimum<atol(parsed[2])&&atol(parsed[2])<maximum){ if (parsed_size>2&&minimum<atol(parsed[2])&&atol(parsed[2])<maximum){
if (atol(parsed[2])>prev_busy){ if (atol(parsed[2])>prev_busy){
prev_busy=atol(parsed[2]); prev_busy=atol(parsed[2]);
} }
@ -2815,10 +2829,46 @@ void on_main_delete(GtkWidget *, main_window *widgets){
dialog_confirmation_data *data=malloc(sizeof(dialog_confirmation_data)); dialog_confirmation_data *data=malloc(sizeof(dialog_confirmation_data));
data->function=NULL; data->function=NULL;
data->data=NULL; data->data=NULL;
if (gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->MainNotebook))==0){ int active = gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->MainNotebook));
switch(active){
case 0:
yon_delete_confirmation_open(widgets); yon_delete_confirmation_open(widgets);
} else { break;
case 1:
yon_group_delete_confirmation_open(widgets); yon_group_delete_confirmation_open(widgets);
break;
case 2:{
GtkTreeModel *model = GTK_TREE_MODEL(widgets->liststore1);
GtkTreeIter iter;
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->SystemTree)),&model,&iter)){
char *target;
gtk_tree_model_get(model,&iter,2,&target,-1);
dialog_confirmation_data *data = malloc(sizeof(dialog_confirmation_data));
int found = !!config(USERADD(target));
if (found){
data->action_text = SYSTEM_USER_CONFIG_REMOVE_CONFIRMATION_LABEL(target);
data->function=NULL;
data->data=NULL;
} else {
data->action_text = SYSTEM_USER_SYSTEM_REMOVE_CONFIRMATION_LABEL(target);
data->function=NULL;
data->data=NULL;
}
if (yon_confirmation_dialog_call(widgets->Window,&data)!=GTK_RESPONSE_ACCEPT){
return;
}
if (found){
yon_delete_confirmation_open(widgets);
} else {
yon_system_delete_confirmation_open(widgets);
}
}
}break;
case 3:{
}break;
} }
} }

@ -56,6 +56,11 @@
#define SYSTEM_GROUP_SYNC_CONFIRMATION_LABEL(target) yon_char_unite(_("This group doesn't exist in configuration. Are you sure want to add group")," <b>",target,"</b> ", _("to configuration?"),NULL) #define SYSTEM_GROUP_SYNC_CONFIRMATION_LABEL(target) yon_char_unite(_("This group doesn't exist in configuration. Are you sure want to add group")," <b>",target,"</b> ", _("to configuration?"),NULL)
#define SYSTEM_GROUP_ADD_CONFIRMATION_LABEL(target) yon_char_unite(_("This group exists in configuration. Are you sure want to update group")," <b>",target,"</b> ", _("data at configuration?"),NULL) #define SYSTEM_GROUP_ADD_CONFIRMATION_LABEL(target) yon_char_unite(_("This group exists in configuration. Are you sure want to update group")," <b>",target,"</b> ", _("data at configuration?"),NULL)
#define SYSTEM_USER_SYSTEM_REMOVE_CONFIRMATION_LABEL(target) yon_char_unite(_("This user doesn't exist in configuration and will be removed from the system. Are you sure want to remove user")," <b>",target,"</b> ", _("from the system??"),NULL)
#define SYSTEM_USER_CONFIG_REMOVE_CONFIRMATION_LABEL(target) yon_char_unite(_("This user exists in configuration. Are you sure want to remove user")," <b>",target,"</b> ", _("?"),NULL)
#define SYSTEM_GROUP_SYSTEM_REMOVE_CONFIRMATION_LABEL(target) yon_char_unite(_("This group doesn't exist in configuration and will be removed from the system. Are you sure want to remove group")," <b>",target,"</b> ", _("from the system?"),NULL)
#define SYSTEM_GROUP_CONFIG_REMOVE_CONFIRMATION_LABEL(target) yon_char_unite(_("This group exists in configuration. Are you sure want to remove group")," <b>",target,"</b>", _("?"),NULL)
//ubl-settings-usergroups-additional-settings.glade //ubl-settings-usergroups-additional-settings.glade
#define ADDITIONAL_SETTINGS_TITLE_LABEL _("Additional settings") #define ADDITIONAL_SETTINGS_TITLE_LABEL _("Additional settings")

Loading…
Cancel
Save