|
|
@ -205,37 +205,48 @@ void on_inspector_update(GtkWidget *self, inspector_window *window){
|
|
|
|
gtk_text_buffer_get_bounds(window->textbuffer1,&titer,&titerend);
|
|
|
|
gtk_text_buffer_get_bounds(window->textbuffer1,&titer,&titerend);
|
|
|
|
gtk_text_buffer_delete(window->textbuffer1,&titer,&titerend);
|
|
|
|
gtk_text_buffer_delete(window->textbuffer1,&titer,&titerend);
|
|
|
|
config_str output;
|
|
|
|
config_str output;
|
|
|
|
if (self==window->UpdateButton){
|
|
|
|
if (!strcmp(window->journal_name,"journald")){
|
|
|
|
switch(window->last_mode){
|
|
|
|
if (self==window->UpdateButton){
|
|
|
|
case 0: output = yon_config_load(get_journal_output_command, &size);
|
|
|
|
switch(window->last_mode){
|
|
|
|
break;
|
|
|
|
case 0: output = yon_config_load(get_journal_output_command, &size);
|
|
|
|
case 1: output = yon_config_load(get_journal_output_since_boot_command, &size);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 1: output = yon_config_load(get_journal_output_since_boot_command, &size);
|
|
|
|
case 2: output = yon_config_load(get_journal_output_followed_command, &size);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 2: output = yon_config_load(get_journal_output_followed_command, &size);
|
|
|
|
case 3: output = yon_config_load(get_journal_output_kernel_command, &size);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 3: output = yon_config_load(get_journal_output_kernel_command, &size);
|
|
|
|
case 4: output = yon_config_load(get_journal_output_prioritied_command, &size);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 4: output = yon_config_load(get_journal_output_prioritied_command, &size);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (self==window->ShowSinceBootButton){
|
|
|
|
if (self==window->ShowSinceBootButton){
|
|
|
|
window->last_mode=1;
|
|
|
|
window->last_mode=1;
|
|
|
|
output = yon_config_load(get_journal_output_since_boot_command, &size);
|
|
|
|
output = yon_config_load(get_journal_output_since_boot_command, &size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (self==window->NewMessagesButton){
|
|
|
|
if (self==window->NewMessagesButton){
|
|
|
|
window->last_mode=2;
|
|
|
|
window->last_mode=2;
|
|
|
|
output = yon_config_load(get_journal_output_followed_command, &size);
|
|
|
|
output = yon_config_load(get_journal_output_followed_command, &size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (self==window->ShowKernelButton){
|
|
|
|
if (self==window->ShowKernelButton){
|
|
|
|
window->last_mode=3;
|
|
|
|
window->last_mode=3;
|
|
|
|
output = yon_config_load(get_journal_output_kernel_command, &size);
|
|
|
|
output = yon_config_load(get_journal_output_kernel_command, &size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (self==window->ShowPriorityButton){
|
|
|
|
if (self==window->ShowPriorityButton){
|
|
|
|
window->last_mode=4;
|
|
|
|
window->last_mode=4;
|
|
|
|
output = yon_config_load(get_journal_output_prioritied_command, &size);
|
|
|
|
output = yon_config_load(get_journal_output_prioritied_command, &size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (output){
|
|
|
|
if (output){
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
|
|
|
gtk_text_buffer_get_end_iter(window->textbuffer1,&titer);
|
|
|
|
|
|
|
|
gtk_text_buffer_insert(window->textbuffer1,&titer,output[i],-1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_text_buffer_get_end_iter(window->textbuffer1,&titer);
|
|
|
|
|
|
|
|
gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(window->LoggingTextView),&titer,0.25,0,1,0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
window->journal_paths = yon_char_replace(window->journal_paths,"\n"," ");
|
|
|
|
|
|
|
|
output = yon_config_load(yon_char_unite("cat ",window->journal_paths,NULL),&size);
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
gtk_text_buffer_get_end_iter(window->textbuffer1,&titer);
|
|
|
|
gtk_text_buffer_get_end_iter(window->textbuffer1,&titer);
|
|
|
|
gtk_text_buffer_insert(window->textbuffer1,&titer,output[i],-1);
|
|
|
|
gtk_text_buffer_insert(window->textbuffer1,&titer,output[i],-1);
|
|
|
@ -261,19 +272,22 @@ void on_inspector_open(GtkWidget *self, main_window *widgets){
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widgets->list);
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widgets->list);
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
char *name;
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
char *paths;
|
|
|
|
g_signal_connect(G_OBJECT(window->UpdateButton),"clicked", G_CALLBACK(on_inspector_update),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->ShowKernelButton),"clicked", G_CALLBACK(on_inspector_update),window);
|
|
|
|
g_signal_connect(G_OBJECT(window->NewMessagesButton),"clicked", G_CALLBACK(on_inspector_update),window);
|
|
|
|
g_signal_connect(G_OBJECT(window->NewMessagesButton),"clicked", G_CALLBACK(on_inspector_update),window);
|
|
|
|
g_signal_connect(G_OBJECT(window->ShowPriorityButton),"clicked", G_CALLBACK(on_inspector_update),window);
|
|
|
|
g_signal_connect(G_OBJECT(window->ShowPriorityButton),"clicked", G_CALLBACK(on_inspector_update),window);
|
|
|
|
g_signal_connect(G_OBJECT(window->ShowSinceBootButton),"clicked", G_CALLBACK(on_inspector_update),window);
|
|
|
|
g_signal_connect(G_OBJECT(window->ShowSinceBootButton),"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)){
|
|
|
|
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);
|
|
|
|
gtk_tree_model_get(model,&iter,0,&name,1,&paths,-1);
|
|
|
|
if (strcmp(name,"journald")){
|
|
|
|
if (strcmp(name,"journald")){
|
|
|
|
window->last_mode=-1;
|
|
|
|
window->last_mode=-1;
|
|
|
|
gtk_widget_hide(window->JournalActionsBox);
|
|
|
|
gtk_widget_hide(window->JournalActionsBox);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
window->last_mode=0;
|
|
|
|
window->last_mode=0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
window->journal_name=name;
|
|
|
|
|
|
|
|
window->journal_paths=paths;
|
|
|
|
on_inspector_update(window->UpdateButton,window);
|
|
|
|
on_inspector_update(window->UpdateButton,window);
|
|
|
|
gtk_widget_show(window->MainWindow);
|
|
|
|
gtk_widget_show(window->MainWindow);
|
|
|
|
}
|
|
|
|
}
|
|
|
|