|
|
|
|
@ -997,6 +997,30 @@ void on_group_save(GtkWidget *self, dictionary *dict){
|
|
|
|
|
on_subwindow_close(self);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_system_parameter_changed(GtkWidget *self, ubl_settings_usergroups_group_creation_window *window){
|
|
|
|
|
|
|
|
|
|
char *non_unique = NULL;
|
|
|
|
|
char *gsystem = NULL;
|
|
|
|
|
|
|
|
|
|
int non_unique_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UnuniqueGIDCheck));
|
|
|
|
|
if(non_unique_active){
|
|
|
|
|
non_unique="--non-unique";
|
|
|
|
|
} else non_unique="";
|
|
|
|
|
|
|
|
|
|
int gsystem_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->SystemGroupCheck));
|
|
|
|
|
if(gsystem_active){
|
|
|
|
|
gsystem="--system";
|
|
|
|
|
} else gsystem="";
|
|
|
|
|
|
|
|
|
|
char *final_str = yon_char_unite(
|
|
|
|
|
yon_char_return_if_exist(non_unique,""),
|
|
|
|
|
!yon_char_is_empty(non_unique)?" ":"",
|
|
|
|
|
yon_char_return_if_exist(gsystem,"")
|
|
|
|
|
);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->groupExtraOptionsEntry),final_str);
|
|
|
|
|
free(final_str);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ubl_settings_usergroups_group_creation_window *yon_ubl_settings_usergroups_group_creation_new(){
|
|
|
|
|
ubl_settings_usergroups_group_creation_window *window = malloc(sizeof(ubl_settings_usergroups_group_creation_window));
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_ubl_settings_usergroups_group_creation);
|
|
|
|
|
@ -1019,6 +1043,7 @@ ubl_settings_usergroups_group_creation_window *yon_ubl_settings_usergroups_group
|
|
|
|
|
window->AdminGroupsEntry=yon_gtk_builder_get_widget(builder,"AdminGroupsEntry");
|
|
|
|
|
window->AdminGroupsButton=yon_gtk_builder_get_widget(builder,"AdminGroupsButton");
|
|
|
|
|
window->GroupaddShutdownCheck=yon_gtk_builder_get_widget(builder,"GroupaddShutdownCheck");
|
|
|
|
|
window->groupExtraOptionsEntry=yon_gtk_builder_get_widget(builder,"groupExtraOptionsEntry");
|
|
|
|
|
|
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->CreateGroupWindow),GROUPS_TITLE_LABEL);
|
|
|
|
|
|
|
|
|
|
@ -1039,6 +1064,8 @@ ubl_settings_usergroups_group_creation_window *yon_ubl_settings_usergroups_group
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->SystemGroupCheck);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"toggled",G_CALLBACK(yon_gtk_toggle_button_set_inactive_from_toggle_button_inversed),window->UnuniqueGIDCheck);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->UnuniqueGIDCheck);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UnuniqueGIDCheck),"toggled",G_CALLBACK(on_system_parameter_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->SystemGroupCheck),"toggled",G_CALLBACK(on_system_parameter_changed),window);
|
|
|
|
|
return window;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|