|
|
|
@ -51,7 +51,7 @@ int yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (type==YON_CONFIG_CUSTOM){
|
|
|
|
else if (type==YON_CONFIG_CUSTOM){
|
|
|
|
char *path;
|
|
|
|
char *path=NULL;;
|
|
|
|
GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,OPEN_LABEL,GTK_RESPONSE_ACCEPT,NULL);
|
|
|
|
GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,OPEN_LABEL,GTK_RESPONSE_ACCEPT,NULL);
|
|
|
|
GtkFileFilter *filter = gtk_file_filter_new();
|
|
|
|
GtkFileFilter *filter = gtk_file_filter_new();
|
|
|
|
gtk_file_filter_add_pattern(filter,"*.ini");
|
|
|
|
gtk_file_filter_add_pattern(filter,"*.ini");
|
|
|
|
@ -70,7 +70,7 @@ int yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yon_config_load_config(type,config_get_command(path),NULL);
|
|
|
|
yon_config_load_config(type,config_get_command(path),NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void yon_interface_update(main_window *widgets){
|
|
|
|
void yon_interface_update(main_window *widgets){
|
|
|
|
@ -182,7 +182,7 @@ void yon_interface_update(main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_local_load(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_config_local_load(GtkWidget *, main_window *widgets){
|
|
|
|
yon_load_proceed(YON_CONFIG_LOCAL);
|
|
|
|
yon_load_proceed(YON_CONFIG_LOCAL);
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
yon_ubl_status_box_render(LOCAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
yon_ubl_status_box_render(LOCAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
@ -191,7 +191,7 @@ void on_config_local_load(GtkWidget *self, main_window *widgets){
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_global_load(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_config_global_load(GtkWidget *, main_window *widgets){
|
|
|
|
yon_load_proceed(YON_CONFIG_GLOBAL);
|
|
|
|
yon_load_proceed(YON_CONFIG_GLOBAL);
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
yon_ubl_status_box_render(GLOBAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
yon_ubl_status_box_render(GLOBAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
@ -200,7 +200,7 @@ void on_config_global_load(GtkWidget *self, main_window *widgets){
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_custom_load(GtkWidget *self,main_window *widgets){
|
|
|
|
void on_config_custom_load(GtkWidget *,main_window *widgets){
|
|
|
|
yon_load_proceed(YON_CONFIG_CUSTOM);
|
|
|
|
yon_load_proceed(YON_CONFIG_CUSTOM);
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
yon_ubl_status_box_render(GLOBAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
yon_ubl_status_box_render(GLOBAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
@ -414,7 +414,7 @@ void on_save_done(main_window *widgets, config_str output, int size){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_save(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_config_save(GtkWidget *, main_window *){
|
|
|
|
main_config.save_config=2;
|
|
|
|
main_config.save_config=2;
|
|
|
|
template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_command("global"),NULL);
|
|
|
|
template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_command("global"),NULL);
|
|
|
|
if (window){
|
|
|
|
if (window){
|
|
|
|
@ -473,7 +473,7 @@ void on_config_save(GtkWidget *self, main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_global_save(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_config_global_save(GtkWidget *, main_window *){
|
|
|
|
main_config.save_config=0;
|
|
|
|
main_config.save_config=0;
|
|
|
|
template_saving_window *window = yon_save_proceed("global",YON_CONFIG_GLOBAL,config_get_command("global"),NULL);
|
|
|
|
template_saving_window *window = yon_save_proceed("global",YON_CONFIG_GLOBAL,config_get_command("global"),NULL);
|
|
|
|
if (window){
|
|
|
|
if (window){
|
|
|
|
@ -481,7 +481,7 @@ void on_config_global_save(GtkWidget *self, main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_local_save(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_config_local_save(GtkWidget *, main_window *){
|
|
|
|
main_config.save_config=1;
|
|
|
|
main_config.save_config=1;
|
|
|
|
int size;
|
|
|
|
int size;
|
|
|
|
config_str keys = yon_config_get_all_by_key(USERADD_SEARCH_macro,&size);
|
|
|
|
config_str keys = yon_config_get_all_by_key(USERADD_SEARCH_macro,&size);
|
|
|
|
@ -515,7 +515,7 @@ void on_config_local_save(GtkWidget *self, main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_custom_save(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_config_custom_save(GtkWidget *, main_window *){
|
|
|
|
main_config.save_config=1;
|
|
|
|
main_config.save_config=1;
|
|
|
|
template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_CUSTOM,config_get_command("system"),NULL);
|
|
|
|
template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_CUSTOM,config_get_command("system"),NULL);
|
|
|
|
if (window){
|
|
|
|
if (window){
|
|
|
|
@ -561,7 +561,7 @@ int yon_samba_sync_get(char *user){
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_delete_confirmation_delete_home_check(GtkCellRenderer *self, char *path, yon_confirmation_window *window){
|
|
|
|
void on_delete_confirmation_delete_home_check(GtkCellRenderer *, char *path, yon_confirmation_window *window){
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
gboolean status;
|
|
|
|
gboolean status;
|
|
|
|
gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(window->list),&iter,path);
|
|
|
|
gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(window->list),&iter,path);
|
|
|
|
@ -570,7 +570,7 @@ void on_delete_confirmation_delete_home_check(GtkCellRenderer *self, char *path,
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_delete_confirmation_delete_check(GtkCellRenderer *self, char *path, yon_confirmation_window *window){
|
|
|
|
void on_delete_confirmation_delete_check(GtkCellRenderer *, char *path, yon_confirmation_window *window){
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
gboolean status;
|
|
|
|
gboolean status;
|
|
|
|
gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(window->list),&iter,path);
|
|
|
|
gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(window->list),&iter,path);
|
|
|
|
@ -640,7 +640,7 @@ void yon_group_delete_confirmation_save(GtkWidget *self, dictionary *dict){
|
|
|
|
int valid2 = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&itar);
|
|
|
|
int valid2 = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&itar);
|
|
|
|
for (;valid2;valid2 = gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&itar)){
|
|
|
|
for (;valid2;valid2 = gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&itar)){
|
|
|
|
char *name_check;
|
|
|
|
char *name_check;
|
|
|
|
int status,delete;
|
|
|
|
int delete;
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&itar,0,&delete,1,&name_check,-1);
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&itar,0,&delete,1,&name_check,-1);
|
|
|
|
if (!strcmp(name,name_check)&&delete){
|
|
|
|
if (!strcmp(name,name_check)&&delete){
|
|
|
|
gtk_list_store_remove(widgets->GroupsList,&iter);
|
|
|
|
gtk_list_store_remove(widgets->GroupsList,&iter);
|
|
|
|
@ -726,7 +726,7 @@ void yon_delete_confirmation_open(main_window *widgets){
|
|
|
|
GList *list = gtk_tree_selection_get_selected_rows(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->UsersTree)),&model);
|
|
|
|
GList *list = gtk_tree_selection_get_selected_rows(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->UsersTree)),&model);
|
|
|
|
int chosen_size=0;
|
|
|
|
int chosen_size=0;
|
|
|
|
config_str chosen = NULL;
|
|
|
|
config_str chosen = NULL;
|
|
|
|
for (int i=0;i<g_list_length(list);i++){
|
|
|
|
for (guint i=0;i<g_list_length(list);i++){
|
|
|
|
char *current;
|
|
|
|
char *current;
|
|
|
|
gtk_tree_model_get_iter(model,&iter,(GtkTreePath*)g_list_nth_data(list,i));
|
|
|
|
gtk_tree_model_get_iter(model,&iter,(GtkTreePath*)g_list_nth_data(list,i));
|
|
|
|
gtk_tree_model_get(model,&iter,2,¤t,-1);
|
|
|
|
gtk_tree_model_get(model,&iter,2,¤t,-1);
|
|
|
|
@ -775,7 +775,7 @@ void yon_group_delete_confirmation_open(main_window *widgets){
|
|
|
|
GList *list = gtk_tree_selection_get_selected_rows(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GroupsTree)),&model);
|
|
|
|
GList *list = gtk_tree_selection_get_selected_rows(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GroupsTree)),&model);
|
|
|
|
int chosen_size=0;
|
|
|
|
int chosen_size=0;
|
|
|
|
config_str chosen = NULL;
|
|
|
|
config_str chosen = NULL;
|
|
|
|
for (int i=0;i<g_list_length(list);i++){
|
|
|
|
for (guint i=0;i<g_list_length(list);i++){
|
|
|
|
char *current;
|
|
|
|
char *current;
|
|
|
|
gtk_tree_model_get_iter(model,&iter,(GtkTreePath*)g_list_nth_data(list,i));
|
|
|
|
gtk_tree_model_get_iter(model,&iter,(GtkTreePath*)g_list_nth_data(list,i));
|
|
|
|
gtk_tree_model_get(model,&iter,1,¤t,-1);
|
|
|
|
gtk_tree_model_get(model,&iter,1,¤t,-1);
|
|
|
|
@ -812,7 +812,7 @@ yon_savasettings_window *yon_saving_settings_new(){
|
|
|
|
return window;
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_saving_settings_open(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_saving_settings_open(GtkWidget *, main_window *widgets){
|
|
|
|
yon_savasettings_window *window = yon_saving_settings_new();
|
|
|
|
yon_savasettings_window *window = yon_saving_settings_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));
|
|
|
|
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_saving_settings_save),window);
|
|
|
|
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_saving_settings_save),window);
|
|
|
|
@ -823,7 +823,7 @@ void on_password_combo_changed(GtkComboBox *self, GtkWidget *target){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_filechooser_open(GtkWidget *self, GtkEntry *output_target){
|
|
|
|
void on_filechooser_open(GtkWidget *, GtkEntry *output_target){
|
|
|
|
GtkWidget *dialog = gtk_file_chooser_dialog_new(FILECHOOSER_TITLE_LABEL,NULL,GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,CANCEL_LABEL,GTK_RESPONSE_CANCEL,ACCEPT_LABEL,GTK_RESPONSE_ACCEPT,NULL);
|
|
|
|
GtkWidget *dialog = gtk_file_chooser_dialog_new(FILECHOOSER_TITLE_LABEL,NULL,GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,CANCEL_LABEL,GTK_RESPONSE_CANCEL,ACCEPT_LABEL,GTK_RESPONSE_ACCEPT,NULL);
|
|
|
|
int responce = gtk_dialog_run(GTK_DIALOG(dialog));
|
|
|
|
int responce = gtk_dialog_run(GTK_DIALOG(dialog));
|
|
|
|
if (responce==GTK_RESPONSE_ACCEPT){
|
|
|
|
if (responce==GTK_RESPONSE_ACCEPT){
|
|
|
|
@ -848,7 +848,7 @@ void on_groups_save(GtkWidget *self, dictionary *dict){
|
|
|
|
on_subwindow_close(self);
|
|
|
|
on_subwindow_close(self);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_groups_clicked(GtkWidget *self, GtkEntry *output_target){
|
|
|
|
void on_groups_clicked(GtkWidget *, GtkEntry *output_target){
|
|
|
|
ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(0);
|
|
|
|
ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(0);
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->GroupsWindow),MAIN_GROUP_LABEL);
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->GroupsWindow),MAIN_GROUP_LABEL);
|
|
|
|
gtk_label_set_text(GTK_LABEL(window->HeaderLabel),MAIN_GROUP_LABEL);
|
|
|
|
gtk_label_set_text(GTK_LABEL(window->HeaderLabel),MAIN_GROUP_LABEL);
|
|
|
|
@ -875,8 +875,8 @@ void on_groups_clicked(GtkWidget *self, GtkEntry *output_target){
|
|
|
|
gtk_tree_view_column_set_visible(gtk_tree_view_get_column(GTK_TREE_VIEW(window->GroupsTree),0),0);
|
|
|
|
gtk_tree_view_column_set_visible(gtk_tree_view_get_column(GTK_TREE_VIEW(window->GroupsTree),0),0);
|
|
|
|
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(window->GroupsTree)),GTK_SELECTION_SINGLE);
|
|
|
|
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(window->GroupsTree)),GTK_SELECTION_SINGLE);
|
|
|
|
const char *current_group=gtk_entry_get_text(output_target);
|
|
|
|
const char *current_group=gtk_entry_get_text(output_target);
|
|
|
|
int digits=0;
|
|
|
|
size_t digits=0;
|
|
|
|
for (int k=0;k<strlen(current_group);k++){
|
|
|
|
for (guint k=0;k<strlen(current_group);k++){
|
|
|
|
if (g_ascii_isdigit(current_group[k])){
|
|
|
|
if (g_ascii_isdigit(current_group[k])){
|
|
|
|
digits++;
|
|
|
|
digits++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -937,7 +937,7 @@ void on_groups_multiple_save(GtkWidget *self, dictionary *dict){
|
|
|
|
on_subwindow_close(self);
|
|
|
|
on_subwindow_close(self);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_groups_multiple_clicked(GtkWidget *self, GtkEntry *output_target){
|
|
|
|
void on_groups_multiple_clicked(GtkWidget *, GtkEntry *output_target){
|
|
|
|
ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(0);
|
|
|
|
ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(0);
|
|
|
|
gtk_tree_view_column_set_title(gtk_tree_view_get_column(GTK_TREE_VIEW(window->GroupsTree),1),GID_LABEL);
|
|
|
|
gtk_tree_view_column_set_title(gtk_tree_view_get_column(GTK_TREE_VIEW(window->GroupsTree),1),GID_LABEL);
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->GroupsWindow),ADDITIONAL_GROUPS_TITLE_LABEL);
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->GroupsWindow),ADDITIONAL_GROUPS_TITLE_LABEL);
|
|
|
|
@ -992,8 +992,7 @@ void on_passwords_encrypt(){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_password_change(GtkWidget *self, dictionary *entry_dict){
|
|
|
|
void on_password_change(GtkWidget *, dictionary *entry_dict){
|
|
|
|
GtkComboBox *combo = yon_dictionary_get_data(entry_dict->first,GtkComboBox*);
|
|
|
|
|
|
|
|
GtkEntry *output_target = yon_dictionary_get_data(entry_dict->first->next,GtkEntry*);
|
|
|
|
GtkEntry *output_target = yon_dictionary_get_data(entry_dict->first->next,GtkEntry*);
|
|
|
|
ubl_settings_usergroups_password_window *window = yon_ubl_settings_usergroups_password_new();
|
|
|
|
ubl_settings_usergroups_password_window *window = yon_ubl_settings_usergroups_password_new();
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
@ -1019,20 +1018,20 @@ void on_password_change(GtkWidget *self, dictionary *entry_dict){
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_additional_settings_clicked(GtkWidget *self, GtkEntry *output_target){
|
|
|
|
void on_additional_settings_clicked(GtkWidget *, GtkEntry *){
|
|
|
|
ubl_settings_usergroups_additional_settings_window *window = yon_ubl_settings_usergroups_additional_settings_new();
|
|
|
|
ubl_settings_usergroups_additional_settings_window *window = yon_ubl_settings_usergroups_additional_settings_new();
|
|
|
|
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_expiration_clicked(GtkWidget *self, ubl_settings_usergroups_user_window *window){
|
|
|
|
void on_expiration_clicked(GtkWidget *, ubl_settings_usergroups_user_window *window){
|
|
|
|
gtk_popover_popup(GTK_POPOVER(window->CalendarPopup));
|
|
|
|
gtk_popover_popup(GTK_POPOVER(window->CalendarPopup));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// standard functions
|
|
|
|
// standard functions
|
|
|
|
|
|
|
|
|
|
|
|
void on_additional_settings_save(GtkWidget *self, ubl_settings_usergroups_additional_settings_window *window){
|
|
|
|
void on_additional_settings_save(GtkWidget *, ubl_settings_usergroups_additional_settings_window *window){
|
|
|
|
const char *default_user = (char*)gtk_entry_get_text(GTK_ENTRY(window->DefaultUserNameEntry));
|
|
|
|
const char *default_user = (char*)gtk_entry_get_text(GTK_ENTRY(window->DefaultUserNameEntry));
|
|
|
|
if (!yon_char_is_empty(default_user)){
|
|
|
|
if (!yon_char_is_empty(default_user)){
|
|
|
|
yon_config_register(DEFAULTUSER_parameter,DEFAULTUSER_parameter_command,yon_char_new((char*)default_user));
|
|
|
|
yon_config_register(DEFAULTUSER_parameter,DEFAULTUSER_parameter_command,yon_char_new((char*)default_user));
|
|
|
|
@ -1092,7 +1091,7 @@ void on_expiration_clicked(GtkWidget *self, ubl_settings_usergroups_user_window
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_hash_changed(GtkWidget *self, ubl_settings_usergroups_additional_settings_window *window){
|
|
|
|
void on_hash_changed(GtkWidget *, ubl_settings_usergroups_additional_settings_window *window){
|
|
|
|
|
|
|
|
|
|
|
|
int hash_size=0;
|
|
|
|
int hash_size=0;
|
|
|
|
config_str hash_algos = yon_file_open(hash_list_path,&hash_size);
|
|
|
|
config_str hash_algos = yon_file_open(hash_list_path,&hash_size);
|
|
|
|
@ -1252,7 +1251,7 @@ ubl_settings_usergroups_additional_settings_window *yon_ubl_settings_usergroups_
|
|
|
|
return window;
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_ubl_settings_usergroups_additional_settings_open(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_ubl_settings_usergroups_additional_settings_open(GtkWidget *, main_window *widgets){
|
|
|
|
ubl_settings_usergroups_additional_settings_window *window = yon_ubl_settings_usergroups_additional_settings_new();
|
|
|
|
ubl_settings_usergroups_additional_settings_window *window = yon_ubl_settings_usergroups_additional_settings_new();
|
|
|
|
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
|
|
|
|
|
|
|
|
@ -1261,7 +1260,7 @@ void on_ubl_settings_usergroups_additional_settings_open(GtkWidget *self, main_w
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_user_choose(GtkWidget *self, GtkEntry *target){
|
|
|
|
void on_user_choose(GtkWidget *, GtkEntry *target){
|
|
|
|
ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(1);
|
|
|
|
ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(1);
|
|
|
|
gtk_label_set_text(GTK_LABEL(window->HeaderLabel),GROUP_USERS_TITLE_LABEL);
|
|
|
|
gtk_label_set_text(GTK_LABEL(window->HeaderLabel),GROUP_USERS_TITLE_LABEL);
|
|
|
|
gtk_label_set_text(GTK_LABEL(window->HeaderLabel),GROUP_USERS_TITLE_LABEL);
|
|
|
|
gtk_label_set_text(GTK_LABEL(window->HeaderLabel),GROUP_USERS_TITLE_LABEL);
|
|
|
|
@ -1310,7 +1309,7 @@ void on_user_choose(GtkWidget *self, GtkEntry *target){
|
|
|
|
gtk_widget_show(window->GroupsWindow);
|
|
|
|
gtk_widget_show(window->GroupsWindow);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_GID_update(GtkWidget *self, ubl_settings_usergroups_group_creation_window *window){
|
|
|
|
void on_GID_update(GtkWidget *, ubl_settings_usergroups_group_creation_window *window){
|
|
|
|
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userUIDAutoCheck))){
|
|
|
|
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userUIDAutoCheck))){
|
|
|
|
if (window->last_gid){
|
|
|
|
if (window->last_gid){
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userUIDEntry),window->last_gid);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userUIDEntry),window->last_gid);
|
|
|
|
@ -1468,7 +1467,7 @@ void on_group_save(GtkWidget *self, dictionary *dict){
|
|
|
|
on_subwindow_close(self);
|
|
|
|
on_subwindow_close(self);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_system_parameter_changed(GtkWidget *self, ubl_settings_usergroups_group_creation_window *window){
|
|
|
|
void on_system_parameter_changed(GtkWidget *, ubl_settings_usergroups_group_creation_window *window){
|
|
|
|
|
|
|
|
|
|
|
|
char *non_unique = NULL;
|
|
|
|
char *non_unique = NULL;
|
|
|
|
char *gsystem = NULL;
|
|
|
|
char *gsystem = NULL;
|
|
|
|
@ -1542,7 +1541,7 @@ ubl_settings_usergroups_group_creation_window *yon_ubl_settings_usergroups_group
|
|
|
|
return window;
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_group_clicked(GtkCellRenderer *self, char *path, ubl_settings_usergroups_group_window *window){
|
|
|
|
void on_group_clicked(GtkCellRenderer *, char *path, ubl_settings_usergroups_group_window *window){
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
gboolean status;
|
|
|
|
gboolean status;
|
|
|
|
gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(window->list),&iter,path);
|
|
|
|
gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(window->list),&iter,path);
|
|
|
|
@ -1612,7 +1611,7 @@ void on_standard_groups_accept(GtkWidget *self, ubl_settings_usergroups_group_wi
|
|
|
|
on_subwindow_close(self);
|
|
|
|
on_subwindow_close(self);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_standard_groups_open(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_standard_groups_open(GtkWidget *, main_window *widgets){
|
|
|
|
ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(0);
|
|
|
|
ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(0);
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->GroupsWindow),DEFAULT_GROUPS_TITLE_LABEL);
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->GroupsWindow),DEFAULT_GROUPS_TITLE_LABEL);
|
|
|
|
gtk_label_set_text(GTK_LABEL(window->HeaderLabel),DEFAULT_GROUPS_TITLE_LABEL);
|
|
|
|
gtk_label_set_text(GTK_LABEL(window->HeaderLabel),DEFAULT_GROUPS_TITLE_LABEL);
|
|
|
|
@ -1658,7 +1657,7 @@ void on_standard_groups_open(GtkWidget *self, main_window *widgets){
|
|
|
|
gtk_widget_show(window->GroupsWindow);
|
|
|
|
gtk_widget_show(window->GroupsWindow);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_password_show_hide(GtkEntry *self, GtkEntryIconPosition icon_pos, GdkEvent* event){
|
|
|
|
void on_password_show_hide(GtkEntry *self, GtkEntryIconPosition icon_pos, GdkEvent*){
|
|
|
|
if (icon_pos == GTK_ENTRY_ICON_SECONDARY){
|
|
|
|
if (icon_pos == GTK_ENTRY_ICON_SECONDARY){
|
|
|
|
int visible = gtk_entry_get_visibility(self);
|
|
|
|
int visible = gtk_entry_get_visibility(self);
|
|
|
|
if (!visible){
|
|
|
|
if (!visible){
|
|
|
|
@ -1670,7 +1669,7 @@ void on_password_show_hide(GtkEntry *self, GtkEntryIconPosition icon_pos, GdkEv
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_password_changed(GtkEntry *self, ubl_settings_usergroups_password_window *window){
|
|
|
|
void on_password_changed(GtkEntry *, ubl_settings_usergroups_password_window *window){
|
|
|
|
char *self_text = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry));
|
|
|
|
char *self_text = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry));
|
|
|
|
char *pair_text = (char*)gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry));
|
|
|
|
char *pair_text = (char*)gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry));
|
|
|
|
if ((!yon_char_is_empty(self_text)&&!yon_char_is_empty(pair_text))&&strcmp(self_text,pair_text)){
|
|
|
|
if ((!yon_char_is_empty(self_text)&&!yon_char_is_empty(pair_text))&&strcmp(self_text,pair_text)){
|
|
|
|
@ -1800,7 +1799,10 @@ void yon_system_load(main_window *window){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gtk_list_store_set(window->liststore1,&iter,0,!strcmp(parsed[1],"!*"),8,parsed_size>2?date_string:"",9,expiration_string,10,parsed_size>3?parsed[3]:"",11,parsed_size>4?parsed[4]:"",12,parsed_size>5?parsed[5]:"",13,parsed_size>2?parsed[6]:"",-1);
|
|
|
|
gtk_list_store_set(window->liststore1,&iter,0,!strcmp(parsed[1],"!*"),8,parsed_size>2?date_string:"",9,expiration_string,10,parsed_size>3?parsed[3]:"",11,parsed_size>4?parsed[4]:"",12,parsed_size>5?parsed[5]:"",13,parsed_size>2?parsed[6]:"",-1);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(date_string)) free(date_string);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(expiration_string)) free(expiration_string);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -1815,7 +1817,7 @@ void yon_system_load(main_window *window){
|
|
|
|
// yon_system_load(window);
|
|
|
|
// yon_system_load(window);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
void on_system_update(GtkWidget *self, main_window *window){
|
|
|
|
void on_system_update(GtkWidget *, main_window *window){
|
|
|
|
|
|
|
|
|
|
|
|
main_config.groups = yon_file_open(groups_path,&main_config.groups_size);
|
|
|
|
main_config.groups = yon_file_open(groups_path,&main_config.groups_size);
|
|
|
|
main_config.users = yon_file_open(users_path,&main_config.users_size);
|
|
|
|
main_config.users = yon_file_open(users_path,&main_config.users_size);
|
|
|
|
@ -1860,7 +1862,7 @@ ubl_settings_usergroups_system_window *yon_ubl_settings_usergroups_system_new(){
|
|
|
|
yon_window_config_custom_window_setup(GTK_WINDOW(window->MonitorWindow),"InspectorWindow");
|
|
|
|
yon_window_config_custom_window_setup(GTK_WINDOW(window->MonitorWindow),"InspectorWindow");
|
|
|
|
yon_gtk_tree_view_minimal_fixed_size_set_full(GTK_TREE_VIEW(window->SystemTree));
|
|
|
|
yon_gtk_tree_view_minimal_fixed_size_set_full(GTK_TREE_VIEW(window->SystemTree));
|
|
|
|
GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(window->SystemTree));
|
|
|
|
GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(window->SystemTree));
|
|
|
|
for (int i=0;i<g_list_length(list);i++){
|
|
|
|
for (guint i=0;i<g_list_length(list);i++){
|
|
|
|
yon_window_config_add_listener((GtkWidget*)g_list_nth_data(list,i),yon_char_append("UserColumn",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
|
|
|
|
yon_window_config_add_listener((GtkWidget*)g_list_nth_data(list,i),yon_char_append("UserColumn",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_list_free(list);
|
|
|
|
g_list_free(list);
|
|
|
|
@ -1871,7 +1873,7 @@ ubl_settings_usergroups_system_window *yon_ubl_settings_usergroups_system_new(){
|
|
|
|
return window;
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_settings_usergroups_system_open(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_settings_usergroups_system_open(GtkWidget *, main_window *){
|
|
|
|
ubl_settings_usergroups_system_window *window = yon_ubl_settings_usergroups_system_new();
|
|
|
|
ubl_settings_usergroups_system_window *window = yon_ubl_settings_usergroups_system_new();
|
|
|
|
gtk_widget_show(window->MonitorWindow);
|
|
|
|
gtk_widget_show(window->MonitorWindow);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1882,7 +1884,7 @@ void on_settings_usergroups_system_open(GtkWidget *self, main_window *widgets){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_user_shell_changed(GtkWidget *self, ubl_settings_usergroups_user_window *window){
|
|
|
|
void on_user_shell_changed(GtkWidget *, ubl_settings_usergroups_user_window *window){
|
|
|
|
const char *current = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->userShellCombo));
|
|
|
|
const char *current = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->userShellCombo));
|
|
|
|
if (!yon_char_is_empty(current)&&!strcmp(current,SET_LABEL)){
|
|
|
|
if (!yon_char_is_empty(current)&&!strcmp(current,SET_LABEL)){
|
|
|
|
if(gtk_combo_box_get_active(GTK_COMBO_BOX(window->userShellCombo))>1){
|
|
|
|
if(gtk_combo_box_get_active(GTK_COMBO_BOX(window->userShellCombo))>1){
|
|
|
|
@ -1895,7 +1897,7 @@ void on_user_shell_changed(GtkWidget *self, ubl_settings_usergroups_user_window
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_UID_update(GtkWidget *self, ubl_settings_usergroups_user_window *window){
|
|
|
|
void on_UID_update(GtkWidget *, ubl_settings_usergroups_user_window *window){
|
|
|
|
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userUIDAutoCheck))){
|
|
|
|
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userUIDAutoCheck))){
|
|
|
|
if (window->last_uid){
|
|
|
|
if (window->last_uid){
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userUIDEntry),window->last_uid);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userUIDEntry),window->last_uid);
|
|
|
|
@ -1929,7 +1931,7 @@ void on_UID_update(GtkWidget *self, ubl_settings_usergroups_user_window *window)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_user_login_update(GtkWidget *self, ubl_settings_usergroups_user_window *window){
|
|
|
|
void on_user_login_update(GtkWidget *, ubl_settings_usergroups_user_window *window){
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userGroupsCheck))){
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userGroupsCheck))){
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userGroupsEntry),gtk_entry_get_text(GTK_ENTRY(window->userLoginEntry)));
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userGroupsEntry),gtk_entry_get_text(GTK_ENTRY(window->userLoginEntry)));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -1946,7 +1948,6 @@ void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
char *login = NULL;
|
|
|
|
char *login = NULL;
|
|
|
|
char *username = NULL;
|
|
|
|
char *username = NULL;
|
|
|
|
char *main_group = NULL;
|
|
|
|
char *main_group = NULL;
|
|
|
|
char *no_user_group=NULL;
|
|
|
|
|
|
|
|
char *additional_groups = NULL;
|
|
|
|
char *additional_groups = NULL;
|
|
|
|
char *password_changed_date = NULL;
|
|
|
|
char *password_changed_date = NULL;
|
|
|
|
char *password_expiration_date = NULL;
|
|
|
|
char *password_expiration_date = NULL;
|
|
|
|
@ -1954,7 +1955,7 @@ void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
char *password_change_interval_maximum = NULL;
|
|
|
|
char *password_change_interval_maximum = NULL;
|
|
|
|
char *warning_days = NULL;
|
|
|
|
char *warning_days = NULL;
|
|
|
|
char *no_activity_days = NULL;
|
|
|
|
char *no_activity_days = NULL;
|
|
|
|
char *force_at_next_login = NULL;
|
|
|
|
// char *force_at_next_login = NULL;
|
|
|
|
char *user_shell = NULL;
|
|
|
|
char *user_shell = NULL;
|
|
|
|
char *user_home = NULL;
|
|
|
|
char *user_home = NULL;
|
|
|
|
char *create_system_user = NULL;
|
|
|
|
char *create_system_user = NULL;
|
|
|
|
@ -2038,7 +2039,7 @@ void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
old_password = window->old_password;
|
|
|
|
old_password = window->old_password;
|
|
|
|
yon_check_password_blocked(old_password);
|
|
|
|
yon_check_password_blocked(old_password);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!old_password||old_password&&strcmp(old_password,password)){
|
|
|
|
if (!old_password||(old_password&&strcmp(old_password,password))){
|
|
|
|
time_t t = time(NULL);
|
|
|
|
time_t t = time(NULL);
|
|
|
|
struct tm tm = *localtime(&t);
|
|
|
|
struct tm tm = *localtime(&t);
|
|
|
|
char *month = yon_char_from_int(tm.tm_mon+1);
|
|
|
|
char *month = yon_char_from_int(tm.tm_mon+1);
|
|
|
|
@ -2072,9 +2073,6 @@ void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
int main_group_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userGroupsCheck));
|
|
|
|
int main_group_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userGroupsCheck));
|
|
|
|
if (!main_group_active){
|
|
|
|
if (!main_group_active){
|
|
|
|
main_group = (char*)gtk_entry_get_text(GTK_ENTRY(window->userGroupsEntry));
|
|
|
|
main_group = (char*)gtk_entry_get_text(GTK_ENTRY(window->userGroupsEntry));
|
|
|
|
if (yon_char_is_empty(main_group)){
|
|
|
|
|
|
|
|
no_user_group="--no-user-group";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
main_group = "";
|
|
|
|
main_group = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -2093,9 +2091,6 @@ void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
if (password_change_interval_minimum_active>0){
|
|
|
|
if (password_change_interval_minimum_active>0){
|
|
|
|
password_change_interval_maximum = yon_char_from_long(password_change_interval_maximum_active);
|
|
|
|
password_change_interval_maximum = yon_char_from_long(password_change_interval_maximum_active);
|
|
|
|
} else password_change_interval_maximum = 0;
|
|
|
|
} else password_change_interval_maximum = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
long password_interval_maximum = gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->userPasswordChangeDelayMaximumSpin));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
password_expiration_date = (char*)gtk_entry_get_text(GTK_ENTRY(window->userPasswordExpirationEntry));
|
|
|
|
password_expiration_date = (char*)gtk_entry_get_text(GTK_ENTRY(window->userPasswordExpirationEntry));
|
|
|
|
if (yon_char_is_empty(password_expiration_date)){
|
|
|
|
if (yon_char_is_empty(password_expiration_date)){
|
|
|
|
@ -2268,7 +2263,7 @@ void on_toggle_button_set_active_from_combo_box(GtkComboBox *self,ubl_settings_u
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_password_user_changed(GtkComboBox *self,ubl_settings_usergroups_user_window *window){
|
|
|
|
void on_password_user_changed(GtkComboBox *,ubl_settings_usergroups_user_window *window){
|
|
|
|
char *passw = (char*)gtk_entry_get_text(GTK_ENTRY(window->userPasswordEntry));
|
|
|
|
char *passw = (char*)gtk_entry_get_text(GTK_ENTRY(window->userPasswordEntry));
|
|
|
|
if ((passw[0]=='$')){
|
|
|
|
if ((passw[0]=='$')){
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBACheck),0);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBACheck),0);
|
|
|
|
@ -2283,7 +2278,7 @@ void on_password_user_changed(GtkComboBox *self,ubl_settings_usergroups_user_win
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_toggle_button_set_active_from_toggle_button_inversed(GtkToggleButton *self, ubl_settings_usergroups_user_window *window){
|
|
|
|
void on_toggle_button_set_active_from_toggle_button_inversed(GtkToggleButton *, ubl_settings_usergroups_user_window *window){
|
|
|
|
char *passw = (char*)gtk_entry_get_text(GTK_ENTRY(window->userPasswordEntry));
|
|
|
|
char *passw = (char*)gtk_entry_get_text(GTK_ENTRY(window->userPasswordEntry));
|
|
|
|
if ((passw[0]!='$')&>k_combo_box_get_active(GTK_COMBO_BOX(window->userPasswordCombo))>1){
|
|
|
|
if ((passw[0]!='$')&>k_combo_box_get_active(GTK_COMBO_BOX(window->userPasswordCombo))>1){
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBACheck))){
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBACheck))){
|
|
|
|
@ -2303,12 +2298,12 @@ void on_toggle_button_set_active_from_toggle_button_inversed(GtkToggleButton *se
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_date_selected(GtkWidget *self, ubl_settings_usergroups_user_window *window){
|
|
|
|
void on_date_selected(GtkWidget *, ubl_settings_usergroups_user_window *window){
|
|
|
|
int year=0, month=0, day=0;
|
|
|
|
guint year=0, month=0, day=0;
|
|
|
|
gtk_calendar_get_date(GTK_CALENDAR(window->ExpirationCalendar),&year,&month,&day);
|
|
|
|
gtk_calendar_get_date(GTK_CALENDAR(window->ExpirationCalendar),&year,&month,&day);
|
|
|
|
time_t t = time(NULL);
|
|
|
|
time_t t = time(NULL);
|
|
|
|
struct tm tm = *localtime(&t);
|
|
|
|
struct tm tm = *localtime(&t);
|
|
|
|
if ((1900+tm.tm_year)>year||((1900+tm.tm_year)==year&&tm.tm_mon>month)||((1900+tm.tm_year)==year&&tm.tm_mon==month&&tm.tm_mday>day)) {
|
|
|
|
if ((1900+tm.tm_year)>(int)year||((1900+tm.tm_year)==(int)year&&tm.tm_mon>(int)month)||((1900+tm.tm_year)==(int)year&&tm.tm_mon==(int)month&&tm.tm_mday>(int)day)) {
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userPasswordExpirationEntry), "");
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userPasswordExpirationEntry), "");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -2325,7 +2320,7 @@ void on_date_selected(GtkWidget *self, ubl_settings_usergroups_user_window *wind
|
|
|
|
free(yr);
|
|
|
|
free(yr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_parameter_changed(GtkWidget *self,ubl_settings_usergroups_user_window *window){
|
|
|
|
void on_parameter_changed(GtkWidget *,ubl_settings_usergroups_user_window *window){
|
|
|
|
char *user_shell=NULL;
|
|
|
|
char *user_shell=NULL;
|
|
|
|
char *user_home=NULL;
|
|
|
|
char *user_home=NULL;
|
|
|
|
char *login=NULL;
|
|
|
|
char *login=NULL;
|
|
|
|
@ -2404,7 +2399,7 @@ void on_parameter_changed(GtkWidget *self,ubl_settings_usergroups_user_window *w
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_remove_expired(GtkWidget *self, GtkEntryIconPosition icon_pos, GdkEvent *event, GtkEntry *target){
|
|
|
|
void on_remove_expired(GtkWidget *, GtkEntryIconPosition icon_pos, GdkEvent *, GtkEntry *target){
|
|
|
|
if (icon_pos == GTK_ENTRY_ICON_SECONDARY){
|
|
|
|
if (icon_pos == GTK_ENTRY_ICON_SECONDARY){
|
|
|
|
gtk_entry_set_text(target,"");
|
|
|
|
gtk_entry_set_text(target,"");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -2485,7 +2480,7 @@ ubl_settings_usergroups_user_window *yon_ubl_settings_usergroups_user_new(){
|
|
|
|
yon_window_config_custom_window_setup(GTK_WINDOW(window->CreateUserWindow),"UserWindow");
|
|
|
|
yon_window_config_custom_window_setup(GTK_WINDOW(window->CreateUserWindow),"UserWindow");
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(entry_dict,"combo",window->userPasswordCombo);
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(entry_dict,"combo",window->userPasswordCombo);
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(entry_dict,"entry",window->userPasswordEntry);
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(entry_dict,"entry",window->userPasswordEntry);
|
|
|
|
char *password = yon_config_get_by_key(USERADD((char*)gtk_entry_get_text(GTK_ENTRY(window->userLoginEntry))));
|
|
|
|
// char *password = yon_config_get_by_key(USERADD((char*)gtk_entry_get_text(GTK_ENTRY(window->userLoginEntry))));
|
|
|
|
g_signal_connect(G_OBJECT(window->UserCancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(window->UserCancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->userUIDEntry);
|
|
|
|
g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->userUIDEntry);
|
|
|
|
g_signal_connect(G_OBJECT(window->userHomeButton),"clicked",G_CALLBACK(on_filechooser_open),window->userHomeEntry);
|
|
|
|
g_signal_connect(G_OBJECT(window->userHomeButton),"clicked",G_CALLBACK(on_filechooser_open),window->userHomeEntry);
|
|
|
|
@ -2530,12 +2525,8 @@ ubl_settings_usergroups_user_window *yon_ubl_settings_usergroups_user_new(){
|
|
|
|
return window;
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_main_add(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_main_add(GtkWidget *, main_window *widgets){
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
|
|
|
GtkWidget *cur_tree;
|
|
|
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
gtk_tree_selection_unselect_all(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->UsersTree)));
|
|
|
|
gtk_tree_selection_unselect_all(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->UsersTree)));
|
|
|
|
ubl_settings_usergroups_user_window *window = yon_ubl_settings_usergroups_user_new();
|
|
|
|
ubl_settings_usergroups_user_window *window = yon_ubl_settings_usergroups_user_new();
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->CreateUserWindow),ADD_USER_TITLE_LABEL);
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->CreateUserWindow),ADD_USER_TITLE_LABEL);
|
|
|
|
@ -2550,7 +2541,6 @@ void on_main_add(GtkWidget *self, main_window *widgets){
|
|
|
|
gtk_window_set_transient_for(GTK_WINDOW(window->CreateUserWindow),GTK_WINDOW(widgets->Window));
|
|
|
|
gtk_window_set_transient_for(GTK_WINDOW(window->CreateUserWindow),GTK_WINDOW(widgets->Window));
|
|
|
|
gtk_widget_show(window->CreateUserWindow);
|
|
|
|
gtk_widget_show(window->CreateUserWindow);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
model = GTK_TREE_MODEL(widgets->GroupsList);
|
|
|
|
|
|
|
|
gtk_tree_selection_unselect_all(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GroupsTree)));
|
|
|
|
gtk_tree_selection_unselect_all(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GroupsTree)));
|
|
|
|
ubl_settings_usergroups_group_creation_window *window = yon_ubl_settings_usergroups_group_creation_new();
|
|
|
|
ubl_settings_usergroups_group_creation_window *window = yon_ubl_settings_usergroups_group_creation_new();
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->CreateGroupWindow),ADD_GROUP_TITLE_LABEL);
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->CreateGroupWindow),ADD_GROUP_TITLE_LABEL);
|
|
|
|
@ -2566,9 +2556,8 @@ void on_main_add(GtkWidget *self, main_window *widgets){
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_main_edit(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_main_edit(GtkWidget *, main_window *widgets){
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkWidget *cur_tree;
|
|
|
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
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);
|
|
|
|
@ -2595,7 +2584,7 @@ void on_main_edit(GtkWidget *self, main_window *widgets){
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userUserNameEntry), parsed_size>0?parameters[0]:"");
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userUserNameEntry), parsed_size>0?parameters[0]:"");
|
|
|
|
window->old_username=name;
|
|
|
|
window->old_username=name;
|
|
|
|
if (parsed_size>1){
|
|
|
|
if (parsed_size>1){
|
|
|
|
if (parsed_size>1&&strcmp(parameters[1],"x")&&strcmp(parameters[1],"")||parsed_size<=1){
|
|
|
|
if ((parsed_size>1&&strcmp(parameters[1],"x")&&strcmp(parameters[1],""))||parsed_size<=1){
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userUIDAutoCheck),0);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userUIDAutoCheck),0);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userUIDEntry), parsed_size>1?parameters[1]:"");
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userUIDEntry), parsed_size>1?parameters[1]:"");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -2779,14 +2768,11 @@ void on_main_edit(GtkWidget *self, main_window *widgets){
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_main_edit_activate(GtkWidget *self, GtkTreePath *path, GtkTreeViewColumn *column, main_window *widgets){
|
|
|
|
void on_main_edit_activate(GtkWidget *self, GtkTreePath *, GtkTreeViewColumn *, main_window *widgets){
|
|
|
|
on_main_edit(self,widgets);
|
|
|
|
on_main_edit(self,widgets);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_main_delete(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_main_delete(GtkWidget *, main_window *widgets){
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
|
|
|
GtkWidget *cur_tree;
|
|
|
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
|
|
|
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;
|
|
|
|
@ -2797,7 +2783,7 @@ void on_main_delete(GtkWidget *self, main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_update(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_config_update(GtkWidget *, main_window *widgets){
|
|
|
|
if (main_config.load_mode==0){
|
|
|
|
if (main_config.load_mode==0){
|
|
|
|
on_config_global_load(NULL,widgets);
|
|
|
|
on_config_global_load(NULL,widgets);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -2817,17 +2803,33 @@ void on_user_sync_with_config(GtkWidget *,main_window *widgets){
|
|
|
|
char *target;
|
|
|
|
char *target;
|
|
|
|
gtk_tree_model_get(model,&iter,2,&target,-1);
|
|
|
|
gtk_tree_model_get(model,&iter,2,&target,-1);
|
|
|
|
int size;
|
|
|
|
int size;
|
|
|
|
config_str passwd_users = yon_config_load(user_shadow_path,&size);
|
|
|
|
config_str passwd_users = yon_file_open(users_path,&size);
|
|
|
|
int active_usr = yon_char_parsed_strstr(passwd_users,size,target);
|
|
|
|
int active_usr = yon_char_parsed_strstr(passwd_users,size,target);
|
|
|
|
int cur_size;
|
|
|
|
int cur_size;
|
|
|
|
if (size>-1){
|
|
|
|
if (size){
|
|
|
|
|
|
|
|
yon_char_remove_last_symbol(passwd_users[active_usr],'\n');
|
|
|
|
config_str cur_user = yon_char_parse(passwd_users[active_usr],&cur_size,":");
|
|
|
|
config_str cur_user = yon_char_parse(passwd_users[active_usr],&cur_size,":");
|
|
|
|
char *final_user = yon_char_unite(cur_user[4],":",cur_user[5],":",cur_size>1?cur_user[1]:"",":",cur_size>2?cur_user[2]:"",":",cur_user[0],":",":",NULL);
|
|
|
|
int final_size=0;
|
|
|
|
char *final_command = yon_config_parameter_prepare_command(dull_parameter_get_command,NULL,"users",USERADD_SYNC(target));
|
|
|
|
config_str final_user_parsed = NULL;
|
|
|
|
yon_config_register(USERADD(target),final_command,final_user);
|
|
|
|
yon_char_parsed_add_or_create_if_exists(final_user_parsed,&final_size,cur_user[4]);
|
|
|
|
|
|
|
|
yon_char_parsed_add_or_create_if_exists(final_user_parsed,&final_size,cur_user[3]);
|
|
|
|
|
|
|
|
yon_char_parsed_add_or_create_if_exists(final_user_parsed,&final_size,"x");
|
|
|
|
|
|
|
|
char *extra_groups = yon_char_unite(!yon_char_is_empty(cur_user[6])?"--shell ":"",!yon_char_is_empty(cur_user[6])?cur_user[6]:"",!yon_char_is_empty(cur_user[6])?" ":"",!yon_char_is_empty(cur_user[5])?"--home-dir ":"",!yon_char_is_empty(cur_user[5])?cur_user[5]:"",NULL);
|
|
|
|
|
|
|
|
yon_char_parsed_add_or_create_if_exists(final_user_parsed,&final_size,extra_groups);
|
|
|
|
|
|
|
|
yon_char_parsed_add_or_create_if_exists(final_user_parsed,&final_size,cur_user[1]);
|
|
|
|
|
|
|
|
char *final_user = yon_char_parsed_to_string(final_user_parsed,final_size,":");
|
|
|
|
|
|
|
|
if (config(USERADD(target))){
|
|
|
|
|
|
|
|
char *final_command = yon_config_parameter_prepare_command(dull_parameter_get_command,NULL,"users",USERADD_SYNC(target));
|
|
|
|
|
|
|
|
yon_config_register(USERADD_SYNC(target),final_command,final_user);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
char *final_command = yon_config_parameter_prepare_command(dull_parameter_get_command,NULL,"users",USERADD(target));
|
|
|
|
|
|
|
|
yon_config_register(USERADD(target),final_command,final_user);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int shadow_size;
|
|
|
|
// int shadow_size;
|
|
|
|
config_str shadow = yon_config_load(shadow_path,&shadow_size);
|
|
|
|
// config_str shadow = yon_file_open(shadow_path,&shadow_size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
@ -2836,8 +2838,8 @@ void on_user_sync_with_config(GtkWidget *,main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int *yon_element_chosen(GtkWidget *target){
|
|
|
|
int yon_element_chosen(GtkWidget *){
|
|
|
|
return (int*)0x1;
|
|
|
|
return (int)1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**config_init()
|
|
|
|
/**config_init()
|
|
|
|
@ -2920,7 +2922,7 @@ void config_init(){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_selection_changed(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_selection_changed(GtkWidget *, main_window *widgets){
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
if (gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->MainNotebook))==0){
|
|
|
|
if (gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->MainNotebook))==0){
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widgets->UsersList);
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widgets->UsersList);
|
|
|
|
@ -2939,12 +2941,13 @@ void on_selection_changed(GtkWidget *self, main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_notebook_page_changed(GtkWidget *self, GtkWidget *page, int num, main_window *widgets){
|
|
|
|
void on_notebook_page_changed(GtkWidget *, GtkWidget *, int num, main_window *widgets){
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
if (num==0){
|
|
|
|
if (num==0){
|
|
|
|
gtk_widget_show(widgets->AddButton);
|
|
|
|
gtk_widget_show(widgets->AddButton);
|
|
|
|
gtk_widget_show(widgets->EditButton);
|
|
|
|
gtk_widget_show(widgets->EditButton);
|
|
|
|
gtk_widget_show(widgets->DeleteButton);
|
|
|
|
gtk_widget_show(widgets->DeleteButton);
|
|
|
|
|
|
|
|
gtk_widget_hide(widgets->UserAddToConfigButton);
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widgets->UsersList);
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widgets->UsersList);
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->UsersTree)),&model,&iter)){
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->UsersTree)),&model,&iter)){
|
|
|
|
gtk_widget_set_sensitive(widgets->EditButton,1);
|
|
|
|
gtk_widget_set_sensitive(widgets->EditButton,1);
|
|
|
|
@ -2955,6 +2958,7 @@ void on_notebook_page_changed(GtkWidget *self, GtkWidget *page, int num, main_wi
|
|
|
|
gtk_widget_show(widgets->AddButton);
|
|
|
|
gtk_widget_show(widgets->AddButton);
|
|
|
|
gtk_widget_show(widgets->EditButton);
|
|
|
|
gtk_widget_show(widgets->EditButton);
|
|
|
|
gtk_widget_show(widgets->DeleteButton);
|
|
|
|
gtk_widget_show(widgets->DeleteButton);
|
|
|
|
|
|
|
|
gtk_widget_hide(widgets->UserAddToConfigButton);
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widgets->GroupsList);
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widgets->GroupsList);
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GroupsTree)),&model,&iter)){
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GroupsTree)),&model,&iter)){
|
|
|
|
gtk_widget_set_sensitive(widgets->EditButton,1);
|
|
|
|
gtk_widget_set_sensitive(widgets->EditButton,1);
|
|
|
|
@ -2964,7 +2968,7 @@ void on_notebook_page_changed(GtkWidget *self, GtkWidget *page, int num, main_wi
|
|
|
|
} else if (num==2||num==3){
|
|
|
|
} else if (num==2||num==3){
|
|
|
|
gtk_widget_hide(widgets->AddButton);
|
|
|
|
gtk_widget_hide(widgets->AddButton);
|
|
|
|
gtk_widget_hide(widgets->EditButton);
|
|
|
|
gtk_widget_hide(widgets->EditButton);
|
|
|
|
gtk_widget_hide(widgets->DeleteButton);
|
|
|
|
gtk_widget_show(widgets->UserAddToConfigButton);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -3027,7 +3031,7 @@ main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
g_signal_connect(G_OBJECT(widgets->DeleteButton),"clicked",G_CALLBACK(on_main_delete),widgets);
|
|
|
|
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->UserAddToConfigButton),"clicked",G_CALLBACK(on_user_sync_with_config),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->UserAddToConfigButton),"clicked",G_CALLBACK(on_user_sync_with_config),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->UpdateButton),"clicked",G_CALLBACK(on_config_update),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->UpdateButton),"clicked",G_CALLBACK(on_config_update),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SavingSettingsButton),"clicked",G_CALLBACK(on_saving_settings_open),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SavingSettingsButton),"clicked",G_CALLBACK(on_saving_settings_open),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SaveMenuItem),"activate",G_CALLBACK(on_config_save),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SaveMenuItem),"activate",G_CALLBACK(on_config_save),widgets);
|
|
|
|
@ -3050,7 +3054,7 @@ main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
g_signal_connect(G_OBJECT(widgets->GroupsTree),"button-press-event",G_CALLBACK(on_menu_open),widgets->GroupsMenu);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->GroupsTree),"button-press-event",G_CALLBACK(on_menu_open),widgets->GroupsMenu);
|
|
|
|
|
|
|
|
|
|
|
|
yon_system_load(widgets);
|
|
|
|
yon_system_load(widgets);
|
|
|
|
on_system_update(NULL,widgets);
|
|
|
|
// on_system_update(NULL,widgets);
|
|
|
|
|
|
|
|
|
|
|
|
yon_root_button_setup((template_main_window*)widgets,main_config.launch_arguments,main_config.launch_size);
|
|
|
|
yon_root_button_setup((template_main_window*)widgets,main_config.launch_arguments,main_config.launch_size);
|
|
|
|
|
|
|
|
|
|
|
|
@ -3063,12 +3067,12 @@ main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
gtk_widget_realize(GTK_WIDGET(widgets->GroupsTree));
|
|
|
|
gtk_widget_realize(GTK_WIDGET(widgets->GroupsTree));
|
|
|
|
yon_gtk_tree_view_minimal_fixed_size_set_full(GTK_TREE_VIEW(widgets->GroupsTree));
|
|
|
|
yon_gtk_tree_view_minimal_fixed_size_set_full(GTK_TREE_VIEW(widgets->GroupsTree));
|
|
|
|
GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(widgets->UsersTree));
|
|
|
|
GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(widgets->UsersTree));
|
|
|
|
for (int i=0;i<g_list_length(list);i++){
|
|
|
|
for (guint i=0;i<g_list_length(list);i++){
|
|
|
|
yon_window_config_add_listener((GtkWidget*)g_list_nth_data(list,i),yon_char_append("UserColumn",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
|
|
|
|
yon_window_config_add_listener((GtkWidget*)g_list_nth_data(list,i),yon_char_append("UserColumn",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_list_free(list);
|
|
|
|
g_list_free(list);
|
|
|
|
list = gtk_tree_view_get_columns(GTK_TREE_VIEW(widgets->GroupsTree));
|
|
|
|
list = gtk_tree_view_get_columns(GTK_TREE_VIEW(widgets->GroupsTree));
|
|
|
|
for (int i=0;i<g_list_length(list);i++){
|
|
|
|
for (guint i=0;i<g_list_length(list);i++){
|
|
|
|
yon_window_config_add_listener((GtkWidget*)g_list_nth_data(list,i),yon_char_append("GroupColumn",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
|
|
|
|
yon_window_config_add_listener((GtkWidget*)g_list_nth_data(list,i),yon_char_append("GroupColumn",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_list_free(list);
|
|
|
|
g_list_free(list);
|
|
|
|
@ -3091,5 +3095,5 @@ int main(int argc, char *argv[]){
|
|
|
|
yon_window_config_load(config_path);
|
|
|
|
yon_window_config_load(config_path);
|
|
|
|
main_config.launch_arguments=yon_char_parsed_copy(argv,argc);
|
|
|
|
main_config.launch_arguments=yon_char_parsed_copy(argv,argc);
|
|
|
|
main_config.launch_size=argc;
|
|
|
|
main_config.launch_size=argc;
|
|
|
|
gtk_main();
|
|
|
|
gtk_main();
|
|
|
|
}
|
|
|
|
}
|