diff --git a/source/ubl-settings-logging.c b/source/ubl-settings-logging.c index dce0000..8c4eaae 100644 --- a/source/ubl-settings-logging.c +++ b/source/ubl-settings-logging.c @@ -582,6 +582,7 @@ void on_logrotate_period_check_toggled(GtkToggleButton *self,logrotate_configure void on_logrotate_save(GtkWidget *self, dictionary *dict){ logrotate_window *dialog = yon_dictionary_get_data(dict->first,logrotate_window*); logrotate_configure_window *window = yon_dictionary_get_data(dict->first->next,logrotate_configure_window*); + char *log_name=""; char *paths=""; char *period=""; char *size=""; @@ -618,6 +619,13 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){ config_str found_paths_list=NULL; int found_paths=0; char *cur_check_paths; + log_name = (char*)gtk_entry_get_text(GTK_ENTRY(window->LogNameEntry)); + if (!strcmp(log_name,"")){ + yon_ubl_status_highlight_incorrect(window->LogNameEntry); + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + return; + } + int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(main_config.logrotate_list),&iter); for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(main_config.logrotate_list),&iter)){ gtk_tree_model_get(GTK_TREE_MODEL(main_config.logrotate_list),&iter,1,&cur_check_paths,-1); @@ -625,6 +633,11 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){ else found_paths_list = yon_char_parsed_append(found_paths_list,&found_paths,cur_check_paths); } valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter); + if (!valid) { + yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(window->LogPathsTree)); + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + return; + } for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&iter)){ char *cur_path; gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,0,&cur_path,-1); @@ -634,12 +647,13 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){ path_amount++; paths = yon_char_unite(paths,strcmp(paths,"") ? "," : "", cur_path,NULL); } - if(!window->paths) + if(!window->paths) { if (matched==path_amount) { yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(window->LogPathsTree)); yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),REPEATED_PATHS_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); return; } + } if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->RotationPeriodCheck))){ int active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->RotationPeriodMainCombo)); switch (active){ @@ -789,6 +803,11 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){ char *endwork = (char*)gtk_entry_get_text(GTK_ENTRY(window->EndworkCommandEntry)); sharedscripts = "sharedscripts"; if (!yon_char_is_empty(before_once)) { + if (strcmp(before_once,",")){ + yon_ubl_status_highlight_incorrect(window->CommandBeforeOnceEntry); + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + return; + } before_once = yon_char_replace(before_once,"\"","=--"); before_once = yon_char_replace(before_once,"=--","\\\""); firstaction = yon_char_append("firstaction,",before_once); @@ -834,7 +853,7 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){ gtk_list_store_append(main_config.logrotate_list,&iter); } paths=yon_char_replace(paths,",","\n"); - gtk_list_store_set(main_config.logrotate_list,&iter,0,gtk_entry_get_text(GTK_ENTRY(window->LogNameEntry)),1,paths,2,gtk_entry_get_text(GTK_ENTRY(window->LogDescriptionEntry)),-1); + gtk_list_store_set(main_config.logrotate_list,&iter,0,log_name,1,paths,2,gtk_entry_get_text(GTK_ENTRY(window->LogDescriptionEntry)),-1); on_close_subwindow(window->MainWindow); } } diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 1548a3f..25b3eab 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -175,6 +175,7 @@ #define SATURDAY_LABEL _("Saturday") #define SUNDAY_LABEL _("Sunday*") #define REPEATED_PATHS_LABEL _("Same record already exists") +#define EMPTY_IMPORTANT_LABEL _("Empty important field") //ubl-settings-logging-logrotate-table.glade #define SYSTEM_CONFIGURATION_LABEL _("System configuration") diff --git a/ubl-settings-logging.pot b/ubl-settings-logging.pot index 1601a18..1f8f92a 100644 --- a/ubl-settings-logging.pot +++ b/ubl-settings-logging.pot @@ -687,71 +687,34 @@ msgstr "" msgid "Sunday*" msgstr "" -#: source/ubl-strings.h:179 -msgid "System configuration" +#: source/ubl-strings.h:177 +msgid "Same record already exists" msgstr "" -#: source/ubl-strings.h:180 -msgid "Applications configuration" +#: source/ubl-strings.h:178 +msgid "Empty important field" msgstr "" -#: source/ubl-strings.h:183 -msgid "Path (-s):" +#: source/ubl-strings.h:181 +msgid "System configuration" msgstr "" -#: source/ubl-strings.h:184 -msgid "Control:" +#: source/ubl-strings.h:182 +msgid "Applications configuration" msgstr "" #: source/ubl-strings.h:185 -msgid "Log file" +msgid "Path (-s):" msgstr "" #: source/ubl-strings.h:186 -msgid "Name:" -msgstr "" - -msgid "System event log rotation service" -msgstr "" - -msgid "System event log" -msgstr "" - -msgid "Service for collecting messages from system events of active network devices" -msgstr "" - -msgid "Log of work and requests to Acpid" -msgstr "" - -msgid "Log of work and requests to the web server" -msgstr "" - -msgid "Audit log" -msgstr "" - -msgid "Log of authorization procedures" -msgstr "" - -msgid "Job scheduler log (cron)" -msgstr "" - -msgid "Log of work and calls to the print server (cups)" -msgstr "" - -msgid "Log of operation and access to system services" -msgstr "" - -msgid "Log of work and access to Samba" -msgstr "" - -msgid "Postfix mail server log" -msgstr "" - -msgid "System log" +msgid "Control:" msgstr "" -msgid "X.org display server log" +#: source/ubl-strings.h:187 +msgid "Log file" msgstr "" -msgid "Graphics X session log" +#: source/ubl-strings.h:188 +msgid "Name:" msgstr "" diff --git a/ubl-settings-logging_ru.po b/ubl-settings-logging_ru.po index a6d2aa8..8d273f0 100644 --- a/ubl-settings-logging_ru.po +++ b/ubl-settings-logging_ru.po @@ -701,72 +701,81 @@ msgstr "Суббота" msgid "Sunday*" msgstr "Воскресенье*" -#: source/ubl-strings.h:179 +#: source/ubl-strings.h:177 +msgid "Same record already exists" +msgstr "Журнал с такими путями уже добавлен" + +#: source/ubl-strings.h:178 +msgid "Empty important field" +msgstr "Важное поле не заполнено" + +#: source/ubl-strings.h:181 msgid "System configuration" msgstr "Настройки системы" -#: source/ubl-strings.h:180 +#: source/ubl-strings.h:182 msgid "Applications configuration" msgstr "Настройки приложений" -#: source/ubl-strings.h:183 +#: source/ubl-strings.h:185 msgid "Path (-s):" msgstr "Путь (-и):" -#: source/ubl-strings.h:184 +#: source/ubl-strings.h:186 msgid "Control:" msgstr "Управление:" -#: source/ubl-strings.h:185 +#: source/ubl-strings.h:187 msgid "Log file" msgstr "Файл лога" -#: source/ubl-strings.h:186 +#: source/ubl-strings.h:188 msgid "Name:" msgstr "Имя:" -msgid "System event log rotation service" -msgstr "Служба ротации системных журналов событий" +#~ msgid "System event log rotation service" +#~ msgstr "Служба ротации системных журналов событий" -msgid "System event log" -msgstr "Системный журнал событий" +#~ msgid "System event log" +#~ msgstr "Системный журнал событий" -msgid "" -"Service for collecting messages from system events of active network devices" -msgstr "Сервис сбора сообщений системных событий активных сетевых устройств" +#~ msgid "" +#~ "Service for collecting messages from system events of active network " +#~ "devices" +#~ msgstr "Сервис сбора сообщений системных событий активных сетевых устройств" -msgid "Log of work and requests to Acpid" -msgstr "Журнал работы и обращений к Acpid" +#~ msgid "Log of work and requests to Acpid" +#~ msgstr "Журнал работы и обращений к Acpid" -msgid "Log of work and requests to the web server" -msgstr "Журнал работы и обращений к веб-серверу" +#~ msgid "Log of work and requests to the web server" +#~ msgstr "Журнал работы и обращений к веб-серверу" -msgid "Audit log" -msgstr "Журнал аудита (audit)" +#~ msgid "Audit log" +#~ msgstr "Журнал аудита (audit)" -msgid "Log of authorization procedures" -msgstr "Журнал процедур авторизации" +#~ msgid "Log of authorization procedures" +#~ msgstr "Журнал процедур авторизации" -msgid "Job scheduler log (cron)" -msgstr "Журнал работы планировщика заданий (cron)" +#~ msgid "Job scheduler log (cron)" +#~ msgstr "Журнал работы планировщика заданий (cron)" -msgid "Log of work and calls to the print server (cups)" -msgstr "Журнал работы и обращений к серверу печати (cups)" +#~ msgid "Log of work and calls to the print server (cups)" +#~ msgstr "Журнал работы и обращений к серверу печати (cups)" -msgid "Log of operation and access to system services" -msgstr "Журнал работы и обращения к службам системы" +#~ msgid "Log of operation and access to system services" +#~ msgstr "Журнал работы и обращения к службам системы" -msgid "Log of work and access to Samba" -msgstr "Журнал работы и обращения к Samba" +#~ msgid "Log of work and access to Samba" +#~ msgstr "Журнал работы и обращения к Samba" -msgid "Postfix mail server log" -msgstr "Журнал почтового сервера Postfix" +#~ msgid "Postfix mail server log" +#~ msgstr "Журнал почтового сервера Postfix" -msgid "System log" -msgstr "Системный журнал" +#~ msgid "System log" +#~ msgstr "Системный журнал" -msgid "X.org display server log" -msgstr "Журнал работы дисплейного сервера X.org" +#~ msgid "X.org display server log" +#~ msgstr "Журнал работы дисплейного сервера X.org" -msgid "Graphics X session log" -msgstr "Журнал сеансов графической системы X" +#~ msgid "Graphics X session log" +#~ msgstr "Журнал сеансов графической системы X"