Log application settings has been returned

pull/2/head
Ivan Yartsev 2 years ago
parent fb3ea6efc9
commit 29ebf5fd89

@ -562,40 +562,39 @@ main_window *setup_window(){
config_str log = yon_char_parse(services[i],&log_size,";");
gtk_list_store_append(widgets->ServicesList,&iter);
gtk_list_store_set(widgets->ServicesList,&iter,0,0,1,0,2,log[0],3,log[1],-1);
// yon_char_parsed_free(log,log_size);
}
// yon_char_parsed_free(services,service_size);
// config_str dirs = yon_config_load(logrotate_config_command,&dirs_size);
// for (int i=0;i<dirs_size;i++){
// int filesize;
// gboolean bracket_found=0;
// yon_char_divide_search_self(dirs[i],"\n",-1);
// config_str file = yon_file_open(yon_char_append(logrotate_config_path,dirs[i]),&filesize);
// for (int j=0;j<filesize;j++){
// file[i]=yon_char_divide_search(file[j],"\n",-1);
// if (file[i][0]!='#'&&bracket_found==0&&strcmp(file[i],"")){
// if (strstr(file[i],"{")) {
// bracket_found = 1;
// yon_char_divide_search_self(file[i],"{",-1);
// if (!cname) cname = file[i];
// continue;
// }
// if (!cname)
// cname = file[i];
// } else if (file[i][0]!='#'&&bracket_found==1&&strcmp(file[i],"")) {
// if (!strstr(file[i],"}"))
// cparams = yon_char_unite(cparams,",",file[i],NULL);
// else if (strstr(file[i],"}")) break;
// }
// }
// cname = yon_char_replace(cname, " ", "\n");
// if (cname[strlen(cname)-1]=='\n') cname[strlen(cname)-1]='\0';
// gtk_list_store_append(main_config.logrotate_apps_list,&iter);
// gtk_list_store_set(main_config.logrotate_apps_list,&iter,0,dirs[i],1,cname,2,cparams,-1);
// free(cname);
// cname=NULL;
// cparams="";
// }
}
config_str dirs = yon_config_load(logrotate_config_command,&dirs_size);
for (int i=0;i<dirs_size;i++){
int filesize;
gboolean bracket_found=0;
yon_char_divide_search_self(dirs[i],"\n",-1);
config_str file = yon_file_open(yon_char_append(logrotate_config_path,dirs[i]),&filesize);
for (int j=0;j<filesize;j++){
file[j]=yon_char_divide_search(file[j],"\n",-1);
if (file[j][0]!='#'&&bracket_found==0&&strcmp(file[j],"")){
if (strstr(file[j],"{")) {
bracket_found = 1;
yon_char_divide_search_self(file[j],"{",-1);
if (!cname) cname = file[j];
continue;
}
if (!cname)
cname = file[j];
} else if (file[j][0]!='#'&&bracket_found==1&&strcmp(file[j],"")) {
if (!strstr(file[j],"}"))
cparams = yon_char_unite(cparams,",",file[j],NULL);
else if (strstr(file[j],"}")) break;
}
}
if (!cname) continue;
cname = yon_char_replace(cname, " ", "\n");
if (cname[strlen(cname)-1]=='\n') cname[strlen(cname)-1]='\0';
gtk_list_store_append(main_config.logrotate_apps_list,&iter);
gtk_list_store_set(main_config.logrotate_apps_list,&iter,0,dirs[i],1,cname,2,cparams,-1);
free(cname);
cname=NULL;
cparams="";
}
/* Widget registration for config monitoring | Регистрация виджетов для мониторинга конфига */

@ -312,9 +312,21 @@
<object class="GtkTreeView">
<property name="visible">True</property>
<property name="can-focus">True</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"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>

@ -927,6 +927,8 @@ translated and supported by community.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Status</property>
<child>
<object class="GtkCellRendererToggle"/>
@ -938,6 +940,8 @@ translated and supported by community.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Autostart</property>
<child>
<object class="GtkCellRendererToggle"/>
@ -949,6 +953,8 @@ translated and supported by community.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Service</property>
<child>
<object class="GtkCellRendererText"/>
@ -960,6 +966,8 @@ translated and supported by community.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Description</property>
<child>
<object class="GtkCellRendererText"/>

Loading…
Cancel
Save