diff --git a/source/ubl-settings-logging.c b/source/ubl-settings-logging.c index 92e3e50..89ba3e3 100644 --- a/source/ubl-settings-logging.c +++ b/source/ubl-settings-logging.c @@ -356,31 +356,39 @@ void on_inspector_update(GtkWidget *self, inspector_window *window){ gtk_style_context_remove_class(gtk_widget_get_style_context(window->ShowInitTreeButton),"boxInfoMessOK"); gtk_style_context_remove_class(gtk_widget_get_style_context(window->ShowPriorityButton),"boxInfoMessOK"); gtk_style_context_remove_class(gtk_widget_get_style_context(window->ShowSinceBootButton),"boxInfoMessOK"); - gtk_style_context_add_class(gtk_widget_get_style_context(self),"boxInfoMessOK"); } GtkWidget *terminal = (GtkWidget*)window->terminals->first->data; gtk_widget_hide(window->LoggingNotebook); gtk_widget_show(gtk_widget_get_parent(window->JournaldTree)); + if (window->last_mode==0) + gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowSinceBootButton),"boxInfoMessOK"); if (self==window->ShowSinceBootButton){ window->last_mode=1; + gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowSinceBootButton),"boxInfoMessOK"); } else if (self==window->NewMessagesButton){ window->last_mode=2; + gtk_style_context_add_class(gtk_widget_get_style_context(window->NewMessagesButton),"boxInfoMessOK"); } else if (self==window->ShowKernelButton){ window->last_mode=3; + gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowKernelButton),"boxInfoMessOK"); } else if (self==window->ShowPriorityButton){ window->last_mode=4; + gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowPriorityButton),"boxInfoMessOK"); } else if (self==window->ShowAllBootsButton){ window->last_mode=5; + gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowAllBootsButton),"boxInfoMessOK"); } else if (self==window->ShowAllUnitsButton){ window->last_mode=6; + gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowAllUnitsButton),"boxInfoMessOK"); } else if (self==window->ShowInitTreeButton){ window->last_mode=7; + gtk_style_context_add_class(gtk_widget_get_style_context(window->ShowInitTreeButton),"boxInfoMessOK"); } main_config.remove_thread=0; gtk_tree_view_set_model(GTK_TREE_VIEW(window->JournaldTree),GTK_TREE_MODEL(window->list)); @@ -435,8 +443,14 @@ GtkWidget *yon_inspector_add_terminal(inspector_window *window,char *page_name,i } -void on_inspector_close(GtkWidget *self){ +void on_inspector_close(GtkWidget *self, inspector_window *window){ main_config.remove_thread++; + GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(window->JournaldTree)); + for (int i=0; i< g_list_length(list);i++){ + int value=gtk_tree_view_column_get_fixed_width((GtkTreeViewColumn*)g_list_nth_data(list,i)); + yon_window_config_add_instant_parameter(yon_char_append("inspectorcolumn",yon_char_from_int(i)),"window",&value,YON_TYPE_INT); + } + } void on_inspector_open(GtkWidget *self, main_window *widgets){ @@ -459,6 +473,14 @@ void on_inspector_open(GtkWidget *self, main_window *widgets){ 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); + GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(window->JournaldTree)); + for (int i=0; i< g_list_length(list);i++){ + int value; + yon_window_config_get_parameter("window",yon_char_append("inspectorcolumn",yon_char_from_int(i)),&value,YON_TYPE_INT); + if (value) + gtk_tree_view_column_set_fixed_width((GtkTreeViewColumn*)g_list_nth_data(list,i),value); + } + g_list_free(list); GtkTreeIter iter; char *name; char *paths; diff --git a/source/ubl-utils.h b/source/ubl-utils.h index 2fef789..4be7328 100644 --- a/source/ubl-utils.h +++ b/source/ubl-utils.h @@ -291,6 +291,8 @@ void yon_window_config_add_listener(GtkWidget *widget, char *param_name, char *w void yon_window_config_add_custom_parameter(char *param_name, char *section, void *tracked_value, enum YON_TYPE val_type); +void yon_window_config_add_instant_parameter(char *param_name, char *section, void *tracked_value, enum YON_TYPE val_type); + 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);