Updated configuration window initiation

pull/304/head
parent ef6aaedd32
commit 25bc2c8b0a

@ -1407,12 +1407,13 @@ void yon_system_load(main_window *window){
if (yon_gtk_list_store_find_text(window->liststore1,&iter,2,parsed[0])){
GDateTime *date = g_date_time_new_from_unix_local(atol(parsed[2])*24*60*60);
char *date_string;
date_string = g_date_time_format(date,yon_settings_configuration_get(date_format_parameter));
char *format = yon_settings_configuration_get(date_format_parameter);
date_string = g_date_time_format(date,format?format:"%d.%m.%Y");
g_date_time_unref(date);
char *expiration_string="";
if (parsed_size>7&&!yon_char_is_empty(parsed[7])){
date = g_date_time_new_from_unix_local(atol(parsed[7])*24*60*60);
expiration_string = g_date_time_format(date,yon_settings_configuration_get(date_format_parameter));
expiration_string = g_date_time_format(date,format?format:"%d.%m.%Y");
g_date_time_unref(date);
}
@ -1525,7 +1526,8 @@ void on_date_selected(GtkWidget *, ubl_settings_usergroups_user_window *window){
char *mn = yon_char_from_int(month+1);
char *yr = yon_char_from_int(year);
GDateTime *datetime = g_date_time_new_local(year,month+1,day,0,0,0);
char *date_string = g_date_time_format(datetime,yon_settings_configuration_get(date_format_parameter));
char *format = yon_settings_configuration_get(date_format_parameter);
char *date_string = g_date_time_format(datetime,format?format:"%d.%m.%Y");
gtk_entry_set_text(GTK_ENTRY(window->userPasswordExpirationEntry), date_string);
window->expiration_unix=date_string;
free(dy);
@ -2468,7 +2470,11 @@ template_main_window *yon_main_window_complete(main_window *widgets){
}
}
g_list_free(menu_items);
yon_configuration_window_add_combo_box_parameter(CONFIGURATION_PARAMETER_BOOL,date_format_parameter,DATE_FORMAT_SETTINGS_LABEL,G_CALLBACK(on_date_format_changed),widgets,"%d.%m.%Y",DMY_FORMAT_LABEL,"%d-%m-%Y",DMY_MINUS_FORMAT_LABEL,"%d/%m/%Y",DMY_SLASH_FORMAT_LABEL,"%m-%d-%Y",MDY_FORMAT_LABEL,NULL);
struct yon_configuration_window_custom_parameter *parameter = malloc(sizeof(struct yon_configuration_window_custom_parameter));
parameter->custom_parameter_create_func = yon_date_chooser_new;
parameter->custom_parameter_save_value_func = yon_date_chooser_save;
parameter->custom_parameter_update_func = yon_date_chooser_update;
yon_configuration_window_add_custom_parameter(date_format_parameter,parameter);
yon_system_load(widgets);

@ -487,6 +487,7 @@ typedef struct{
GtkToggleButton *defaut_toggle;
};
ubl_settings_usergroups_additional_settings_window *yon_ubl_settings_usergroups_additional_settings_new();
void on_ubl_settings_usergroups_additional_settings_open(GtkWidget *self, main_window *widgets);

@ -292,14 +292,6 @@
#define AUTH_PASSWORD_LOCKED_LABEL _("User auth with password is blocked for user.\nOther access methods are allowed (key auth, user switching etc).")
#define USER_INFORMATION_TOOLTIP_LABEL _("User information")
#define DATE_FORMAT_SETTINGS_LABEL _("Date format:")
#define YEAR_FORMAT_LABEL _("YYYY")
#define MONTH_FORMAT_LABEL _("MM")
#define DAY_FORMAT_LABEL _("DD")
#define DMY_FORMAT_LABEL _("DD.MM.YYYY")
#define DMY_MINUS_FORMAT_LABEL _("DD-MM-YYYY")
#define DMY_SLASH_FORMAT_LABEL _("DD/MM/YYYY")
#define MDY_FORMAT_LABEL _("MM-DD-YYYY")
#define HOMEDIR_USED_LABEL _("The selected home directory is used by another user")
#define SYSTEM_LANGUAGE_LABEL _("System language:")

Loading…
Cancel
Save