diff --git a/Makefile b/Makefile index e333928..7e06a54 100644 --- a/Makefile +++ b/Makefile @@ -133,6 +133,20 @@ install: check uninstall @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.decrease-symbolic.svg" @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.profile-symbolic.svg" @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.edit-symbolic.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.check-symbolic.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.uncheck-symbolic.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.settings-symbolic.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.trash-symbolic.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.sort-symbolic.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.sync-symbolic.svg" + + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.generic1-symbolic.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.generic2-symbolic.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.generic3-symbolic.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.generic4-symbolic.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.generic5-symbolic.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.generic6-symbolic.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/actions/" "icons/com.ublinux.${PKGNAME}.generic7-symbolic.svg" @install -Dm644 -t "${DESTDIR}/usr/share/${PKGNAME}/csv/" "journals_list.csv" @install -Dm644 -t "${DESTDIR}/usr/share/${PKGNAME}/csv/" "logging_services.csv" @install -Dm644 -t "${DESTDIR}/usr/share/polkit-1/actions/" "${CMAKE_BUILD_DIR}/com.ublinux.${PKGNAME}${PKGIDENT}.policy" diff --git a/gresource.xml b/gresource.xml index f7a9968..1f26a40 100644 --- a/gresource.xml +++ b/gresource.xml @@ -8,6 +8,7 @@ ubl-settings-logging-logrotate.glade ubl-settings-logging-journald.glade ubl-settings-logging-rules.glade + ubl-settings-logging-filechooser.glade ubl-settings-logging-logrotate-table.glade diff --git a/icons/com.ublinux.ubl-settings-logging.check-symbolic.svg b/icons/com.ublinux.ubl-settings-logging.check-symbolic.svg new file mode 100644 index 0000000..5d9f3a3 --- /dev/null +++ b/icons/com.ublinux.ubl-settings-logging.check-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/com.ublinux.ubl-settings-logging.generic1-symbolic.svg b/icons/com.ublinux.ubl-settings-logging.generic1-symbolic.svg new file mode 100644 index 0000000..356b2c6 --- /dev/null +++ b/icons/com.ublinux.ubl-settings-logging.generic1-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/com.ublinux.ubl-settings-logging.generic2-symbolic.svg b/icons/com.ublinux.ubl-settings-logging.generic2-symbolic.svg new file mode 100644 index 0000000..3d21313 --- /dev/null +++ b/icons/com.ublinux.ubl-settings-logging.generic2-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/com.ublinux.ubl-settings-logging.generic3-symbolic.svg b/icons/com.ublinux.ubl-settings-logging.generic3-symbolic.svg new file mode 100644 index 0000000..08ac435 --- /dev/null +++ b/icons/com.ublinux.ubl-settings-logging.generic3-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/com.ublinux.ubl-settings-logging.generic4-symbolic.svg b/icons/com.ublinux.ubl-settings-logging.generic4-symbolic.svg new file mode 100644 index 0000000..cdebe7c --- /dev/null +++ b/icons/com.ublinux.ubl-settings-logging.generic4-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/com.ublinux.ubl-settings-logging.generic5-symbolic.svg b/icons/com.ublinux.ubl-settings-logging.generic5-symbolic.svg new file mode 100644 index 0000000..1f56c8a --- /dev/null +++ b/icons/com.ublinux.ubl-settings-logging.generic5-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/com.ublinux.ubl-settings-logging.generic6-symbolic.svg b/icons/com.ublinux.ubl-settings-logging.generic6-symbolic.svg new file mode 100644 index 0000000..6454053 --- /dev/null +++ b/icons/com.ublinux.ubl-settings-logging.generic6-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/com.ublinux.ubl-settings-logging.generic7-symbolic.svg b/icons/com.ublinux.ubl-settings-logging.generic7-symbolic.svg new file mode 100644 index 0000000..bf05260 --- /dev/null +++ b/icons/com.ublinux.ubl-settings-logging.generic7-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/com.ublinux.ubl-settings-logging.play-symbolic.svg b/icons/com.ublinux.ubl-settings-logging.play-symbolic.svg index 3ebe8f3..146bda8 100644 --- a/icons/com.ublinux.ubl-settings-logging.play-symbolic.svg +++ b/icons/com.ublinux.ubl-settings-logging.play-symbolic.svg @@ -1,169 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - + \ No newline at end of file diff --git a/icons/com.ublinux.ubl-settings-logging.settings-symbolic.svg b/icons/com.ublinux.ubl-settings-logging.settings-symbolic.svg new file mode 100644 index 0000000..67d3487 --- /dev/null +++ b/icons/com.ublinux.ubl-settings-logging.settings-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/com.ublinux.ubl-settings-logging.sort-symbolic.svg b/icons/com.ublinux.ubl-settings-logging.sort-symbolic.svg new file mode 100644 index 0000000..0e4bd61 --- /dev/null +++ b/icons/com.ublinux.ubl-settings-logging.sort-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/com.ublinux.ubl-settings-logging.stop-symbolic.svg b/icons/com.ublinux.ubl-settings-logging.stop-symbolic.svg index 91f45bc..ef24159 100644 --- a/icons/com.ublinux.ubl-settings-logging.stop-symbolic.svg +++ b/icons/com.ublinux.ubl-settings-logging.stop-symbolic.svg @@ -1,185 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - + \ No newline at end of file diff --git a/icons/com.ublinux.ubl-settings-logging.sync-symbolic.svg b/icons/com.ublinux.ubl-settings-logging.sync-symbolic.svg new file mode 100644 index 0000000..13651dd --- /dev/null +++ b/icons/com.ublinux.ubl-settings-logging.sync-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/com.ublinux.ubl-settings-logging.trash-symbolic.svg b/icons/com.ublinux.ubl-settings-logging.trash-symbolic.svg new file mode 100644 index 0000000..03ca715 --- /dev/null +++ b/icons/com.ublinux.ubl-settings-logging.trash-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/com.ublinux.ubl-settings-logging.uncheck-symbolic.svg b/icons/com.ublinux.ubl-settings-logging.uncheck-symbolic.svg new file mode 100644 index 0000000..c55bf8e --- /dev/null +++ b/icons/com.ublinux.ubl-settings-logging.uncheck-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/com.ublinux.ubl-settings-logging.view-symbolic.svg b/icons/com.ublinux.ubl-settings-logging.view-symbolic.svg index 86197b6..8e6a1ed 100644 --- a/icons/com.ublinux.ubl-settings-logging.view-symbolic.svg +++ b/icons/com.ublinux.ubl-settings-logging.view-symbolic.svg @@ -1,49 +1 @@ - - - - - - - - - - + \ No newline at end of file diff --git a/journals_list.csv b/journals_list.csv index c939ad6..37454f0 100644 --- a/journals_list.csv +++ b/journals_list.csv @@ -1,12 +1,13 @@ -Acpid;/var/log/acpid;Журнал работы и обращений к Acpid -Apache2;/var/log/apache2/error.log,/var/log/apache2/access.log;Журнал работы и обращений к веб-серверу -Audit;/var/log/audit/audit.log;Журнал аудита (audit) -Authlog;/var/log/auth.log;Журнал процедур авторизации -Cron;/var/log/syslog;Журнал работы планировщика заданий (cron) -CUPS;/var/log/cups/access_log,/var/log/cups/page_log,/var/log/cups/cups-pdf_log;Журнал работы и обращений к серверу печати (cups) -Daemonlog;/var/log/daemon.log;Журнал работы и обращения к службам системы -Samba;/var/log/samba/log.smbd,/var/log/samba/log.localhost,/var/log/samba/log.127.0.0.1,/var/log/samba/log.nmbd;Журнал работы и обращения к Samba -Postfix;/var/log/mail.log,/var/log/mail.info,/var/log/mail.warn,/var/log/mail.err;Журнал почтового сервера Postfix -Syslog;/var/log/syslog;Системный журнал -Xorg;/var/log/Xorg.0.log;Журнал работы дисплейного сервера X.org -Xsession;~/.xsession-errors;Журнал сеансов графической системы X \ No newline at end of file +Service_Name;Path_Log;Service_Description +Acpid;/var/log/acpid;Log of work and requests to Acpid +Apache2;/var/log/apache2/error.log,/var/log/apache2/access.log;Log of work and requests to the web server +Audit;/var/log/audit/audit.log;Audit log +Authlog;/var/log/auth.log;Log of authorization procedures +Cron;/var/log/syslog;Job scheduler log (cron) +CUPS;/var/log/cups/access_log,/var/log/cups/page_log,/var/log/cups/cups-pdf_log;Log of work and calls to the print server (cups) +Daemonlog;/var/log/daemon.log;Log of operation and access to system services +Samba;/var/log/samba/log.smbd,/var/log/samba/log.localhost,/var/log/samba/log.127.0.0.1,/var/log/samba/log.nmbd;Log of work and access to Samba +Postfix;/var/log/mail.log,/var/log/mail.info,/var/log/mail.warn,/var/log/mail.err;Postfix mail server log +Syslog;/var/log/syslog;System log +Xorg;/var/log/Xorg.0.log;X.org display server log +Xsession;~/.xsession-errors;Graphics X session log \ No newline at end of file diff --git a/logging_services.csv b/logging_services.csv index e9d43a8..98be66d 100644 --- a/logging_services.csv +++ b/logging_services.csv @@ -1,4 +1,5 @@ -journald;Системный журнал событий;systemctl start;systemctl start systemd-journald.service;systemctl stop systemd-journald.service;ubconfig set config SERVICESSTART+=systemd-journald.service;ubconfig set config SERVICESSTART-=systemd-journald.service;systemctl status systemd-journald.service -logrotate;Служба ротации системных журналов событий;systemctl start logrotate.service;systemctl stop logrotate.service;ubconfig set config SERVICESSTART+=logrotate.service;ubconfig set config SERVICESSTART-=logrotate.service;systemctl status logrotate.service -#metalog;Системный журнал событий;systemctl start metalog.service;systemctl stop metalog.service;ubconfig set config SERVICESSTART+=metalog.service;ubconfig set config SERVICESSTART-=metalog.service;systemctl status metalog.service -#syslog-ng;Сервис сбора сообщений системных событий активных сетевых устройств;systemctl start syslog-ng.service;systemctl stop syslog-ng.service;ubconfig set config SERVICESSTART+=syslog-ng.service;ubconfig set config SERVICESSTART-=syslog-ng.service;systemctl status syslog-ng.service \ No newline at end of file +Service_Name;Service_Description;command_start;command_stop;command_enable;command_disable;command_status +journald;System event log;systemctl start systemd-journald.service;systemctl stop systemd-journald.service;ubconfig set config SERVICESSTART+=systemd-journald.service;ubconfig set config SERVICESSTART-=systemd-journald.service;systemctl status systemd-journald.service +logrotate;System event log rotation service;systemctl start logrotate.timer;systemctl stop logrotate.timer,systemctl stop logrotate.service;ubconfig set config SERVICESNOSTART-=,logrotate.timer;ubconfig set config SERVICESNOSTART+=,logrotate.timer;systemctl status logrotate.service +#metalog;System event log;systemctl start metalog.service;systemctl stop metalog.service;ubconfig set config SERVICESSTART+=metalog.service;ubconfig set config SERVICESSTART-=metalog.service;systemctl status metalog.service +#syslog-ng;Service for collecting messages from system events of active network devices;systemctl start syslog-ng.service;systemctl stop syslog-ng.service;ubconfig set config SERVICESSTART+=syslog-ng.service;ubconfig set config SERVICESSTART-=syslog-ng.service;systemctl status syslog-ng.service \ No newline at end of file diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 24aa362..87c4d28 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -8,10 +8,10 @@ include_directories(${GTK_INCLUDE_DIRS}) link_directories(${GTK_LIBRARY_DIRS}) add_definitions(${GTK_CFLAGS_OTHER}) -#pkg_check_modules(VTE291 REQUIRED vte-2.91) -#include_directories(${VTE291_INCLUDE_DIRS}) -#link_directories(${VTE291_LIBRARY_DIRS}) -#add_definitions(${VTE291_CFLAGS_OTHER}) +pkg_check_modules(VTE291 REQUIRED vte-2.91) +include_directories(${VTE291_INCLUDE_DIRS}) +link_directories(${VTE291_LIBRARY_DIRS}) +add_definitions(${VTE291_CFLAGS_OTHER}) find_library(WEBKIT_LIBRARIES_FOUND webkit2gtk-4.0 webkit2gtk-web-extension-4.0) @@ -43,6 +43,7 @@ set(DEPENDFILES ../ubl-settings-logging-journald.glade ../ubl-settings-logging-logrotate.glade ../ubl-settings-logging-logrotate-table.glade + ../ubl-settings-logging-filechooser.glade ../gresource.xml ../ubl-settings-logging-banner.png ../ubl-settings-logging.css @@ -88,7 +89,7 @@ set(SOURCE_FILES set(LIBRARIES ${GTK_LIBRARIES} ${WEBKIT_LIBRARIES} -# ${VTE291_LIBRARIES} + ${VTE291_LIBRARIES} pthread) diff --git a/source/ubl-settings-logging.c b/source/ubl-settings-logging.c index a4d8b0e..dce0000 100644 --- a/source/ubl-settings-logging.c +++ b/source/ubl-settings-logging.c @@ -125,19 +125,20 @@ int yon_size_get_int_from_letter(char size){ //functions - void update_loaded_logrotate(){ int size=0; gtk_list_store_clear(main_config.logrotate_list); GtkTreeIter iter; config_str loaded = yon_config_get_all_by_key("LOGROTATE[",&size); + char *desc; for (int i=0;itextbuffer1,&titer,&titerend); - gtk_text_buffer_delete(window->textbuffer1,&titer,&titerend); config_str output; if (!strcmp(window->journal_name,"journald")){ if (self==window->UpdateButton){ switch(window->last_mode){ - case 0: output = yon_config_load(get_journal_output_command, &size); + case 0: + yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_command,NULL,NULL); + break; + case 1: + yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_since_boot_command,NULL,NULL); + break; + case 2: + yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_followed_command,NULL,NULL); break; - case 1: output = yon_config_load(get_journal_output_since_boot_command, &size); + case 3: + yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_kernel_command,NULL,NULL); break; - case 2: output = yon_config_load(get_journal_output_followed_command, &size); + case 4: + yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_prioritied_command,NULL,NULL); break; - case 3: output = yon_config_load(get_journal_output_kernel_command, &size); + case 5: + yon_terminal_integrated_start(window->LoggingTerminal, get_journal_all_boots_command,NULL,NULL); break; - case 4: output = yon_config_load(get_journal_output_prioritied_command, &size); + case 6: + yon_terminal_integrated_start(window->LoggingTerminal, get_journal_all_units_command,NULL,NULL); + break; + case 7: + yon_terminal_integrated_start(window->LoggingTerminal, get_journal_init_tree_command,NULL,NULL); break; } } if (self==window->ShowSinceBootButton){ window->last_mode=1; - output = yon_config_load(get_journal_output_since_boot_command, &size); + yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_since_boot_command,NULL,NULL); } if (self==window->NewMessagesButton){ window->last_mode=2; - output = yon_config_load(get_journal_output_followed_command, &size); + yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_followed_command,NULL,NULL); } if (self==window->ShowKernelButton){ window->last_mode=3; - output = yon_config_load(get_journal_output_kernel_command, &size); + yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_kernel_command,NULL,NULL); } if (self==window->ShowPriorityButton){ window->last_mode=4; - output = yon_config_load(get_journal_output_prioritied_command, &size); + yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_prioritied_command,NULL,NULL); } - if (output){ - for (int i=0;itextbuffer1,&titer); - gtk_text_buffer_insert(window->textbuffer1,&titer,output[i],-1); - } - gtk_text_buffer_get_end_iter(window->textbuffer1,&titer); - gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(window->LoggingTextView),&titer,0.25,0,1,0); + if (self==window->ShowAllBootsButton){ + window->last_mode=5; + yon_terminal_integrated_start(window->LoggingTerminal, get_journal_all_boots_command,NULL,NULL); + } + if (self==window->ShowAllUnitsButton){ + window->last_mode=6; + yon_terminal_integrated_start(window->LoggingTerminal, get_journal_all_units_command,NULL,NULL); + } + if (self==window->ShowInitTreeButton){ + window->last_mode=7; + yon_terminal_integrated_start(window->LoggingTerminal, get_journal_init_tree_command,NULL,NULL); } } else { window->journal_paths = yon_char_replace(window->journal_paths,"\n"," "); - output = yon_config_load(yon_char_unite("cat ",window->journal_paths,NULL),&size); - for (int i=0;itextbuffer1,&titer); - gtk_text_buffer_insert(window->textbuffer1,&titer,output[i],-1); + yon_terminal_integrated_start(window->LoggingTerminal,yon_char_unite("cat ",window->journal_paths,NULL),NULL,NULL); } - gtk_text_buffer_get_end_iter(window->textbuffer1,&titer); - gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(window->LoggingTextView),&titer,0.25,0,1,0); - } } void on_inspector_open(GtkWidget *self, main_window *widgets){ inspector_window *window = malloc(sizeof(inspector_window)); GtkBuilder *builder = gtk_builder_new_from_resource(glade_inspector_path); - window->textbuffer1=GTK_TEXT_BUFFER(gtk_builder_get_object(builder,"textbuffer1")); window->MainWindow=yon_gtk_builder_get_widget(builder,"MainWindow"); window->ShowSinceBootButton=yon_gtk_builder_get_widget(builder,"ShowSinceBootButton"); window->NewMessagesButton=yon_gtk_builder_get_widget(builder,"NewMessagesButton"); window->ShowKernelButton=yon_gtk_builder_get_widget(builder,"ShowKernelButton"); window->ShowPriorityButton=yon_gtk_builder_get_widget(builder,"ShowPriorityButton"); + window->ShowAllBootsButton=yon_gtk_builder_get_widget(builder,"ShowAllBootsButton"); + window->ShowAllUnitsButton=yon_gtk_builder_get_widget(builder,"ShowAllUnitsButton"); + window->ShowInitTreeButton=yon_gtk_builder_get_widget(builder,"ShowInitTreeButton"); window->UpdateButton=yon_gtk_builder_get_widget(builder,"UpdateButton"); - window->LoggingTextView=yon_gtk_builder_get_widget(builder,"LoggingTextView"); + window->LoggingTerminal=yon_gtk_builder_get_widget(builder,"LoggingTerminal"); window->JournalActionsBox=yon_gtk_builder_get_widget(builder,"JournalActionsBox"); gtk_window_set_title(GTK_WINDOW(window->MainWindow),TITLE_LABEL); + gtk_window_set_transient_for(GTK_WINDOW(window->MainWindow),GTK_WINDOW(widgets->Window)); GtkTreeModel *model = GTK_TREE_MODEL(widgets->list); GtkTreeIter iter; char *name; char *paths; + GdkRGBA rgba; + rgba.alpha=1; + rgba.red=0.95; + rgba.green=0.95; + rgba.blue=0.95; + vte_terminal_set_color_background(VTE_TERMINAL(window->LoggingTerminal),&rgba); + rgba.red=0; + rgba.green=0; + rgba.blue=0; + vte_terminal_set_color_foreground(VTE_TERMINAL(window->LoggingTerminal),&rgba); g_signal_connect(G_OBJECT(window->UpdateButton),"clicked", G_CALLBACK(on_inspector_update),window); g_signal_connect(G_OBJECT(window->ShowKernelButton),"clicked", G_CALLBACK(on_inspector_update),window); g_signal_connect(G_OBJECT(window->NewMessagesButton),"clicked", G_CALLBACK(on_inspector_update),window); g_signal_connect(G_OBJECT(window->ShowPriorityButton),"clicked", G_CALLBACK(on_inspector_update),window); g_signal_connect(G_OBJECT(window->ShowSinceBootButton),"clicked", G_CALLBACK(on_inspector_update),window); + g_signal_connect(G_OBJECT(window->ShowAllBootsButton),"clicked", G_CALLBACK(on_inspector_update),window); + g_signal_connect(G_OBJECT(window->ShowAllUnitsButton),"clicked", G_CALLBACK(on_inspector_update),window); + g_signal_connect(G_OBJECT(window->ShowInitTreeButton),"clicked", G_CALLBACK(on_inspector_update),window); if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MainTree)),&model,&iter)){ gtk_tree_model_get(model,&iter,0,&name,1,&paths,-1); if (strcmp(name,"journald")){ @@ -293,23 +320,6 @@ void on_inspector_open(GtkWidget *self, main_window *widgets){ } } -void on_log_choose(GtkWidget *self,add_log_window *window){ - GtkWidget *dialog = gtk_file_chooser_dialog_new(TITLE_LABEL,GTK_WINDOW(window->MainWindow),GTK_FILE_CHOOSER_ACTION_OPEN,CANCEL_LABEL,GTK_RESPONSE_CANCEL,ACCEPT_LABEL,GTK_RESPONSE_ACCEPT,NULL); - gtk_file_chooser_add_shortcut_folder(GTK_FILE_CHOOSER(dialog),yon_ubl_user_get_home_directory(),NULL); - gtk_file_chooser_add_shortcut_folder(GTK_FILE_CHOOSER(dialog),"/var/",NULL); - gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog),"/var/"); - GtkFileFilter *filter = gtk_file_filter_new(); - gtk_file_filter_add_pattern(filter,"*.log"); - gtk_file_filter_set_name(filter,".log"); - gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter); - int responce = gtk_dialog_run(GTK_DIALOG(dialog)); - if (responce == GTK_RESPONSE_ACCEPT){ - char *filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); - gtk_entry_set_text(GTK_ENTRY(window->LogPathEntry),filename); - } - gtk_widget_destroy(dialog); -} - // Logrotate window void on_logrotate_configuration_path_add(GtkWidget *self, logrotate_configure_window *window){ @@ -377,6 +387,198 @@ void on_logrotate_configuration_path_remove(GtkWidget *self, logrotate_configure } } +void on_combo_activate_first(GtkComboBox *self, GtkWidget *target){ + if (gtk_combo_box_get_active(self)==1) gtk_widget_set_sensitive(target,1); + else gtk_widget_set_sensitive(target,0); + +} + +void on_combo_activate_second(GtkComboBox *self, GtkWidget *target){ + if (gtk_combo_box_get_active(self)==2) gtk_widget_set_sensitive(target,1); + else gtk_widget_set_sensitive(target,0); + +} + +void on_file_amount_checked(GtkToggleButton *self, logrotate_configure_window *window){ + if (gtk_toggle_button_get_active(self)==1){ + gtk_widget_set_sensitive(window->FileAmountCombo,1); + gtk_widget_set_sensitive(window->FileAmountSpin,1); + if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->FileAmountCombo))==2){ + gtk_widget_set_sensitive(window->FileAmountButton,1); + gtk_widget_set_sensitive(window->FileAmountEntry,1); + } + } else { + gtk_widget_set_sensitive(window->FileAmountButton,0); + gtk_widget_set_sensitive(window->FileAmountEntry,0); + gtk_widget_set_sensitive(window->FileAmountSpin,0); + gtk_widget_set_sensitive(window->FileAmountCombo,0); + + } +} + +void on_rules_accept(GtkWidget *self, dictionary *dict){ + GtkEntry *entry = yon_dictionary_get_data(dict->first,GtkEntry*); + logrotate_rules_window *window = yon_dictionary_get_data(dict->first->next,logrotate_rules_window*); + int owner_read = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UserReadCheck)); + int owner_write = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UserWriteCheck)); + int owner_exec = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UserExecuteCheck)); + + int group_read = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupReadCheck)); + int group_write = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupWriteCheck)); + int group_exec = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupExecuteCheck)); + + int public_read = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->PublicReadCheck)); + int public_write = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->PublicWriteCheck)); + int public_exec = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->PublicExecuteCheck)); + int owner = owner_read&&owner_write&&owner_exec? 7 : \ + owner_read&&!owner_write&&!owner_exec ? 4 : \ + !owner_read&&owner_write&&!owner_exec ? 2 : \ + !owner_read&&!owner_write&&owner_exec ? 1 : \ + owner_read&&owner_write&&!owner_exec ? 6 : \ + owner_read&&!owner_write&&owner_exec ? 5 : \ + !owner_read&&owner_write&&owner_exec ? 3 : \ + 0; + int group = group_read&&group_write&&group_exec? 7 : \ + group_read&&!group_write&&!group_exec ? 4 : \ + !group_read&&group_write&&!group_exec ? 2 : \ + !group_read&&!group_write&&group_exec ? 1 : \ + group_read&&group_write&&!group_exec ? 6 : \ + group_read&&!group_write&&group_exec ? 5 : \ + !group_read&&group_write&&group_exec ? 3 : \ + 0; + int public = public_read&&public_write&&public_exec? 7 : \ + public_read&&!public_write&&!public_exec ? 4 : \ + !public_read&&public_write&&!public_exec ? 2 : \ + !public_read&&!public_write&&public_exec ? 1 : \ + public_read&&public_write&&!public_exec ? 6 : \ + public_read&&!public_write&&public_exec ? 5 : \ + !public_read&&public_write&&public_exec ? 3 : \ + 0; + gtk_entry_set_text(entry,yon_char_unite(yon_char_from_int(owner),yon_char_from_int(group),yon_char_from_int(public),NULL)); + gtk_widget_destroy(window->Window); +} + +void on_rules_update(GtkWidget *self, logrotate_rules_window *window){ + int owner_read = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UserReadCheck)); + int owner_write = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UserWriteCheck)); + int owner_exec = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UserExecuteCheck)); + + int group_read = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupReadCheck)); + int group_write = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupWriteCheck)); + int group_exec = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupExecuteCheck)); + + int public_read = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->PublicReadCheck)); + int public_write = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->PublicWriteCheck)); + int public_exec = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->PublicExecuteCheck)); + int owner = owner_read&&owner_write&&owner_exec? 7 : \ + owner_read&&!owner_write&&!owner_exec ? 4 : \ + !owner_read&&owner_write&&!owner_exec ? 2 : \ + !owner_read&&!owner_write&&owner_exec ? 1 : \ + owner_read&&owner_write&&!owner_exec ? 6 : \ + owner_read&&!owner_write&&owner_exec ? 5 : \ + !owner_read&&owner_write&&owner_exec ? 3 : \ + 0; + int group = group_read&&group_write&&group_exec? 7 : \ + group_read&&!group_write&&!group_exec ? 4 : \ + !group_read&&group_write&&!group_exec ? 2 : \ + !group_read&&!group_write&&group_exec ? 1 : \ + group_read&&group_write&&!group_exec ? 6 : \ + group_read&&!group_write&&group_exec ? 5 : \ + !group_read&&group_write&&group_exec ? 3 : \ + 0; + int public = public_read&&public_write&&public_exec? 7 : \ + public_read&&!public_write&&!public_exec ? 4 : \ + !public_read&&public_write&&!public_exec ? 2 : \ + !public_read&&!public_write&&public_exec ? 1 : \ + public_read&&public_write&&!public_exec ? 6 : \ + public_read&&!public_write&&public_exec ? 5 : \ + !public_read&&public_write&&public_exec ? 3 : \ + 0; + gtk_entry_set_text(GTK_ENTRY(window->FinalEntry),yon_char_unite(yon_char_from_int(owner),yon_char_from_int(group),yon_char_from_int(public),NULL)); +} + +void on_rules_open(GtkWidget *self,GtkEntry *entry){ + GtkBuilder *builder = gtk_builder_new_from_resource(glade_rules_path); + logrotate_rules_window *window = malloc(sizeof(logrotate_rules_window)); + window->Window=yon_gtk_builder_get_widget(builder,"MainWindow"); + window->UserReadCheck=yon_gtk_builder_get_widget(builder,"UserReadCheck"); + window->UserWriteCheck=yon_gtk_builder_get_widget(builder,"UserWriteCheck"); + window->UserExecuteCheck=yon_gtk_builder_get_widget(builder,"UserExecuteCheck"); + window->GroupReadCheck=yon_gtk_builder_get_widget(builder,"GroupReadCheck"); + window->GroupWriteCheck=yon_gtk_builder_get_widget(builder,"GroupWriteCheck"); + window->GroupExecuteCheck=yon_gtk_builder_get_widget(builder,"GroupExecuteCheck"); + window->PublicReadCheck=yon_gtk_builder_get_widget(builder,"PublicReadCheck"); + window->PublicWriteCheck=yon_gtk_builder_get_widget(builder,"PublicWriteCheck"); + window->PublicExecuteCheck=yon_gtk_builder_get_widget(builder,"PublicExecuteCheck"); + window->FinalEntry=yon_gtk_builder_get_widget(builder,"FinalEntry"); + window->CancelButton=yon_gtk_builder_get_widget(builder,"CancelButton"); + window->SaveButton=yon_gtk_builder_get_widget(builder,"SaveButton"); + gtk_window_set_title(GTK_WINDOW(window->Window),TITLE_LABEL); + dictionary *dict = NULL; + yon_dictionary_add_or_create_if_exists_with_data(dict,"entry",entry); + yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window); + g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_close_subwindow),NULL); + g_signal_connect(G_OBJECT(window->SaveButton),"clicked",G_CALLBACK(on_rules_accept),dict); + + g_signal_connect(G_OBJECT(window->UserReadCheck),"toggled",G_CALLBACK(on_rules_update),window); + g_signal_connect(G_OBJECT(window->UserWriteCheck),"toggled",G_CALLBACK(on_rules_update),window); + g_signal_connect(G_OBJECT(window->UserExecuteCheck),"toggled",G_CALLBACK(on_rules_update),window); + + g_signal_connect(G_OBJECT(window->GroupReadCheck),"toggled",G_CALLBACK(on_rules_update),window); + g_signal_connect(G_OBJECT(window->GroupWriteCheck),"toggled",G_CALLBACK(on_rules_update),window); + g_signal_connect(G_OBJECT(window->GroupExecuteCheck),"toggled",G_CALLBACK(on_rules_update),window); + + g_signal_connect(G_OBJECT(window->PublicReadCheck),"toggled",G_CALLBACK(on_rules_update),window); + g_signal_connect(G_OBJECT(window->PublicWriteCheck),"toggled",G_CALLBACK(on_rules_update),window); + g_signal_connect(G_OBJECT(window->PublicExecuteCheck),"toggled",G_CALLBACK(on_rules_update),window); + gtk_widget_show(window->Window); +} + +void on_filechooser_mode_switch(GtkWidget *self, logrotate_filechooser_window *window){ + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->FileOrDirCheck))){ + gtk_file_chooser_set_action(GTK_FILE_CHOOSER(window->FileChooser),GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); + } + gtk_file_chooser_set_action(GTK_FILE_CHOOSER(window->FileChooser),GTK_FILE_CHOOSER_ACTION_OPEN); +} + +void on_filechooser_save(GtkWidget *self, dictionary *dict){ + logrotate_configure_window *window = yon_dictionary_get_data(dict->first,logrotate_configure_window*); + logrotate_filechooser_window *dialog = yon_dictionary_get_data(dict->first->next,logrotate_filechooser_window*); + char *filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog->FileChooser)); + gtk_entry_set_text(GTK_ENTRY(window->FileAmountEntry),filename); + gtk_widget_destroy(dialog->FileChooser); +} + +void on_filechooser_open(GtkWidget *self, logrotate_configure_window *window){ + GtkBuilder *builder = gtk_builder_new_from_resource(glade_filechooser_path); + logrotate_filechooser_window *dialog = malloc(sizeof(logrotate_filechooser_window)); + dialog->FileChooser = yon_gtk_builder_get_widget(builder,"FileChooser"); + dialog->FileOrDirCheck = yon_gtk_builder_get_widget(builder,"FileOrDirCheck"); + dialog->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton"); + dialog->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton"); + gtk_window_set_transient_for(GTK_WINDOW(window->MainWindow),GTK_WINDOW(window->MainWindow)); + + dictionary *dict = NULL; + gtk_window_set_title(GTK_WINDOW(dialog->FileChooser),TITLE_LABEL); + yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window); + yon_dictionary_add_or_create_if_exists_with_data(dict,"dialog",dialog); + g_signal_connect(G_OBJECT(dialog->FileOrDirCheck),"toggled",G_CALLBACK(on_filechooser_mode_switch),dialog); + g_signal_connect(G_OBJECT(dialog->CancelButton),"clicked",G_CALLBACK(on_close_subwindow),NULL); + g_signal_connect(G_OBJECT(dialog->AcceptButton),"clicked",G_CALLBACK(on_filechooser_save),dict); + gtk_widget_show(dialog->FileChooser); +} + +void on_logrotate_period_check_toggled(GtkToggleButton *self,logrotate_configure_window *window){ + if (gtk_toggle_button_get_active(self)){ + if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->RotationPeriodMainCombo))==2) gtk_widget_set_sensitive(window->RotationPeriodAdditionalCombo,1); + else gtk_widget_set_sensitive(window->RotationPeriodAdditionalCombo,0); + gtk_widget_set_sensitive(window->RotationPeriodMainCombo,1); + } else { + gtk_widget_set_sensitive(window->RotationPeriodMainCombo,0); + gtk_widget_set_sensitive(window->RotationPeriodAdditionalCombo,0); + } +} + 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*); @@ -411,12 +613,33 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){ char *endscript=""; GtkTreeIter iter; - int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter); + int matched=0; + int path_amount=0; + config_str found_paths_list=NULL; + int found_paths=0; + char *cur_check_paths; + 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); + if (!found_paths_list) found_paths_list = yon_char_parsed_new(&found_paths,cur_check_paths,NULL); + 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); 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); + for (int i=0;ipaths) + 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){ @@ -428,7 +651,7 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){ int weekday = gtk_combo_box_get_active(GTK_COMBO_BOX(window->RotationPeriodAdditionalCombo)); weekday++; if (weekday==7) weekday=0; - period = yon_char_unite(period,", ",yon_char_from_int(weekday),NULL); + period = yon_char_unite(period," ",yon_char_from_int(weekday),NULL); break; case 3: period = "monthly"; break; @@ -565,25 +788,47 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){ char *after = (char*)gtk_entry_get_text(GTK_ENTRY(window->CommandAfterEntry)); char *endwork = (char*)gtk_entry_get_text(GTK_ENTRY(window->EndworkCommandEntry)); sharedscripts = "sharedscripts"; - if (!yon_char_is_empty(before_once)) - firstaction = yon_char_append("firstaction ",before_once); - if (!yon_char_is_empty(after_once)) - lastaction = yon_char_append("lastaction ",after_once); - if (!yon_char_is_empty(before)) - prerotate = yon_char_append("prerotate ",before); - if (!yon_char_is_empty(after)) - postrotate = yon_char_append("postrotate ",after); - if (!yon_char_is_empty(endwork)) - endscript = yon_char_append("endscript ",endwork); + if (!yon_char_is_empty(before_once)) { + before_once = yon_char_replace(before_once,"\"","=--"); + before_once = yon_char_replace(before_once,"=--","\\\""); + firstaction = yon_char_append("firstaction,",before_once); + } + if (!yon_char_is_empty(after_once)) { + after_once = yon_char_replace(after_once,"\"","=--"); + after_once = yon_char_replace(after_once,"=--","\\\""); + lastaction = yon_char_append("lastaction,",after_once); + } + if (!yon_char_is_empty(before)) { + before = yon_char_replace(before,"\"","=--"); + before = yon_char_replace(before,"=--","\\\""); + prerotate = yon_char_append("prerotate,",before); + } + if (!yon_char_is_empty(after)) { + after = yon_char_replace(after,"\"","=--"); + after = yon_char_replace(after,"=--","\\\""); + postrotate = yon_char_append("postrotate,",after); + } + if (!yon_char_is_empty(endwork)){ + endwork = yon_char_replace(endwork,"\"","=--"); + endwork = yon_char_replace(endwork,"=--","\\\""); + preremove = yon_char_append("preremove,",endwork); + } + if (!yon_char_is_empty(firstaction)||!yon_char_is_empty(after_once)||!yon_char_is_empty(before)||!yon_char_is_empty(after)) + endscript = "endscript"; } char *commandline = yon_char_unite(period,yon_add_space_if_exists(size),yon_add_space_if_exists(rotate_count),yon_add_space_if_exists(olddir),yon_add_space_if_exists(su),yon_add_space_if_exists(missingok),yon_add_space_if_exists(ifempty),yon_add_space_if_exists(notifempty),yon_add_space_if_exists(minage),yon_add_space_if_exists(maxage),yon_add_space_if_exists(minsize),yon_add_space_if_exists(maxsize),yon_add_space_if_exists(create),yon_add_space_if_exists(copytruncate),yon_add_space_if_exists(compress),yon_add_space_if_exists(delaycompress),yon_add_space_if_exists(extension),yon_add_space_if_exists(dateext),yon_add_space_if_exists(start),yon_add_space_if_exists(mail),yon_add_space_if_exists(mailfirst),yon_add_space_if_exists(sharedscripts),yon_add_space_if_exists(firstaction),yon_add_space_if_exists(lastaction),yon_add_space_if_exists(prerotate),yon_add_space_if_exists(postrotate),yon_add_space_if_exists(preremove),yon_add_space_if_exists(endscript),NULL); - if (commandline[0]==' '){ - free(yon_char_divide_search(commandline," ",-1)); + if (commandline[0]==','){ + free(yon_char_divide_search(commandline,",",-1)); } if(!yon_char_is_empty(paths)){ + if(window->paths){ + yon_config_remove_by_key(window->paths); + yon_window_config_erase_custom_parameter(window->paths,"description"); + } GtkTreeIter iter; yon_config_register(LOGROTATE(paths),"logging",commandline); + yon_window_config_add_custom_parameter(paths,"description",yon_char_new((char*)gtk_entry_get_text(GTK_ENTRY(window->LogDescriptionEntry))),YON_TYPE_STRING); GtkTreeModel *model = GTK_TREE_MODEL(main_config.logrotate_list); if (!dialog||!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->MainTree)),&model,&iter)){ gtk_list_store_append(main_config.logrotate_list,&iter); @@ -658,8 +903,34 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind window->CommandBeforeEntry=yon_gtk_builder_get_widget(builder,"CommandBeforeEntry"); window->CommandAfterEntry=yon_gtk_builder_get_widget(builder,"CommandAfterEntry"); window->EndworkCommandEntry=yon_gtk_builder_get_widget(builder,"EndworkCommandEntry"); + window->StatusBox=yon_gtk_builder_get_widget(builder,"StatusBox"); gtk_window_set_title(GTK_WINDOW(window->MainWindow),TITLE_LABEL); + if (dialog) + gtk_window_set_transient_for(GTK_WINDOW(window->MainWindow),GTK_WINDOW(dialog->Window)); + window->paths=paths; + if (paths){ + int sz; + float finalsize=0.0; + char *temp_paths = yon_char_new(paths); + config_str parsed_paths = yon_char_parse(temp_paths,&sz,","); + free(temp_paths); + temp_paths=NULL; + for (int i=0;iLogSizeLabel),yon_char_append(fin,yon_size_get_letter_from_int(sizenumber))); + + } dictionary *dict=NULL; yon_dictionary_add_or_create_if_exists_with_data(dict,"dialog",dialog); yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window); @@ -671,17 +942,13 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind g_signal_connect(G_OBJECT(window->LogPathEditButton),"clicked",G_CALLBACK(on_logrotate_configuration_path_edit),window); g_signal_connect(G_OBJECT(window->LogPathRemoveButton),"clicked",G_CALLBACK(on_logrotate_configuration_path_remove),window); - g_signal_connect(G_OBJECT(window->RotationPeriodCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotationPeriodAdditionalCombo); - g_signal_connect(G_OBJECT(window->RotationPeriodCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotationPeriodMainCombo); + g_signal_connect(G_OBJECT(window->RotationPeriodCheck),"toggled",G_CALLBACK(on_logrotate_period_check_toggled),window); g_signal_connect(G_OBJECT(window->JournalMaxSizeCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->JournalMaxSizeCombo); g_signal_connect(G_OBJECT(window->JournalMaxSizeCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->JournalMaxSizeSpin); - g_signal_connect(G_OBJECT(window->FileAmountCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->FileAmountSpin); - g_signal_connect(G_OBJECT(window->FileAmountCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->FileAmountCombo); - g_signal_connect(G_OBJECT(window->FileAmountCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->FileAmountEntry); - g_signal_connect(G_OBJECT(window->FileAmountCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->FileAmountButton); - + g_signal_connect(G_OBJECT(window->FileAmountCheck),"toggled",G_CALLBACK(on_file_amount_checked),window); + g_signal_connect(G_OBJECT(window->DoNotRotateYoungerCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->DoNotRotateYoungerSpin); g_signal_connect(G_OBJECT(window->DeleteOlderCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->DeleteOlderSpin); @@ -692,16 +959,36 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind g_signal_connect(G_OBJECT(window->RotateSizeMaxBeforeTimeCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotateSizeMaxBeforeTimeSpin); g_signal_connect(G_OBJECT(window->RotateSizeMaxBeforeTimeCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotateSizeMaxBeforeTimeCombo); - g_signal_connect(G_OBJECT(window->CreateLogCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box_inversed),window->CreateLogUserCombo); - g_signal_connect(G_OBJECT(window->CreateLogCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box_inversed),window->CreateGroupCombo); - g_signal_connect(G_OBJECT(window->CreateLogCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box_inversed),window->CreateLogEntry); - g_signal_connect(G_OBJECT(window->CreateLogCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box_inversed),window->CreateLogButton); + g_signal_connect(G_OBJECT(window->CreateLogCombo),"changed",G_CALLBACK(on_combo_activate_second),window->CreateLogUserCombo); + g_signal_connect(G_OBJECT(window->CreateLogCombo),"changed",G_CALLBACK(on_combo_activate_second),window->CreateGroupCombo); + g_signal_connect(G_OBJECT(window->CreateLogCombo),"changed",G_CALLBACK(on_combo_activate_second),window->CreateLogEntry); + g_signal_connect(G_OBJECT(window->CreateLogCombo),"changed",G_CALLBACK(on_combo_activate_second),window->CreateLogButton); + g_signal_connect(G_OBJECT(window->FileAmountCombo),"changed",G_CALLBACK(on_combo_activate_second),window->FileAmountButton); + g_signal_connect(G_OBJECT(window->FileAmountCombo),"changed",G_CALLBACK(on_combo_activate_second),window->FileAmountEntry); + g_signal_connect(G_OBJECT(window->CompressionCombo),"changed",G_CALLBACK(on_combo_activate_first),window->QueueCombo); + g_signal_connect(G_OBJECT(window->SaveOriginalCombo),"changed",G_CALLBACK(on_combo_activate_first),window->SaveOriginalEntry); + g_signal_connect(G_OBJECT(window->OldNumberCombo),"changed",G_CALLBACK(on_combo_activate_first),window->OldNumberEntry); + + g_signal_connect(G_OBJECT(window->EmailCombo),"changed",G_CALLBACK(on_combo_activate_first),window->EmailEntry); + g_signal_connect(G_OBJECT(window->EmailCombo),"changed",G_CALLBACK(on_combo_activate_first),window->EmailContentsCombo); + + g_signal_connect(G_OBJECT(window->RotationPeriodMainCombo),"changed",G_CALLBACK(on_combo_activate_second),window->RotationPeriodAdditionalCombo); + + g_signal_connect(G_OBJECT(window->FileAmountButton),"clicked",G_CALLBACK(on_filechooser_open),window); + + g_signal_connect(G_OBJECT(window->CreateLogButton),"clicked",G_CALLBACK(on_rules_open),window->CreateLogEntry); + int usize=0; config_str users = yon_ubl_get_all_users(&usize); yon_gtk_combo_box_fill(window->CreateLogUserCombo,users,usize); yon_gtk_combo_box_fill(window->RotationAtUserCombo,users,usize); + for (int i=0;iRotationAtGroupCombo),main_config.groups[i]); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(window->CreateGroupCombo),main_config.groups[i]); + } + if (paths){ int size; GtkTreeIter iter; @@ -721,30 +1008,24 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind } else if (!strcmp(parsed[i],"daily")){ gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationPeriodMainCombo),1); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->RotationPeriodCheck),1); - }else if (!strcmp(parsed[i],"weekly")){ + }else if (strstr(parsed[i],"weekly")){ gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationPeriodMainCombo),2); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->RotationPeriodCheck),1); - gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationPeriodAdditionalCombo),atoi(parsed[i+1])); + int dayofweek = atoi(strstr(parsed[i]," ")+1); + if (dayofweek==0) dayofweek=7; + dayofweek--; + gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationPeriodAdditionalCombo),dayofweek); }else if (!strcmp(parsed[i],"monthly")){ gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationPeriodMainCombo),3); }else if (!strcmp(parsed[i],"yearly")){ gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationPeriodMainCombo),4); - }else if (!strcmp(parsed[i],"size")){ - int sizemod = yon_size_get_int_from_letter(parsed[i][strlen(parsed[i])-1]); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->JournalMaxSizeSpin),atol(parsed[i])); - gtk_combo_box_set_active(GTK_COMBO_BOX(window->JournalMaxSizeCombo),sizemod); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->JournalMaxSizeCheck),1); - }else if (!strcmp(parsed[i],"rotate")){ - char *value = strstr(parsed[i]," ")+1; - gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->FileAmountSpin),atol(value)); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->FileAmountCheck),1); }else if (!strcmp(parsed[i],"olddir")){ char *value = strstr(parsed[i]," ")+1; gtk_entry_set_text(GTK_ENTRY(window->FileAmountEntry),value); gtk_combo_box_set_active(GTK_COMBO_BOX(window->FileAmountCombo),1); }else if (!strcmp(parsed[i],"noolddir")){ gtk_combo_box_set_active(GTK_COMBO_BOX(window->FileAmountCombo),2); - }else if (!strcmp(parsed[i],"su")){ + }else if (strstr(parsed[i],"su")){ char *value = strstr(parsed[i]," ")+1; char *nvalue = yon_char_divide_search(value," ",-1); int us = yon_gtk_combo_box_text_find(window->RotationAtUserCombo,nvalue); @@ -759,20 +1040,20 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind gtk_combo_box_set_active(GTK_COMBO_BOX(window->JournalEmptyCombo),1); }else if (!strcmp(parsed[i],"notifempty")){ gtk_combo_box_set_active(GTK_COMBO_BOX(window->JournalEmptyCombo),2); - }else if (!strcmp(parsed[i],"minage")){ + }else if (strstr(parsed[i],"minage")){ char *value = strstr(parsed[i]," ")+1; gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->DoNotRotateYoungerSpin),atol(value)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->DoNotRotateYoungerCheck),1); - }else if (!strcmp(parsed[i],"maxage")){ + }else if (strstr(parsed[i],"maxage")){ char *value = strstr(parsed[i]," ")+1; gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->DeleteOlderSpin),atol(value)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->DeleteOlderCheck),1); - }else if (!strcmp(parsed[i],"minsize")){ + }else if (strstr(parsed[i],"minsize")){ char *value = strstr(parsed[i]," ")+1; gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->RotateSizeMaxAfterTimeSpin),atol(value)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->RotateSizeMaxAfterTimeCheck),1); gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotateSizeMaxAfterTimeCombo),yon_size_get_int_from_letter(value[strlen(value)-1])); - }else if (!strcmp(parsed[i],"maxsize")){ + }else if (strstr(parsed[i],"maxsize")){ char *value = strstr(parsed[i]," ")+1; gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->RotateSizeMaxBeforeTimeSpin),atol(value)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->RotateSizeMaxBeforeTimeCheck),1); @@ -781,6 +1062,11 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind // // }else if (!strcmp(parsed[i],"nocreate")){ // + }else if (strstr(parsed[i],"size")){ + int sizemod = yon_size_get_int_from_letter(parsed[i][strlen(parsed[i])-1]); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->JournalMaxSizeSpin),atol(strstr(parsed[i], " ")+1)); + gtk_combo_box_set_active(GTK_COMBO_BOX(window->JournalMaxSizeCombo),sizemod); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->JournalMaxSizeCheck),1); }else if (!strcmp(parsed[i],"copytruncate")){ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->CutCheck),1); }else if (!strcmp(parsed[i],"compress")){ @@ -792,48 +1078,52 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind }else if (!strcmp(parsed[i],"nodelaycompress")){ gtk_combo_box_set_active(GTK_COMBO_BOX(window->QueueCombo),2); - }else if (!strcmp(parsed[i],"extension")){ + }else if (strstr(parsed[i],"extension")){ char *value = strstr(parsed[i]," ")+1; gtk_combo_box_set_active(GTK_COMBO_BOX(window->SaveOriginalCombo),1); gtk_entry_set_text(GTK_ENTRY(window->SaveOriginalEntry),value); }else if (!strcmp(parsed[i],"dateext")){ gtk_combo_box_set_active(GTK_COMBO_BOX(window->AddDateCombo),1); - }else if (!strcmp(parsed[i],"start")){ + }else if (strstr(parsed[i],"start")){ char *value = strstr(parsed[i]," ")+1; gtk_combo_box_set_active(GTK_COMBO_BOX(window->OldNumberCombo),1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->OldNumberEntry),atol(value)); - }else if (!strcmp(parsed[i],"mail")){ + }else if (!strcmp(parsed[i],"nomail")){ + gtk_combo_box_set_active(GTK_COMBO_BOX(window->EmailCombo),2); + }else if (strstr(parsed[i],"mail")){ char *value = strstr(parsed[i]," ")+1; gtk_entry_set_text(GTK_ENTRY(window->EmailEntry),value); gtk_combo_box_set_active(GTK_COMBO_BOX(window->EmailCombo),1); - }else if (!strcmp(parsed[i],"nomail")){ - gtk_combo_box_set_active(GTK_COMBO_BOX(window->EmailCombo),2); }else if (!strcmp(parsed[i],"mailfirst")){ gtk_combo_box_set_active(GTK_COMBO_BOX(window->EmailContentsCombo),1); }else if (!strcmp(parsed[i],"maillast")){ gtk_combo_box_set_active(GTK_COMBO_BOX(window->EmailContentsCombo),2); }else if (!strcmp(parsed[i],"sharedscripts")){ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->SharedScenariosCheck),1); - }else if (!strcmp(parsed[i],"firstaction")){ + }else if (strstr(parsed[i],"firstaction")){ char *value = parsed[i+1]; gtk_entry_set_text(GTK_ENTRY(window->CommandBeforeOnceEntry),value); i++; - }else if (!strcmp(parsed[i],"lastaction")){ + }else if (strstr(parsed[i],"lastaction")){ char *value = parsed[i+1]; gtk_entry_set_text(GTK_ENTRY(window->CommandAfterOnceEntry),value); i++; - }else if (!strcmp(parsed[i],"prerotate")){ + }else if (strstr(parsed[i],"prerotate")){ char *value = parsed[i+1]; gtk_entry_set_text(GTK_ENTRY(window->CommandBeforeEntry),value); i++; - }else if (!strcmp(parsed[i],"postrotate")){ + }else if (strstr(parsed[i],"postrotate")){ char *value = parsed[i+1]; gtk_entry_set_text(GTK_ENTRY(window->CommandAfterEntry),value); i++; - // }else if (!strcmp(parsed[i],"preremove")){ - // char *value = parsed[i+1]; - // gtk_entry_set_text(GTK_ENTRY(window->CommandBeforeOnceEntry),value); - // i++; + }else if (!strcmp(parsed[i],"preremove")){ + char *value = parsed[i+1]; + gtk_entry_set_text(GTK_ENTRY(window->EndworkCommandEntry),value); + i++; + }else if (strstr(parsed[i],"rotate")){ + char *value = strstr(parsed[i]," ")+1; + gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->FileAmountSpin),atol(value)); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->FileAmountCheck),1); }else if (!strcmp(parsed[i],"endscript")){ } } @@ -846,6 +1136,7 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind void on_logrotate_add(GtkWidget *self, logrotate_window *dialog){ logrotate_configure_window *window = yon_logrotate_window_new(NULL,NULL); gtk_tree_selection_unselect_all(gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->MainTree))); + gtk_window_set_transient_for(GTK_WINDOW(window->MainWindow),GTK_WINDOW(dialog->Window)); gtk_widget_show(window->MainWindow); gtk_widget_set_sensitive(window->LogNameEntry,1); gtk_widget_set_sensitive(window->LogDescriptionEntry,1); @@ -869,12 +1160,12 @@ void on_logrotate_edit(GtkWidget *self, logrotate_window *window){ logrotate_configure_window *dialog = yon_logrotate_window_new(paths,window); gtk_widget_show(dialog->MainWindow); gtk_tree_model_get(model,&iter,0,&name,1,&paths,2,&description,-1); - gtk_entry_set_text(GTK_ENTRY(dialog->LogNameEntry),name); - gtk_entry_set_text(GTK_ENTRY(dialog->LogDescriptionEntry),description); + gtk_entry_set_text(GTK_ENTRY(dialog->LogNameEntry),name ? name : ""); + gtk_entry_set_text(GTK_ENTRY(dialog->LogDescriptionEntry),description ? description : ""); gtk_widget_set_can_focus(dialog->LogNameEntry,0); - gtk_widget_set_can_focus(dialog->LogDescriptionEntry,0); + // gtk_widget_set_can_focus(dialog->LogDescriptionEntry,0); gtk_entry_set_has_frame(GTK_ENTRY(dialog->LogNameEntry),0); - gtk_entry_set_has_frame(GTK_ENTRY(dialog->LogDescriptionEntry),0); + // gtk_entry_set_has_frame(GTK_ENTRY(dialog->LogDescriptionEntry),0); gtk_style_context_add_class(gtk_widget_get_style_context(dialog->LogNameEntry),"nobackground"); gtk_style_context_add_class(gtk_widget_get_style_context(dialog->LogDescriptionEntry),"nobackground"); } @@ -895,17 +1186,38 @@ void on_logrotate_remove(GtkWidget *self, logrotate_window *window){ void on_logrotate_apps_configure(GtkWidget *self, logrotate_window *window){ GtkTreeModel *model = GTK_TREE_MODEL(main_config.logrotate_apps_list); - GtkTreeIter iter,itar; + GtkTreeIter iter,itar,itor; if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(window->AppsMainTree)),&model,&iter)){ char *paths; char *name; char *settings; - gtk_list_store_append(main_config.logrotate_list,&itar); + int cur_size=0; + int found=0; gtk_tree_model_get(model,&iter,0,&name,1,&paths,2,&settings,-1); - settings = yon_char_replace(settings,",\t",","); - if (settings[0]==',') yon_char_divide_search(settings,",",-1); + config_str cur = yon_char_parse(paths,&cur_size,"\n"); + int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(main_config.logrotate_list),&itor); + for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(main_config.logrotate_list),&itor)){ + char *check_paths; + gtk_tree_model_get(GTK_TREE_MODEL(main_config.logrotate_list),&itor,1,&check_paths,-1); + int check_size=0; + config_str parsed_check = yon_char_parse(check_paths,&check_size,"\n"); + for (int i=0;iStatusBox),REPEATED_PATHS_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + return; + } + + } + gtk_list_store_append(main_config.logrotate_list,&itar); + settings = yon_char_replace(settings,",\t",","); + if (settings[0]==',') yon_char_divide_search(settings,",",-1); yon_config_register(LOGROTATE(yon_char_replace(paths,"\n",",")),"logging",settings); gtk_list_store_set(main_config.logrotate_list,&itar,0,name,1,paths,-1); + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),SUCCESS_LABEL,5,BACKGROUND_IMAGE_SUCCESS_TYPE); } } @@ -940,6 +1252,30 @@ void on_log_edit_logrotate_settings(GtkWidget *self, dictionary *dict){ // Logrotate tab window +void on_logrotate_tab_selection_changed(GtkWidget *self, logrotate_window *window){ + GtkTreeModel *model = GTK_TREE_MODEL(main_config.logrotate_list); + GtkTreeIter iter; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(window->MainTree)),&model,&iter)){ + gtk_widget_set_sensitive(window->AddButton,1); + gtk_widget_set_sensitive(window->RemoveButton,1); + gtk_widget_set_sensitive(window->ConfigureButton,1); + } else { + gtk_widget_set_sensitive(window->AddButton,1); + gtk_widget_set_sensitive(window->RemoveButton,0); + gtk_widget_set_sensitive(window->ConfigureButton,0); + } +} + +void on_logrotate_applications_tab_selection_changed(GtkWidget *self, logrotate_window *window){ + GtkTreeModel *model = GTK_TREE_MODEL(main_config.logrotate_apps_list); + GtkTreeIter iter; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(window->AppsMainTree)),&model,&iter)){ + gtk_widget_set_sensitive(window->AppsConfigureButton,1); + } else { + gtk_widget_set_sensitive(window->AppsConfigureButton,0); + } +} + void on_logrotate_tab_open(GtkWidget *self, main_window *widgets){ logrotate_window *window = malloc(sizeof(logrotate_window)); GtkBuilder *builder = gtk_builder_new_from_resource(glade_logrotate_table_path); @@ -952,6 +1288,7 @@ void on_logrotate_tab_open(GtkWidget *self, main_window *widgets){ window->ConfigureButton = yon_gtk_builder_get_widget(builder,"ConfigureButton"); window->AddButton = yon_gtk_builder_get_widget(builder,"AddButton"); window->RemoveButton = yon_gtk_builder_get_widget(builder,"RemoveButton"); + window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox"); gtk_window_set_title(GTK_WINDOW(window->Window),TITLE_LABEL); gtk_tree_view_set_model(GTK_TREE_VIEW(window->MainTree),GTK_TREE_MODEL(main_config.logrotate_list)); @@ -963,6 +1300,9 @@ void on_logrotate_tab_open(GtkWidget *self, main_window *widgets){ g_signal_connect(G_OBJECT(window->RemoveButton),"clicked",G_CALLBACK(on_logrotate_remove),window); g_signal_connect(G_OBJECT(window->ConfigureButton),"clicked",G_CALLBACK(on_logrotate_edit),window); g_signal_connect(G_OBJECT(window->AppsConfigureButton),"clicked",G_CALLBACK(on_logrotate_apps_configure),window); + + g_signal_connect(G_OBJECT(window->MainTree),"cursor-changed",G_CALLBACK(on_logrotate_tab_selection_changed),window); + g_signal_connect(G_OBJECT(window->AppsMainTree),"cursor-changed",G_CALLBACK(on_logrotate_applications_tab_selection_changed),window); gtk_widget_show(window->Window); } @@ -1040,8 +1380,12 @@ void on_journald_save(GtkWidget *self, journald_window *window){ for (int i=0;i0) - yon_config_register(JOURNALD("SystemMaxUse"),"logging",yon_char_from_long(logssize)); + if (logssize>0){ + float val; + int size; + val = yon_size_convert_automatic(logssize,&size); + yon_config_register(JOURNALD("SystemMaxUse"),"logging",yon_char_append(yon_char_from_float(val),yon_size_get_letter_from_int(size))); + } } else yon_config_remove_by_key(JOURNALD("SystemMaxUse")); @@ -1144,6 +1488,12 @@ journald_window *yon_journald_open(GtkWidget *self, main_window *widgets){ window->LowerTimeButton=yon_gtk_builder_get_widget(builder,"LowerTimeButton"); window->headerTopic=yon_gtk_builder_get_widget(builder,"headerTopic"); + gtk_window_set_transient_for(GTK_WINDOW(window->MainWindow),GTK_WINDOW(widgets->Window)); + { + int sz; + config_str logsize = yon_config_load(journald_size_command,&sz); + gtk_label_set_text(GTK_LABEL(window->LogSizeLabel),logsize[0]); + } gtk_window_set_title(GTK_WINDOW(window->MainWindow),TITLE_LABEL); g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_close_subwindow),NULL); @@ -1251,16 +1601,35 @@ void on_journald_open(GtkWidget *self, main_window *widgets){ // Log adding menu -add_log_window *on_add_open(){ +void on_log_save(GtkWidget *self, dictionary *dict){ + main_window *widgets = yon_dictionary_get_data(dict->first,main_window*); + add_log_window *window = yon_dictionary_get_data(dict->first->next,add_log_window*); + GList *list = gtk_container_get_children(GTK_CONTAINER(window->LogPathsBox)); + char *pathse=NULL; + for (int i=0;iNameEntry)); + char *desc = (char*)gtk_entry_get_text(GTK_ENTRY(window->LogDescriptionEntry)); + if (!yon_char_is_empty(name)){ + GtkTreeModel *model = GTK_TREE_MODEL(widgets->list); + GtkTreeIter iter; + if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MainTree)),&model,&iter)) + gtk_list_store_append(widgets->list,&iter); + gtk_list_store_set(widgets->list,&iter,0,name,1,pathse,2,&desc ? desc : "",-1); + } + on_close_subwindow(self); +} + +add_log_window *on_add_open(main_window *widgets){ add_log_window *window = malloc(sizeof(add_log_window)); GtkBuilder *builder = gtk_builder_new_from_resource(glade_add_path); window->MainWindow=yon_gtk_builder_get_widget(builder,"MainWindow"); window->CancelButton=yon_gtk_builder_get_widget(builder,"CancelButton"); window->SaveButton=yon_gtk_builder_get_widget(builder,"SaveButton"); - window->LogAddingBox=yon_gtk_builder_get_widget(builder,"LogAddingBox"); window->LogTypeCombo=yon_gtk_builder_get_widget(builder,"LogTypeCombo"); - window->LogPathEntry=yon_gtk_builder_get_widget(builder,"LogPathEntry"); - window->LogFindButton=yon_gtk_builder_get_widget(builder,"LogFindButton"); window->LogDescriptionEntry=yon_gtk_builder_get_widget(builder,"LogDescriptionEntry"); window->LogrotateButton=yon_gtk_builder_get_widget(builder,"LogrotateButton"); window->MetalogButton=yon_gtk_builder_get_widget(builder,"MetalogButton"); @@ -1270,33 +1639,17 @@ add_log_window *on_add_open(){ window->StatisticsFrame=yon_gtk_builder_get_widget(builder,"StatisticsFrame"); window->ControlSectionBox=yon_gtk_builder_get_widget(builder,"ControlSectionBox"); window->LogPathsBox=yon_gtk_builder_get_widget(builder,"LogPathsBox"); + window->NameEntry=yon_gtk_builder_get_widget(builder,"NameEntry"); gtk_window_set_title(GTK_WINDOW(window->MainWindow),TITLE_LABEL); + gtk_window_set_transient_for(GTK_WINDOW(window->MainWindow),GTK_WINDOW(widgets->Window)); + dictionary *dict = NULL; + yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets); + yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window); g_signal_connect(G_OBJECT(window->CancelButton),"clicked", G_CALLBACK(on_close_subwindow),NULL); - g_signal_connect(G_OBJECT(window->SaveButton),"clicked", G_CALLBACK(on_close_subwindow),NULL); + g_signal_connect(G_OBJECT(window->SaveButton),"clicked", G_CALLBACK(on_log_save),dict); return window; } -void on_log_add(GtkWidget *self, main_window *widgets){ - GtkTreeModel *model = GTK_TREE_MODEL(widgets->list); - GtkTreeIter iter; - add_log_window *window = on_add_open(); - gtk_widget_show(window->MainWindow); - gtk_widget_hide(window->StatisticsFrame); - gtk_widget_hide(window->ControlSectionBox); -} - -void on_log_path_choose(GtkWidget *self,add_log_window *window){ - GtkWidget *dialog = gtk_file_chooser_dialog_new(TITLE_LABEL,GTK_WINDOW(window->MainWindow),GTK_FILE_CHOOSER_ACTION_OPEN,CANCEL_LABEL,GTK_RESPONSE_CANCEL,ACCEPT_LABEL,GTK_RESPONSE_ACCEPT,NULL); - gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog),"/"); - int response = gtk_dialog_run(GTK_DIALOG(dialog)); - if (response == GTK_RESPONSE_ACCEPT){ - GtkWidget *parent = gtk_widget_get_parent(self); - GList *list = gtk_container_get_children(GTK_CONTAINER(parent)); - gtk_entry_set_text((GtkEntry*)g_list_nth_data(list,1),gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog))); - } - gtk_widget_destroy(dialog); -} - void on_log_path_remove(GtkWidget *self, add_log_window *window){ GList *paths = gtk_container_get_children(GTK_CONTAINER(window->LogPathsBox)); for (int i=0;iMainWindow),GTK_FILE_CHOOSER_ACTION_OPEN,CANCEL_LABEL,GTK_RESPONSE_CANCEL,ACCEPT_LABEL,GTK_RESPONSE_ACCEPT,NULL); + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog),"/"); + int response = gtk_dialog_run(GTK_DIALOG(dialog)); + if (response == GTK_RESPONSE_ACCEPT){ + GtkWidget *parent = gtk_widget_get_parent(self); + GList *list = gtk_container_get_children(GTK_CONTAINER(parent)); + gtk_entry_set_text((GtkEntry*)g_list_nth_data(list,1),gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog))); + } + gtk_widget_destroy(dialog); +} + void on_log_path_append(GtkWidget *self, add_log_window *window){ GList *paths = gtk_container_get_children(GTK_CONTAINER(window->LogPathsBox)); GtkWidget *box = (GtkWidget*)g_list_nth_data(paths,g_list_length(paths)-1); - GList *path_widgets = gtk_container_get_children(GTK_CONTAINER(box)); - GtkWidget *entry = (GtkWidget*)g_list_nth_data(path_widgets,1); - if (gtk_widget_get_sensitive(box)&&strcmp(gtk_entry_get_text(GTK_ENTRY(entry)),"")){ + GList *path_widgets; + GtkWidget *entry; + if (box){ + path_widgets = gtk_container_get_children(GTK_CONTAINER(box)); + entry = (GtkWidget*)g_list_nth_data(path_widgets,1); + + if (!gtk_widget_get_sensitive(box)||!strcmp(gtk_entry_get_text(GTK_ENTRY(entry)),"")){ + return; + } else + gtk_widget_hide(self); + } GtkBuilder *builder = gtk_builder_new_from_resource(glade_add_path_path); - GtkWidget *box = yon_gtk_builder_get_widget(builder,"PathBox"); - GtkWidget *entry = yon_gtk_builder_get_widget(builder,"PathEntry"); + GtkWidget *box_path = yon_gtk_builder_get_widget(builder,"PathBox"); + GtkWidget *entry_path = yon_gtk_builder_get_widget(builder,"PathEntry"); GtkWidget *AppendButton = yon_gtk_builder_get_widget(builder,"AppendButton"); GtkWidget *SearchButton = yon_gtk_builder_get_widget(builder,"SearchButton"); GtkWidget *RemoveButton = yon_gtk_builder_get_widget(builder,"RemoveButton"); @@ -1333,29 +1706,43 @@ void on_log_path_append(GtkWidget *self, add_log_window *window){ g_signal_connect(G_OBJECT(RemoveButton),"clicked",G_CALLBACK(on_log_path_remove),window); g_signal_connect(G_OBJECT(SearchButton),"clicked",G_CALLBACK(on_log_path_choose),window); gtk_widget_show(AppendButton); - gtk_widget_hide(self); - gtk_box_pack_start(GTK_BOX(window->LogPathsBox),box,0,0,5); - } - g_list_free(paths); - g_list_free(path_widgets); + gtk_box_pack_start(GTK_BOX(window->LogPathsBox),box_path,0,0,5); +} + +void on_log_add(GtkWidget *self, main_window *widgets){ + GtkTreeModel *model = GTK_TREE_MODEL(widgets->list); + GtkTreeIter iter; + add_log_window *window = on_add_open(widgets); + gtk_tree_selection_unselect_all(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MainTree))); + gtk_widget_show(window->MainWindow); + gtk_widget_hide(window->StatisticsFrame); + gtk_widget_hide(window->ControlSectionBox); + on_log_path_append(NULL,window); } void on_log_edit(GtkWidget *self,main_window *widgets){ GtkTreeModel *model = GTK_TREE_MODEL(widgets->list); GtkTreeIter iter; if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MainTree)),&model,&iter)){ - add_log_window *window = on_add_open(); + add_log_window *window = on_add_open(widgets); gtk_widget_show(window->MainWindow); gtk_widget_hide(window->StatisticsFrame); char *name; char *paths; int size; char *description; - gtk_tree_model_get(model,&iter,0,&name,1,&paths,2,&description,-1); + gboolean is_standard; + int protect; + gtk_tree_model_get(model,&iter,0,&name,1,&paths,2,&description,3,&is_standard,4,&protect,-1); + gtk_entry_set_text(GTK_ENTRY(window->NameEntry),name); if (!strcmp(name,"journald")){ gtk_widget_hide(window->LogrotateButton); gtk_widget_hide(window->MetalogButton); gtk_widget_hide(window->SyslogButton); + gtk_widget_show(window->StatisticsFrame); + int sz; + config_str logsize = yon_config_load(journald_size_command,&sz); + gtk_label_set_text(GTK_LABEL(window->LogSizeLabel),logsize[0]); g_signal_connect(G_OBJECT(window->JournaldButton),"clicked", G_CALLBACK(on_journald_open),widgets); } else { gtk_widget_hide(window->JournaldButton); @@ -1367,9 +1754,10 @@ void on_log_edit(GtkWidget *self,main_window *widgets){ // g_signal_connect(G_OBJECT(window->SyslogButton),"clicked", G_CALLBACK(yon_journald_open),widgets); } window->log_name=name; - gtk_entry_set_text(GTK_ENTRY(window->LogDescriptionEntry),description); + gtk_entry_set_text(GTK_ENTRY(window->LogDescriptionEntry),description ? description : ""); config_str paths_parsed = yon_char_parse(paths,&size,"\n"); GtkWidget *last=NULL; + int protected=0; for (int i=0;iLogPathsBox),box,0,0,5); last = AppendButton; } + if (strcmp(name,"journald")) gtk_widget_show(last); g_signal_connect(G_OBJECT(last),"clicked",G_CALLBACK(on_log_path_append),window); gtk_widget_set_sensitive(window->LogTypeCombo,0); - gtk_widget_set_sensitive(window->LogDescriptionEntry,0); + if (is_standard) { + gtk_widget_set_sensitive(window->NameEntry,0); + gtk_widget_set_sensitive(window->LogDescriptionEntry,0); + gtk_entry_set_has_frame(GTK_ENTRY(window->NameEntry),0); + gtk_widget_set_sensitive(window->NameEntry,0); + gtk_style_context_add_class(gtk_widget_get_style_context(window->NameEntry),"nobackground"); + gtk_style_context_add_class(gtk_widget_get_style_context(window->NameEntry),"noborder"); + gtk_style_context_add_class(gtk_widget_get_style_context(window->NameEntry),"instant"); + } else { + gtk_widget_set_sensitive(window->NameEntry,1); + gtk_widget_set_sensitive(window->LogDescriptionEntry,1); + } } } @@ -1415,6 +1823,115 @@ void on_service_edit(GtkWidget *self,main_window *widgets){ } } +void on_main_window_tree_selection_changed(GtkWidget *self,main_window *widgets){ + GtkTreeModel *model = GTK_TREE_MODEL(widgets->list); + GtkTreeIter iter; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MainTree)),&model,&iter)){ + gboolean is_standard; + gtk_tree_model_get(model,&iter,3,&is_standard,-1); + gtk_widget_set_sensitive(widgets->AddButton,1); + if (!is_standard) + gtk_widget_set_sensitive(widgets->RemoveButton,1); + else + gtk_widget_set_sensitive(widgets->RemoveButton,0); + gtk_widget_set_sensitive(widgets->InspectButton,1); + gtk_widget_set_sensitive(widgets->ConfigureButton,1); + } else { + gtk_widget_set_sensitive(widgets->AddButton,0); + gtk_widget_set_sensitive(widgets->RemoveButton,0); + gtk_widget_set_sensitive(widgets->InspectButton,0); + gtk_widget_set_sensitive(widgets->ConfigureButton,0); + } +} + +void on_main_window_services_tree_selection_changed(GtkWidget *self,main_window *widgets){ + GtkTreeModel *model = GTK_TREE_MODEL(widgets->ServicesList); + GtkTreeIter iter; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->ServicesTree)),&model,&iter)){ + gboolean is_active; + gboolean is_enabled; + char *name; + gtk_tree_model_get(model,&iter,0,&is_active,1,&is_enabled,2,&name,-1); + if (is_active){ + gtk_widget_set_sensitive(widgets->ServicesEditButton,1); + gtk_widget_set_sensitive(widgets->ServicesEnableDisableButton,1); + gtk_widget_set_sensitive(widgets->ServicesStartStopButton,1); + gtk_widget_set_tooltip_text(widgets->ServicesEnableDisableButton,AUTOSTART_OFF_LABEL); + gtk_widget_set_tooltip_text(widgets->ServicesStartStopButton,STOP_SERVICE_LABEL); + gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->ServicesStartStopButton))),stop_icon_name,GTK_ICON_SIZE_BUTTON); + } else { + gtk_widget_set_sensitive(widgets->ServicesEditButton,0); + gtk_widget_set_sensitive(widgets->ServicesEnableDisableButton,1); + gtk_widget_set_sensitive(widgets->ServicesStartStopButton,1); + gtk_widget_set_tooltip_text(widgets->ServicesEnableDisableButton,AUTOSTART_ON_LABEL); + gtk_widget_set_tooltip_text(widgets->ServicesStartStopButton,START_SERVICE_LABEL); + gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->ServicesStartStopButton))),start_icon_name,GTK_ICON_SIZE_BUTTON); + } + if (is_enabled){ + gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->ServicesEnableDisableButton))),disable_icon_name,GTK_ICON_SIZE_BUTTON); + } else { + gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->ServicesEnableDisableButton))),enable_icon_name,GTK_ICON_SIZE_BUTTON); + + } + if (!strcmp(name,"journald")){ + gtk_widget_set_sensitive(widgets->ServicesEnableDisableButton,0); + gtk_widget_set_sensitive(widgets->ServicesStartStopButton,0); + gtk_widget_set_tooltip_text(widgets->ServicesEnableDisableButton,AUTOSTART_OFF_LABEL); + gtk_widget_set_tooltip_text(widgets->ServicesStartStopButton,STOP_SERVICE_LABEL); + } + } else { + gtk_widget_set_sensitive(widgets->ServicesEditButton,0); + gtk_widget_set_sensitive(widgets->ServicesEnableDisableButton,0); + gtk_widget_set_sensitive(widgets->ServicesStartStopButton,0); + gtk_widget_set_tooltip_text(widgets->ServicesEnableDisableButton,AUTOSTART_ON_LABEL); + gtk_widget_set_tooltip_text(widgets->ServicesStartStopButton,START_SERVICE_LABEL); + } +} + +void on_start_stop_clicked(GtkButton *self, main_window *widgets){ + GtkTreeModel *model = GTK_TREE_MODEL(widgets->ServicesList); + GtkTreeIter iter; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->ServicesTree)),&model,&iter)){ + char *start_command; + char *stop_command; + gboolean is_started; + gtk_tree_model_get(model,&iter,0,&is_started,4,&start_command,5,&stop_command,-1); + if (is_started){ + yon_launch(stop_command); + gtk_list_store_set(widgets->ServicesList,&iter,0,0,-1); + gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(self)),start_icon_name,GTK_ICON_SIZE_BUTTON); + gtk_widget_set_tooltip_text(widgets->ServicesStartStopButton,START_SERVICE_LABEL); + } else { + yon_launch(start_command); + gtk_list_store_set(widgets->ServicesList,&iter,0,1,-1); + gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(self)),stop_icon_name,GTK_ICON_SIZE_BUTTON); + gtk_widget_set_tooltip_text(widgets->ServicesEnableDisableButton,STOP_SERVICE_LABEL); + } + } +} + +void on_enable_disable_clicked(GtkButton *self, main_window *widgets){ + GtkTreeModel *model = GTK_TREE_MODEL(widgets->ServicesList); + GtkTreeIter iter; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->ServicesTree)),&model,&iter)){ + char *start_command; + char *stop_command; + gboolean is_started; + gtk_tree_model_get(model,&iter,1,&is_started,6,&start_command,7,&stop_command,-1); + if (is_started){ + yon_launch(stop_command); + gtk_list_store_set(widgets->ServicesList,&iter,1,0,-1); + gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(self)),enable_icon_name,GTK_ICON_SIZE_BUTTON); + gtk_widget_set_tooltip_text(widgets->ServicesEnableDisableButton,AUTOSTART_ON_LABEL); + } else { + yon_launch(start_command); + gtk_list_store_set(widgets->ServicesList,&iter,1,1,-1); + gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(self)),disable_icon_name,GTK_ICON_SIZE_BUTTON); + gtk_widget_set_tooltip_text(widgets->ServicesEnableDisableButton,AUTOSTART_OFF_LABEL); + } + } +} + // standard functions void config_init(){ @@ -1473,6 +1990,8 @@ main_window *setup_window(){ widgets->RemoveButton = yon_gtk_builder_get_widget(builder,"MainRemoveButton"); widgets->Notebook = yon_gtk_builder_get_widget(builder,"MainNotebook"); widgets->ServicesEditButton = yon_gtk_builder_get_widget(builder,"ServicesEditButton"); + widgets->ServicesStartStopButton = yon_gtk_builder_get_widget(builder,"ServicesStartStopButton"); + widgets->ServicesEnableDisableButton = yon_gtk_builder_get_widget(builder,"ServicesEnableDisableButton"); widgets->ServicesTree = yon_gtk_builder_get_widget(builder,"ServicesTree"); widgets->list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1")); widgets->ServicesList = GTK_LIST_STORE(gtk_builder_get_object(builder,"ServicesList")); @@ -1503,22 +2022,25 @@ main_window *setup_window(){ char *cparams=""; GtkTreeIter iter; config_str journals = yon_file_open(journals_list_path,&size); - for (int i=0;ilist,&iter); - gtk_list_store_set(widgets->list,&iter,0,log[0],1,log[1],2,log[2],3,-1,4,-1,5,-1,6,-1,7,-1,-1); + free(yon_char_parse(log[1],&psize,"\n")); + gtk_list_store_set(widgets->list,&iter,0,log[0],1,log[1],2,_(log[2]),3,1,4,psize,-1); } config_str services = yon_file_open(services_list_path,&service_size); - for (int i=0;iServicesList,&iter); - gtk_list_store_set(widgets->ServicesList,&iter,0,1,1,1,2,log[0],3,log[1],-1); + // yon_config_load + gtk_list_store_set(widgets->ServicesList,&iter,0,1,1,1,2,log[0],3,_(log[1]),4,log[2],5,log[3],6,log[4],7,log[5],8,log[6],-1); } } config_str dirs = yon_config_load(logrotate_config_command,&dirs_size); @@ -1529,6 +2051,9 @@ main_window *setup_window(){ config_str file = yon_file_open(yon_char_append(logrotate_config_path,dirs[i]),&filesize); for (int j=0;jMainTree)); + for (int i=0; iServicesTree)); + for (int i=0; iHeadInfoLabel,"head-text","label",YON_TYPE_STRING); @@ -1574,7 +2115,12 @@ main_window *setup_window(){ g_signal_connect(G_OBJECT(widgets->LoadGlobalMenuItem),"activate",G_CALLBACK(on_load_global),NULL); g_signal_connect(G_OBJECT(widgets->LoadLocalMenuItem),"activate",G_CALLBACK(on_load_local),NULL); + + g_signal_connect(G_OBJECT(widgets->MainTree),"cursor-changed",G_CALLBACK(on_main_window_tree_selection_changed),widgets); + g_signal_connect(G_OBJECT(widgets->ServicesTree),"cursor-changed",G_CALLBACK(on_main_window_services_tree_selection_changed),widgets); + g_signal_connect(G_OBJECT(widgets->ServicesStartStopButton),"clicked",G_CALLBACK(on_start_stop_clicked),widgets); + g_signal_connect(G_OBJECT(widgets->ServicesEnableDisableButton),"clicked",G_CALLBACK(on_enable_disable_clicked),widgets); gtk_widget_show(widgets->Window); return widgets; @@ -1669,8 +2215,16 @@ int main(int argc, char *argv[]){ yon_ubl_status_box_render(LOCAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); yon_ubl_setup_sockets(widgets->PlugBox,widgets->LeftBox,widgets->RightBox,main_config.socket_id,main_config.load_socket_id,main_config.save_socket_id); yon_window_config_setup(GTK_WINDOW(widgets->Window)); - yon_load_proceed(YON_CONFIG_LOCAL); yon_window_config_load(config_path); + GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(widgets->ServicesTree)); + for (int i = 0; i < g_list_length(list); i++){ + yon_gtk_column_minimal_fixed_size_set((GtkTreeViewColumn*)g_list_nth_data(list,i)); + } + g_list_free(list); + list = gtk_tree_view_get_columns(GTK_TREE_VIEW(widgets->MainTree)); + for (int i = 0; i < g_list_length(list); i++){ + yon_gtk_column_minimal_fixed_size_set((GtkTreeViewColumn*)g_list_nth_data(list,i)); + } yon_load_proceed(YON_CONFIG_LOCAL); update_loaded_logrotate(); GtkCssProvider *css=gtk_css_provider_new(); diff --git a/source/ubl-settings-logging.h b/source/ubl-settings-logging.h index b560b95..b2da285 100644 --- a/source/ubl-settings-logging.h +++ b/source/ubl-settings-logging.h @@ -8,6 +8,9 @@ #include #include #include +#include +#include +#include #include "../compile/ubl-cmake.h" #ifdef WEBKIT_FOUND #include @@ -25,12 +28,16 @@ #define glade_journald_path "/com/ublinux/ui/ubl-settings-logging-journald.glade" #define glade_logrotate_path "/com/ublinux/ui/ubl-settings-logging-logrotate.glade" #define glade_logrotate_table_path "/com/ublinux/ui/ubl-settings-logging-logrotate-table.glade" +#define glade_rules_path "/com/ublinux/ui/ubl-settings-logging-rules.glade" +#define glade_filechooser_path "/com/ublinux/ui/ubl-settings-logging-filechooser.glade" #define banner_path "/com/ublinux/images/ubl-settings-logging-banner.png" #define CssPath "/com/ublinux/css/ubl-settings-logging.css" #define config_path yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL) #define journals_list_path "/usr/share/ubl-settings-logging/csv/journals_list.csv" #define services_list_path "/usr/share/ubl-settings-logging/csv/logging_services.csv" #define logrotate_config_command "ls /etc/logrotate.d/ |sed -e 's/ */\\n/g'" +#define journald_size_command "journalctl --disk-usage | grep -oE \"[0-9]{1,}.[0-9]{1,}[A-Z]\"" +#define logrotate_size_command(paths) yon_char_unite("du ",paths," |grep -oE '^[0-9]{1,}'",NULL) #define logrotate_config_path "/etc/logrotate.d/" #define LocalePath "/usr/share/locale" @@ -39,11 +46,21 @@ #define JOURNALD(key) yon_char_unite("JOURNALD[",key,"]",NULL) #define LOGROTATE(key) yon_char_unite("LOGROTATE[",key,"]",NULL) -#define get_journal_output_command "journalctl --no-pager" -#define get_journal_output_since_boot_command "journalctl --no-pager -b" -#define get_journal_output_followed_command "journalctl --no-pager -f" -#define get_journal_output_kernel_command "journalctl --no-pager -k" -#define get_journal_output_prioritied_command "journalctl --no-pager -p err..alert" +#define get_journal_output_command "clear;journalctl --no-pager" +#define get_journal_output_since_boot_command "clear;journalctl --no-pager -b" +#define get_journal_output_followed_command "clear;journalctl --no-pager -f" +#define get_journal_output_kernel_command "clear;journalctl --no-pager -k" +#define get_journal_output_prioritied_command "clear;journalctl --no-pager -p err..alert" +#define get_journal_all_boots_command "clear;journalctl --list-boots" +#define get_journal_all_units_command "clear;systemd-analyze blame --no-pager" +#define get_journal_init_tree_command "clear;systemd-analyze critical-chain" + +#define group_list_path "/etc/group" + +#define start_icon_name "com.ublinux.ubl-settings-logging.play-symbolic" +#define stop_icon_name "com.ublinux.ubl-settings-logging.stop-symbolic" +#define enable_icon_name "com.ublinux.ubl-settings-logging.check-symbolic" +#define disable_icon_name "com.ublinux.ubl-settings-logging.uncheck-symbolic" #define yon_add_space_if_exists(string) yon_char_is_empty(string) ? "" : yon_char_append(",",string) typedef char* string; @@ -71,6 +88,8 @@ typedef struct { GtkListStore *logrotate_list; GtkListStore *logrotate_apps_list; + config_str groups; + int groups_size; } config; typedef struct { @@ -113,6 +132,8 @@ typedef struct { GtkWidget *Notebook; GtkWidget *ServicesTree; GtkWidget *ServicesEditButton; + GtkWidget *ServicesStartStopButton; + GtkWidget *ServicesEnableDisableButton; GtkListStore *list; GtkListStore *ServicesList; // Custom @@ -138,31 +159,9 @@ typedef struct { GtkWidget *CancelButton; GtkWidget *SaveButton; GtkWidget *LogTypeCombo; - GtkWidget *LogPathEntry; - GtkWidget *LogFindButton; GtkWidget *LogDescriptionEntry; GtkWidget *editingBox; - GtkWidget *FileAmountCheck; - GtkWidget *FileAmountSpin; - GtkWidget *FileSizeCheck; - GtkWidget *FileSizeSpin; - GtkWidget *FileSizeCombo; - GtkWidget *RotationPeriodCheck; - GtkWidget *RotationPeriodCombo; - GtkWidget *JournalSizeCheck; - GtkWidget *JournalSizeSpin; - GtkWidget *JournalSizeCombo; - GtkWidget *JournalGatheringPeriodCheck; - GtkWidget *JournalGatheringPeriodCombo; GtkWidget *logSizeLabel; - GtkWidget *diskSizeLabel; - GtkWidget *headerBar; - GtkWidget *headerTopic; - GtkWidget *LogSettingsBox; - GtkWidget *JournalSettingsBox; - GtkWidget *LogEditingBox; - GtkWidget *LogAddingBox; - GtkWidget *LogNameLabel; GtkWidget *LogrotateButton; GtkWidget *MetalogButton; GtkWidget *SyslogButton; @@ -171,12 +170,12 @@ typedef struct { GtkWidget *StatisticsFrame; GtkWidget *ControlSectionBox; GtkWidget *LogPathsBox; + GtkWidget *NameEntry; char *log_name; } add_log_window; typedef struct { -GtkTextBuffer *textbuffer1; GtkWidget *MainWindow; GtkWidget *plugBox; GtkWidget *ShowSinceBootButton; @@ -184,7 +183,10 @@ GtkWidget *NewMessagesButton; GtkWidget *ShowKernelButton; GtkWidget *ShowPriorityButton; GtkWidget *UpdateButton; -GtkWidget *LoggingTextView; +GtkWidget *ShowAllBootsButton; +GtkWidget *ShowAllUnitsButton; +GtkWidget *ShowInitTreeButton; +GtkWidget *LoggingTerminal; GtkWidget *JournalActionsBox; int last_mode; char *journal_name; @@ -195,12 +197,26 @@ char *journal_paths; typedef struct { GtkWidget *Window; - GtkWidget *MainTree; - GtkWidget *ConfiguraButton; + GtkWidget *UserReadCheck; + GtkWidget *UserWriteCheck; + GtkWidget *UserExecuteCheck; + GtkWidget *GroupReadCheck; + GtkWidget *GroupWriteCheck; + GtkWidget *GroupExecuteCheck; + GtkWidget *PublicReadCheck; + GtkWidget *PublicWriteCheck; + GtkWidget *PublicExecuteCheck; + GtkWidget *FinalEntry; GtkWidget *CancelButton; GtkWidget *SaveButton; - GtkListStore *list; -} logrotate_tab_window; +} logrotate_rules_window; + +typedef struct { + GtkWidget *FileChooser; + GtkWidget *FileOrDirCheck; + GtkWidget *CancelButton; + GtkWidget *AcceptButton; +} logrotate_filechooser_window; typedef struct { GtkWidget *Window; @@ -212,6 +228,7 @@ typedef struct { GtkWidget *ConfigureButton; GtkWidget *CancelButton; GtkWidget *SaveButton; + GtkWidget *StatusBox; } logrotate_window; typedef struct { @@ -253,6 +270,8 @@ typedef struct { typedef struct { GtkWidget *MainWindow; + GtkWidget *StatusBox; + GtkWidget *CancelButton; GtkWidget *SaveButton; GtkWidget *LogNameEntry; @@ -313,6 +332,7 @@ typedef struct { GtkWidget *CommandBeforeEntry; GtkWidget *CommandAfterEntry; GtkWidget *EndworkCommandEntry; + char *paths; } logrotate_configure_window; main_window *setup_window(); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 4c834c2..1548a3f 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -1,5 +1,5 @@ #define VERSION_LABEL yon_char_unite(_("Version:")," ",version_application,"\n",NULL) -#define HELP_LABEL yon_char_unite(_("ubl-settings-loggign version:")," ", version_application,"\n",_("Logs and events"),"\n",_("Usage:"), " ubl-settings-loggign ",_("[OPTIONS]"),"\n",_("Options:"),"\n\t--help, -h\t\t\t",_("Show this help"),"\n\t--version, -V\t\t\t",_("Show package version"),"\n\t--lock-help\t\t\t",_("Lock this help menu"),"\n\t--lock-save\t\t\t",_("Lock configuration saving"),"\n\t--lock-save-local\t\t",_("Lock local configration saving"),"\n\t--lock-save-global\t\t",_("Lock global configration saving"),"\n\t--lock-load-global\t\t",_("Lock global configration loading"),"\n",NULL) +#define HELP_LABEL yon_char_unite(_("ubl-settings-loggign version:")," ", version_application,"\n",_("Logs and events"),"\n",_("Usage:"), " ubl-settings-logging ",_("[OPTIONS]"),"\n",_("Options:"),"\n\t--help, -h\t\t\t",_("Show this help"),"\n\t--version, -V\t\t\t",_("Show package version"),"\n\t--lock-help\t\t\t",_("Lock this help menu"),"\n\t--lock-save\t\t\t",_("Lock configuration saving"),"\n\t--lock-save-local\t\t",_("Lock local configration saving"),"\n\t--lock-save-global\t\t",_("Lock global configration saving"),"\n\t--lock-load-global\t\t",_("Lock global configration loading"),"\n\t--clear-config\t\t\t",_("Clear application configuration"),"\n",NULL) #define TITLE_LABEL _("Logs and events") #define TITLE_INFO_LABEL _("Logs and events configuration") @@ -53,15 +53,17 @@ #define STATUS_LABEL _("Status") #define SERVICE_LABEL _("Service") #define AUTOSTART_LABEL _("Autostart") +#define AUTOSTART_OFF_LABEL _("Switch autostart off") +#define AUTOSTART_ON_LABEL _("Switch autostart on") //ubl-settings-logging-inspector.glade #define TOOLTIP_BOOT_LABEL _("Show messages since the current system boot") #define TOOLTIP_FOLLOW_LABEL _("Follow for new messages") #define TOOLTIP_KERNEL_LABEL _("Show kernel ring buffer") #define TOOLTIP_PRIORITY_LABEL _("Show only priority error messages, critical messages and warnings") -// #define LABEL _("Cancel") -// #define LABEL _("Cancel") -// #define LABEL _("Cancel") +#define ALL_BOOTS_LABEL _("Show all boots") +#define ALL_UNITS_LABEL _("Show a list of all units, ordered by the time of their initialisation") +#define TREE_INIT_LABEL _("Show tree of time-critical initialization unit chain") #define UPDATE_LABEL _("Update") //ubl-settings-logging-journald.glade @@ -172,6 +174,7 @@ #define FRIDAY_LABEL _("Friday") #define SATURDAY_LABEL _("Saturday") #define SUNDAY_LABEL _("Sunday*") +#define REPEATED_PATHS_LABEL _("Same record already exists") //ubl-settings-logging-logrotate-table.glade #define SYSTEM_CONFIGURATION_LABEL _("System configuration") @@ -180,4 +183,5 @@ //ubl-settings-logging-add.glade #define ADD_PATHS_LABEL _("Path (-s):") #define CONTROL_LABEL _("Control:") -#define LOG_LABEL _("Log file") \ No newline at end of file +#define LOG_LABEL _("Log file") +#define NAME_LABEL _("Name:") \ No newline at end of file diff --git a/source/ubl-utils.c b/source/ubl-utils.c index 29373da..c7b87c4 100644 --- a/source/ubl-utils.c +++ b/source/ubl-utils.c @@ -607,12 +607,32 @@ char *yon_char_from_int(int int_to_convert) return ch; } +/**yon_char_from_float(int int_to_convert) + * [EN] + * converts float to char*. + * + * [RU] + * Конвертирует float в char* + */ +char *yon_char_from_float(float int_to_convert) +{ + int i = 1; + float convert_check = (float)int_to_convert; + for (i = 1; convert_check >= 10; i++) + { + convert_check = convert_check / 10; + } + char *ch = g_malloc0(i * sizeof(char) + 1); + sprintf(ch, "%f", int_to_convert); + return ch; +} + /**yon_char_from_long(int int_to_convert) * [EN] - * converts int to char*. + * converts long to char*. * * [RU] - * Конвертирует int в char* + * Конвертирует long в char* */ char *yon_char_from_long(long int_to_convert) { @@ -867,6 +887,23 @@ config_str yon_ubl_get_all_users(int *user_size){ // parsing functions +/** yon_size_convert_automatic(int bytes, int *size) + * [EN] + * + * [RU] + * +*/ +float yon_size_convert_automatic(int bytes, int *size){ + float byte_float=bytes; + for (*size=-1;byte_float>1024;*size=*size+1){ + byte_float=byte_float/1024; + } + if (*size==-1) { + *size=0; + byte_float=byte_float/1024; + } + return byte_float; +} apps *yon_apps_scan_and_parse_desktops(int *sizef) { @@ -1353,7 +1390,7 @@ int yon_config_force_save_registered(char *path){ if (dct->data&&strcmp(yon_dictionary_get_data(dct,char*),"")!=0){ if (((yon_config_parameter*)dct)->flag1==1||((yon_config_parameter*)dct)->flag1==0){ if (sections_add&&yon_dictionary_get(§ions_add,((yon_config_parameter*)dct)->section)) sections_add->data=(void*)yon_char_unite(yon_dictionary_get_data(sections_add,char*)," ",dct->key,"=",yon_dictionary_get_data(dct,char*),NULL); - else yon_dictionary_add_or_create_if_exists_with_data(sections_add,((yon_config_parameter*)dct)->section,yon_char_unite (ubconfig_save_command,path ? yon_char_append(" --target ",path):"", " set ", ((yon_config_parameter*)dct)->section, " ",dct->key,"=",yon_dictionary_get_data(dct,char*),NULL)); + else yon_dictionary_add_or_create_if_exists_with_data(sections_add,((yon_config_parameter*)dct)->section,yon_char_unite (ubconfig_save_command,path ? yon_char_append(" --target ",path):"", " set ", ((yon_config_parameter*)dct)->section, " ",dct->key,"=\"",yon_dictionary_get_data(dct,char*),"\"",NULL)); } else if (((yon_config_parameter*)dct)->flag1==-1){ if (sections_remove&&yon_dictionary_get(§ions_remove,((yon_config_parameter*)dct)->section)) sections_remove->data=(void*)yon_char_unite(yon_dictionary_get_data(sections_remove,char*)," ",dct->key,NULL); else yon_dictionary_add_or_create_if_exists_with_data(sections_remove,((yon_config_parameter*)dct)->section,yon_char_unite (ubconfig_save_command,path ? yon_char_append(" --target ",path):"", " remove ", ((yon_config_parameter*)dct)->section, " ",dct->key,NULL)); @@ -1595,7 +1632,7 @@ void yon_terminal_integrated_start(GtkWidget *terminal, char* command, void *end NULL, NULL, NULL); - vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal), 100); + vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal), -1); vte_terminal_set_scroll_on_output(VTE_TERMINAL(terminal), TRUE); vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(terminal), TRUE); gtk_widget_show_all(terminal); @@ -1823,6 +1860,12 @@ void yon_terminal_integrated_start(GtkWidget *terminal, char* command, void *end param->property = tracked_value; param->containing_type = val_type; yon_dictionary_add_or_create_if_exists_with_data(__yon_main_window_config.custom_parameters,param->parameter_name,param); + dictionary *dict=NULL; + if (__yon_main_window_config.deleted_parameters) + for_dictionaries(dict,__yon_main_window_config.deleted_parameters){ + if (strcmp(dict->key,param->parameter_name)) + yon_dictionary_rip(dict); + } } void yon_window_config_erase_custom_parameter(char *param_name, char *section){ @@ -1925,6 +1968,11 @@ int yon_gtk_combo_box_text_find(GtkWidget *combo_box, char *text_to_find){ } return -1; } +void yon_gtk_column_minimal_fixed_size_set(GtkTreeViewColumn *column){ + int width= gtk_tree_view_column_get_width(column); + gtk_tree_view_column_set_min_width(column,width); +} + /**yon_dictionary_gtk_pack_start_multiple_widgets(GtkBox *destination, gboolean expand, gboolean fill, int padding, ...) * [EN] * @@ -2034,6 +2082,86 @@ void yon_ubl_status_box_render(char *text, BACKGROUND_IMAGE_TYPE type){ _yon_ubl_status_box_render(text,type); } +void _yon_ubl_status_highlight_incorrect(GtkWidget *widget){ + gtk_style_context_add_class(gtk_widget_get_style_context(widget),"errorBox"); + sleep(5); + gtk_style_context_remove_class(gtk_widget_get_style_context(widget),"errorBox"); +} + +void yon_ubl_status_highlight_incorrect(GtkWidget *widget){ + GThread *thread = g_thread_new(NULL,(GThreadFunc)_yon_ubl_status_highlight_incorrect,widget); +} + +struct temp_statusbox { + int times; + GtkWidget *revealer; + }; + +void _yon_ubl_status_box_timed_remove(struct temp_statusbox *statusstruct){ + sleep(statusstruct->times); + if (statusstruct->revealer){ + gtk_revealer_set_reveal_child(GTK_REVEALER(statusstruct->revealer),0); + sleep(1); + gtk_widget_destroy(statusstruct->revealer); + + } + status_thread_busy=0; +} + +void yon_ubl_status_box_spawn(GtkContainer *container,char *display_text, int timeout,BACKGROUND_IMAGE_TYPE type){ + if (!status_thread_busy){ + GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5); + GtkWidget *revealer = gtk_revealer_new(); + GtkWidget *label = gtk_label_new(""); + GtkWidget *icon = gtk_image_new(); + gtk_container_add(GTK_CONTAINER(revealer),box); + gtk_box_pack_start(GTK_BOX(box),icon,0,0,5); + gtk_box_pack_start(GTK_BOX(box),label,0,0,5); + gtk_container_add(container,revealer); + + gtk_widget_show_all(revealer); + gtk_revealer_set_reveal_child(GTK_REVEALER(revealer),1); + + gtk_widget_set_margin_bottom(label,9); + gtk_widget_set_margin_top(label,9); + gtk_label_set_xalign(GTK_LABEL(label),0.0); + PangoAttrList *attributes = pango_attr_list_new(); + PangoAttribute *boldAttr = pango_attr_weight_new(PANGO_WEIGHT_BOLD); + pango_attr_list_insert(attributes, boldAttr); + gtk_label_set_attributes(GTK_LABEL(label),attributes); + + GdkRGBA textColor; + gdk_rgba_parse(&textColor, "#4d4d4d4d4d4d"); + PangoAttribute *colorAttr = pango_attr_foreground_new( + (int)(textColor.red * 65535), + (int)(textColor.green * 65535), + (int)(textColor.blue * 65535) + ); + pango_attr_list_insert(attributes, colorAttr); + + GtkIconTheme *ictheme = gtk_icon_theme_get_default(); + if (type == BACKGROUND_IMAGE_SUCCESS_TYPE||! type) + { + gtk_style_context_remove_class(gtk_widget_get_style_context(box), "boxInfoMessError"); + gtk_style_context_add_class(gtk_widget_get_style_context(box), "boxInfoMessOK"); + gtk_image_set_from_pixbuf(GTK_IMAGE(icon), gtk_icon_theme_load_icon_for_scale(ictheme, "com.ublinux.ubl-settings-logging.checked", 25, 1, GTK_ICON_LOOKUP_FORCE_SIZE, NULL)); + } + else if (type == BACKGROUND_IMAGE_FAIL_TYPE) + { + gtk_style_context_remove_class(gtk_widget_get_style_context(box), "boxInfoMessOK"); + gtk_style_context_add_class(gtk_widget_get_style_context(box), "boxInfoMessError"); + gtk_image_set_from_pixbuf(GTK_IMAGE(icon), gtk_icon_theme_load_icon_for_scale(ictheme, "com.ublinux.ubl-settings-logging.warning", 25, 1, GTK_ICON_LOOKUP_FORCE_SIZE, NULL)); + } + if (display_text) + gtk_label_set_text(GTK_LABEL(label),display_text); + struct temp_statusbox *statusstruct = malloc(sizeof(struct temp_statusbox)); + statusstruct->revealer = revealer; + statusstruct->times = timeout; + GThread *thread = g_thread_new("StatusThread",(GThreadFunc)_yon_ubl_status_box_timed_remove,statusstruct); + status_thread_busy=1; + } +} + /**yon_ubl_setup_sockets(GtkWidget *main_window, GtkWidget *left_window, GtkWidget *right_window, int socket_main_id, int socket_left_id, int socket_right_id) * [EN] * Set up plugs for using with GtkSockets insine ubl-settings-manager. diff --git a/source/ubl-utils.h b/source/ubl-utils.h index 0ed953b..d488149 100644 --- a/source/ubl-utils.h +++ b/source/ubl-utils.h @@ -14,6 +14,7 @@ #include #include #include +#include #include "../compile/ubl-cmake.h" #ifdef WEBKIT_FOUND @@ -141,6 +142,8 @@ char *yon_char_divide_search(char *source, char *dividepos, int delete_divider); char *yon_char_from_int(int int_to_convert); +char *yon_char_from_float(float int_to_convert); + char *yon_char_from_long(long int_to_convert); char *yon_char_replace(char *source, char *find, char*replace); @@ -173,6 +176,8 @@ config_str yon_ubl_get_all_users(int *user_size); // parsing functions +float yon_size_convert_automatic(int bytes, int *size); + config_str philos_list_user(int* size); apps *yon_apps_scan_and_parse_desktops(int *sizef); @@ -287,6 +292,8 @@ int yon_gtk_combo_box_fill(GtkWidget *combo, char **parameters,int size); int yon_gtk_combo_box_text_find(GtkWidget *combo_box, char *text_to_find); +void yon_gtk_column_minimal_fixed_size_set(GtkTreeViewColumn *column); + int yon_gtk_icon_view_hide_empty(dictionary *icon_view_segment); int yon_dictionary_gtk_pack_start_multiple_widgets(GtkBox *destination, gboolean expand, gboolean fill, int padding, ...); @@ -345,6 +352,11 @@ int yon_ubl_status_box_setup(GtkWidget *icon, GtkWidget *box, GtkWidget *label); */ void yon_ubl_status_box_render(char *text, BACKGROUND_IMAGE_TYPE type); +void yon_ubl_status_highlight_incorrect(GtkWidget *widget); + +static int status_thread_busy; +void yon_ubl_status_box_spawn(GtkContainer *container,char *display_text, int timeout,BACKGROUND_IMAGE_TYPE type); + #ifdef __cplusplus /**yon_ubl_header_setup(overlay, head, image, imag_path) diff --git a/ubl-settings-logging-add.glade b/ubl-settings-logging-add.glade index f7d8eec..27a9496 100644 --- a/ubl-settings-logging-add.glade +++ b/ubl-settings-logging-add.glade @@ -31,22 +31,22 @@ True False - document-save-symbolic + com.ublinux.ubl-settings-logging.sort-symbolic True False - document-save-symbolic + com.ublinux.ubl-settings-logging.sort-symbolic True False - document-save-symbolic + com.ublinux.ubl-settings-logging.sort-symbolic True False - document-save-symbolic + com.ublinux.ubl-settings-logging.sort-symbolic 450 @@ -149,6 +149,29 @@ 1 + + + True + False + Name: + + + False + True + 2 + + + + + True + True + + + False + True + 3 + + False @@ -162,6 +185,7 @@ True never in + 150 True diff --git a/ubl-settings-logging-filechooser.glade b/ubl-settings-logging-filechooser.glade new file mode 100644 index 0000000..28ddce1 --- /dev/null +++ b/ubl-settings-logging-filechooser.glade @@ -0,0 +1,124 @@ + + + + + + True + False + process-stop-symbolic + + + True + False + emblem-ok-symbolic + + + 800 + 600 + False + True + com.ublinux.ubl-settings-logging + dialog + True + True + + + False + vertical + 2 + + + False + end + + + Choose directory instead of file + True + True + False + True + + + True + True + 0 + + + + + Cancel + True + True + True + image1 + + + True + True + 1 + + + + + Accept + True + True + True + image2 + + + True + True + 2 + + + + + False + False + 0 + + + + + + + True + False + True + + + True + False + 5 + 5 + 5 + 5 + 2 + Logs and events + + + + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 32 + com.ublinux.ubl-settings-logging + + + + + + + diff --git a/ubl-settings-logging-inspector.glade b/ubl-settings-logging-inspector.glade index 33f25fa..f935238 100644 --- a/ubl-settings-logging-inspector.glade +++ b/ubl-settings-logging-inspector.glade @@ -2,6 +2,7 @@ + 100 @@ -13,47 +14,51 @@ 1 10 + + 100 + 1 + 10 + True False - system-shutdown-symbolic + com.ublinux.ubl-settings-logging.generic1-symbolic True False - document-open-recent-symbolic + com.ublinux.ubl-settings-logging.generic2-symbolic True False - emblem-system-symbolic + com.ublinux.ubl-settings-logging.generic3-symbolic True False - starred-symbolic + com.ublinux.ubl-settings-logging.generic4-symbolic True False - emblem-synchronizing-symbolic + com.ublinux.ubl-settings-logging.sync-symbolic True False - emblem-documents-symbolic + com.ublinux.ubl-settings-logging.generic6-symbolic True False - emblem-synchronizing-symbolic + com.ublinux.ubl-settings-logging.generic5-symbolic True False - emblem-shared-symbolic + com.ublinux.ubl-settings-logging.generic7-symbolic - 800 600 @@ -66,7 +71,6 @@ True False 5 - 5 5 5 vertical @@ -156,11 +160,11 @@ - + True True True - Show only priority error messages, critical messages and warnings + Show all boots image7 + False + vertical + 5 + + + True + True + True + image5 + + + + False + True + 0 + + + + + True + False + True + True + image4 + + + + False + True + 1 + + + + + True + False + True + True + image3 + + + + False + True + 2 + + False @@ -140,143 +163,186 @@ - + True True - True - image4 - + in + + + True + True + + + Log/Journal + + + + 0 + + + + + + + Path + + + + 1 + + + + + + + Description + + + + 2 + + + + + + - False + True True 1 - - - True - True - True - image3 - - - - False - True - 2 - - + + + + + True + False + System configuration - False - True - 0 + False - + True - True - in + False + 5 + 5 + 5 + 5 + 5 + 5 + 5 - + True - True - - - + False + vertical + 5 - - Log/Journal - - - - 0 - - + + True + False + True + True + image8 + + + False + True + 2 + + + + False + True + 0 + + + + + True + True + in - - Path + + True + True - - - 1 - + + Log/Journal + + + + 0 + + + - - - - - Description - - - 2 - + + Path + + + + 1 + + + + + True + True + 1 + - True - True 1 - - - - - True - False - System configuration + + + True + False + Applications configuration + + + 1 + False + + - False + True + True + 0 True False - 5 - 5 - 5 - 5 - 5 - 5 + end 5 + True - + + Cancel True - False - vertical - 5 - - - True - True - True - image8 - - - - False - True - 2 - - + True + True + image1 False @@ -285,69 +351,31 @@ - + + Save True True - in - - - True - True - - - - - - Log/Journal - - - - 0 - - - - - - - Path - - - - 1 - - - - - - + True + image2 - True + False True 1 + False + True 1 - - - True - False - Applications configuration - - - 1 - False - - True True - 0 + 1 diff --git a/ubl-settings-logging-logrotate.glade b/ubl-settings-logging-logrotate.glade index 637791d..2b13c77 100644 --- a/ubl-settings-logging-logrotate.glade +++ b/ubl-settings-logging-logrotate.glade @@ -4,65 +4,55 @@ - 1024 + 999999999 1 10 - 100 + 999999999 1 10 - 1024 + 999999999 1 10 - 100 + 999999999 1 10 - 100 + 999999999 1 10 - 100 + 999999999 1 10 - 100 + 999999999 1 10 - 100 + 999999999 1 10 - 100 + 999999999 1 10 - 100 + 999999999 1 10 - - True - False - process-stop-symbolic - - - True - False - emblem-ok-symbolic - True False @@ -88,86 +78,71 @@ False com.ublinux.ubl-settings-logging.increase-symbolic + + True + False + process-stop-symbolic + + + True + False + emblem-ok-symbolic + - + 800 600 False True com.ublinux.ubl-settings-logging - dialog - + + True False - 5 - 5 - 5 - 5 vertical - 5 - - + + + True False - end - - - Cancel - True - True - True - image1 - - - True - True - 0 - - + vertical - - Save - True - True - True - image2 - - - True - True - 1 - + False - False - 2 + True + 0 - + True - True - in + False + 5 + 5 + 5 + 5 + vertical + 5 - + True - False - 5 - 5 - 5 - 5 + True + in - + True False - vertical - 5 + 5 + 5 + 5 + 5 True @@ -178,13 +153,38 @@ True False + vertical 5 - + True False - Log/Journal: - 0 + 5 + + + True + False + Log/Journal: + 0 + + + False + True + 0 + + + + + True + False + True + + + True + True + 1 + + False @@ -193,94 +193,113 @@ - - True - False - True - - - True - True - 1 - - - - - False - True - 0 - - - - - True - False - 5 - - + True False - Description: - 0 + 5 + + + True + False + Description: + 0 + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + False True - 0 - - - - - True - False - True - - - True - True 1 - - - False - True - 1 - - - - - True - False - 0.019999999552965164 - in - + True False - 5 - 5 - 5 + 0.019999999552965164 + in - + True False - 5 + 5 + 5 + 5 True False - vertical 5 - + True - True - True - image3 - + False + vertical + 5 + + + True + True + True + image3 + + + + False + True + 0 + + + + + True + True + True + image7 + + + + False + True + 1 + + + + + True + True + True + image6 + + + + False + True + 2 + + False @@ -289,140 +308,147 @@ - - True - True - True - image7 - - - - False - True - 1 - - - - - True - True - True - image6 - - - - False - True - 2 - - - - - False - True - 0 - - - - - True - True - in - - + True True - liststore1 - False - - - + in - - Path + + True + True + liststore1 + False - - - 0 - + + Path + + + + 0 + + + + + True + True + 1 + - - True - True - 1 - + + + True + False + Paths to log and journals files + + - - - - True - False - Paths to log and journals files - + + False + True + 2 + False True - 2 + 0 - - - False - True - 0 - - - - - True - False - vertical - 5 - + True False - 0.019999999552965164 - in + vertical + 5 - + True False - 5 - 5 - 5 + 0.019999999552965164 + in - + True False - vertical - 5 + 5 + 5 + 5 True False + vertical 5 - - Rotation period: + True - True - False - True + False + 5 + + + Rotation period: + True + True + False + True + + + False + True + 0 + + + + + True + False + False + 0 + + Hourly + Daily + Weekly* + Monthly + Yearly + + + + False + True + 1 + + + + + True + False + False + 0 + + Monday + Tuesday + Wednesday + Thursday + Friday + Saturday + Sunday* + + + + False + True + 2 + + False @@ -431,18 +457,55 @@ - + True - False False - 0 - - Hourly - Daily - Weekly* - Monthly - Yearly - + 5 + + + Maximum size of file: + True + True + False + True + + + False + True + 0 + + + + + True + False + True + adjustment4 + + + False + True + 1 + + + + + True + False + False + 0 + + Kb + Mb + Gb + + + + False + True + 2 + + False @@ -450,47 +513,131 @@ 1 - - - True - False - False - 0 - - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday - Sunday* - - - - False - True - 2 - - - - False - True - 0 - + + + + + True + False + Checking frequency configuration + + + + + False + True + 0 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 True False + vertical 5 - - Maximum size of file: + True - True - False - True + False + 5 + + + File amount: + True + True + False + True + + + False + True + 0 + + + + + True + False + True + adjustment6 + + + False + True + 1 + + + + + True + False + Store at: + + + False + True + 2 + + + + + True + False + False + 0 + + Default + Same directory + Separate directory + + + + False + True + 3 + + + + + True + False + True + + + False + True + 4 + + + + + True + False + True + True + image4 + + + False + True + 5 + + False @@ -499,92 +646,142 @@ - - True - False - True - adjustment4 - - - False - True - 1 - - - - + True - False False - 0 - - Kb - Mb - Gb - + 5 + + + True + False + Rotation as user: + + + False + True + 0 + + + + + True + False + 0 + + root* + + + + False + True + 1 + + + + + True + False + Rotation as group: + + + False + True + 2 + + + + + True + False + 0 + + root* + + + + False + True + 3 + + False True - 2 + 1 - - False - True - 1 - + + + True + False + Rotation configuration + + + + False + True + 1 + - - - True - False - Checking frequency configuration - - - - - False - True - 0 - - - - - True - False - 0.019999999552965164 - in - + True False - 5 - 5 - 5 + 0.019999999552965164 + in - + True False - vertical - 5 + 5 + 5 + 5 True False + vertical 5 - - File amount: + True - True - False - True + False + 5 + + + True + False + Error processing: + + + False + True + 0 + + + + + True + False + 0 + + Default + Output errors if log file does not exist* + Do not output errors if log file does not exist + + + + False + True + 1 + + False @@ -593,11 +790,39 @@ - + True - False - True - adjustment6 + False + 5 + + + True + False + Rotation of jurnal even when it is empty: + + + False + True + 0 + + + + + True + False + 0 + + Default + On + Off + + + + False + True + 1 + + False @@ -606,10 +831,49 @@ - + True False - Store at: + 5 + + + Do not rotate journal younger than + True + True + False + True + + + False + True + 0 + + + + + True + False + True + adjustment7 + + + False + True + 1 + + + + + True + False + days + + + False + True + 2 + + False @@ -618,16 +882,49 @@ - + True - False False - 0 - - Default - Same directory - Separate directory - + 5 + + + Delete rotated journals older than + True + True + False + True + + + False + True + 0 + + + + + True + False + True + adjustment5 + + + False + True + 1 + + + + + True + False + days + + + False + True + 2 + + False @@ -636,10 +933,68 @@ - + True - False - True + False + 5 + + + Rotate journals if size more than + True + True + False + True + + + False + True + 0 + + + + + True + False + True + adjustment8 + + + False + True + 1 + + + + + True + False + False + 0 + + Kb + Mb + Gb + + + + False + True + 2 + + + + + True + False + but not earlier than the specified time interval + True + + + False + True + 3 + + False @@ -648,12 +1003,68 @@ - + True - False - True - True - image4 + False + 5 + + + Rotate journals if size more than + True + True + False + True + + + False + True + 0 + + + + + True + False + True + adjustment9 + + + False + True + 1 + + + + + True + False + False + 0 + + Kb + Mb + Gb + + + + False + True + 2 + + + + + True + False + before specified time interval + True + + + False + True + 3 + + False @@ -662,22 +1073,171 @@ - - False - True - 0 - + + + + + True + False + File choosing configuration + + + + + False + True + 2 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 True False + vertical 5 - + True False - Rotation as user: + 5 + + + True + False + Create log + + + False + True + 0 + + + + + True + False + 0 + + Default + Do not output + Output errors + Off + + + + False + True + 1 + + + + + True + False + as user: + + + False + True + 2 + + + + + True + False + False + 0 + + Default + + + + False + True + 3 + + + + + True + False + as group: + + + False + True + 4 + + + + + True + False + False + 0 + + Default + + + + False + True + 5 + + + + + True + False + rules: + + + False + True + 6 + + + + + True + False + True + + + False + True + 7 + + + + + True + False + True + True + image5 + + + False + True + 8 + + False @@ -686,13 +1246,24 @@ - + True False - 0 - - root* - + 5 + + + Cut source journal fileafter copy creating instead of moving old journal file and creating new one + True + True + False + True + + + False + True + 0 + + False @@ -700,87 +1271,107 @@ 1 - - - True - False - Rotation as group: - - - False - True - 2 - - - - - True - False - 0 - - root* - - - - False - True - 3 - - - - False - True - 1 - + + + True + False + Files and directories configuration + + + + False + True + 3 + - - - True - False - Rotation configuration - - - - - False - True - 1 - - - - - True - False - 0.019999999552965164 - in - + True False - 5 - 5 - 5 + 0.019999999552965164 + in - + True False - vertical - 5 + 5 + 5 + 5 True False + vertical 5 - + True False - Error processing: + 5 + + + True + False + Use compression: + + + False + True + 0 + + + + + True + False + 0 + + Default + On + Off + + + + False + True + 1 + + + + + True + False + Delay compression by one journal in queue: + + + False + True + 2 + + + + + True + False + False + 0 + + Default + Yes + No + + + + False + True + 3 + + False @@ -788,40 +1379,89 @@ 0 - - - True - False - 0 - - Default - Output errors if log file does not exist* - Do not output errors if log file does not exist - - - - False - True - 1 - - - - False - True - 0 - + + + + + True + False + Compression configuration + + + + + False + True + 4 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 True False + vertical 5 - + True False - Rotation of jurnal even when it is empty: + 5 + + + True + False + Save original log file after rotation if it has specified extension: + + + False + True + 0 + + + + + True + False + 0 + + Default + On + Off + + + + False + True + 1 + + + + + True + False + True + + + False + True + 2 + + False @@ -830,15 +1470,39 @@ - + True False - 0 - - Default - On - Off - + 5 + + + True + False + Add date of rotation before log header + + + False + True + 0 + + + + + True + False + 0 + + Default + On + Off + + + + False + True + 1 + + False @@ -846,72 +1510,232 @@ 1 - - - False - True - 1 - - - - - True - False - 5 - - - Do not rotate journal younger than - True - True - False - True - - - False - True - 0 - - - + True - False - True - adjustment7 + False + 5 + + + True + False + Number from which numbering of old logs will begin + + + False + True + 0 + + + + + True + False + 0 + + Default + On + Off + + + + False + True + 1 + + + + + True + False + True + adjustment10 + + + False + True + 2 + + False True - 1 + 2 + + + + + + + True + False + Filename configuration + + + + + False + True + 5 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 + + + True + False + vertical + 5 - + True False - days + 5 + + + True + False + Email after rotation: + + + False + True + 0 + + + + + True + False + 0 + + Default + Send Email + Don't send Email + + + + False + True + 1 + + + + + True + False + adress: + + + False + True + 2 + + + + + True + False + True + + + False + True + 3 + + + + + True + False + contents: + + + False + True + 4 + + + + + True + False + False + 0 + + Default + First rotated copy + Last rotated copy + + + + False + True + 5 + + False True - 2 + 0 - - False - True - 2 - + + + + + True + False + Message configuration + + + + + False + True + 6 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 True False + vertical 5 - - Delete rotated journals older than + + Scenarios are running for each rotated journal True True False @@ -924,11 +1748,34 @@ - + True - False - True - adjustment5 + False + 5 + + + True + False + Command before rotation (one time): + 0 + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + False @@ -937,10 +1784,34 @@ - + True False - days + 5 + + + True + False + Command after rotation (one time): + 0 + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + False @@ -948,169 +1819,171 @@ 2 - - - False - True - 3 - - - - - True - False - 5 - - Rotate journals if size more than + True - True - False - True + False + 5 + + + True + False + Command before rotation: + 0 + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + False True - 0 + 3 - + True - False - True - adjustment8 + False + 5 + + + True + False + Command after rotation: + 0 + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + False True - 1 + 4 - + True - False False - 0 - - Kb - Mb - Gb - + 5 + + + True + False + Endwork command: + 0 + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + False True - 2 - - - - - True - False - but not earlier than the specified time interval - True - - - False - True - 3 - - - - - False - True - 4 - - - - - True - False - 5 - - - Rotate journals if size more than - True - True - False - True - - - False - True - 0 - - - - - True - False - True - adjustment9 - - - False - True - 1 - - - - - True - False - False - 0 - - Kb - Mb - Gb - - - - False - True - 2 - - - - - True - False - before specified time interval - True - - - False - True - 3 + 5 - - False - True - 5 - + + + True + False + Scenarios + + + + False + True + 7 + - - - True + + False - File choosing configuration + 5 + + + True + False + Manual input: + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + False + True + 8 + False True - 2 + 1 @@ -1130,137 +2003,12 @@ True False - vertical 5 - + True False - 5 - - - True - False - Create log - - - False - True - 0 - - - - - True - False - 0 - - Default - Do not output - Output errors - Off - - - - False - True - 1 - - - - - True - False - as user: - - - False - True - 2 - - - - - True - False - False - 0 - - Default - - - - False - True - 3 - - - - - True - False - as group: - - - False - True - 4 - - - - - True - False - False - 0 - - Default - - - - False - True - 5 - - - - - True - False - rules: - - - False - True - 6 - - - - - True - False - True - - - False - True - 7 - - - - - True - False - True - True - image5 - - - False - True - 8 - - + Log (-s) size: False @@ -1269,27 +2017,13 @@ - + True False - 5 - - - Cut source journal fileafter copy creating instead of moving old journal file and creating new one - True - True - False - True - - - False - True - 0 - - + loglize - False + True True 1 @@ -1302,775 +2036,68 @@ True False - Files and directories configuration + Statistics False True - 3 + 2 - - - True - False - 0.019999999552965164 - in - - - True - False - 5 - 5 - 5 - - - True - False - vertical - 5 - - - True - False - 5 - - - True - False - Use compression: - - - False - True - 0 - - - - - True - False - 0 - - Default - On - Off - - - - False - True - 1 - - - - - True - False - Delay compression by one journal in queue: - - - False - True - 2 - - - - - True - False - False - 0 - - Default - Yes - No - - - - False - True - 3 - - - - - False - True - 0 - - - - - - - - - True - False - Compression configuration - - - - - False - True - 4 - - - - - True - False - 0.019999999552965164 - in - - - True - False - 5 - 5 - 5 - - - True - False - vertical - 5 - - - True - False - 5 - - - True - False - Save original log file after rotation if it has specified extension: - - - False - True - 0 - - - - - True - False - 0 - - Default - On - Off - - - - False - True - 1 - - - - - True - False - True - - - False - True - 2 - - - - - False - True - 0 - - - - - True - False - 5 - - - True - False - Add date of rotation before log header - - - False - True - 0 - - - - - True - False - 0 - - Default - On - Off - - - - False - True - 1 - - - - - False - True - 1 - - - - - True - False - 5 - - - True - False - Number from which numbering of old logs will begin - - - False - True - 0 - - - - - True - False - 0 - - Default - On - Off - - - - False - True - 1 - - - - - True - True - adjustment10 - - - False - True - 2 - - - - - False - True - 2 - - - - - - - - - True - False - Filename configuration - - - - - False - True - 5 - - - - - True - False - 0.019999999552965164 - in - - - True - False - 5 - 5 - 5 - - - True - False - vertical - 5 - - - True - False - 5 - - - True - False - Email after rotation: - - - False - True - 0 - - - - - True - False - 0 - - Default - Send Email - Don't send Email - - - - False - True - 1 - - - - - True - False - adress: - - - False - True - 2 - - - - - True - False - True - - - False - True - 3 - - - - - True - False - contents: - - - False - True - 4 - - - - - True - False - False - 0 - - Default - First rotated copy - Last rotated copy - - - - False - True - 5 - - - - - False - True - 0 - - - - - - - - - True - False - Message configuration - - - - - False - True - 6 - - - - - True - False - 0.019999999552965164 - in - - - True - False - 5 - 5 - 5 - - - True - False - vertical - 5 - - - Scenarios are running for each rotated journal - True - True - False - True - - - False - True - 0 - - - - - True - False - 5 - - - True - False - Command before rotation (one time): - 0 - - - False - True - 0 - - - - - True - True - - - True - True - 1 - - - - - False - True - 1 - - - - - True - False - 5 - - - True - False - Command after rotation (one time): - 0 - - - False - True - 0 - - - - - True - True - - - True - True - 1 - - - - - False - True - 2 - - - - - True - False - 5 - - - True - False - Command before rotation: - 0 - - - False - True - 0 - - - - - True - True - - - True - True - 1 - - - - - False - True - 3 - - - - - True - False - 5 - - - True - False - Command after rotation: - 0 - - - False - True - 0 - - - - - True - True - - - True - True - 1 - - - - - False - True - 4 - - - - - True - False - 5 - - - True - False - Endwork command: - 0 - - - False - True - 0 - - - - - True - True - - - True - True - 1 - - - - - False - True - 5 - - - - - - - - - True - False - Scenarios - - - - - False - True - 7 - - - - - False - 5 - - - True - False - Manual input: - - - False - True - 0 - - - - - True - True - - - True - True - 1 - - - - - False - True - 8 - - - - - False - True - 1 - - - - - True - False - 0.019999999552965164 - in - - - True - False - 5 - 5 - 5 - - - True - False - 5 - - - True - False - Log (-s) size: - - - False - True - 0 - - - - - True - False - loglize - - - True - True - 1 - - - - - - - - - True - False - Statistics - - - - False - True - 2 - + + True + True + 1 + + + + + True + False + end + 5 + + + Save + True + True + True + image9 + + + True + True + end + 0 + + + + + Cancel + True + True + True + image8 + + + True + True + 1 + + + + + False + True + 2 + diff --git a/ubl-settings-logging-rules.glade b/ubl-settings-logging-rules.glade index c3fd858..3b1f097 100644 --- a/ubl-settings-logging-rules.glade +++ b/ubl-settings-logging-rules.glade @@ -12,266 +12,137 @@ False emblem-ok-symbolic - + False - 550 - 450 + True com.ublinux.ubl-settings-logging - - - True + dialog + + False - 5 - 5 - 5 - 5 vertical - 5 - - - True + 2 + + False - 0.019999999552965164 - in + end - + + Cancel True - False - 5 - 5 - 5 - - - True - False - 5 - - - Read - True - True - False - True - - - False - True - 0 - - - - - Write - True - True - False - True - - - False - True - 1 - - - - - Execute - True - True - False - True - - - False - True - 2 - - - - + True + True + image1 + + False + True + 0 + - - + + + Accept True - False - Owner rules + True + True + image2 + + False + True + 1 + False - True + False 0 - + True False - 0.019999999552965164 - in + 5 + 5 + 5 + 5 + vertical + 5 - + True False - 5 - 5 - 5 + 0.019999999552965164 + in - + True False - 5 + 5 + 5 + 5 - - Read + True - True - False - True + False + 5 + + + Read + True + True + False + True + + + False + True + 0 + + + + + Write + True + True + False + True + + + False + True + 1 + + + + + Execute + True + True + False + True + + + False + True + 2 + + - - False - True - 0 - - - - - Write - True - True - False - True - - - False - True - 1 - - - - - Execute - True - True - False - True - - - False - True - 2 - - - - - - True - False - Group rules - - - - - False - True - 1 - - - - - True - False - 0.019999999552965164 - in - - - True - False - 5 - 5 - 5 - - + + True False - 5 - - - Read - True - True - False - True - - - False - True - 0 - - - - - Write - True - True - False - True - - - False - True - 1 - - - - - Execute - True - True - False - True - - - False - True - 2 - - + Owner rules - - - - True - False - Public rules - - - - - False - True - 2 - - - - - True - False - 5 - - - True - False - Value: - False True @@ -279,9 +150,76 @@ - + True False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 + + + True + False + 5 + + + Read + True + True + False + True + + + False + True + 0 + + + + + Write + True + True + False + True + + + False + True + 1 + + + + + Execute + True + True + False + True + + + False + True + 2 + + + + + + + + + True + False + Group rules + + False @@ -289,53 +227,127 @@ 1 - - - False - True - 3 - - - - - True - False - end - 5 - - Cancel + True - True - True - image1 + False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 + + + True + False + 5 + + + Read + True + True + False + True + + + False + True + 0 + + + + + Write + True + True + False + True + + + False + True + 1 + + + + + Execute + True + True + False + True + + + False + True + 2 + + + + + + + + + True + False + Public rules + + False True - 0 + 2 - - Accept + True - True - True - image2 + False + 5 + + + True + False + Value: + + + False + True + 0 + + + + + True + False + 3 + 3 + digits + + + True + True + 1 + + False True - 1 + 3 False True - end - 4 + 1 diff --git a/ubl-settings-logging.css b/ubl-settings-logging.css index 88e8c57..2f1e822 100644 --- a/ubl-settings-logging.css +++ b/ubl-settings-logging.css @@ -111,4 +111,12 @@ background:transparent; .boxInfoMessOK{ background-color: #f3f0ac; +} +.instant { + transition: 0ms; +} +.errorBox { + border-width: 2px; + border-color: #ea9999; + border-style:solid; } \ No newline at end of file diff --git a/ubl-settings-logging.glade b/ubl-settings-logging.glade index 3f720ec..f254aa1 100644 --- a/ubl-settings-logging.glade +++ b/ubl-settings-logging.glade @@ -207,6 +207,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + + + + + + + + + @@ -217,7 +227,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. True False - document-edit-symbolic + com.ublinux.ubl-settings-logging.settings-symbolic True @@ -227,22 +237,22 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. True False - user-trash-symbolic + com.ublinux.ubl-settings-logging.trash-symbolic True False - com.ublinux.ubl-settings-logging.stop-symbolic + com.ublinux.ubl-settings-logging.play-symbolic True False - com.ublinux.ubl-settings-logging.play-symbolic + com.ublinux.ubl-settings-logging.check-symbolic True False - document-edit-symbolic + com.ublinux.ubl-settings-logging.settings-symbolic True @@ -453,27 +463,18 @@ translated and supported by community. - - - - - - - - - + + + journald /var/log/journal/ - System events journal - 0 + System event log + False 0 - 0 - 0 - 0 @@ -682,6 +683,7 @@ translated and supported by community. True + False True True Inspect log @@ -699,6 +701,7 @@ translated and supported by community. True + False True True Configure log @@ -716,6 +719,7 @@ translated and supported by community. True + False True True Add log @@ -733,6 +737,7 @@ translated and supported by community. True + False True True Remove log @@ -772,7 +777,7 @@ translated and supported by community. True fixed - 30 + 50 Log/Journal @@ -789,7 +794,8 @@ translated and supported by community. True fixed - 30 + 130 + 50 Path @@ -806,7 +812,7 @@ translated and supported by community. True fixed - 30 + 50 Description @@ -856,8 +862,9 @@ translated and supported by community. vertical 5 - + True + False True True Stop service @@ -873,11 +880,12 @@ translated and supported by community. - + True + False True True - Start service + Switch autostart off image6