Merge pull request 'master' (#62) from YanTheKaller/ubl-settings-logging:master into master

Reviewed-on: #62
pull/139/head
Dmitry Razumov 2 years ago
commit 2c797d7998

@ -139,6 +139,7 @@ install: check uninstall
@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}.funnel-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"
@ -150,6 +151,7 @@ install: check uninstall
@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"
@install -Dm644 -t "${DESTDIR}/usr/share/polkit-1/actions/" "com.ublinux.${PKGNAME}.auth.policy"
@if [ -z ${DESTDIR} ]; then \
[ -d "${DESTDIR}/usr/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}/usr/share/icons/hicolor/" &>/dev/null || true; \
update-desktop-database --quiet &>/dev/null || true; \

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<vendor>UBLinux</vendor>
<vendor_url>https://ublinux.ru</vendor_url>
<action id="com.ublinux.ubl-settings-logging">
<description>Run ubl-settings-logging as root</description>
<description xml:lang="ru">Запуск утилиты ubl-settings-logging с правами root</description>
<message>Authentication is required to run ubl-settings-logging</message>
<message xml:lang="ru">Требуется авторизация для запуска утилиты ubl-settings-logging с правами root</message>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/pkexec</annotate>
</action>
</policyconfig>

@ -10,6 +10,7 @@
<file>ubl-settings-logging-rules.glade</file>
<file>ubl-settings-logging-filechooser.glade</file>
<file>ubl-settings-logging-logrotate-table.glade</file>
<file>ubl-settings-logging-terminal.glade</file>
</gresource>
<gresource prefix="/com/ublinux/css">
<file>ubl-settings-logging.css</file>

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
version="1.1"
id="svg1359"
width="256"
height="256"
viewBox="0 0 256 256"
sodipodi:docname="funnel.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1363" />
<sodipodi:namedview
id="namedview1361"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="1.5333252"
inkscape:cx="133.37027"
inkscape:cy="231.84906"
inkscape:window-width="1920"
inkscape:window-height="1027"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="g1365" />
<g
inkscape:groupmode="layer"
inkscape:label="Image"
id="g1365">
<path
style="fill:#313131;stroke-width:0.499256;fill-opacity:1"
d="m 104.65705,237.70905 c -0.62183,-0.24981 -1.35199,-1.03652 -1.62259,-1.74825 -0.31065,-0.81708 -0.49199,-18.8221 -0.49199,-48.8496 V 139.55564 L 63.364841,95.35613 24.187217,51.156622 18.806245,50.863604 C 12.784621,50.535703 10.172614,49.782271 6.8934643,47.427365 -3.1207996,40.235664 -1.3333195,24.490308 10.106237,19.127045 l 2.819779,-1.322011 H 128.00452 243.08303 l 2.81978,1.322011 c 3.59114,1.683651 6.65629,4.748951 8.33921,8.33961 1.8728,3.995783 1.8839,9.615451 0.0268,13.553783 -3.22543,6.840051 -9.19011,9.973686 -19.00052,9.982229 l -3.32143,0.0029 -39.24013,44.276883 -39.24012,44.27689 -0.011,35.72889 c -0.0103,33.46974 -0.0684,35.85515 -0.9194,37.72591 -0.49963,1.09836 -1.22486,2.25007 -1.61161,2.55936 -1.04329,0.83431 -44.14983,22.65836 -44.68151,22.62142 -0.25051,-0.0174 -0.96424,-0.23604 -1.58606,-0.48586 z"
id="path1444" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -1,5 +1,5 @@
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
logrotate;System event log rotation service;systemctl start logrotate.timer;systemctl stop logrotate.timer 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
1 Service_Name Service_Description command_start command_stop command_enable command_disable command_status
2 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
3 logrotate System event log rotation service systemctl start logrotate.timer systemctl stop logrotate.timer,systemctl stop logrotate.service systemctl stop logrotate.timer logrotate.service ubconfig set config SERVICESNOSTART-=,logrotate.timer ubconfig set config SERVICESNOSTART+=,logrotate.timer systemctl status logrotate.service
4 #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
5 #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

@ -13,6 +13,11 @@ include_directories(${VTE291_INCLUDE_DIRS})
link_directories(${VTE291_LIBRARY_DIRS})
add_definitions(${VTE291_CFLAGS_OTHER})
pkg_check_modules(POLKIT REQUIRED polkit-agent-1)
include_directories(${POLKIT_INCLUDE_DIRS})
link_directories(${POLKIT_LIBRARY_DIRS})
add_definitions(${POLKIT_CFLAGS_OTHER})
find_library(WEBKIT_LIBRARIES_FOUND webkit2gtk-4.0 webkit2gtk-web-extension-4.0)
option(WEBKIT_FOUND "No" OFF)
@ -44,6 +49,7 @@ set(DEPENDFILES
../ubl-settings-logging-logrotate.glade
../ubl-settings-logging-logrotate-table.glade
../ubl-settings-logging-filechooser.glade
../ubl-settings-logging-terminal.glade
../gresource.xml
../ubl-settings-logging-banner.png
../ubl-settings-logging.css
@ -90,6 +96,7 @@ set(LIBRARIES
${GTK_LIBRARIES}
${WEBKIT_LIBRARIES}
${VTE291_LIBRARIES}
${POLKIT_LIBRARIES}
pthread)

@ -10,7 +10,9 @@ config main_config;
* [RU]
* Закрывает окно, в котором расположен виджет [self].
*/
void on_close_subwindow(GtkWidget *self){
void on_close_subwindow(GtkWidget *self, char *window){
if(window)
yon_window_config_custom_window_set(GTK_WINDOW(gtk_widget_get_toplevel(self)),window);
gtk_widget_destroy(gtk_widget_get_toplevel(self));
}
@ -125,25 +127,59 @@ int yon_size_get_int_from_letter(char size){
//functions
void yon_polkit_authorized_action(GCallback *func){
}
void yon_logs_custom_save(main_window *widgets){
GtkTreeIter iter;
char *name;
char *description;
char *paths;
int standard;
int standard_paths;
int size=0;
int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(widgets->list),&iter);
char *final_strings=NULL;
for (;valid;valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(widgets->list),&iter)){
gtk_tree_model_get(GTK_TREE_MODEL(widgets->list),&iter,0,&name,1,&paths,2,&description,3,&standard,4,&standard_paths,-1);
if (paths){
if (standard!=1){
for (int i=0;i<standard_paths;i++)
free(yon_char_divide_search(paths,",",-1));
paths = yon_char_replace(paths,"\n",",");
final_strings = yon_char_unite(final_strings?yon_char_append(final_strings,"\n"):"",name?name:"",";",paths?paths:"",";",description?description:"",NULL);
}
}
free(paths);
}
FILE *fl = fopen(custom_logs_saving_file_path,"w");
if (final_strings)
fputs(final_strings,fl);
fclose(fl);
}
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;
char *name;
for (int i=0;i<size;i++){
char *paths = yon_char_divide_search(loaded[i],"=",-1);
yon_char_divide(paths,strlen("LOGROTATE"));
yon_char_divide_search_self(paths,"]",-1);
yon_window_config_get_parameter("description",paths,&desc,YON_TYPE_STRING);
yon_window_config_get_parameter("render_name",paths,&name,YON_TYPE_STRING);
paths = yon_char_replace(paths,",","\n");
gtk_list_store_append(main_config.logrotate_list,&iter);
gtk_list_store_set(main_config.logrotate_list,&iter,1,paths,2,desc ? desc : "",-1);
gtk_list_store_set(main_config.logrotate_list,&iter,0,name,1,paths,2,desc ? desc : "",-1);
}
}
int yon_load_proceed(YON_CONFIG_TYPE type){
if (yon_config_load_register(type,"logging",LOGROTATE("*"),JOURNALD("*"),NULL)){
if (yon_config_load_register(type,"logging",LOGROTATE("*"),"logging",JOURNALD("*"),NULL)){
update_loaded_logrotate();
return 1;
}
@ -200,71 +236,161 @@ void on_save_local(){
// Inspector functions
void on_inspector_update(GtkWidget *self, inspector_window *window){
int size;
GtkTextIter titer,titerend;
config_str output;
if (!strcmp(window->journal_name,"journald")){
if (self==window->UpdateButton){
void on_inspector_jornald_read_async(inspector_window *window){
FILE *fl;
switch(window->last_mode){
case 0:
yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_command,NULL,NULL);
fl = popen(get_journal_output_command,"r");
break;
case 1:
yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_since_boot_command,NULL,NULL);
fl = popen(get_journal_output_since_boot_command,"r");
break;
case 2:
yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_followed_command,NULL,NULL);
fl = popen(get_journal_output_followed_command,"r");
break;
case 3:
yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_kernel_command,NULL,NULL);
fl = popen(get_journal_output_kernel_command,"r");
break;
case 4:
yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_prioritied_command,NULL,NULL);
fl = popen(get_journal_output_prioritied_command,"r");
break;
case 5:
yon_terminal_integrated_start(window->LoggingTerminal, get_journal_all_boots_command,NULL,NULL);
fl = popen(get_journal_all_boots_command,"r");
break;
case 6:
yon_terminal_integrated_start(window->LoggingTerminal, get_journal_all_units_command,NULL,NULL);
fl = popen(get_journal_all_units_command,"r");
break;
case 7:
yon_terminal_integrated_start(window->LoggingTerminal, get_journal_init_tree_command,NULL,NULL);
fl = popen(get_journal_init_tree_command,"r");
break;
}
char *output = g_malloc0(sizeof(char)*4096);
GtkTreeIter iter;
main_config.remove_thread=0;
fd_set fds;
struct timeval tv;
int fd = fileno(fl);
while (main_config.remove_thread==0){
FD_ZERO(&fds);
FD_SET(fd, &fds);
tv.tv_sec = 1;
tv.tv_usec = 0;
if(select(fd + 1, &fds, NULL, NULL, &tv)){
output = fgets(output,4092,fl);
if((output)){
if(strcmp(output,"")){
gtk_list_store_append(window->list, &iter);
char *identifier="";
char *temp = yon_char_new(output);
char *log=temp;
if (strstr(log,"\033[H\033[2J\033[3"))
yon_char_divide(log,strlen("\033[H\033[2J\033[3"));
log = yon_char_divide_search(log,"\n",-1);
if (window->last_mode<5){
identifier = log;
log=strstr(log,":")+1;
log=strstr(log,":")+1;
log=strstr(log,":")+1;
char *iden = yon_char_new(identifier);
identifier=yon_char_divide(iden,strlen(identifier)-strlen(log)-1);
free(iden);
}
gtk_list_store_set(window->list,&iter,0,identifier,1,log,-1);
free(temp);
}
}
}
}
main_config.inspector_thread=0;
pclose(fl);
}
void on_inspector_update(GtkWidget *self, inspector_window *window){
int size;
GtkTextIter titer,titerend;
config_str output;
if (!strcmp(window->journal_name,"journald")){
GtkWidget *terminal = (GtkWidget*)window->terminals->first->data;
gtk_widget_hide(window->LoggingNotebook);
gtk_widget_show(gtk_widget_get_parent(window->JournaldTree));
if (self==window->ShowSinceBootButton){
window->last_mode=1;
yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_since_boot_command,NULL,NULL);
}
if (self==window->NewMessagesButton){
else if (self==window->NewMessagesButton){
window->last_mode=2;
yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_followed_command,NULL,NULL);
}
if (self==window->ShowKernelButton){
else if (self==window->ShowKernelButton){
window->last_mode=3;
yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_kernel_command,NULL,NULL);
}
if (self==window->ShowPriorityButton){
else if (self==window->ShowPriorityButton){
window->last_mode=4;
yon_terminal_integrated_start(window->LoggingTerminal, get_journal_output_prioritied_command,NULL,NULL);
}
if (self==window->ShowAllBootsButton){
else 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){
else 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){
else if (self==window->ShowInitTreeButton){
window->last_mode=7;
yon_terminal_integrated_start(window->LoggingTerminal, get_journal_init_tree_command,NULL,NULL);
}
main_config.remove_thread=0;
gtk_tree_view_set_model(GTK_TREE_VIEW(window->JournaldTree),GTK_TREE_MODEL(window->list));
gtk_list_store_clear(window->list);
gtk_tree_view_set_model(GTK_TREE_VIEW(window->JournaldTree),GTK_TREE_MODEL(window->list));
if (main_config.inspector_thread){
main_config.remove_thread=1;
pthread_join(main_config.inspector_thread,NULL);
}
pthread_create(&main_config.inspector_thread, NULL, (void *)on_inspector_jornald_read_async, window);
} else {
if (window->terminals){
gtk_widget_hide(gtk_widget_get_parent(window->JournaldTree));
gtk_widget_show(window->LoggingNotebook);
dictionary *dict=NULL;
for_dictionaries (dict,window->terminals){
GtkWidget *terminal = (GtkWidget*)dict->data;
yon_terminal_integrated_start(terminal,yon_char_unite("cat ",dict->key,NULL),NULL,NULL);
}
}
}
}
GtkWidget *yon_inspector_add_terminal(inspector_window *window,char *page_name,int mode){
GtkBuilder *builder = gtk_builder_new_from_resource(glade_terminal_path);
GtkWidget *box = yon_gtk_builder_get_widget(builder,"TerminalBox");
GtkWidget *terminal = yon_gtk_builder_get_widget(builder,"LoggingTerminal");
GtkWidget *unfound_label = yon_gtk_builder_get_widget(builder,"UnfoundLabel");
GtkWidget *label = gtk_label_new(page_name);
gtk_notebook_append_page(GTK_NOTEBOOK(window->LoggingNotebook),box,label);
if (mode){
GdkRGBA rgba;
rgba.alpha=1;
rgba.red=0.95;
rgba.green=0.95;
rgba.blue=0.95;
vte_terminal_set_color_cursor(VTE_TERMINAL(terminal),&rgba);
vte_terminal_set_color_background(VTE_TERMINAL(terminal),&rgba);
rgba.red=0;
rgba.green=0;
rgba.blue=0;
vte_terminal_set_color_foreground(VTE_TERMINAL(terminal),&rgba);
return terminal;
} else {
window->journal_paths = yon_char_replace(window->journal_paths,"\n"," ");
yon_terminal_integrated_start(window->LoggingTerminal,yon_char_unite("cat ",window->journal_paths,NULL),NULL,NULL);
gtk_widget_destroy(terminal);
gtk_widget_show(unfound_label);
char *label_text = yon_char_append(page_name,PATH_NOT_FOUND_LABEL);
gtk_label_set_text(GTK_LABEL(unfound_label),label_text);
return NULL;
}
}
void on_inspector_close(GtkWidget *self){
main_config.remove_thread++;
}
void on_inspector_open(GtkWidget *self, main_window *widgets){
@ -278,25 +404,19 @@ void on_inspector_open(GtkWidget *self, main_window *widgets){
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->LoggingNotebook=yon_gtk_builder_get_widget(builder,"MainNotebook");
window->UpdateButton=yon_gtk_builder_get_widget(builder,"UpdateButton");
window->LoggingTerminal=yon_gtk_builder_get_widget(builder,"LoggingTerminal");
window->JournalActionsBox=yon_gtk_builder_get_widget(builder,"JournalActionsBox");
window->JournaldTree=yon_gtk_builder_get_widget(builder,"JournaldTree");
window->list=GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1"));
yon_window_config_custom_window_setup(GTK_WINDOW(window->MainWindow),"InspectorWindow");
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->MainWindow),"destroy", G_CALLBACK(on_inspector_close),window);
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);
@ -305,16 +425,30 @@ void on_inspector_open(GtkWidget *self, main_window *widgets){
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);
window->journal_name=name;
window->journal_paths=yon_char_parse(paths,&window->journal_size,"\n");
window->terminals = NULL;
if (strcmp(name,"journald")){
window->last_mode=-1;
for (int i=0;i<window->journal_size;i++){
if (!access(window->journal_paths[i],F_OK)){
yon_dictionary_add_or_create_if_exists_with_data(window->terminals,window->journal_paths[i],yon_inspector_add_terminal(window,window->journal_paths[i],1));
}
else{
GtkWidget *terminal = yon_inspector_add_terminal(window,window->journal_paths[i],0);
if (terminal)
yon_dictionary_add_or_create_if_exists_with_data(window->terminals,window->journal_paths[i],terminal);
}
}
gtk_widget_hide(window->JournalActionsBox);
} else {
window->last_mode=0;
yon_dictionary_add_or_create_if_exists_with_data(window->terminals,"Journald",yon_inspector_add_terminal(window,"Journald",1));
}
window->journal_name=name;
window->journal_paths=paths;
on_inspector_update(window->UpdateButton,window);
gtk_widget_show(window->MainWindow);
}
@ -337,15 +471,31 @@ void on_logrotate_configuration_path_add(GtkWidget *self, logrotate_configure_wi
}
void on_path_editing_done(GtkCellRendererText* self,gchar* path,gchar* new_text,logrotate_configure_window *window){
GtkTreeIter iter;
GtkTreeIter iter, itar;
char *cur_path;
gtk_tree_model_get_iter(GTK_TREE_MODEL(window->list),&iter,gtk_tree_path_new_from_string(path));
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,0,&cur_path,-1);
if (cur_path&&!strcmp(cur_path,"")&&!strcmp(new_text,""))
if (!strcmp(new_text,"")||cur_path&&!strcmp(cur_path,""))
gtk_list_store_remove(window->list,&iter);
else if (new_text&&strcmp(new_text,""))
else if (new_text&&strcmp(new_text,"")){
int deleted=0;
int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&itar);
for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&itar)){
char *path;
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&itar,0,&path,-1);
if (path&&new_text)
if (!strcmp(path,new_text)){
yon_ubl_status_list_store_highlight_incorrect(window->list,gtk_tree_iter_copy(&itar));
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),REPEAT_PATHS_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
gtk_list_store_remove(window->list,&iter);
deleted=1;
}
}
if (!deleted)
gtk_list_store_set(window->list,&iter,0,new_text,-1);
}
GValue *val = g_malloc0(sizeof(GValue));
g_object_get_property(G_OBJECT(self),"editable",val);
g_value_set_boolean(val,0);
@ -455,7 +605,7 @@ void on_rules_accept(GtkWidget *self, dictionary *dict){
!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);
on_close_subwindow(window->Window,"RulesWindow");
}
void on_rules_update(GtkWidget *self, logrotate_rules_window *window){
@ -513,11 +663,12 @@ void on_rules_open(GtkWidget *self,GtkEntry *entry){
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");
yon_window_config_custom_window_set(GTK_WINDOW(window->Window),"RulesWindow");
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->CancelButton),"clicked",G_CALLBACK(on_close_subwindow),"RulesWindow");
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);
@ -546,7 +697,7 @@ void on_filechooser_save(GtkWidget *self, dictionary *dict){
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);
on_close_subwindow(dialog->FileChooser,"FileDialog");
}
void on_filechooser_open(GtkWidget *self, logrotate_configure_window *window){
@ -556,6 +707,7 @@ void on_filechooser_open(GtkWidget *self, logrotate_configure_window *window){
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");
yon_window_config_custom_window_set(GTK_WINDOW(dialog->FileChooser),"FileDialog");
gtk_window_set_transient_for(GTK_WINDOW(window->MainWindow),GTK_WINDOW(window->MainWindow));
dictionary *dict = NULL;
@ -563,7 +715,7 @@ void on_filechooser_open(GtkWidget *self, logrotate_configure_window *window){
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->CancelButton),"clicked",G_CALLBACK(on_close_subwindow),"FileDialog");
g_signal_connect(G_OBJECT(dialog->AcceptButton),"clicked",G_CALLBACK(on_filechooser_save),dict);
gtk_widget_show(dialog->FileChooser);
}
@ -582,6 +734,7 @@ void on_logrotate_period_check_toggled(GtkToggleButton *self,logrotate_configure
void on_logrotate_save(GtkWidget *self, dictionary *dict){
logrotate_window *dialog = yon_dictionary_get_data(dict->first,logrotate_window*);
logrotate_configure_window *window = yon_dictionary_get_data(dict->first->next,logrotate_configure_window*);
char *log_name="";
char *paths="";
char *period="";
char *size="";
@ -618,6 +771,13 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){
config_str found_paths_list=NULL;
int found_paths=0;
char *cur_check_paths;
log_name = (char*)gtk_entry_get_text(GTK_ENTRY(window->LogNameEntry));
if (!strcmp(log_name,"")){
yon_ubl_status_highlight_incorrect(window->LogNameEntry);
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
return;
}
int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(main_config.logrotate_list),&iter);
for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(main_config.logrotate_list),&iter)){
gtk_tree_model_get(GTK_TREE_MODEL(main_config.logrotate_list),&iter,1,&cur_check_paths,-1);
@ -625,6 +785,13 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){
else found_paths_list = yon_char_parsed_append(found_paths_list,&found_paths,cur_check_paths);
}
valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter);
if (!valid) {
yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(window->LogPathsTree));
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
return;
}
GtkTreeIter *lastiter;
GtkTreeIter *lastitar;
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);
@ -633,13 +800,16 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){
}
path_amount++;
paths = yon_char_unite(paths,strcmp(paths,"") ? "," : "", cur_path,NULL);
lastiter=gtk_tree_iter_copy(&iter);
lastitar=gtk_tree_iter_copy(&iter);
}
if(!window->paths)
if(!window->paths) {
if (matched==path_amount) {
yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(window->LogPathsTree));
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),REPEATED_PATHS_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
return;
}
}
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->RotationPeriodCheck))){
int active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->RotationPeriodMainCombo));
switch (active){
@ -720,11 +890,6 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){
maxsize = yon_char_unite("maxsize ", yon_char_from_long(value),yon_size_get_letter_from_int(last),NULL);
}
// int create_log_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->CreateLogCombo));
// if (create_log_active){
// if (create_log_active==2)
// }
copytruncate = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->CutCheck)) ? "copytruncate" : "";
int compression_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->CompressionCombo));
@ -829,13 +994,14 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){
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);
yon_window_config_add_custom_parameter(paths,"render_name",yon_char_new((char*)gtk_entry_get_text(GTK_ENTRY(window->LogNameEntry))),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);
}
paths=yon_char_replace(paths,",","\n");
gtk_list_store_set(main_config.logrotate_list,&iter,0,gtk_entry_get_text(GTK_ENTRY(window->LogNameEntry)),1,paths,2,gtk_entry_get_text(GTK_ENTRY(window->LogDescriptionEntry)),-1);
on_close_subwindow(window->MainWindow);
gtk_list_store_set(main_config.logrotate_list,&iter,0,log_name,1,paths,2,gtk_entry_get_text(GTK_ENTRY(window->LogDescriptionEntry)),-1);
on_close_subwindow(window->MainWindow,"LogrotateWindow");
}
}
@ -904,6 +1070,8 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind
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");
yon_window_config_custom_window_get(GTK_WINDOW(window->MainWindow),"LogrotateWindow");
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));
@ -926,8 +1094,6 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind
int sizenumber=0;
finalsize = yon_size_convert_automatic(finalsize,&sizenumber);
char *fin = yon_char_from_float(finalsize);
char *unw = strstr(fin,",")+3;
fin = yon_char_divide(fin,strlen(fin)-strlen(unw));
gtk_label_set_text(GTK_LABEL(window->LogSizeLabel),yon_char_append(fin,yon_size_get_letter_from_int(sizenumber)));
}
@ -1058,10 +1224,6 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->RotateSizeMaxBeforeTimeSpin),atol(value));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->RotateSizeMaxBeforeTimeCheck),1);
gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotateSizeMaxBeforeTimeCombo),yon_size_get_int_from_letter(value[strlen(value)-1]));
// }else if (!strcmp(parsed[i],"create")){
//
// }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));
@ -1163,9 +1325,7 @@ void on_logrotate_edit(GtkWidget *self, logrotate_window *window){
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_entry_set_has_frame(GTK_ENTRY(dialog->LogNameEntry),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");
}
@ -1289,13 +1449,14 @@ void on_logrotate_tab_open(GtkWidget *self, main_window *widgets){
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");
yon_window_config_custom_window_get(GTK_WINDOW(window->Window),"LogrotateTabWindow");
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));
gtk_tree_view_set_model(GTK_TREE_VIEW(window->AppsMainTree),GTK_TREE_MODEL(main_config.logrotate_apps_list));
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->CancelButton),"clicked",G_CALLBACK(on_close_subwindow),"LogrotateTabWindow");
g_signal_connect(G_OBJECT(window->SaveButton),"clicked",G_CALLBACK(on_close_subwindow),"LogrotateTabWindow");
g_signal_connect(G_OBJECT(window->AddButton),"clicked",G_CALLBACK(on_logrotate_add),window);
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);
@ -1318,6 +1479,36 @@ void yon_combo_compress_check(GtkComboBox *self, journald_window *window){
}
}
void on_journald_reset(GtkWidget *self, journald_window *window){
gtk_combo_box_set_active(GTK_COMBO_BOX(window->LogStorageCombo),0);
gtk_combo_box_set_active(GTK_COMBO_BOX(window->LogCompressionCombo),0);
gtk_combo_box_set_active(GTK_COMBO_BOX(window->RedirectCombo),0);
gtk_combo_box_set_active(GTK_COMBO_BOX(window->LowerSizeCombo),0);
gtk_combo_box_set_active(GTK_COMBO_BOX(window->LowerTimeCombo),0);
gtk_combo_box_set_active(GTK_COMBO_BOX(window->LogStorageCombo),0);
gtk_combo_box_set_active(GTK_COMBO_BOX(window->LogFreeSpaceCombo),0);
gtk_combo_box_set_active(GTK_COMBO_BOX(window->ForwardedTypeCombo),0);
gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationSizeMaxCombo),0);
gtk_combo_box_set_active(GTK_COMBO_BOX(window->LogCompressionSizeCombo),0);
gtk_combo_box_set_active(GTK_COMBO_BOX(window->DivideJournalFilesCombo),0);
gtk_combo_box_set_active(GTK_COMBO_BOX(window->LogSizeMaxCombo),0);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->LogSizeMaxCheck),0);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->LogIntervalCheck),0);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->LogFreeSpaceCheck),0);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->RotationSizeMaxCheck),0);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->LogIntervalAmountCheck),0);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->LogSizeMaxSpin),0);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->LogIntervalSpin),0);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->LogFreeSpaceSpin),0);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->RotationSizeMaxSpin),0);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->LogIntervalAmountSpin),0);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->LogCompressionEntry),0);
gtk_entry_set_text(GTK_ENTRY(window->RedirectTTYEntry),"");
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->LowerSizeEntry),0);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->LowerTimeEntry),0);
}
void on_journald_save(GtkWidget *self, journald_window *window){
char *storage;
int storage_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->LogStorageCombo));
@ -1374,18 +1565,10 @@ void on_journald_save(GtkWidget *self, journald_window *window){
}
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->LogSizeMaxCheck))){
long logssize=-1;
long logssize=0;
logssize = gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->LogSizeMaxSpin));
int log_size_mod = gtk_combo_box_get_active(GTK_COMBO_BOX(window->LogSizeMaxCombo));
for (int i=0;i<log_size_mod+1;i++){
logssize=logssize*1024;
}
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)));
}
yon_config_register(JOURNALD("SystemMaxUse"),"logging",yon_char_append(yon_char_from_long(logssize),yon_size_get_letter_from_int(log_size_mod)));
} else
yon_config_remove_by_key(JOURNALD("SystemMaxUse"));
@ -1417,7 +1600,7 @@ void on_journald_save(GtkWidget *self, journald_window *window){
char *TTY=NULL;
if (consoleforwardactive == 1){
confor = "yes";
TTY = (char*)gtk_entry_get_text(GTK_ENTRY(window->RedirectTTYEntry));
TTY = yon_char_new((char*)gtk_entry_get_text(GTK_ENTRY(window->RedirectTTYEntry)));
if (yon_char_is_empty(TTY))
consoleforwardactive=0;
}
@ -1439,15 +1622,18 @@ void on_journald_save(GtkWidget *self, journald_window *window){
yon_config_register(JOURNALD("SplitMode"),"logging",splitmode);
else
yon_config_remove_by_key(JOURNALD("SplitMode"));
if (consoleforwardactive != 0)
if (consoleforwardactive != 0){
yon_config_register(JOURNALD("ForwardToConsole"),"logging",confor);
else
yon_config_register(JOURNALD("TTYPath"),"logging",TTY);
} else {
yon_config_remove_by_key(JOURNALD("ForwardToConsole"));
yon_config_register(JOURNALD("TTYPath"),"logging",TTY);
}
if (forwardempty!=0)
yon_config_register(JOURNALD("MaxLevelConsole"),"logging",yon_char_from_int(forwardempty-1));
else
yon_config_remove_by_key(JOURNALD("MaxLevelConsole"));
on_close_subwindow(window->MainWindow);
on_close_subwindow(window->MainWindow,"JournaldWindow");
}
journald_window *yon_journald_open(GtkWidget *self, main_window *widgets){
@ -1456,6 +1642,7 @@ journald_window *yon_journald_open(GtkWidget *self, main_window *widgets){
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->ResetButton=yon_gtk_builder_get_widget(builder,"ResetButton");
window->LogNameLabel=yon_gtk_builder_get_widget(builder,"LogNameEntry");
window->LogDescriptionLabel=yon_gtk_builder_get_widget(builder,"LogDescriptionEntry");
window->LogStorageCombo=yon_gtk_builder_get_widget(builder,"LogStorageCombo");
@ -1488,16 +1675,20 @@ 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");
yon_window_config_custom_window_get(GTK_WINDOW(window->MainWindow),"JournaldWindow");
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);
if (logsize)
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);
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_close_subwindow),"JournaldWindow");
g_signal_connect(G_OBJECT(window->SaveButton),"clicked",G_CALLBACK(on_journald_save),window);
g_signal_connect(G_OBJECT(window->ResetButton),"clicked",G_CALLBACK(on_journald_reset),window);
g_signal_connect(G_OBJECT(window->LogIntervalCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->LogIntervalSpin);
g_signal_connect(G_OBJECT(window->LogIntervalCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->LogIntervalAmountCheck);
@ -1608,7 +1799,26 @@ void on_log_save(GtkWidget *self, dictionary *dict){
char *pathse=NULL;
for (int i=0;i<g_list_length(list);i++){
GList *paths = gtk_container_get_children((GtkContainer*)g_list_nth_data(list,i));
pathse=yon_char_unite(pathse ? yon_char_append(pathse,"\n"):"",gtk_entry_get_text((GtkEntry*)g_list_nth_data(paths,1)),NULL);
char *cur = (char*)gtk_entry_get_text((GtkEntry*)g_list_nth_data(paths,1));
if (strcmp(cur,""))
pathse=yon_char_unite(pathse ? yon_char_append(pathse,"\n"):"",cur,NULL);
}
int fo=0;
int so=0;
int paths_size;
if (!pathse){
yon_ubl_status_highlight_incorrect(window->LogPathsBox);
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
return;
}
config_str paths_parsed = yon_char_parse(pathse,&paths_size,"\n");
if (yon_char_parsed_check_repeats(paths_parsed,paths_size,&fo,&so)){
GList *list = gtk_container_get_children(GTK_CONTAINER(window->LogPathsBox));
yon_ubl_status_highlight_incorrect((GtkWidget*)g_list_nth_data(list,so));
yon_ubl_status_highlight_incorrect((GtkWidget*)g_list_nth_data(list,fo));
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),REPEAT_PATHS_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
return;
}
GtkTreeIter iter;
char *name = (char*)gtk_entry_get_text(GTK_ENTRY(window->NameEntry));
@ -1616,11 +1826,44 @@ void on_log_save(GtkWidget *self, dictionary *dict){
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))
int stat;
if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MainTree)),&model,&iter)){
int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(widgets->list),&iter);
for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(widgets->list),&iter)){
char *paths=NULL;
char *name;
gtk_tree_model_get(GTK_TREE_MODEL(widgets->list),&iter,0,&name,1,&paths,-1);
if (!strcmp(gtk_entry_get_text(GTK_ENTRY(window->NameEntry)),name)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),REPEATED_PATHS_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->NameEntry);
return;
}
int paths_size=0;
config_str paths_parsed = yon_char_parse(paths,&paths_size,"\n");
int pathse_size=0;
config_str pathse_parsed = yon_char_parse(pathse,&pathse_size,"\n");
if (yon_char_parsed_includes_char_parsed(pathse_parsed,paths_parsed,pathse_size,paths_size)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),REPEATED_PATHS_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
return;
}
}
gtk_list_store_append(widgets->list,&iter);
gtk_list_store_set(widgets->list,&iter,3,0,-1);
gtk_list_store_set(widgets->list,&iter,0,name,1,pathse,2,&desc ? desc : "",3,0,-1);
yon_window_config_custom_window_set(GTK_WINDOW(window->MainWindow),"AddWindow");
} else {
yon_window_config_custom_window_set(GTK_WINDOW(window->MainWindow),"EditWindow");
gtk_tree_model_get(GTK_TREE_MODEL(widgets->list),&iter,3,&stat,-1);
gtk_list_store_set(widgets->list,&iter,3,stat==0?0:stat==1?2:2,-1);
}
gtk_list_store_set(widgets->list,&iter,0,name,1,pathse,2,&desc ? desc : "",-1);
} else {
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),WRITE_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->NameEntry);
return;
}
on_close_subwindow(self);
yon_logs_custom_save(widgets);
on_close_subwindow(self,NULL);
}
add_log_window *on_add_open(main_window *widgets){
@ -1640,12 +1883,12 @@ add_log_window *on_add_open(main_window *widgets){
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");
window->StatusBox=yon_gtk_builder_get_widget(builder,"StatusBox");
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_log_save),dict);
return window;
}
@ -1713,6 +1956,8 @@ 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);
yon_window_config_custom_window_get(GTK_WINDOW(window->MainWindow),"AddWindow");
g_signal_connect(G_OBJECT(window->CancelButton),"clicked", G_CALLBACK(on_close_subwindow),"AddWindow");
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);
@ -1725,6 +1970,8 @@ void on_log_edit(GtkWidget *self,main_window *widgets){
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(widgets);
g_signal_connect(G_OBJECT(window->CancelButton),"clicked", G_CALLBACK(on_close_subwindow),"EditWindow");
yon_window_config_custom_window_get(GTK_WINDOW(window->MainWindow),"EditWindow");
gtk_widget_show(window->MainWindow);
gtk_widget_hide(window->StatisticsFrame);
char *name;
@ -1735,13 +1982,21 @@ void on_log_edit(GtkWidget *self,main_window *widgets){
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(getuid()!=0){
gtk_widget_set_sensitive(window->SyslogButton,0);
gtk_widget_set_sensitive(window->MetalogButton,0);
gtk_widget_set_sensitive(window->JournaldButton,0);
gtk_widget_set_sensitive(window->LogrotateButton,0);
}
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);
if (logsize)
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 {
@ -1750,8 +2005,6 @@ void on_log_edit(GtkWidget *self,main_window *widgets){
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->LogrotateButton),"clicked", G_CALLBACK(on_log_edit_logrotate_settings),dict);
// g_signal_connect(G_OBJECT(window->MetalogButton),"clicked", G_CALLBACK(on_log),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 ? description : "");
@ -1767,14 +2020,17 @@ void on_log_edit(GtkWidget *self,main_window *widgets){
GtkWidget *RemoveButton = yon_gtk_builder_get_widget(builder,"RemoveButton");
if (protected<protect){
gtk_widget_set_sensitive(RemoveButton,0);
gtk_widget_set_sensitive(entry,0);
gtk_widget_set_sensitive(SearchButton,0);
protected++;
} else {
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);
}
if (!strcmp(name,"journald")) {
gtk_widget_hide(AppendButton);
gtk_widget_hide(RemoveButton);
}
gtk_widget_set_sensitive(entry,0);
gtk_widget_set_sensitive(SearchButton,0);
gtk_entry_set_text(GTK_ENTRY(entry),paths_parsed[i]);
gtk_box_pack_start(GTK_BOX(window->LogPathsBox),box,0,0,5);
last = AppendButton;
@ -1847,6 +2103,13 @@ void on_main_window_tree_selection_changed(GtkWidget *self,main_window *widgets)
void on_main_window_services_tree_selection_changed(GtkWidget *self,main_window *widgets){
GtkTreeModel *model = GTK_TREE_MODEL(widgets->ServicesList);
GtkTreeIter iter;
if (getuid()!=0){
gtk_widget_set_sensitive(widgets->ServicesEditButton,0);
gtk_widget_set_sensitive(widgets->ServicesEnableDisableButton,0);
gtk_widget_set_sensitive(widgets->ServicesStartStopButton,0);
return;
}
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->ServicesTree)),&model,&iter)){
gboolean is_active;
gboolean is_enabled;
@ -1934,6 +2197,57 @@ void on_enable_disable_clicked(GtkButton *self, main_window *widgets){
// standard functions
void on_permissions_changed(){
if (g_permission_get_allowed(main_config.permissions)){
PolkitAuthority *auth = polkit_authority_get_sync(NULL,NULL);
PolkitSubject *subject;
pid_t parent_pid;
parent_pid = getppid ();
subject = polkit_unix_process_new_for_owner (parent_pid,0,getuid());
PolkitDetails *dets = polkit_details_new();
if (polkit_authority_check_authorization_sync(auth,subject,"com.ublinux.ubl-settings-logging",dets,POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,NULL,NULL)){
printf("Allowed\n");
char *command[] = {"/bin/pkexec","/bin/echo","1", NULL};
gchar *standard_output = NULL;
gchar *standard_error = NULL;
gint exit_status = -1;
GError *error = NULL;
gboolean success = g_spawn_sync(
NULL,
command,
NULL,
G_SPAWN_DEFAULT,
NULL,
NULL,
&standard_output,
&standard_error,
NULL,
&error
);
if (success) {
if (standard_output != NULL) {
printf("Output: %s\n", standard_output);
g_free(standard_output);
}
if (standard_error != NULL) {
printf("Error output: %s\n", standard_error);
g_free(standard_error);
}
printf("Exit status: %d\n", exit_status);
} else {
g_printerr("Error running command: %s\n", error->message);
g_error_free(error);
}
} else {
if (g_permission_get_can_acquire(main_config.permissions)){
g_permission_acquire(main_config.permissions,NULL,NULL);
}
}
}
}
void config_init(){
main_config.always_open_documentation=0;
main_config.win_height=0;
@ -1950,6 +2264,19 @@ void config_init(){
main_config.lock_save_local=0;
main_config.logrotate_list = gtk_list_store_new(3,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING);
main_config.logrotate_apps_list = gtk_list_store_new(3,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING);
main_config.remove_thread=-1;
PolkitSubject *subject = NULL;
pid_t parent_pid;
parent_pid = getppid ();
if (parent_pid == 1)
{
g_printerr ("Parent process was reaped by init(1)\n");
}
subject = polkit_unix_process_new_for_owner (parent_pid,0,getuid());
main_config.permissions = polkit_permission_new_sync("com.ublinux.ubl-settings-logging",subject,NULL,NULL);
g_signal_connect(G_OBJECT(main_config.permissions),"notify::allowed",G_CALLBACK(on_permissions_changed),NULL);
}
main_window *setup_window(){
@ -1996,6 +2323,8 @@ main_window *setup_window(){
widgets->list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1"));
widgets->ServicesList = GTK_LIST_STORE(gtk_builder_get_object(builder,"ServicesList"));
widgets->UpgradePermissionsMenuItem = yon_gtk_builder_get_widget(builder,"UpgradePermissionsMenuItem");
widgets->MainTree = yon_gtk_builder_get_widget(builder,"MainTree");
gtk_window_set_title(GTK_WINDOW(widgets->Window),TITLE_LABEL);
@ -2029,7 +2358,9 @@ main_window *setup_window(){
config_str log = yon_char_parse(journals[i],&log_size,";");
log[1] = yon_char_replace(log[1],",","\n");
gtk_list_store_append(widgets->list,&iter);
free(yon_char_parse(log[1],&psize,"\n"));
config_str sfafa = yon_char_parse(log[1],&psize,"\n");
if (sfafa)
free(sfafa);
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);
@ -2039,7 +2370,6 @@ main_window *setup_window(){
services[i]=yon_char_divide_search(services[i],"\n",-1);
config_str log = yon_char_parse(services[i],&log_size,";");
gtk_list_store_append(widgets->ServicesList,&iter);
// 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);
}
}
@ -2082,13 +2412,11 @@ main_window *setup_window(){
GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(widgets->MainTree));
for (int i=0; i<g_list_length(list);i++){
yon_window_config_add_listener(g_list_nth_data(list,i),yon_char_append("column",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
// 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->ServicesTree));
for (int i=0; i<g_list_length(list);i++){
yon_window_config_add_listener(g_list_nth_data(list,i),yon_char_append("servicecolumn",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
// yon_gtk_column_minimal_fixed_size_set((GtkTreeViewColumn*)g_list_nth_data(list,i));
}
main_config.groups = yon_file_open(group_list_path,&main_config.groups_size);
@ -2096,6 +2424,39 @@ main_window *setup_window(){
yon_char_divide_search_self(main_config.groups[i],":",-1);
}
size =0;
config_str custom_watchers = yon_file_open(custom_logs_saving_file_path,&size);
if (custom_watchers){
GtkTreeIter itar;
for (int i=0;i<size;i++){
int cur_size=0;
config_str cur_watcher = yon_char_parse(custom_watchers[i],&cur_size,";");
if (cur_watcher){
cur_watcher = yon_char_parsed_append(cur_watcher,&cur_size,NULL);
char *cur_name;
int found=0;
int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(widgets->list),&iter);
for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(widgets->list),&iter)){
gtk_tree_model_get(GTK_TREE_MODEL(widgets->list),&iter,0,&cur_name,-1);
if (!strcmp(cur_name,cur_watcher[0])){
found=1;
break;
}
}
if (!found)
gtk_list_store_append(widgets->list,&iter);
cur_watcher[1] = yon_char_replace(cur_watcher[1],",","\n");
gtk_list_store_set(widgets->list,&iter,0,cur_watcher[0],1,cur_watcher[1],2,cur_watcher[2]?cur_watcher[2]:"",-1);
yon_char_parsed_free(cur_watcher,cur_size);
}
}
} else {
if (access(custom_logs_saving_file_path,F_OK)){
yon_file_create_full_path(custom_logs_saving_file_path,0777);
}
FILE *fl = fopen(custom_logs_saving_file_path,"w");
fclose(fl);
}
/* Widget registration for config monitoring | Регистрация виджетов для мониторинга конфига */
// yon_window_config_add_custom_parameter(widgets->HeadInfoLabel,"head-text","label",YON_TYPE_STRING);
@ -2116,6 +2477,8 @@ 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->UpgradePermissionsMenuItem),"activate",G_CALLBACK(on_permissions_changed),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);
@ -2126,10 +2489,11 @@ main_window *setup_window(){
return widgets;
}
int main(int argc, char *argv[]){
int main(int argc, char *argv[], char **envp){
local=setlocale(LC_ALL, "");
textdomain (LocaleName);
config_init();
main_config.envp=envp;
int option_index=0;
int show_help=0;
int debug_mode=0;
@ -2149,7 +2513,7 @@ int main(int argc, char *argv[]){
{ NULL, 0, NULL, 0 }
};
for (int i=0;i<argc;i++){
int argument=getopt_long(argc,argv,"hVvs:e:t:",long_options,&option_index);
int argument=getopt_long(argc,argv,"hVvs:e:t:c",long_options,&option_index);
switch(argument){
case 'h':
show_help=1;
@ -2172,6 +2536,7 @@ int main(int argc, char *argv[]){
main_config.load_socket_id=atoi(optarg);
break;
case 'c': system(yon_char_unite("rm -rfd ", yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",NULL));
mkdir(yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",NULL),0777);
break;
case 1:
main_config.lock_help=1;

@ -10,12 +10,14 @@
#include <libintl.h>
#include <vte/vte.h>
#include <sys/types.h>
#include <sys/select.h>
#include <pwd.h>
#include "../compile/ubl-cmake.h"
#ifdef WEBKIT_FOUND
#include <webkit2/webkit2.h>
#endif
#include "ubl-strings.h"
#include <polkit/polkit.h>
#define WIKI_LINK "https://wiki.ublinux.ru/ru/Программное_обеспечениерограммы_и_утилиты/Все/ubl-settings-logging"
@ -30,6 +32,7 @@
#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 glade_terminal_path "/com/ublinux/ui/ubl-settings-logging-terminal.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)
@ -39,6 +42,7 @@
#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 custom_logs_saving_file_path yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/logwatcher.csv",NULL)
#define LocalePath "/usr/share/locale"
#define LocaleName "ubl-settings-logging"
@ -46,14 +50,14 @@
#define JOURNALD(key) yon_char_unite("JOURNALD[",key,"]",NULL)
#define LOGROTATE(key) yon_char_unite("LOGROTATE[",key,"]",NULL)
#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 get_journal_output_command "clear;SYSTEMD_COLORS=false journalctl --no-pager"
#define get_journal_output_since_boot_command "clear;SYSTEMD_COLORS=false journalctl --no-pager -b"
#define get_journal_output_followed_command "clear;SYSTEMD_COLORS=false journalctl --no-pager -f"
#define get_journal_output_kernel_command "clear;SYSTEMD_COLORS=false journalctl --no-pager -k"
#define get_journal_output_prioritied_command "clear;SYSTEMD_COLORS=false journalctl --no-pager -p err..alert"
#define get_journal_all_boots_command "clear;SYSTEMD_COLORS=false journalctl --no-pager --list-boots"
#define get_journal_all_units_command "clear;SYSTEMD_COLORS=false systemd-analyze blame --no-pager"
#define get_journal_init_tree_command "clear;SYSTEMD_COLORS=false systemd-analyze critical-chain --no-pager"
#define group_list_path "/etc/group"
@ -69,6 +73,7 @@ string version_application;
char *local;
typedef struct {
char **envp;
int always_open_documentation;
int win_pos_x;
int win_pos_y;
@ -88,8 +93,16 @@ typedef struct {
GtkListStore *logrotate_list;
GtkListStore *logrotate_apps_list;
config_str groups;
int groups_size;
config_str *saved_logs;
GPermission *permissions;
pthread_t inspector_thread;
int remove_thread;
} config;
typedef struct {
@ -136,6 +149,8 @@ typedef struct {
GtkWidget *ServicesEnableDisableButton;
GtkListStore *list;
GtkListStore *ServicesList;
GtkWidget *UpgradePermissionsMenuItem;
GtkWidget *PermissionsLock;
// Custom
} main_window;
@ -154,6 +169,7 @@ typedef struct {
typedef struct {
GtkWidget *MainWindow;
GtkWidget *StatusBox;
GtkWidget *adjustment1;
GtkWidget *adjustment2;
GtkWidget *CancelButton;
@ -186,11 +202,15 @@ GtkWidget *UpdateButton;
GtkWidget *ShowAllBootsButton;
GtkWidget *ShowAllUnitsButton;
GtkWidget *ShowInitTreeButton;
GtkWidget *LoggingTerminal;
GtkWidget *LoggingNotebook;
GtkWidget *JournalActionsBox;
GtkListStore *list;
GtkWidget *JournaldTree;
dictionary *terminals;
int last_mode;
char *journal_name;
char *journal_paths;
int journal_size;
config_str journal_paths;
} inspector_window;
@ -235,6 +255,7 @@ typedef struct {
GtkWidget *MainWindow;
GtkWidget *CancelButton;
GtkWidget *SaveButton;
GtkWidget *ResetButton;
GtkWidget *LogNameLabel;
GtkWidget *LogDescriptionLabel;
GtkWidget *LogStorageCombo;

@ -101,6 +101,7 @@
#define DAYS_LABEL _("Days")
#define WEEKS_LABEL _("Weeks")
#define YEARS_LABEL _("Years")
#define RESET_LABEL _("Reset")
//ubl-settings-logging-logrotate.glade
#define LOGROTATE_LOG_JOURNAL_TAB_LABEL _("Log/Journal:")
@ -175,6 +176,9 @@
#define SATURDAY_LABEL _("Saturday")
#define SUNDAY_LABEL _("Sunday*")
#define REPEATED_PATHS_LABEL _("Same record already exists")
#define EMPTY_IMPORTANT_LABEL _("Empty important field")
#define REPEAT_PATHS_LABEL _("Repeating paths")
#define WRITE_IMPORTANT_LABEL _("Write down all important fields")
//ubl-settings-logging-logrotate-table.glade
#define SYSTEM_CONFIGURATION_LABEL _("System configuration")
@ -185,3 +189,15 @@
#define CONTROL_LABEL _("Control:")
#define LOG_LABEL _("Log file")
#define NAME_LABEL _("Name:")
//ubl-settings-logging-rules.glade
#define OWNER_LABEL _("Owner rules")
#define GROUP_LABEL _("Group rules")
#define PUBLIC_LABEL _("Public rules")
#define READ_LABEL _("Read")
#define WRITE_LABEL _("Write")
#define EXECUTE_LABEL _("Execute")
#define VALUE_LABEL _("Value:")
//ubl-settings-logging-terminal.glade
#define PATH_NOT_FOUND_LABEL _(": no such file(s)")

@ -622,8 +622,8 @@ char *yon_char_from_float(float int_to_convert)
{
convert_check = convert_check / 10;
}
char *ch = g_malloc0(i * sizeof(char) + 1);
sprintf(ch, "%f", int_to_convert);
char *ch = g_malloc0((i + 9)* sizeof(char));
sprintf(ch, "%.2f", int_to_convert);
return ch;
}
@ -680,24 +680,22 @@ char *yon_char_replace(char *source, char *find, char*replace){
* size of returned array
*/
char **yon_char_parse(char *parameters, int *size, char *divider){
if (parameters){
char **string=NULL;
int i=1;
string=malloc(sizeof(char*));
*size=0;
char *paramline=yon_char_new(parameters);
char *param;
while ((param=yon_char_divide_search(paramline,divider,1))){
string=realloc(string,sizeof(char*)*i);
string[i-1]=yon_char_new(param);
i++;
if (strcmp(param,paramline)==0) break;
}
// string=realloc(string,sizeof(char*)*i);
// string[i-1]=yon_char_new(paramline);
// i++;
// printf("%d\n",i);
*size=i-1;
char *param = strstr(paramline,divider);
for (;param;param=strstr(paramline,divider)){
string = yon_remalloc(string,sizeof(char*)*((*size)+1));
string[(*size)]=yon_char_divide(paramline,strlen(paramline)-strlen(param));
*size=(*size)+1;
}
string = yon_remalloc(string,sizeof(char*)*((*size)+1));
string[(*size)]=paramline;
(*size)+=1;
return string;
}
return NULL;
}
/**yon_char_parsed_rip(char **char_string, int *size, int item_to_delete)
@ -746,6 +744,30 @@ int yon_char_parsed_check_exist(char **parameters, int size, char *param){
return -1;
}
/**yon_char_parsed_check_repeats(char **parameters, int size)
* [EN]
* Checks if [parameters] string array of length [size]
* has repeated elements;
* [RU]
* Проверяет есть ли в массиве строк [parameters], размера [size]
* повторения
*/
int yon_char_parsed_check_repeats(char **parameters, int size, int *first_overlap, int *second_overlap){
if (parameters){
*first_overlap=0;
*second_overlap=0;
for ((*first_overlap)=0;(*first_overlap)<size;(*first_overlap)++){
for ((*second_overlap)=0;(*second_overlap)<size;(*second_overlap)++){
if (parameters[(*first_overlap)]&&parameters[(*second_overlap)]){
if (!strcmp(parameters[(*first_overlap)],parameters[(*second_overlap)])&&(*first_overlap)!=(*second_overlap))
return 1;
}
}
}
}
return 0;
}
/**yon_char_parsed_includes_char_parsed (config_str source, config_str to_check, int source_size, int check_size)
* [EN]
*
@ -1192,7 +1214,7 @@ void *yon_config_get_by_key(char *key){
check_config{
dictionary *dict = NULL;
for_dictionaries(dict, (dictionary*)__yon__config__strings){
if (strcmp(dict->key,key)==0){
if (strcmp(dict->key,key)==0&&((yon_config_parameter*)dict)->flag1!=-1){
return dict->data;
}
}
@ -1205,7 +1227,7 @@ void *yon_config_get_all_by_key(char *key, int *size){
config_str ret_data=NULL;
dictionary *dict = NULL;
for_dictionaries(dict, (dictionary*)__yon__config__strings){
if (strstr(dict->key,key)) {
if (strstr(dict->key,key)&&((yon_config_parameter*)dict)->flag1!=-1) {
char *ret_string = yon_char_unite(dict->key,"=",(char*)dict->data,NULL);
if (ret_data) ret_data = yon_char_parsed_append(ret_data,size,ret_string);
else ret_data = yon_char_parsed_new(size,ret_string,NULL);
@ -1334,12 +1356,17 @@ config_str yon_config_load(char *command, int *str_len){
}
}
/**int yon_config_save_registered(char *path, char *section)
/**int yon_config_save_registered(char *path)
* [EN]
* Saves config with [command]
* Saves config at [path] config.
* [path] can be:
* system
* global
* [RU]
* Выполняет команду [command], добавляя в конец все записи конфига в таком виде:
* [ПАРАМЕТР1]="[значения1]" [ПАРАМЕТР2]="[значения2]"
* Сохраняет конфигурацию в [path] конфиг.
* [path] может быть
* system - локальный конфиг
* global - глобальный конфиг
*/
int yon_config_save_registered(char *path){
check_config{
@ -1350,7 +1377,7 @@ int yon_config_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(&sections_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);
if (sections_add&&yon_dictionary_get(&sections_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 if (((yon_config_parameter*)dct)->flag1==-1){
((yon_config_parameter*)dct)->flag1=0;
@ -1376,10 +1403,15 @@ int yon_config_save_registered(char *path){
/**int yon_config_force_save_registered(char *path, char *section)
* [EN]
* Saves config with [command]
* Force config to save at [path] config ignoring parameter save status.
* [path] can be:
* system
* global
* [RU]
* Выполняет команду [command], добавляя в конец все записи конфига в таком виде:
* [ПАРАМЕТР1]="[значения1]" [ПАРАМЕТР2]="[значения2]"
* Принудительно сохраняет конфигурацию в [path] конфиг игнорируя статус параметра.
* [path] может быть
* system - локальный конфиг
* global - глобальный конфиг
*/
int yon_config_force_save_registered(char *path){
check_config{
@ -1389,7 +1421,7 @@ int yon_config_force_save_registered(char *path){
for_dictionaries(dct,(dictionary*)__yon__config__strings){
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(&sections_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);
if (sections_add&&yon_dictionary_get(&sections_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 if (((yon_config_parameter*)dct)->flag1==-1){
if (sections_remove&&yon_dictionary_get(&sections_remove,((yon_config_parameter*)dct)->section)) sections_remove->data=(void*)yon_char_unite(yon_dictionary_get_data(sections_remove,char*)," ",dct->key,NULL);
@ -1483,6 +1515,59 @@ config_str yon_file_open(char *file_path, int *size){
}
}
/**yon_file_create(char *path, char *name, int rules)
* [EN]
*
* [RU]
* Создать файл с названием [name], находящимся по пути [path]
* С правами доступа [rules] (от 0000 до 0777)
*/
int yon_file_create(char *path, char *name, int rules){
if (path&&name){
char *full_path = yon_char_unite(path,"/",name,NULL);
if (access(full_path,F_OK)){
FILE *fl = fopen(full_path,"w");
if (fl){
chmod(full_path,rules);
fclose(fl);
return 1;
} else {
return 0;
}
} else {
return -1;
}
} else {
return 0;
}
}
/**yon_file_create_full_path(char *path, char *name, int rules)
* [EN]
*
* [RU]
* Создать файл по пути [path]
* С правами доступа [rules] (от 0000 до 0777)
*/
int yon_file_create_full_path(char *path, int rules){
if (path){
if (access(path,F_OK)){
FILE *fl = fopen(path,"w");
if (fl){
chmod(path,rules);
fclose(fl);
return 1;
} else {
return 0;
}
} else {
return -1;
}
} else {
return 0;
}
}
// terminal-using functions
/**yon_launch_app_with_arguments(char *name, char *args)
@ -1552,8 +1637,7 @@ void yon_terminal_integrated_launch(GtkWidget *place_to_show, char* command, voi
VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL);
vte_terminal_set_pty(VTE_TERMINAL(terminal),pty);
gtk_container_add(GTK_CONTAINER(place_to_show),terminal);
char *install_command=yon_char_unite("tput cup 0 0 && tput ed; ",command," ; sleep 5;exit 0","\n",NULL);
printf("%s\n",install_command);
char *install_command=yon_char_unite("clear;tput cup 0 0 && tput ed; ",command," ; sleep 5;exit 0","\n",NULL);
if(endwork_function)
g_signal_connect(G_OBJECT(terminal), "child-exited", G_CALLBACK(endwork_function), endwork_function_argument);
vte_terminal_spawn_async(VTE_TERMINAL(terminal),
@ -1606,7 +1690,7 @@ void yon_terminal_integrated_start(GtkWidget *terminal, char* command, void *end
vte_terminal_set_size(VTE_TERMINAL(terminal),10,15);
VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL);
vte_terminal_set_pty(VTE_TERMINAL(terminal),pty);
char *install_command=yon_char_unite("tput cup 0 0 && tput ed; ",command," ; sleep 5;exit 0","\n",NULL);
char *install_command=yon_char_unite("clear;tput cup 0 0 && tput ed; ",command," ; sleep 5; stty -echo; unset PS1","\n",NULL);
if(endwork_function)
g_signal_connect(G_OBJECT(terminal), "child-exited", G_CALLBACK(endwork_function), endwork_function_argument);
vte_terminal_spawn_async(VTE_TERMINAL(terminal),
@ -1679,6 +1763,11 @@ void yon_terminal_integrated_start(GtkWidget *terminal, char* command, void *end
g_key_file_set_integer(__yon_window_config_file,"window","WindowHeight",__yon_main_window_config.height);
g_key_file_set_integer(__yon_window_config_file,"window","fullscreen",__yon_main_window_config.fullscreen);
dictionary *dict=NULL;
if (__yon_main_window_config.deleted_parameters)
for_dictionaries(dict,__yon_main_window_config.deleted_parameters){
__yon_custom_parameter *param = yon_dictionary_get_data(dict,__yon_custom_parameter*);
g_key_file_remove_key(__yon_window_config_file,param->section,param->parameter_name,NULL);
}
if (__yon_main_window_config.custom_listeners)
for_dictionaries(dict,__yon_main_window_config.custom_listeners){
__yon_listener_parameter *param = yon_dictionary_get_data(dict,__yon_listener_parameter*);
@ -1714,11 +1803,7 @@ void yon_terminal_integrated_start(GtkWidget *terminal, char* command, void *end
break;
}
}
if (__yon_main_window_config.deleted_parameters)
for_dictionaries(dict,__yon_main_window_config.deleted_parameters){
__yon_custom_parameter *param = yon_dictionary_get_data(dict,__yon_custom_parameter*);
g_key_file_remove_key(__yon_window_config_file,param->section,param->parameter_name,NULL);
}
g_key_file_save_to_file(__yon_window_config_file,__yon_window_config_path,NULL);
}
@ -1787,6 +1872,7 @@ void yon_terminal_integrated_start(GtkWidget *terminal, char* command, void *end
}
FILE *fp;
fp=fopen(__yon_window_config_path,"w");
chmod(__yon_window_config_path,0777);
fclose(fp);
g_key_file_load_from_file(__yon_window_config_file,__yon_window_config_path,G_KEY_FILE_NONE,NULL);
}
@ -1868,6 +1954,17 @@ void yon_terminal_integrated_start(GtkWidget *terminal, char* command, void *end
}
}
void yon_window_config_add_instant_parameter(char *param_name, char *section, void *tracked_value, enum YON_TYPE val_type){
switch (val_type){
case YON_TYPE_BOOLEAN: g_key_file_set_boolean(__yon_window_config_file,section,param_name,*((gboolean*)tracked_value));
break;
case YON_TYPE_INT: g_key_file_set_integer(__yon_window_config_file,section,param_name,*((int*)tracked_value));
break;
case YON_TYPE_STRING: g_key_file_set_string(__yon_window_config_file,section,param_name,(char*)tracked_value);
break;
}
}
void yon_window_config_erase_custom_parameter(char *param_name, char *section){
__yon_custom_parameter *param = NULL;
param = yon_remalloc(param,sizeof(__yon_custom_parameter));
@ -1901,6 +1998,81 @@ void yon_terminal_integrated_start(GtkWidget *terminal, char* command, void *end
}
}
void yon_on_window_config_custom_window_destroy(GtkWindow *window, char *window_name){
if (!gtk_window_is_maximized(window)){
int height=0;
int width=0;
int X=0;
int Y=0;
gtk_window_get_position(window,&X,&Y);
yon_window_config_add_instant_parameter(yon_char_append(window_name,"PosX"),"window",&X,YON_TYPE_INT);
yon_window_config_add_instant_parameter(yon_char_append(window_name,"PosY"),"window",&Y,YON_TYPE_INT);
}
}
void yon_on_window_config_custom_window_resize(GtkWindow *window, char *window_name){
if (!gtk_window_is_maximized(window)){
int height=0;
int width=0;
int X=0;
int Y=0;
gtk_window_get_size(window,&width,&height);
gtk_window_get_position(window,&X,&Y);
yon_window_config_add_instant_parameter(yon_char_append(window_name,"Width"),"window",&width,YON_TYPE_INT);
yon_window_config_add_instant_parameter(yon_char_append(window_name,"Height"),"window",&height,YON_TYPE_INT);
yon_window_config_add_instant_parameter(yon_char_append(window_name,"PosX"),"window",&X,YON_TYPE_INT);
yon_window_config_add_instant_parameter(yon_char_append(window_name,"PosY"),"window",&Y,YON_TYPE_INT);
}
}
void yon_window_config_custom_window_setup(GtkWindow *window, char *window_name){
int height=0;
int width=0;
int X=0;
int Y=0;
yon_window_config_get_parameter("window",yon_char_append(window_name,"Width"),&width,YON_TYPE_INT);
yon_window_config_get_parameter("window",yon_char_append(window_name,"Height"),&height,YON_TYPE_INT);
yon_window_config_get_parameter("window",yon_char_append(window_name,"PosX"),&X,YON_TYPE_INT);
yon_window_config_get_parameter("window",yon_char_append(window_name,"PosY"),&Y,YON_TYPE_INT);
if (width&&height)
gtk_window_resize(window,width,height);
if (X&&Y)
gtk_window_move(window,X,Y);
char *signals_window_name = yon_char_new(window_name);
g_signal_connect(G_OBJECT(window),"check-resize",G_CALLBACK(yon_on_window_config_custom_window_resize),signals_window_name);
g_signal_connect(G_OBJECT(window),"delete-event",G_CALLBACK(yon_on_window_config_custom_window_destroy),signals_window_name);
}
void yon_window_config_custom_window_get(GtkWindow *window, char *window_name){
int height=0;
int width=0;
int X=0;
int Y=0;
yon_window_config_get_parameter("window",yon_char_append(window_name,"Width"),&width,YON_TYPE_INT);
yon_window_config_get_parameter("window",yon_char_append(window_name,"Height"),&height,YON_TYPE_INT);
yon_window_config_get_parameter("window",yon_char_append(window_name,"PosX"),&X,YON_TYPE_INT);
yon_window_config_get_parameter("window",yon_char_append(window_name,"PosY"),&Y,YON_TYPE_INT);
if (width&&height)
gtk_window_resize(window,width,height);
if (X&&Y)
gtk_window_move(window,X,Y);
}
void yon_window_config_custom_window_set(GtkWindow *window, char *window_name){
int height=0;
int width=0;
int X=0;
int Y=0;
gtk_window_get_size(window,&width,&height);
gtk_window_get_position(window,&X,&Y);
yon_window_config_add_instant_parameter(yon_char_append(window_name,"Width"),"window",&width,YON_TYPE_INT);
yon_window_config_add_instant_parameter(yon_char_append(window_name,"Height"),"window",&height,YON_TYPE_INT);
yon_window_config_add_instant_parameter(yon_char_append(window_name,"PosX"),"window",&X,YON_TYPE_INT);
yon_window_config_add_instant_parameter(yon_char_append(window_name,"PosY"),"window",&Y,YON_TYPE_INT);
}
GtkWidget *yon_ubl_menu_item_about_new(char *buttonname){
GtkWidget *menu_item = gtk_menu_item_new();
gtk_style_context_add_class(gtk_widget_get_style_context(menu_item),"menuitembottom");
@ -2092,6 +2264,30 @@ void yon_ubl_status_highlight_incorrect(GtkWidget *widget){
GThread *thread = g_thread_new(NULL,(GThreadFunc)_yon_ubl_status_highlight_incorrect,widget);
}
void _yon_ubl_status_list_store_highlight_incorrect(GtkWidget **widget_pack){
GtkListStore *list = (GtkListStore*)widget_pack[0];
GtkTreeIter *iter = (GtkTreeIter*)widget_pack[1];
GdkRGBA rgba,rgba2;
rgba.alpha=1;
rgba.blue=153.0/255.0;
rgba.green=153.0/255.0;
rgba.red=234.0/255.0;
rgba2.alpha=1;
rgba2.blue=0;
rgba2.green=0;
rgba2.red=0;
gtk_list_store_set(list,iter,1,gdk_rgba_to_string(&rgba2),2,gdk_rgba_to_string(&rgba),-1);
sleep(5);
gtk_list_store_set(list,iter,1,NULL,2,NULL,-1);
}
void yon_ubl_status_list_store_highlight_incorrect(GtkListStore *list, GtkTreeIter *iter){
GtkWidget **pack = malloc(sizeof(GtkWidget *)*2);
pack[0]=(GtkWidget*)list;
pack[1]=(GtkWidget*)iter;
GThread *thread = g_thread_new(NULL,(GThreadFunc)_yon_ubl_status_list_store_highlight_incorrect,pack);
}
struct temp_statusbox {
int times;
GtkWidget *revealer;
@ -2099,7 +2295,7 @@ struct temp_statusbox {
void _yon_ubl_status_box_timed_remove(struct temp_statusbox *statusstruct){
sleep(statusstruct->times);
if (statusstruct->revealer){
if (status_thread_busy){
gtk_revealer_set_reveal_child(GTK_REVEALER(statusstruct->revealer),0);
sleep(1);
gtk_widget_destroy(statusstruct->revealer);
@ -2108,6 +2304,10 @@ void _yon_ubl_status_box_timed_remove(struct temp_statusbox *statusstruct){
status_thread_busy=0;
}
void __yon_ubl_status_box_destroyed(){
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);
@ -2121,6 +2321,7 @@ void yon_ubl_status_box_spawn(GtkContainer *container,char *display_text, int ti
gtk_widget_show_all(revealer);
gtk_revealer_set_reveal_child(GTK_REVEALER(revealer),1);
g_signal_connect(G_OBJECT(revealer),"destroy", G_CALLBACK(__yon_ubl_status_box_destroyed),NULL);
gtk_widget_set_margin_bottom(label,9);
gtk_widget_set_margin_top(label,9);

@ -15,6 +15,7 @@
#include <gtk/gtk.h>
#include <gtk/gtkx.h>
#include <vte/vte.h>
#include <time.h>
#include "../compile/ubl-cmake.h"
#ifdef WEBKIT_FOUND
@ -154,6 +155,8 @@ char **yon_char_parsed_rip(char **char_string, int *size, int item_to_delete);
int yon_char_parsed_check_exist(char **parameters, int size, char *param);
int yon_char_parsed_check_repeats(char **parameters, int size, int *first_overlap, int *second_overlap);
int yon_char_find_count(char *source, char *find);
int yon_char_parsed_includes_char_parsed (config_str source, config_str to_check, int source_size, int check_size);
@ -188,6 +191,10 @@ apps *yon_apps_get_by_name(apps *applist, char *name, int size);
config_str yon_file_open(char *file_path, int *size);
int yon_file_create(char *path, char *name, int rules);
int yon_file_create_full_path(char *path, int rules);
config_str yon_dir_get_contents(char *dir_path, int *size);
//config functions
@ -288,6 +295,12 @@ void yon_window_config_erase_custom_parameter(char *param_name, char *section);
int yon_window_config_get_parameter(char *section, char *config_parameter, void *return_value, enum YON_TYPE type);
void yon_window_config_custom_window_setup(GtkWindow *window, char *window_name);
void yon_window_config_custom_window_get(GtkWindow *window, char *window_name);
void yon_window_config_custom_window_set(GtkWindow *window, char *window_name);
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);
@ -354,6 +367,8 @@ void yon_ubl_status_box_render(char *text, BACKGROUND_IMAGE_TYPE type);
void yon_ubl_status_highlight_incorrect(GtkWidget *widget);
void yon_ubl_status_list_store_highlight_incorrect(GtkListStore *list, GtkTreeIter *iter);
static int status_thread_busy;
void yon_ubl_status_box_spawn(GtkContainer *container,char *display_text, int timeout,BACKGROUND_IMAGE_TYPE type);

@ -3,6 +3,13 @@
<interface domain="ubl-settings-logging">
<requires lib="gtk+" version="3.24"/>
<!-- interface-css-provider-path ubl-settings-logging.css -->
<object class="GtkSizeGroup">
<widgets>
<widget name="label1"/>
<widget name="label2"/>
<widget name="label3"/>
</widgets>
</object>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">1024</property>
<property name="step-increment">1</property>
@ -28,26 +35,6 @@
<property name="can-focus">False</property>
<property name="icon-name">emblem-ok-symbolic</property>
</object>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.ubl-settings-logging.sort-symbolic</property>
</object>
<object class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.ubl-settings-logging.sort-symbolic</property>
</object>
<object class="GtkImage" id="image7">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.ubl-settings-logging.sort-symbolic</property>
</object>
<object class="GtkImage" id="image8">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.ubl-settings-logging.sort-symbolic</property>
</object>
<object class="GtkDialog" id="MainWindow">
<property name="width-request">450</property>
<property name="can-focus">False</property>
@ -57,9 +44,6 @@
<child internal-child="vbox">
<object class="GtkBox">
<property name="can-focus">False</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
@ -103,6 +87,92 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="StatusBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkFrame" id="StatisticsFrame">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label-xalign">0.019999999552965164</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkAlignment">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="top-padding">5</property>
<property name="bottom-padding">12</property>
<property name="left-padding">5</property>
<property name="right-padding">5</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Log size:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="LogSizeLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">0.0 Mb</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Statistics</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack-type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
@ -190,6 +260,8 @@
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">5</property>
@ -260,19 +332,6 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
@ -372,66 +431,23 @@
</packing>
</child>
<child>
<object class="GtkFrame" id="StatisticsFrame">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label-xalign">0.019999999552965164</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkAlignment">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="top-padding">5</property>
<property name="bottom-padding">12</property>
<property name="left-padding">5</property>
<property name="right-padding">5</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel">
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Log size:</property>
<property name="xalign">0</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="LogSizeLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">0.0 Mb</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">3</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Statistics</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack-type">end</property>
<property name="position">4</property>
<property name="position">1</property>
</packing>
</child>
</object>
@ -476,11 +492,24 @@
</object>
</child>
</object>
<object class="GtkSizeGroup">
<widgets>
<widget name="label1"/>
<widget name="label2"/>
<widget name="label3"/>
</widgets>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.ubl-settings-logging.sort-symbolic</property>
</object>
<object class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.ubl-settings-logging.sort-symbolic</property>
</object>
<object class="GtkImage" id="image7">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.ubl-settings-logging.sort-symbolic</property>
</object>
<object class="GtkImage" id="image8">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.ubl-settings-logging.sort-symbolic</property>
</object>
</interface>

@ -33,7 +33,6 @@
<child>
<object class="GtkCheckButton" id="FileOrDirCheck">
<property name="label" translatable="yes">Choose directory instead of file</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>

@ -2,7 +2,6 @@
<!-- Generated with glade 3.38.2 -->
<interface domain="ubl-settings-logging">
<requires lib="gtk+" version="3.24"/>
<requires lib="vte-2.91" version="0.68"/>
<!-- interface-css-provider-path ubl-settings-logging.css -->
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">100</property>
@ -14,11 +13,6 @@
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment3">
<property name="upper">100</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can-focus">False</property>
@ -59,10 +53,19 @@
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.ubl-settings-logging.generic7-symbolic</property>
</object>
<object class="GtkListStore" id="liststore1">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
<!-- column-name gchararray2 -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkWindow" id="MainWindow">
<property name="width-request">800</property>
<property name="height-request">600</property>
<property name="can-focus">False</property>
<property name="modal">True</property>
<property name="default-width">800</property>
<property name="default-height">600</property>
<property name="icon-name">com.ublinux.ubl-settings-logging</property>
@ -242,16 +245,10 @@
</packing>
</child>
<child>
<object class="VteTerminal" id="LoggingTerminal">
<object class="GtkNotebook" id="MainNotebook">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hscroll-policy">natural</property>
<property name="vadjustment">adjustment3</property>
<property name="vscroll-policy">natural</property>
<property name="encoding">UTF-8</property>
<property name="scrollback-lines">0</property>
<property name="scroll-on-keystroke">True</property>
<property name="scroll-on-output">False</property>
<property name="can-focus">True</property>
<property name="scrollable">True</property>
</object>
<packing>
<property name="expand">True</property>
@ -260,14 +257,53 @@
</packing>
</child>
<child>
<object class="GtkScrollbar">
<object class="GtkScrolledWindow">
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="JournaldTree">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="adjustment">adjustment3</property>
<property name="can-focus">True</property>
<property name="model">liststore1</property>
<property name="headers-visible">False</property>
<property name="enable-grid-lines">both</property>
<property name="tooltip-column">0</property>
<child>
<object class="GtkTreeViewColumn">
<property name="sizing">fixed</property>
<property name="fixed-width">175</property>
<property name="min-width">75</property>
<property name="title" translatable="yes">column</property>
<child>
<object class="GtkCellRendererText">
<property name="ellipsize">end</property>
</object>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">column</property>
<property name="expand">True</property>
<child>
<object class="GtkCellRendererText">
<property name="wrap-mode">word</property>
<property name="wrap-width">500</property>
</object>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
@ -321,5 +357,4 @@
</object>
</child>
</object>
<object class="GtkTextBuffer" id="textbuffer1"/>
</interface>

@ -94,6 +94,7 @@
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
@ -963,6 +964,20 @@
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="spacing">5</property>
<child>
<object class="GtkButton" id="ResetButton">
<property name="label" translatable="yes">Reset</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">image5</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="CancelButton">
<property name="label" translatable="yes">Cancel</property>
@ -974,7 +989,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="position">1</property>
</packing>
</child>
<child>
@ -988,7 +1003,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
</object>
@ -1047,4 +1062,9 @@
<widget name="label2"/>
</widgets>
</object>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.ubl-settings-logging.funnel-symbolic</property>
</object>
</interface>

@ -92,6 +92,10 @@
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
<!-- column-name gchararray2 -->
<column type="gchararray"/>
<!-- column-name gchararray3 -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkWindow" id="MainWindow">
@ -318,12 +322,17 @@
<property name="can-focus">True</property>
<property name="model">liststore1</property>
<property name="headers-visible">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Path</property>
<child>
<object class="GtkCellRendererText" id="PathCell"/>
<attributes>
<attribute name="background">2</attribute>
<attribute name="foreground">1</attribute>
<attribute name="text">0</attribute>
</attributes>
</child>

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<interface>
<interface domain="ubl-settings-logging">
<requires lib="gtk+" version="3.24"/>
<!-- interface-css-provider-path ubl-settings-logging.css -->
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can-focus">False</property>

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<interface domain="ubl-settings-logging">
<requires lib="gtk+" version="3.24"/>
<requires lib="vte-2.91" version="0.68"/>
<object class="GtkAdjustment" id="adjustment3">
<property name="upper">100</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkBox" id="TerminalBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="VteTerminal" id="LoggingTerminal">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hscroll-policy">natural</property>
<property name="vadjustment">adjustment3</property>
<property name="vscroll-policy">natural</property>
<property name="cursor-blink-mode">off</property>
<property name="cursor-shape">underline</property>
<property name="encoding">UTF-8</property>
<property name="pointer-autohide">True</property>
<property name="scrollback-lines">0</property>
<property name="scroll-on-keystroke">True</property>
<property name="scroll-on-output">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="UnfoundLabel">
<property name="can-focus">False</property>
<property name="label" translatable="yes">Label</property>
<property name="xalign">0.019999999552965164</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="foreground" value="#e0e01b1b2424"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrollbar">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="adjustment">adjustment3</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</interface>

@ -473,7 +473,7 @@ translated and supported by community.</property>
<col id="0">journald</col>
<col id="1">/var/log/journal/</col>
<col id="2" translatable="yes">System event log</col>
<col id="3">False</col>
<col id="3">True</col>
<col id="4">0</col>
</row>
</data>
@ -508,6 +508,12 @@ translated and supported by community.</property>
<property name="can-focus">False</property>
<property name="take-focus">False</property>
<property name="reserve-toggle-size">False</property>
<child>
<object class="GtkCheckMenuItem" id="UpgradePermissionsMenuItem">
<property name="can-focus">False</property>
<property name="label" translatable="yes">Upgrade permissions to root</property>
</object>
</child>
</object>
<object class="GtkMenu" id="menu3">
<property name="visible">True</property>
@ -719,7 +725,6 @@ translated and supported by community.</property>
<child>
<object class="GtkButton" id="MainAddButton">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Add log</property>
@ -1043,6 +1048,7 @@ translated and supported by community.</property>
<object class="GtkHeaderBar" id="headerBar">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">5</property>
<property name="show-close-button">True</property>
<child type="title">
<object class="GtkLabel" id="headerTopic">

@ -413,304 +413,356 @@ msgstr ""
msgid "Years"
msgstr ""
#: source/ubl-strings.h:106
msgid "Log/Journal:"
#: source/ubl-strings.h:104
msgid "Reset"
msgstr ""
#: source/ubl-strings.h:107
msgid "Paths to log and journals files"
msgid "Log/Journal:"
msgstr ""
#: source/ubl-strings.h:108
msgid "On"
msgid "Paths to log and journals files"
msgstr ""
#: source/ubl-strings.h:109
msgid "On"
msgstr ""
#: source/ubl-strings.h:110
msgid "Off"
msgstr ""
#: source/ubl-strings.h:110 source/ubl-strings.h:164
#: source/ubl-strings.h:111 source/ubl-strings.h:165
msgid "Scenarios"
msgstr ""
#: source/ubl-strings.h:111 source/ubl-strings.h:163
#: source/ubl-strings.h:112 source/ubl-strings.h:164
msgid "Scenarios are running for each rotated journal"
msgstr ""
#: source/ubl-strings.h:112
#: source/ubl-strings.h:113
msgid "Command before rotation (one time):"
msgstr ""
#: source/ubl-strings.h:113
#: source/ubl-strings.h:114
msgid "Command after rotation (one time):"
msgstr ""
#: source/ubl-strings.h:114
#: source/ubl-strings.h:115
msgid "Command before rotation:"
msgstr ""
#: source/ubl-strings.h:115
#: source/ubl-strings.h:116
msgid "Command after rotation:"
msgstr ""
#: source/ubl-strings.h:116
#: source/ubl-strings.h:117
msgid "Rotation period:"
msgstr ""
#: source/ubl-strings.h:117
#: source/ubl-strings.h:118
msgid "Maximum size of file:"
msgstr ""
#: source/ubl-strings.h:118
#: source/ubl-strings.h:119
msgid "Checking frequency configuration"
msgstr ""
#: source/ubl-strings.h:119
#: source/ubl-strings.h:120
msgid "File amount:"
msgstr ""
#: source/ubl-strings.h:120
#: source/ubl-strings.h:121
msgid "Store at:"
msgstr ""
#: source/ubl-strings.h:121
#: source/ubl-strings.h:122
msgid "Rotation as user:"
msgstr ""
#: source/ubl-strings.h:122
#: source/ubl-strings.h:123
msgid "Rotation as group:"
msgstr ""
#: source/ubl-strings.h:123
#: source/ubl-strings.h:124
msgid "Rotation configuration"
msgstr ""
#: source/ubl-strings.h:124
#: source/ubl-strings.h:125
msgid "Error processing:"
msgstr ""
#: source/ubl-strings.h:125
#: source/ubl-strings.h:126
msgid "Rotation of jurnal even when it is empty:"
msgstr ""
#: source/ubl-strings.h:126
#: source/ubl-strings.h:127
msgid "Do not rotate journal younger than"
msgstr ""
#: source/ubl-strings.h:127
#: source/ubl-strings.h:128
msgid "days"
msgstr ""
#: source/ubl-strings.h:128
#: source/ubl-strings.h:129
msgid "Delete rotated journals older than"
msgstr ""
#: source/ubl-strings.h:129
#: source/ubl-strings.h:130
msgid "Rotate journals if size more than"
msgstr ""
#: source/ubl-strings.h:130
#: source/ubl-strings.h:131
msgid "but not earlier than the specified time interval"
msgstr ""
#: source/ubl-strings.h:131
#: source/ubl-strings.h:132
msgid "before specified time interval"
msgstr ""
#: source/ubl-strings.h:132
#: source/ubl-strings.h:133
msgid "File choosing configuration"
msgstr ""
#: source/ubl-strings.h:133
#: source/ubl-strings.h:134
msgid "Create log"
msgstr ""
#: source/ubl-strings.h:134
#: source/ubl-strings.h:135
msgid "as user:"
msgstr ""
#: source/ubl-strings.h:135
#: source/ubl-strings.h:136
msgid "as group:"
msgstr ""
#: source/ubl-strings.h:136
#: source/ubl-strings.h:137
msgid "rules:"
msgstr ""
#: source/ubl-strings.h:137
#: source/ubl-strings.h:138
msgid ""
"Cut source journal fileafter copy creating instead of moving old journal "
"file and creating new one"
msgstr ""
#: source/ubl-strings.h:138
#: source/ubl-strings.h:139
msgid "Files and directories configuration"
msgstr ""
#: source/ubl-strings.h:139
#: source/ubl-strings.h:140
msgid "Delay compression by one journal in queue:"
msgstr ""
#: source/ubl-strings.h:140
#: source/ubl-strings.h:141
msgid "Compression configuration"
msgstr ""
#: source/ubl-strings.h:141
#: source/ubl-strings.h:142
msgid "Save original log file after rotation if it has specified extension:"
msgstr ""
#: source/ubl-strings.h:142
#: source/ubl-strings.h:143
msgid "Add date of rotation before log header"
msgstr ""
#: source/ubl-strings.h:143
#: source/ubl-strings.h:144
msgid "Number from which numbering of old logs will begin"
msgstr ""
#: source/ubl-strings.h:144
#: source/ubl-strings.h:145
msgid "Filename configuration"
msgstr ""
#: source/ubl-strings.h:145
#: source/ubl-strings.h:146
msgid "Email after rotation:"
msgstr ""
#: source/ubl-strings.h:146
#: source/ubl-strings.h:147
msgid "adress:"
msgstr ""
#: source/ubl-strings.h:147
#: source/ubl-strings.h:148
msgid "contents:"
msgstr ""
#: source/ubl-strings.h:148 source/ubl-strings.h:161
#: source/ubl-strings.h:149 source/ubl-strings.h:162
msgid "Message configuration"
msgstr ""
#: source/ubl-strings.h:149
#: source/ubl-strings.h:150
msgid "Manual input:"
msgstr ""
#: source/ubl-strings.h:150
#: source/ubl-strings.h:151
msgid "Log (-s) size:"
msgstr ""
#: source/ubl-strings.h:151
#: source/ubl-strings.h:152
msgid "Same directory"
msgstr ""
#: source/ubl-strings.h:152
#: source/ubl-strings.h:153
msgid "Separate directory"
msgstr ""
#: source/ubl-strings.h:153
#: source/ubl-strings.h:154
msgid "Output errors if log file does not exist*"
msgstr ""
#: source/ubl-strings.h:154
#: source/ubl-strings.h:155
msgid "Do not output errors if log file does not exist"
msgstr ""
#: source/ubl-strings.h:155
#: source/ubl-strings.h:156
msgid "Do not output"
msgstr ""
#: source/ubl-strings.h:156
#: source/ubl-strings.h:157
msgid "Output errors"
msgstr ""
#: source/ubl-strings.h:157
#: source/ubl-strings.h:158
msgid "Send Email"
msgstr ""
#: source/ubl-strings.h:158
#: source/ubl-strings.h:159
msgid "Don't send Email"
msgstr ""
#: source/ubl-strings.h:159
#: source/ubl-strings.h:160
msgid "First rotated copy"
msgstr ""
#: source/ubl-strings.h:160
#: source/ubl-strings.h:161
msgid "Last rotated copy"
msgstr ""
#: source/ubl-strings.h:162
#: source/ubl-strings.h:163
msgid "Endwork command:"
msgstr ""
#: source/ubl-strings.h:165
#: source/ubl-strings.h:166
msgid "Hourly"
msgstr ""
#: source/ubl-strings.h:166
#: source/ubl-strings.h:167
msgid "Daily"
msgstr ""
#: source/ubl-strings.h:167
#: source/ubl-strings.h:168
msgid "Weekly*"
msgstr ""
#: source/ubl-strings.h:168
#: source/ubl-strings.h:169
msgid "Monthly"
msgstr ""
#: source/ubl-strings.h:169
#: source/ubl-strings.h:170
msgid "Yearly"
msgstr ""
#: source/ubl-strings.h:170
#: source/ubl-strings.h:171
msgid "Monday"
msgstr ""
#: source/ubl-strings.h:171
#: source/ubl-strings.h:172
msgid "Tuesday"
msgstr ""
#: source/ubl-strings.h:172
#: source/ubl-strings.h:173
msgid "Wednesday"
msgstr ""
#: source/ubl-strings.h:173
#: source/ubl-strings.h:174
msgid "Thursday"
msgstr ""
#: source/ubl-strings.h:174
#: source/ubl-strings.h:175
msgid "Friday"
msgstr ""
#: source/ubl-strings.h:175
#: source/ubl-strings.h:176
msgid "Saturday"
msgstr ""
#: source/ubl-strings.h:176
#: source/ubl-strings.h:177
msgid "Sunday*"
msgstr ""
#: source/ubl-strings.h:178
msgid "Same record already exists"
msgstr ""
#: source/ubl-strings.h:179
msgid "System configuration"
msgid "Empty important field"
msgstr ""
#: source/ubl-strings.h:180
msgid "Repeating paths"
msgstr ""
#: source/ubl-strings.h:181
msgid "Write down all important fields"
msgstr ""
#: source/ubl-strings.h:184
msgid "System configuration"
msgstr ""
#: source/ubl-strings.h:185
msgid "Applications configuration"
msgstr ""
#: source/ubl-strings.h:183
#: source/ubl-strings.h:188
msgid "Path (-s):"
msgstr ""
#: source/ubl-strings.h:184
#: source/ubl-strings.h:189
msgid "Control:"
msgstr ""
#: source/ubl-strings.h:185
#: source/ubl-strings.h:190
msgid "Log file"
msgstr ""
#: source/ubl-strings.h:186
#: source/ubl-strings.h:191
msgid "Name:"
msgstr ""
#: source/ubl-strings.h:194
msgid "Owner rules"
msgstr ""
#: source/ubl-strings.h:195
msgid "Group rules"
msgstr ""
#: source/ubl-strings.h:196
msgid "Public rules"
msgstr ""
#: source/ubl-strings.h:197
msgid "Read"
msgstr ""
#: source/ubl-strings.h:198
msgid "Write"
msgstr ""
#: source/ubl-strings.h:199
msgid "Execute"
msgstr ""
#: source/ubl-strings.h:200
msgid "Value:"
msgstr ""
#: source/ubl-strings.h:203
msgid ": no such file(s)"
msgstr ""
msgid "System event log rotation service"
msgstr ""

@ -423,131 +423,135 @@ msgstr "Недель"
msgid "Years"
msgstr "Лет"
#: source/ubl-strings.h:106
#: source/ubl-strings.h:104
msgid "Reset"
msgstr "По умлочанию"
#: source/ubl-strings.h:107
msgid "Log/Journal:"
msgstr "Лог/Журнал:"
#: source/ubl-strings.h:107
#: source/ubl-strings.h:108
msgid "Paths to log and journals files"
msgstr "Пути к файлам лога/журнала"
#: source/ubl-strings.h:108
#: source/ubl-strings.h:109
msgid "On"
msgstr "Включено"
#: source/ubl-strings.h:109
#: source/ubl-strings.h:110
msgid "Off"
msgstr "Выключено"
#: source/ubl-strings.h:110 source/ubl-strings.h:164
#: source/ubl-strings.h:111 source/ubl-strings.h:165
msgid "Scenarios"
msgstr "Сценарии"
#: source/ubl-strings.h:111 source/ubl-strings.h:163
#: source/ubl-strings.h:112 source/ubl-strings.h:164
msgid "Scenarios are running for each rotated journal"
msgstr "Сценарии запускаются для каждого ротируемого журнала"
#: source/ubl-strings.h:112
#: source/ubl-strings.h:113
msgid "Command before rotation (one time):"
msgstr "Команда перед ротацией (один раз):"
#: source/ubl-strings.h:113
#: source/ubl-strings.h:114
msgid "Command after rotation (one time):"
msgstr "Команда после ротации (один раз):"
#: source/ubl-strings.h:114
#: source/ubl-strings.h:115
msgid "Command before rotation:"
msgstr "Команда перед ротацией:"
#: source/ubl-strings.h:115
#: source/ubl-strings.h:116
msgid "Command after rotation:"
msgstr "Команда после ротации:"
#: source/ubl-strings.h:116
#: source/ubl-strings.h:117
msgid "Rotation period:"
msgstr "Период ротации:"
#: source/ubl-strings.h:117
#: source/ubl-strings.h:118
msgid "Maximum size of file:"
msgstr "Максимальный размер файла:"
#: source/ubl-strings.h:118
#: source/ubl-strings.h:119
msgid "Checking frequency configuration"
msgstr "Настройки частоты проверки"
#: source/ubl-strings.h:119
#: source/ubl-strings.h:120
msgid "File amount:"
msgstr "Количество файлов:"
#: source/ubl-strings.h:120
#: source/ubl-strings.h:121
msgid "Store at:"
msgstr "Хранить в:"
#: source/ubl-strings.h:121
#: source/ubl-strings.h:122
msgid "Rotation as user:"
msgstr "Ротация от пользователя:"
#: source/ubl-strings.h:122
#: source/ubl-strings.h:123
msgid "Rotation as group:"
msgstr "Ротация от группы:"
#: source/ubl-strings.h:123
#: source/ubl-strings.h:124
msgid "Rotation configuration"
msgstr "Настройки ротации"
#: source/ubl-strings.h:124
#: source/ubl-strings.h:125
msgid "Error processing:"
msgstr "Обработка ошибок:"
#: source/ubl-strings.h:125
#: source/ubl-strings.h:126
msgid "Rotation of jurnal even when it is empty:"
msgstr "Ротация файла журнала даже если он пуст:"
#: source/ubl-strings.h:126
#: source/ubl-strings.h:127
msgid "Do not rotate journal younger than"
msgstr "Не ротировать журналы, возраст которых меньше"
#: source/ubl-strings.h:127
#: source/ubl-strings.h:128
msgid "days"
msgstr "дней"
#: source/ubl-strings.h:128
#: source/ubl-strings.h:129
msgid "Delete rotated journals older than"
msgstr "Удалить ротированные журналы старше"
#: source/ubl-strings.h:129
#: source/ubl-strings.h:130
msgid "Rotate journals if size more than"
msgstr "Ротация журналов, если размер превышает"
#: source/ubl-strings.h:130
#: source/ubl-strings.h:131
msgid "but not earlier than the specified time interval"
msgstr "но не раньше указанного интервала времени"
#: source/ubl-strings.h:131
#: source/ubl-strings.h:132
msgid "before specified time interval"
msgstr "до истечения указанного интервала времени"
#: source/ubl-strings.h:132
#: source/ubl-strings.h:133
msgid "File choosing configuration"
msgstr "Настройки выбора файла"
#: source/ubl-strings.h:133
#: source/ubl-strings.h:134
msgid "Create log"
msgstr "Создавать лог"
#: source/ubl-strings.h:134
#: source/ubl-strings.h:135
msgid "as user:"
msgstr "от пользователя:"
#: source/ubl-strings.h:135
#: source/ubl-strings.h:136
msgid "as group:"
msgstr "от группы:"
#: source/ubl-strings.h:136
#: source/ubl-strings.h:137
msgid "rules:"
msgstr "права:"
#: source/ubl-strings.h:137
#: source/ubl-strings.h:138
msgid ""
"Cut source journal fileafter copy creating instead of moving old journal "
"file and creating new one"
@ -555,176 +559,225 @@ msgstr ""
"После создания копии, обрезать исходный файл журнала взамен перемещения "
"старого файла журнала и создания нового"
#: source/ubl-strings.h:138
#: source/ubl-strings.h:139
msgid "Files and directories configuration"
msgstr "Настройки файлов и папок"
#: source/ubl-strings.h:139
#: source/ubl-strings.h:140
msgid "Delay compression by one journal in queue:"
msgstr "Отложить сжание на один журнал в очереди:"
#: source/ubl-strings.h:140
#: source/ubl-strings.h:141
msgid "Compression configuration"
msgstr "Настройка сжатия"
#: source/ubl-strings.h:141
#: source/ubl-strings.h:142
msgid "Save original log file after rotation if it has specified extension:"
msgstr ""
"Сохранять оригинальный лог после ротации, если у него указано расширение:"
#: source/ubl-strings.h:142
#: source/ubl-strings.h:143
msgid "Add date of rotation before log header"
msgstr "Добавлять дату ротации перед заголовком старого лога:"
#: source/ubl-strings.h:143
#: source/ubl-strings.h:144
msgid "Number from which numbering of old logs will begin"
msgstr "Номер, с которого будет начата нумерация старых логов:"
#: source/ubl-strings.h:144
#: source/ubl-strings.h:145
msgid "Filename configuration"
msgstr "Настройка имени файлов"
#: source/ubl-strings.h:145
#: source/ubl-strings.h:146
msgid "Email after rotation:"
msgstr "Отправка Email после ротации:"
#: source/ubl-strings.h:146
#: source/ubl-strings.h:147
msgid "adress:"
msgstr "на адрес:"
#: source/ubl-strings.h:147
#: source/ubl-strings.h:148
msgid "contents:"
msgstr "содержимое:"
#: source/ubl-strings.h:148 source/ubl-strings.h:161
#: source/ubl-strings.h:149 source/ubl-strings.h:162
msgid "Message configuration"
msgstr "Настройка сообщения"
#: source/ubl-strings.h:149
#: source/ubl-strings.h:150
msgid "Manual input:"
msgstr "Команды настройки"
#: source/ubl-strings.h:150
#: source/ubl-strings.h:151
msgid "Log (-s) size:"
msgstr "Общий размер лога (-ов):"
#: source/ubl-strings.h:151
#: source/ubl-strings.h:152
msgid "Same directory"
msgstr "Той же папке"
#: source/ubl-strings.h:152
#: source/ubl-strings.h:153
msgid "Separate directory"
msgstr "Другой папке"
#: source/ubl-strings.h:153
#: source/ubl-strings.h:154
msgid "Output errors if log file does not exist*"
msgstr "Выводить ошибки, если лог файла не существует*"
#: source/ubl-strings.h:154
#: source/ubl-strings.h:155
msgid "Do not output errors if log file does not exist"
msgstr "Не выводить ошибки, если лог файла не существует"
#: source/ubl-strings.h:155
#: source/ubl-strings.h:156
msgid "Do not output"
msgstr "Не выводить"
#: source/ubl-strings.h:156
#: source/ubl-strings.h:157
msgid "Output errors"
msgstr "Выводить ошибки"
#: source/ubl-strings.h:157
#: source/ubl-strings.h:158
msgid "Send Email"
msgstr "Отправлять Email"
#: source/ubl-strings.h:158
#: source/ubl-strings.h:159
msgid "Don't send Email"
msgstr "Не отправлять Email"
#: source/ubl-strings.h:159
#: source/ubl-strings.h:160
msgid "First rotated copy"
msgstr "Первая ротированная копия"
#: source/ubl-strings.h:160
#: source/ubl-strings.h:161
msgid "Last rotated copy"
msgstr "Последняя ротированная копия"
#: source/ubl-strings.h:162
#: source/ubl-strings.h:163
msgid "Endwork command:"
msgstr "Команда перед удалением файла журнала:"
#: source/ubl-strings.h:165
#: source/ubl-strings.h:166
#, fuzzy
msgid "Hourly"
msgstr "Час"
#: source/ubl-strings.h:166
#: source/ubl-strings.h:167
msgid "Daily"
msgstr "День"
#: source/ubl-strings.h:167
#: source/ubl-strings.h:168
msgid "Weekly*"
msgstr "Неделя*"
#: source/ubl-strings.h:168
#: source/ubl-strings.h:169
msgid "Monthly"
msgstr "Месяц"
#: source/ubl-strings.h:169
#: source/ubl-strings.h:170
msgid "Yearly"
msgstr "Год"
#: source/ubl-strings.h:170
#: source/ubl-strings.h:171
msgid "Monday"
msgstr "Понедельник"
#: source/ubl-strings.h:171
#: source/ubl-strings.h:172
msgid "Tuesday"
msgstr "Вторник"
#: source/ubl-strings.h:172
#: source/ubl-strings.h:173
msgid "Wednesday"
msgstr "Среда"
#: source/ubl-strings.h:173
#: source/ubl-strings.h:174
msgid "Thursday"
msgstr "Четверг"
#: source/ubl-strings.h:174
#: source/ubl-strings.h:175
msgid "Friday"
msgstr "Пятница"
#: source/ubl-strings.h:175
#: source/ubl-strings.h:176
msgid "Saturday"
msgstr "Суббота"
#: source/ubl-strings.h:176
#: source/ubl-strings.h:177
msgid "Sunday*"
msgstr "Воскресенье*"
#: source/ubl-strings.h:178
msgid "Same record already exists"
msgstr "Такая запись уже существует"
#: source/ubl-strings.h:179
msgid "Empty important field"
msgstr "Важное поле не заполнено"
#: source/ubl-strings.h:180
msgid "Repeating paths"
msgstr "Повторяющиеся пути"
#: source/ubl-strings.h:181
#, fuzzy
msgid "Write down all important fields"
msgstr "Введите все необходимые поля"
#: source/ubl-strings.h:184
msgid "System configuration"
msgstr "Настройки системы"
#: source/ubl-strings.h:180
#: source/ubl-strings.h:185
msgid "Applications configuration"
msgstr "Настройки приложений"
#: source/ubl-strings.h:183
#: source/ubl-strings.h:188
msgid "Path (-s):"
msgstr "Путь (-и):"
#: source/ubl-strings.h:184
#: source/ubl-strings.h:189
msgid "Control:"
msgstr "Управление:"
#: source/ubl-strings.h:185
#: source/ubl-strings.h:190
msgid "Log file"
msgstr "Файл лога"
#: source/ubl-strings.h:186
#: source/ubl-strings.h:191
msgid "Name:"
msgstr "Имя:"
#: source/ubl-strings.h:194
msgid "Owner rules"
msgstr "Правила владельца"
#: source/ubl-strings.h:195
msgid "Group rules"
msgstr "Правила группы"
#: source/ubl-strings.h:196
msgid "Public rules"
msgstr "Правила остальных"
#: source/ubl-strings.h:197
msgid "Read"
msgstr "Чтение"
#: source/ubl-strings.h:198
msgid "Write"
msgstr "Запись"
#: source/ubl-strings.h:199
msgid "Execute"
msgstr "Исполнение"
#: source/ubl-strings.h:200
msgid "Value:"
msgstr "Значение:"
#: source/ubl-strings.h:203
msgid ": no such file(s)"
msgstr ": файл(ы) не найден(ы)"
msgid "System event log rotation service"
msgstr "Служба ротации системных журналов событий"

Loading…
Cancel
Save