diff --git a/source/ubl-settings-system.c b/source/ubl-settings-system.c index 86422f3..2fcdde1 100644 --- a/source/ubl-settings-system.c +++ b/source/ubl-settings-system.c @@ -113,7 +113,10 @@ void yon_load_proceed(YON_CONFIG_TYPE type){ void yon_config_local_load(GtkWidget *self, main_window *widgets){ gtk_entry_set_text(GTK_ENTRY(widgets->HostnameEntry),""); gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),""); - gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),""); + int size; + config_str rtn = yon_config_load(get_id_command,&size); + rtn[0]=yon_char_divide_search(rtn[0],"\n",-1); + gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),*rtn); gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->ConsoleFontCombo),0); gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LanguageCombo),0); yon_load_proceed(YON_CONFIG_LOCAL); @@ -150,7 +153,10 @@ void yon_config_local_load(GtkWidget *self, main_window *widgets){ void yon_config_global_load(GtkWidget *self, main_window *widgets){ gtk_entry_set_text(GTK_ENTRY(widgets->HostnameEntry),""); gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),""); - gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),""); + int size; + config_str rtn = yon_config_load(get_id_command,&size); + rtn[0]=yon_char_divide_search(rtn[0],"\n",-1); + gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),*rtn); gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->ConsoleFontCombo),0); gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LanguageCombo),0); yon_load_proceed(YON_CONFIG_GLOBAL); @@ -160,9 +166,6 @@ void yon_config_global_load(GtkWidget *self, main_window *widgets){ gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->IDCombo),1); else if (!strcmp(id,"hardware")) gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->IDCombo),2); - else - gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),id); - GtkTreeIter iter; char *code; char *cons_font = yon_config_get_by_key(console_font_parameter); @@ -188,15 +191,18 @@ void yon_config_global_load(GtkWidget *self, main_window *widgets){ void yon_config_global_local_save(){ yon_config_save_registered(NULL,""); + yon_ubl_status_box_render(yon_char_unite(GLOBAL_LOCAL_SAVE_SUCCESS_LABEL," ", SAVE_WARNING_LABEL,NULL),BACKGROUND_IMAGE_SUCCESS_TYPE); } void yon_config_local_save(){ yon_config_save_registered("system","config"); + yon_ubl_status_box_render(yon_char_unite(LOCAL_SAVE_SUCCESS_LABEL," ", SAVE_WARNING_LABEL,NULL),BACKGROUND_IMAGE_SUCCESS_TYPE); } void yon_config_global_save(){ yon_config_save_registered("global",""); + yon_ubl_status_box_render(yon_char_unite(GLOBAL_SAVE_SUCCESS_LABEL," ", SAVE_WARNING_LABEL,NULL),BACKGROUND_IMAGE_SUCCESS_TYPE); } @@ -219,12 +225,9 @@ void on_id_combo_toggled(GtkComboBox *self, main_window *widgets){ } } if (id<3){ - gtk_widget_set_sensitive(widgets->IDEntry,0); - gtk_widget_set_sensitive(widgets->IDCopyButton,0); } else { - gtk_widget_set_sensitive(widgets->IDCopyButton,1); gtk_widget_set_sensitive(widgets->IDEntry,1); } } @@ -358,7 +361,6 @@ main_window *setup_window(){ gtk_widget_set_sensitive(widgets->SaveLocalMenuItem,0); gtk_widget_set_sensitive(widgets->SaveMenuItem,0); } - /* Widget registration for config monitoring | Регистрация виджетов для мониторинга конфига */ // yon_window_config_add_custom_parameter(widgets->HeadInfoLabel,"head-text","label",YON_TYPE_STRING); @@ -379,8 +381,7 @@ main_window *setup_window(){ g_signal_connect(G_OBJECT(widgets->IDCopyButton),"clicked",G_CALLBACK(on_id_copy),widgets); g_signal_connect(G_OBJECT(widgets->ConsoleFontCombo),"changed",G_CALLBACK(on_console_font_changed),widgets); g_signal_connect(G_OBJECT(widgets->LanguageCombo),"changed",G_CALLBACK(on_language_changed),widgets); - // g_signal_connect(G_OBJECT(widgets->IDRandomCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->IDCopyButton); - // g_signal_connect(G_OBJECT(widgets->IDRandomCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->IDEntry); + int size; config_str locales = yon_config_load(get_locales_command,&size); GtkTreeIter iter; diff --git a/source/ubl-settings-system.h b/source/ubl-settings-system.h index 02f4723..ca328b5 100644 --- a/source/ubl-settings-system.h +++ b/source/ubl-settings-system.h @@ -32,8 +32,16 @@ #define get_locales_command "grep '' /usr/share/ubl-settings-system/csv/locales.csv" #define get_fonts_command "grep '' /usr/share/ubl-settings-system/csv/fonts.csv" +#define get_id_command "grep '' /etc/machine-id" // #define get_fonts_command "ls /usr/share/kbd/consolefonts/ |grep -v \"README\"|grep -oE \"^[-a-zA-Z0-9_]{3,}.psf\"|sed -e 's/\\.psf//g'" +#define hostname_parameter "HOSTNAME" +#define id_parameter "MACHINEID" +#define keyboard_layout_parameter "XkbLayout" +#define console_font_parameter "CONSOLE_FONT" +#define num_lock_boot_parameter "NUMLOCK" +#define language_parameter "LANG" + typedef char* string; string version_application; diff --git a/source/ubl-strings.h b/source/ubl-strings.h index e8136b9..1649cda 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -36,6 +36,7 @@ #define GLOBAL_LOCAL_SAVE_SUCCESS_LABEL _("Local and global configuration saving succseeded.") #define GLOBAL_SAVE_SUCCESS_LABEL _("Global configuration saving succseeded.") #define LOCAL_SAVE_SUCCESS_LABEL _("Local configuration saving succseeded.") +#define SAVE_WARNING_LABEL _("Warning! New machine ID will apply after system reboot") #define HOSTNAME_LABEL _("Hostname:") #define ID_LABEL _("Work station ID:") diff --git a/source/ubl-utils.h b/source/ubl-utils.h index 88222c1..ab19767 100644 --- a/source/ubl-utils.h +++ b/source/ubl-utils.h @@ -28,14 +28,6 @@ #define get_home_dir_command yon_char_unite("getent passwd \"",yon_ubl_root_user_get(),"\" | cut -d: -f6",NULL) - -#define hostname_parameter "HOSTNAME" -#define id_parameter "MACHINEID" -#define keyboard_layout_parameter "XkbLayout" -#define console_font_parameter "CONSOLE_FONT" -#define num_lock_boot_parameter "NUMLOCK" -#define language_parameter "LANG" - typedef enum { #ifdef __GTK_H__ diff --git a/ubl-settings-system.desktop b/ubl-settings-system.desktop index 941293e..89644e7 100644 --- a/ubl-settings-system.desktop +++ b/ubl-settings-system.desktop @@ -1,15 +1,15 @@ [Desktop Entry] Encoding=UTF-8 Name=System configuration -Name[ru]=TEMPLATE +Name[ru]=Системные настройки GenericName=ubl-settings-system -GenericName[ru]=TEMPLATE +GenericName[ru]=ubl-settings-system Comment=System basic parameters configuration -Comment[ru]=Приложение для TEMPLATE +Comment[ru]=Настройка основных параметров системы Type=Application Exec=pkexec ubl-settings-system Icon=com.ublinux.ubl-settings-system Terminal=false X-XfcePluggable=true X-UBLPluggable=true -Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;X-UBL-SettingsManager;X-UBL-Personal-Settings; +Categories=XFCE;GTK;Settings;X-UBL-SettingsManager;X-UBL-System-Settings; diff --git a/ubl-settings-system.glade b/ubl-settings-system.glade index 85456f4..9b011b2 100644 --- a/ubl-settings-system.glade +++ b/ubl-settings-system.glade @@ -711,6 +711,7 @@ translated and supported by community. True True + True True diff --git a/ubl-settings-system.pot b/ubl-settings-system.pot index c0517de..34c45e1 100644 --- a/ubl-settings-system.pot +++ b/ubl-settings-system.pot @@ -173,51 +173,55 @@ msgstr "" msgid "Local configuration saving succseeded." msgstr "" -#: source/ubl-strings.h:40 -msgid "Hostname:" +#: source/ubl-strings.h:39 +msgid "Warning! New machine ID will apply after reboot" msgstr "" #: source/ubl-strings.h:41 -msgid "Work station ID:" +msgid "Hostname:" msgstr "" #: source/ubl-strings.h:42 -msgid "System" +msgid "Work station ID:" msgstr "" #: source/ubl-strings.h:43 -msgid "Random" +msgid "System" msgstr "" #: source/ubl-strings.h:44 -msgid "Hardware" +msgid "Random" msgstr "" #: source/ubl-strings.h:45 -msgid "Manual" +msgid "Hardware" msgstr "" #: source/ubl-strings.h:46 -msgid "Console" +msgid "Manual" msgstr "" #: source/ubl-strings.h:47 -msgid "Console font:" +msgid "Console" msgstr "" #: source/ubl-strings.h:48 -msgid "Locale" +msgid "Console font:" msgstr "" #: source/ubl-strings.h:49 +msgid "Locale" +msgstr "" + +#: source/ubl-strings.h:50 msgid "Language:" msgstr "" -#: source/ubl-strings.h:51 +#: source/ubl-strings.h:52 msgid "Default" msgstr "" -#: source/ubl-strings.h:53 +#: source/ubl-strings.h:54 msgid "Machine ID has been copied" msgstr "" diff --git a/ubl-settings-system_ru.po b/ubl-settings-system_ru.po index a47ba90..b4b6e19 100644 --- a/ubl-settings-system_ru.po +++ b/ubl-settings-system_ru.po @@ -155,11 +155,11 @@ msgstr "Ничего не было выбрано" #: source/ubl-strings.h:32 msgid "Global configuration loading succseeded." -msgstr "Успешно загружена глобальная конфигурация" +msgstr "Успешно загружена глобальная конфигурация." #: source/ubl-strings.h:33 msgid "Local configuration loading succseeded." -msgstr "Успешно загружена локальная конфигурация" +msgstr "Успешно загружена локальная конфигурация." #: source/ubl-strings.h:34 msgid "Config loading failed" @@ -167,61 +167,65 @@ msgstr "Ошибка загрузки конфигурации" #: source/ubl-strings.h:36 msgid "Local and global configuration saving succseeded." -msgstr "Успешно записаны локальная и глобальная конфигурация" +msgstr "Успешно записаны локальная и глобальная конфигурация." #: source/ubl-strings.h:37 msgid "Global configuration saving succseeded." -msgstr "Успешно записана глобальная конфигурация" +msgstr "Успешно записана глобальная конфигурация." #: source/ubl-strings.h:38 msgid "Local configuration saving succseeded." -msgstr "Успешно записана локальная конфигурация" +msgstr "Успешно записана локальная конфигурация." -#: source/ubl-strings.h:40 +#: source/ubl-strings.h:39 +msgid "Warning! New machine ID will apply after reboot" +msgstr "Внимание! Новый ID рабочей станции будет применён после перезагрузки системы." + +#: source/ubl-strings.h:41 msgid "Hostname:" msgstr "Имя хоста:" -#: source/ubl-strings.h:41 +#: source/ubl-strings.h:42 msgid "Work station ID:" msgstr "ID рабочей станции:" -#: source/ubl-strings.h:42 +#: source/ubl-strings.h:43 msgid "System" msgstr "Система" -#: source/ubl-strings.h:43 +#: source/ubl-strings.h:44 msgid "Random" msgstr "Случайный" -#: source/ubl-strings.h:44 +#: source/ubl-strings.h:45 msgid "Hardware" msgstr "Системный" -#: source/ubl-strings.h:45 +#: source/ubl-strings.h:46 msgid "Manual" msgstr "Вручную" -#: source/ubl-strings.h:46 +#: source/ubl-strings.h:47 msgid "Console" msgstr "Консоль" -#: source/ubl-strings.h:47 +#: source/ubl-strings.h:48 msgid "Console font:" msgstr "Шрифт в консоли" -#: source/ubl-strings.h:48 +#: source/ubl-strings.h:49 msgid "Locale" msgstr "Локаль" -#: source/ubl-strings.h:49 +#: source/ubl-strings.h:50 msgid "Language:" msgstr "Язык" -#: source/ubl-strings.h:51 +#: source/ubl-strings.h:52 msgid "Default" msgstr "По умолчанию" -#: source/ubl-strings.h:53 +#: source/ubl-strings.h:54 msgid "Machine ID has been copied" msgstr "ID рабочей станции скопирован"