|
|
|
|
@ -100,8 +100,88 @@ void on_about(){
|
|
|
|
|
gtk_widget_show(window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_toggle_button_switched(GtkToggleButton *self, GtkWidget *widget){
|
|
|
|
|
gtk_widget_set_sensitive(widget,!gtk_toggle_button_get_active(self));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//functions
|
|
|
|
|
|
|
|
|
|
void on_uid_changed(GtkWidget *self, dictionary *dict){
|
|
|
|
|
user_window *window = yon_dictionary_get_data(dict->first,user_window*);
|
|
|
|
|
user_config *user_cfg = yon_dictionary_get_data(dict->first->next,user_config*);
|
|
|
|
|
user_cfg->uid = atoi(gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(window->UserUIDEntry))));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_username_changed(GtkWidget *self, dictionary *dict){
|
|
|
|
|
user_window *window = yon_dictionary_get_data(dict->first,user_window*);
|
|
|
|
|
user_config *user_cfg = yon_dictionary_get_data(dict->first->next,user_config*);
|
|
|
|
|
user_cfg->username = (char*)(gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(window->userUserNameEntry))));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_login_changed(GtkWidget *self, dictionary *dict){
|
|
|
|
|
user_window *window = yon_dictionary_get_data(dict->first,user_window*);
|
|
|
|
|
user_config *user_cfg = yon_dictionary_get_data(dict->first->next,user_config*);
|
|
|
|
|
user_cfg->login = (char*)(gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(window->userLoginEntry))));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_password_changed(GtkWidget *self, dictionary *dict){
|
|
|
|
|
user_window *window = yon_dictionary_get_data(dict->first,user_window*);
|
|
|
|
|
user_config *user_cfg = yon_dictionary_get_data(dict->first->next,user_config*);
|
|
|
|
|
user_cfg->password = (char*)(gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(window->userPasswordEntry))));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_group_changed(GtkWidget *self, dictionary *dict){
|
|
|
|
|
user_window *window = yon_dictionary_get_data(dict->first,user_window*);
|
|
|
|
|
user_config *user_cfg = yon_dictionary_get_data(dict->first->next,user_config*);
|
|
|
|
|
user_cfg->main_group = (char*)(gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(window->userGroupsEntry))));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_hash_changed(GtkWidget *self, dictionary *dict){
|
|
|
|
|
user_window *window = yon_dictionary_get_data(dict->first,user_window*);
|
|
|
|
|
user_config *user_cfg = yon_dictionary_get_data(dict->first->next,user_config*);
|
|
|
|
|
user_cfg->password_hash = gtk_combo_box_get_active(GTK_COMBO_BOX(window->userPasswordHashAlgorithmCombo));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_extra_changed(GtkWidget *self, dictionary *dict){
|
|
|
|
|
user_window *window = yon_dictionary_get_data(dict->first,user_window*);
|
|
|
|
|
user_config *user_cfg = yon_dictionary_get_data(dict->first->next,user_config*);
|
|
|
|
|
user_cfg->extra_options = (char*)(gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(window->userExtraOptionsEntry))));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_user_def_password_changed(GtkWidget *self, dictionary *dict){
|
|
|
|
|
user_window *window = yon_dictionary_get_data(dict->first,user_window*);
|
|
|
|
|
user_config *user_cfg = yon_dictionary_get_data(dict->first->next,user_config*);
|
|
|
|
|
user_cfg->password=NULL;
|
|
|
|
|
user_cfg->password_default = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self));
|
|
|
|
|
on_toggle_button_switched(GTK_TOGGLE_BUTTON(self),window->userPasswordEntry);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_auto_uid_changed(GtkWidget *self, dictionary *dict){
|
|
|
|
|
user_window *window = yon_dictionary_get_data(dict->first,user_window*);
|
|
|
|
|
user_config *user_cfg = yon_dictionary_get_data(dict->first->next,user_config*);
|
|
|
|
|
user_cfg->uid=0;
|
|
|
|
|
user_cfg->uid_default = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self));
|
|
|
|
|
on_toggle_button_switched(GTK_TOGGLE_BUTTON(self),window->UserUIDEntry);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_SAMBA_changed(GtkWidget *self, dictionary *dict){
|
|
|
|
|
user_window *window = yon_dictionary_get_data(dict->first,user_window*);
|
|
|
|
|
user_config *user_cfg = yon_dictionary_get_data(dict->first->next,user_config*);
|
|
|
|
|
user_cfg->sync_SAMBA=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_user_accept(GtkWidget *self, dictionary * dict){
|
|
|
|
|
user_window *window = yon_dictionary_get_data(dict->first,user_window*);
|
|
|
|
|
user_config *user_cfg = yon_dictionary_get_data(dict->first->next,user_config*);
|
|
|
|
|
main_window *widgets = yon_dictionary_get_data(dict->first->next->next,main_window*);
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
gtk_list_store_append(main_config.usersListStore,&iter);
|
|
|
|
|
gtk_list_store_set(main_config.usersListStore,&iter,(user_cfg->uid_default==0) ? 0 : 1,(user_cfg->uid_default==0) ? user_cfg->uid : 1,2,user_cfg->login, 3,(user_cfg->password_default==0) ? "*******" : _("Default"),5,user_cfg->username,-1);
|
|
|
|
|
// widgets->MainUserTree;
|
|
|
|
|
on_close_subwindow(self);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_load_proceed(char *command){
|
|
|
|
|
if (yon_config_load_register(command))
|
|
|
|
|
yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
@ -110,19 +190,61 @@ void yon_load_proceed(char *command){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_groups_open(){
|
|
|
|
|
void on_def_groups_accept(GtkWidget *self, dictionary *windowes){
|
|
|
|
|
char *groups_string = "";
|
|
|
|
|
main_window *widgets = yon_dictionary_get_data(windowes->first->next,main_window*);
|
|
|
|
|
groups_window *window = yon_dictionary_get_data(windowes->first,groups_window*);
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupsAdmCheck))==1) groups_string = yon_char_append(groups_string,"adm,");
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupsAudioCheck))==1) groups_string = yon_char_append(groups_string,"audio,");
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupsAutologinCheck))==1) groups_string = yon_char_append(groups_string,"autologin,");
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupsAvahiCheck))==1) groups_string = yon_char_append(groups_string,"avahi,");
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupsBinCheck))==1) groups_string = yon_char_append(groups_string,"bin,");
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupsBrlapiCheck))==1) groups_string = yon_char_append(groups_string,"brlapi,");
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupsBrittyCheck))==1) groups_string = yon_char_append(groups_string,"britty,");
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupsBumblbeeCheck))==1) groups_string = yon_char_append(groups_string,"bumblbee,");
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupsChronyCheck))==1) groups_string = yon_char_append(groups_string,"chrony,");
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupsClamavCheck))==1) groups_string = yon_char_append(groups_string,"clamav,");
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupsCockpitWsCheck))==1) groups_string = yon_char_append(groups_string,"cockpit-ws,");
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupsCockpitWsinstanceCheck))==1) groups_string = yon_char_append(groups_string,"cockpit-wsinstance,");
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupsColordCheck))==1) groups_string = yon_char_append(groups_string,"colord,");
|
|
|
|
|
if (strcmp(groups_string,"")!=0) groups_string[strlen(groups_string)-1]='\0';
|
|
|
|
|
gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(widgets->MainDefaultGroupsEntry)),groups_string,strlen(groups_string));
|
|
|
|
|
on_close_subwindow(self);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_groups_open(GtkWidget *self, main_window *widgets){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_def_groups_open(GtkWidget *self, main_window *widgets){
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_groups_path);
|
|
|
|
|
groups_window *window = malloc(sizeof(groups_window));
|
|
|
|
|
window->Window = yon_gtk_builder_get_widget(builder,"GroupsWindow");
|
|
|
|
|
window->GroupsCancelButton = yon_gtk_builder_get_widget(builder,"GroupsCancelButton");
|
|
|
|
|
window->GroupsOkButton = yon_gtk_builder_get_widget(builder,"GroupsOkButton");
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->GroupsCancelButton),"clicked",G_CALLBACK(on_close_subwindow),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->GroupsOkButton),"clicked",G_CALLBACK(on_close_subwindow),NULL);
|
|
|
|
|
window->GroupsAdmCheck = yon_gtk_builder_get_widget(builder,"groupsAdmGroupCheck");
|
|
|
|
|
window->GroupsAudioCheck = yon_gtk_builder_get_widget(builder,"groupsAudioGroupCheck");
|
|
|
|
|
window->GroupsAutologinCheck = yon_gtk_builder_get_widget(builder,"groupsAutologinGroupCheck");
|
|
|
|
|
window->GroupsAvahiCheck = yon_gtk_builder_get_widget(builder,"groupsAvahiGroupCheck");
|
|
|
|
|
window->GroupsBinCheck = yon_gtk_builder_get_widget(builder,"groupsBinGroupCheck");
|
|
|
|
|
window->GroupsBrlapiCheck = yon_gtk_builder_get_widget(builder,"groupsBrlapiGroupCheck");
|
|
|
|
|
window->GroupsBrittyCheck = yon_gtk_builder_get_widget(builder,"groupsBrittyGroupCheck");
|
|
|
|
|
window->GroupsBumblbeeCheck = yon_gtk_builder_get_widget(builder,"groupsBumblbeeGroupCheck");
|
|
|
|
|
window->GroupsChronyCheck = yon_gtk_builder_get_widget(builder,"groupsChronyGroupCheck");
|
|
|
|
|
window->GroupsClamavCheck = yon_gtk_builder_get_widget(builder,"groupsClamavGroupCheck");
|
|
|
|
|
window->GroupsCockpitWsCheck = yon_gtk_builder_get_widget(builder,"groupsCockpitWsGroupCheck");
|
|
|
|
|
window->GroupsCockpitWsinstanceCheck = yon_gtk_builder_get_widget(builder,"groupsCockpitWsinstanceGroupCheck");
|
|
|
|
|
window->GroupsColordCheck = yon_gtk_builder_get_widget(builder,"groupsColordGroupCheck");
|
|
|
|
|
dictionary *windgets=NULL;
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(windgets,"window",window);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(windgets,"widgets",widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->GroupsCancelButton),"clicked",G_CALLBACK(on_close_subwindow),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->GroupsOkButton),"clicked",G_CALLBACK(on_def_groups_accept),windgets);
|
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_user_add(){
|
|
|
|
|
void on_user_add(GtkWidget *self, main_window *widgets){
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_user_path);
|
|
|
|
|
user_window *window = malloc(sizeof(user_window));
|
|
|
|
|
window->Window = yon_gtk_builder_get_widget(builder,"CreateUserWindow");
|
|
|
|
|
@ -130,9 +252,47 @@ void on_user_add(){
|
|
|
|
|
window->UserCancelButton = yon_gtk_builder_get_widget(builder,"UserCancelButton");
|
|
|
|
|
window->UserOkButton = yon_gtk_builder_get_widget(builder,"UserOkButton");
|
|
|
|
|
|
|
|
|
|
window->UserUIDAutoCheck = yon_gtk_builder_get_widget(builder,"userUIDAutoCheck");
|
|
|
|
|
window->UserUIDEntry = yon_gtk_builder_get_widget(builder,"userUIDEntry");
|
|
|
|
|
window->userUserNameEntry = yon_gtk_builder_get_widget(builder,"userUserNameEntry");
|
|
|
|
|
window->userLoginEntry = yon_gtk_builder_get_widget(builder,"userLoginEntry");
|
|
|
|
|
window->userPasswordDefaultCheck = yon_gtk_builder_get_widget(builder,"userPasswordDefaultCheck");
|
|
|
|
|
window->userPasswordEntry = yon_gtk_builder_get_widget(builder,"userPasswordEntry");
|
|
|
|
|
window->userGroupsEntry = yon_gtk_builder_get_widget(builder,"userGroupsEntry");
|
|
|
|
|
window->userPasswordHashAlgorithmCombo = yon_gtk_builder_get_widget(builder,"userPasswordHashAlgorithmCombo");
|
|
|
|
|
window->userSyncSAMBACheck = yon_gtk_builder_get_widget(builder,"userSyncSAMBACheck");
|
|
|
|
|
window->userExtraOptionsEntry = yon_gtk_builder_get_widget(builder,"userExtraOptionsEntry");
|
|
|
|
|
user_config *user_cfg=malloc(sizeof(user_config));
|
|
|
|
|
user_cfg->username=NULL;
|
|
|
|
|
user_cfg->login=NULL;
|
|
|
|
|
user_cfg->password=NULL;
|
|
|
|
|
user_cfg->main_group=NULL;
|
|
|
|
|
user_cfg->additional_groups=NULL;
|
|
|
|
|
user_cfg->extra_options=NULL;
|
|
|
|
|
user_cfg->uid=-1;
|
|
|
|
|
user_cfg->password_default=0;
|
|
|
|
|
user_cfg->password_hash=-1;
|
|
|
|
|
user_cfg->sync_SAMBA=0;
|
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window)
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"config",user_cfg);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UserCancelButton),"clicked",G_CALLBACK(on_close_subwindow),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UserOkButton),"clicked",G_CALLBACK(on_close_subwindow),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UserOkButton),"clicked",G_CALLBACK(on_user_accept),dict);
|
|
|
|
|
// g_signal_connect(G_OBJECT(window->UserUIDAutoCheck),"clicked",G_CALLBACK(on_toggle_button_switched),window->UserUIDEntry);
|
|
|
|
|
// g_signal_connect(G_OBJECT(window->userPasswordDefaultCheck),"clicked",G_CALLBACK(on_toggle_button_switched),window->UserPasswordEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UserAdditionalGroupsButton),"clicked",G_CALLBACK(on_groups_open),NULL);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UserUIDAutoCheck),"toggled",G_CALLBACK(on_auto_uid_changed),dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UserUIDEntry),"changed",G_CALLBACK(on_uid_changed),dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userUserNameEntry),"changed",G_CALLBACK(on_username_changed),dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userLoginEntry),"changed",G_CALLBACK(on_login_changed),dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userPasswordDefaultCheck),"toggled",G_CALLBACK(on_user_def_password_changed),dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userPasswordEntry),"changed",G_CALLBACK(on_password_changed),dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userGroupsEntry),"changed",G_CALLBACK(on_group_changed),dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userPasswordHashAlgorithmCombo),"changed",G_CALLBACK(on_hash_changed),dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userSyncSAMBACheck),"toggled",G_CALLBACK(on_SAMBA_changed),dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userExtraOptionsEntry),"changed",G_CALLBACK(on_extra_changed),dict);
|
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -144,6 +304,34 @@ void on_user_delete(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_def_groups_edit(GtkCellEditable *self, main_window *widgets){
|
|
|
|
|
main_config.default_groups=(char*)gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(widgets->MainDefaultGroupsEntry)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_def_user_edit(GtkCellEditable *self, main_window *widgets){
|
|
|
|
|
main_config.default_user_name=(char*)gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(widgets->MainDefaultUserNameEntry)));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_def_admin_edit(GtkWidget *self, main_window *widgets){
|
|
|
|
|
main_config.is_1000_administrator=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->MainDefaultUserAdministratorCheck));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_def_password_edit(GtkCellEditable *self, main_window *widgets){
|
|
|
|
|
main_config.default_password=(char*)gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(widgets->MainDefaultPasswordEntry)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_root_password_edit(GtkCellEditable *self, main_window *widgets){
|
|
|
|
|
main_config.root_password=(char*)gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(widgets->MainRootPasswordEntry)));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_hash_edit(GtkWidget *self, main_window *widgets){
|
|
|
|
|
main_config.hash_alg=gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->MainPasswordHashCombo));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// standard functions
|
|
|
|
|
|
|
|
|
|
void config_init(){
|
|
|
|
|
@ -160,6 +348,13 @@ void config_init(){
|
|
|
|
|
main_config.lock_load_global = 0;
|
|
|
|
|
main_config.lock_save_global = 0;
|
|
|
|
|
main_config.lock_save_local = 0;
|
|
|
|
|
main_config.default_groups = NULL;
|
|
|
|
|
main_config.default_groups_config = NULL;
|
|
|
|
|
main_config.default_password = NULL;
|
|
|
|
|
main_config.default_user_name = NULL;
|
|
|
|
|
main_config.is_1000_administrator=0;
|
|
|
|
|
main_config.hash_alg=0;
|
|
|
|
|
main_config.root_password=NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
main_window *setup_window(){
|
|
|
|
|
@ -200,6 +395,16 @@ main_window *setup_window(){
|
|
|
|
|
|
|
|
|
|
widgets->MainEditGroupsButton = yon_gtk_builder_get_widget(builder,"MainEditGroupsButton");
|
|
|
|
|
|
|
|
|
|
widgets->MainDefaultGroupsEntry = yon_gtk_builder_get_widget(builder,"mainDefaultGroupsEntry");
|
|
|
|
|
widgets->MainDefaultUserNameEntry = yon_gtk_builder_get_widget(builder,"mainDefaultUserNameEntry");
|
|
|
|
|
widgets->MainDefaultUserAdministratorCheck = yon_gtk_builder_get_widget(builder,"mainDefaultUserAdministratorCheck");
|
|
|
|
|
widgets->MainDefaultPasswordEntry = yon_gtk_builder_get_widget(builder,"mainDefaultPasswordEntry");
|
|
|
|
|
widgets->MainRootPasswordEntry = yon_gtk_builder_get_widget(builder,"mainRootPasswordEntry");
|
|
|
|
|
widgets->MainUserTree = yon_gtk_builder_get_widget(builder,"mainUserTree");
|
|
|
|
|
widgets->MainPasswordHashCombo = yon_gtk_builder_get_widget(builder,"mainPasswordHashCombo");
|
|
|
|
|
|
|
|
|
|
main_config.usersListStore = GTK_LIST_STORE(gtk_builder_get_object(builder,"UserList"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (main_config.lock_load_global == 1){
|
|
|
|
|
gtk_widget_set_sensitive(widgets->LoadGlobalMenuItem,0);
|
|
|
|
|
@ -217,10 +422,16 @@ main_window *setup_window(){
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->Window), "destroy", G_CALLBACK(gtk_main_quit), NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->DocumentationMenuItem),"activate",G_CALLBACK(on_open_documentation_confirmation),WIKI_LINK);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->AboutMenuItem),"activate",G_CALLBACK(on_about),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MainAddUserButton),"clicked",G_CALLBACK(on_user_add),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MainAddUserButton),"clicked",G_CALLBACK(on_user_add),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MainEditUserButton),"clicked",G_CALLBACK(on_user_edit),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MainDeleteUserButton),"clicked",G_CALLBACK(on_user_delete),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MainEditGroupsButton),"clicked",G_CALLBACK(on_groups_open),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MainEditGroupsButton),"clicked",G_CALLBACK(on_def_groups_open),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MainDefaultGroupsEntry),"changed",G_CALLBACK(on_def_groups_edit),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MainDefaultUserNameEntry),"changed",G_CALLBACK(on_def_user_edit),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MainDefaultUserAdministratorCheck),"toggled",G_CALLBACK(on_def_admin_edit),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MainDefaultPasswordEntry),"changed",G_CALLBACK(on_def_password_edit),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MainRootPasswordEntry),"changed",G_CALLBACK(on_root_password_edit),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MainPasswordHashCombo),"changed",G_CALLBACK(on_hash_edit),widgets);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gtk_widget_show(widgets->Window);
|
|
|
|
|
@ -311,7 +522,7 @@ int main(int argc, char *argv[]){
|
|
|
|
|
if (getuid()!=0)
|
|
|
|
|
yon_ubl_status_box_render(ROOT_WARNING_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
else
|
|
|
|
|
yon_ubl_status_box_render(TITLE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(LOCAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
yon_ubl_setup_sockets(widgets->PlugBox,widgets->LeftBox,widgets->RightBox,main_config.socket_id,main_config.load_socket_id,main_config.save_socket_id);
|
|
|
|
|
yon_window_config_setup(GTK_WINDOW(widgets->Window));
|
|
|
|
|
yon_window_config_load(config_path);
|
|
|
|
|
|