diff --git a/source/ubl-settings-system.c b/source/ubl-settings-system.c index 2fcdde1..e228026 100644 --- a/source/ubl-settings-system.c +++ b/source/ubl-settings-system.c @@ -234,11 +234,13 @@ void on_id_combo_toggled(GtkComboBox *self, main_window *widgets){ void on_id_changed(GtkEntry *self, main_window *widgets){ char *text = (char*)gtk_entry_get_text(self); - if (yon_config_get_by_key(id_parameter)){ - yon_config_set(id_parameter,text); - } else { - yon_config_register(id_parameter,"config",text); - } + if (strcmp(text,"")){ + if (yon_config_get_by_key(id_parameter)){ + yon_config_set(id_parameter,text); + } else { + yon_config_register(id_parameter,"config",text); + } + } else yon_ubl_status_box_render(ID_EMPTY_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); } diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 1649cda..29520a7 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -51,4 +51,6 @@ #define DEFAULT_LABEL _("Default") -#define COPY_SUCCESS_LABEL _("Machine ID has been copied") \ No newline at end of file +#define COPY_SUCCESS_LABEL _("Machine ID has been copied") + +#define ID_EMPTY_LABEL _("ID field can't be empty!"); \ No newline at end of file diff --git a/ubl-settings-system.pot b/ubl-settings-system.pot index 34c45e1..882bc57 100644 --- a/ubl-settings-system.pot +++ b/ubl-settings-system.pot @@ -225,6 +225,10 @@ msgstr "" msgid "Machine ID has been copied" msgstr "" +#: source/ubl-strings.h:56 +msgid "ID string can't be empty!" +msgstr "" + msgid "Afrikaans, South Africa" msgstr "" diff --git a/ubl-settings-system_ru.po b/ubl-settings-system_ru.po index b4b6e19..3ed1e65 100644 --- a/ubl-settings-system_ru.po +++ b/ubl-settings-system_ru.po @@ -178,7 +178,7 @@ msgid "Local configuration saving succseeded." msgstr "Успешно записана локальная конфигурация." #: source/ubl-strings.h:39 -msgid "Warning! New machine ID will apply after reboot" +msgid "Warning! New machine ID will apply after system reboot" msgstr "Внимание! Новый ID рабочей станции будет применён после перезагрузки системы." #: source/ubl-strings.h:41 @@ -229,6 +229,11 @@ msgstr "По умолчанию" msgid "Machine ID has been copied" msgstr "ID рабочей станции скопирован" +#: source/ubl-strings.h:56 +msgid "ID field can't be empty!" +msgstr "Поле ID не может быть пустым!" + + msgid "Afrikaans, South Africa" msgstr "Африканский, Южная Африка"