|
|
|
@ -1591,6 +1591,7 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind
|
|
|
|
|
}
|
|
|
|
|
config_str logsize = yon_config_load(logrotate_size_command(temp_paths),&sz);
|
|
|
|
|
for (int i=0;i<sz;i++){
|
|
|
|
|
if (logsize[i][strlen(logsize[i])-1]=='\n') logsize[i][strlen(logsize[i])-1]='\0';
|
|
|
|
|
finalsize+=atof(logsize[i]);
|
|
|
|
|
}
|
|
|
|
|
int sizenumber=0;
|
|
|
|
@ -2201,6 +2202,7 @@ journald_window *yon_journald_open(GtkWidget *self, main_window *widgets){
|
|
|
|
|
int sz;
|
|
|
|
|
config_str logsize = yon_config_load(journald_size_command,&sz);
|
|
|
|
|
if (logsize)
|
|
|
|
|
if (logsize[0][strlen(logsize[0])-1]=='\n') logsize[0][strlen(logsize[0])-1]='\0';
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(window->LogSizeLabel),logsize[0]);
|
|
|
|
|
}
|
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->MainWindow),TITLE_LABEL);
|
|
|
|
@ -2598,10 +2600,35 @@ void on_log_edit(GtkWidget *self,main_window *widgets){
|
|
|
|
|
int sz;
|
|
|
|
|
config_str logsize = yon_config_load(journald_size_command,&sz);
|
|
|
|
|
if (logsize)
|
|
|
|
|
if (logsize[0][strlen(logsize[0])-1]=='\n') logsize[0][strlen(logsize[0])-1]='\0';
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(window->LogSizeLabel),logsize[0]);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->JournaldButton),"clicked", G_CALLBACK(on_journald_open),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->JournaldButton),"clicked", G_CALLBACK(on_journald_open),widgets);
|
|
|
|
|
} else {
|
|
|
|
|
gtk_widget_hide(window->JournaldButton);
|
|
|
|
|
if (paths){
|
|
|
|
|
int sz;
|
|
|
|
|
float finalsize=0.0;
|
|
|
|
|
char *temp_paths = yon_char_new(paths);
|
|
|
|
|
config_str parsed_paths = yon_char_parse(temp_paths,&sz,"\n");
|
|
|
|
|
free(temp_paths);
|
|
|
|
|
temp_paths=NULL;
|
|
|
|
|
for (int i=0;i<sz;i++){
|
|
|
|
|
if (!access(parsed_paths[i],F_OK))
|
|
|
|
|
yon_char_unite(temp_paths ? yon_char_append(temp_paths," ") : "",parsed_paths[i],NULL);
|
|
|
|
|
}
|
|
|
|
|
if (!yon_char_is_empty(temp_paths)){
|
|
|
|
|
config_str logsize = yon_config_load(logrotate_size_command(temp_paths),&sz);
|
|
|
|
|
for (int i=0;i<sz;i++){
|
|
|
|
|
if (logsize[i][strlen(logsize[i])-1]=='\n') logsize[i][strlen(logsize[i])-1]='\0';
|
|
|
|
|
finalsize+=atof(logsize[i]);
|
|
|
|
|
}
|
|
|
|
|
int sizenumber=0;
|
|
|
|
|
finalsize = yon_size_convert_automatic(finalsize,&sizenumber);
|
|
|
|
|
char *fin = yon_char_from_float(finalsize);
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(window->LogSizeLabel),yon_char_append(fin,yon_size_get_letter_from_int(sizenumber)));
|
|
|
|
|
gtk_widget_show(window->StatisticsFrame);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|