diff --git a/source/ubl-settings-logging.c b/source/ubl-settings-logging.c index d7e14a4..1796d02 100644 --- a/source/ubl-settings-logging.c +++ b/source/ubl-settings-logging.c @@ -158,7 +158,6 @@ void on_load_local(){ void on_config_custom_load(GtkWidget *,main_window *){ yon_load_proceed(YON_CONFIG_CUSTOM); main_config.load_mode=YON_CONFIG_CUSTOM; - // yon_interface_update(widgets); } void on_save_global_local(){ @@ -191,7 +190,6 @@ void on_save_done(main_window *, config_str output, int size){ free(final_output); } yon_char_parsed_free(output,size); - // yon_interface_update(widgets); textdomain(template_ui_LocaleName); switch (main_config.save_config){ @@ -321,9 +319,6 @@ void on_inspector_jornald_read_async(inspector_window *window){ } void on_inspector_update(GtkWidget *self, inspector_window *window){ - // int size; - // GtkTextIter titer; - // config_str output; if (!strcmp(window->journal_name,"journald")){ if(self!=window->UpdateButton){ gtk_style_context_remove_class(gtk_widget_get_style_context(window->ShowKernelButton),"chosenOutline"); @@ -341,7 +336,6 @@ void on_inspector_update(GtkWidget *self, inspector_window *window){ gtk_widget_set_sensitive(window->ShowPriorityButton,1); gtk_widget_set_sensitive(window->ShowSinceBootButton,1); } - // GtkWidget *terminal = (GtkWidget*)window->terminals->first->data; gtk_widget_hide(window->LoggingNotebook); gtk_widget_show(gtk_widget_get_parent(window->JournaldTree)); if (self==window->ShowSinceBootButton){ @@ -694,7 +688,6 @@ void on_logrotate_configuration_path_add(GtkWidget *, logrotate_configure_window GtkTreeIter iter; gtk_list_store_append(window->list, &iter); GtkTreeViewColumn *column = gtk_tree_view_get_column(GTK_TREE_VIEW(window->LogPathsTree),0); - // GList *list = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(column)); gtk_tree_view_set_cursor(GTK_TREE_VIEW(window->LogPathsTree),gtk_tree_model_get_path(model,&iter),column,1); } @@ -703,7 +696,6 @@ void on_path_editing_done(GtkCellRendererText* ,gchar* gtkpath,gchar* new_text,l char *cur_path; gtk_tree_model_get_iter(GTK_TREE_MODEL(window->list),&iter,gtk_tree_path_new_from_string(gtkpath)); gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,0,&cur_path,-1); - // int deleted=0; if (!strcmp(new_text,"")||(cur_path&&!strcmp(cur_path,""))) gtk_list_store_remove(window->list,&iter); @@ -741,7 +733,6 @@ void on_logrotate_configuration_path_edit(GtkWidget *, logrotate_configure_windo GtkTreeIter iter; if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(window->LogPathsTree)),&model,&iter)){ GtkTreeViewColumn *column = gtk_tree_view_get_column(GTK_TREE_VIEW(window->LogPathsTree),0); - // GList *list = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(column)); gtk_tree_view_set_cursor(GTK_TREE_VIEW(window->LogPathsTree),gtk_tree_model_get_path(model,&iter),column,1); } } @@ -1056,8 +1047,6 @@ void on_logrotate_save(GtkWidget *, dictionary *dict){ return; } if (on_logrotate_check_repeats(NULL,window)==1) return; - // GtkTreeIter *lastiter; - // GtkTreeIter *lastitar; for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&iter)){ char *cur_path; gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,0,&cur_path,-1); @@ -1066,8 +1055,6 @@ void on_logrotate_save(GtkWidget *, dictionary *dict){ } path_amount++; paths = yon_char_unite(paths,strcmp(paths,"") ? "," : "", cur_path,NULL); - // lastiter=gtk_tree_iter_copy(&iter); - // lastitar=gtk_tree_iter_copy(&iter); } if(!window->paths) { if (matched==path_amount) { @@ -1493,7 +1480,6 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind g_signal_connect(G_OBJECT(window->PathCell),"editing-canceled",G_CALLBACK(on_path_editing_cancel),window); g_signal_connect(G_OBJECT(window->LogPathAddButton),"clicked",G_CALLBACK(on_logrotate_configuration_path_filechooser_open),window); g_signal_connect(G_OBJECT(window->LogPathEditButton),"clicked",G_CALLBACK(on_logrotate_configuration_path_filechooser_open),window); - // g_signal_connect(G_OBJECT(window->LogPathsTree),"changed",G_CALLBACK(on_logrotate_paths_done),window); g_signal_connect(G_OBJECT(window->LogPathRemoveButton),"clicked",G_CALLBACK(on_logrotate_configuration_path_remove),window); g_signal_connect(G_OBJECT(window->RotationPeriodCheck),"toggled",G_CALLBACK(on_logrotate_period_check_toggled),window); @@ -2314,8 +2300,6 @@ void on_journald_open(GtkWidget *self, main_window *widgets){ gtk_entry_set_text(GTK_ENTRY(window->LogDescriptionLabel),description); gtk_entry_set_text(GTK_ENTRY(window->LogNameLabel),name); } - // int jsize; - // config_str journald_parameters = yon_config_get_all_by_key("JOURNALD[",&jsize); gtk_widget_show(window->MainWindow); } @@ -2355,7 +2339,6 @@ void on_log_save(GtkWidget *self, dictionary *dict){ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),REPEAT_PATHS_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); return; } - // GtkTreeIter iter; char *name = (char*)gtk_entry_get_text(GTK_ENTRY(window->NameEntry)); char *desc = (char*)gtk_entry_get_text(GTK_ENTRY(window->LogDescriptionEntry)); if (!yon_char_is_empty(name)){ @@ -2577,8 +2560,6 @@ void on_log_path_append(GtkWidget *self, add_log_window *window){ } void on_log_add(GtkWidget *, main_window *widgets){ - // GtkTreeModel *model = GTK_TREE_MODEL(widgets->list); - // GtkTreeIter iter; add_log_window *window = on_add_open(widgets); yon_window_config_custom_window_get(GTK_WINDOW(window->MainWindow),"AddWindow"); g_signal_connect(G_OBJECT(window->CancelButton),"clicked", G_CALLBACK(on_subwindow_close),NULL); @@ -2823,7 +2804,6 @@ void on_main_window_services_tree_selection_changed(GtkWidget *,main_window *wid gtk_tree_model_get(model,&iter,0,&is_active,1,&is_enabled,2,&name,-1); if (is_active){ gtk_widget_set_sensitive(widgets->ServicesEditButton,1); - // gtk_widget_set_sensitive(GTK_WIDGET(g_list_nth_data(list,0)),1); gtk_widget_set_sensitive(GTK_WIDGET(g_list_nth_data(list,1)),1); gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->ServicesControlButton))),stop_icon_name,GTK_ICON_SIZE_BUTTON); GList *item = gtk_container_get_children(GTK_CONTAINER(g_list_nth_data(list,0))); @@ -2833,7 +2813,6 @@ void on_main_window_services_tree_selection_changed(GtkWidget *,main_window *wid g_list_free(items); } else { gtk_widget_set_sensitive(widgets->ServicesEditButton,0); - // gtk_widget_set_sensitive(GTK_WIDGET(g_list_nth_data(list,0)),1); gtk_widget_set_sensitive(GTK_WIDGET(g_list_nth_data(list,1)),0); gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->ServicesControlButton))),start_icon_name,GTK_ICON_SIZE_BUTTON); GList *item = gtk_container_get_children(GTK_CONTAINER(g_list_nth_data(list,0))); @@ -2842,34 +2821,12 @@ void on_main_window_services_tree_selection_changed(GtkWidget *,main_window *wid g_list_free(item); g_list_free(items); } - // if (is_enabled){ - // gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->ServicesControlButton))),disable_icon_name,GTK_ICON_SIZE_BUTTON); - // GList *item = gtk_container_get_children(GTK_CONTAINER(g_list_nth_data(list,1))); - // GList *items = gtk_container_get_children(GTK_CONTAINER(g_list_nth_data(item,0))); - // gtk_image_set_from_icon_name(GTK_IMAGE(g_list_nth_data(items,0)),disable_icon_name,GTK_ICON_SIZE_BUTTON); - // gtk_label_set_text(GTK_LABEL(g_list_nth_data(items,1)),AUTOSTART_OFF_LABEL); - // g_list_free(item); - // g_list_free(items); - // } else { - // gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->ServicesControlButton))),enable_icon_name,GTK_ICON_SIZE_BUTTON); - // GList *item = gtk_container_get_children(GTK_CONTAINER(g_list_nth_data(list,1))); - // GList *items = gtk_container_get_children(GTK_CONTAINER(g_list_nth_data(item,0))); - // gtk_image_set_from_icon_name(GTK_IMAGE(g_list_nth_data(items,0)),enable_icon_name,GTK_ICON_SIZE_BUTTON); - // gtk_label_set_text(GTK_LABEL(g_list_nth_data(items,1)),AUTOSTART_ON_LABEL); - // g_list_free(item); - // g_list_free(items); - // } if (!strcmp(name,"journald")){ - // gtk_widget_set_sensitive(GTK_WIDGET(g_list_nth_data(list,0)),0); - // gtk_widget_set_sensitive(GTK_WIDGET(g_list_nth_data(list,1)),0); - // gtk_widget_set_sensitive(widgets->ServicesControlButton,0); - // gtk_widget_set_tooltip_text(widgets->ServicesControlButton,AUTOSTART_OFF_LABEL); } g_list_free(list); } else { gtk_widget_set_sensitive(widgets->ServicesEditButton,0); gtk_widget_set_sensitive(widgets->ServicesControlButton,0); - // gtk_widget_set_tooltip_text(widgets->ServicesControlButton,AUTOSTART_ON_LABEL); } } @@ -2918,19 +2875,11 @@ void on_enable_disable_clicked(GtkButton *, main_window *widgets){ gtk_list_store_set(widgets->ServicesList,&iter,1,0,-1); gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->ServicesControlButton))),start_icon_name,GTK_ICON_SIZE_BUTTON); gtk_image_set_from_icon_name(GTK_IMAGE(g_list_nth_data(box,0)),start_icon_name,GTK_ICON_SIZE_BUTTON); - // gtk_widget_set_tooltip_text(widgets->ServicesControlButton,AUTOSTART_ON_LABEL); } else { - /* - g_mutex_lock(&main_config.authorized_mutex); - main_config.queue_size += 1; - main_config.queue = yon_remalloc(main_config.queue,sizeof(queue_func**)*(main_config.queue_size)); - main_config.queue[main_config.queue_size-1] = yon_queue_add_function(G_SOURCE_FUNC(system),start_command); - g_mutex_unlock(&main_config.authorized_mutex);*/ yon_launch(start_command); gtk_list_store_set(widgets->ServicesList,&iter,1,1,-1); gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->ServicesControlButton))),stop_icon_name,GTK_ICON_SIZE_BUTTON); gtk_image_set_from_icon_name(GTK_IMAGE(g_list_nth_data(box,0)),stop_icon_name,GTK_ICON_SIZE_BUTTON); - // gtk_widget_set_tooltip_text(widgets->ServicesControlButton,AUTOSTART_OFF_LABEL); } } } @@ -3019,7 +2968,6 @@ void config_init(){ main_config.save_config=1; main_config.queue=NULL; main_config.queue_size=0; - // main_config.process = polkit_unix_process_new_for_owner(getpid(),0,getuid()); pid_t parent_pid; parent_pid = getppid (); if (parent_pid == 1) @@ -3174,7 +3122,6 @@ void yon_main_window_complete(template_main_window **window){ size =0; config_str custom_watchers = yon_file_open(custom_logs_saving_file_path,&size); if (custom_watchers){ - // GtkTreeIter itar; for (int i=0;iHeadInfoLabel,"head-text","label",YON_TYPE_STRING); /* Signal connection | Присоединение сигналов */ g_signal_connect(G_OBJECT(widgets->InspectButton),"clicked",G_CALLBACK(on_inspector_open),widgets); @@ -3245,7 +3191,6 @@ void yon_main_window_complete(template_main_window **window){ SERVICE_MANAGEMENT_TOOLTIP,start_icon_name,G_CALLBACK(on_service_manage),widgets, CONFIGURE_SERVICE_LABEL,settings_icon_name,G_CALLBACK(on_service_edit),widgets, NULL); - // yon_rmb_menu_setup(widgets->ServicesTree,(RmbCheck)gtk_widget_get_sensitive,widgets->MainTree,CONFIGURE_LOG_LABEL,edit_icon_name,G_CALLBACK(on_log_edit),widgets,ADD_LOG_LABEL,add_icon_name,G_CALLBACK(on_log_add),widgets,REMOVE_LOG_LABEL,remove_icon_name,G_CALLBACK(on_log_remove),widgets,NULL); yon_window_config_setup(GTK_WINDOW(widgets->Window)); yon_window_config_load(config_path);