Fixed empty screen if nothing were found

pull/80/head
Ivan Yartsev 2 years ago
parent 071b605a57
commit cbe6cc4870

@ -540,6 +540,12 @@ void on_inspector_open(GtkWidget *self, main_window *widgets){
window->terminals = NULL; window->terminals = NULL;
if (strcmp(name,"journald")){ if (strcmp(name,"journald")){
window->last_mode=-1; window->last_mode=-1;
if (window->journal_size==0){
GtkWidget *terminal = yon_inspector_add_terminal(window,window->journal_name,0);
if (terminal){
yon_dictionary_add_or_create_if_exists_with_data(window->terminals,window->journal_name,terminal);
}
} else {
for (int i=0;i<window->journal_size;i++){ for (int i=0;i<window->journal_size;i++){
if (!access(window->journal_paths[i],F_OK)){ if (!access(window->journal_paths[i],F_OK)){
GFile *file = g_file_new_for_path(window->journal_paths[i]); GFile *file = g_file_new_for_path(window->journal_paths[i]);
@ -553,6 +559,7 @@ void on_inspector_open(GtkWidget *self, main_window *widgets){
yon_dictionary_add_or_create_if_exists_with_data(window->terminals,window->journal_paths[i],terminal); yon_dictionary_add_or_create_if_exists_with_data(window->terminals,window->journal_paths[i],terminal);
} }
} }
}
gtk_widget_hide(window->JournalActionsBox); gtk_widget_hide(window->JournalActionsBox);
} else { } else {
window->last_mode=0; window->last_mode=0;

Loading…
Cancel
Save