From d947a402cb2eceda74c4353bec699972ed2fd59c Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 9 Sep 2024 17:26:59 +0600 Subject: [PATCH] Test removal of saving parameters for tests --- source/ubinstall-gtk.c | 82 +++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 6262fbb..7f047dd 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -904,26 +904,26 @@ int cur_slide=0; int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled); int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled) { - int width = gtk_widget_get_allocated_width((gtk_widget_get_parent(GTK_WIDGET(target)))); - int height = gtk_widget_get_allocated_height((gtk_widget_get_parent(GTK_WIDGET(target)))); + // int width = gtk_widget_get_allocated_width((gtk_widget_get_parent(GTK_WIDGET(target)))); + // int height = gtk_widget_get_allocated_height((gtk_widget_get_parent(GTK_WIDGET(target)))); - int newImgWidthDef = (width <= 217) ? width : width - 30; - int newImgHeightDef = (height <= 120) ? height : height - 80; + // int newImgWidthDef = (width <= 217) ? width : width - 30; + // int newImgHeightDef = (height <= 120) ? height : height - 80; - int originalWidth = gdk_pixbuf_get_width(pixbuf_unscaled); - int originalHeight = gdk_pixbuf_get_height(pixbuf_unscaled); - int newImgHeight = (int)(originalHeight / ((double) originalWidth / newImgWidthDef)); + // int originalWidth = gdk_pixbuf_get_width(pixbuf_unscaled); + // int originalHeight = gdk_pixbuf_get_height(pixbuf_unscaled); + // int newImgHeight = (int)(originalHeight / ((double) originalWidth / newImgWidthDef)); - if (newImgHeight > newImgHeightDef) { - newImgHeight = newImgHeightDef; - newImgWidthDef = (int)(originalWidth / ((double) originalHeight / newImgHeight)); - } - int newImageWidth = (int)(originalWidth / ((double) originalHeight / newImgHeight)); + // if (newImgHeight > newImgHeightDef) { + // newImgHeight = newImgHeightDef; + // newImgWidthDef = (int)(originalWidth / ((double) originalHeight / newImgHeight)); + // } + // int newImageWidth = (int)(originalWidth / ((double) originalHeight / newImgHeight)); - GdkPixbuf *scaledPixBuf = gdk_pixbuf_scale_simple(pixbuf_unscaled, newImageWidth, newImgHeight, GDK_INTERP_BILINEAR); - gtk_image_set_from_pixbuf(target, scaledPixBuf); + // GdkPixbuf *scaledPixBuf = gdk_pixbuf_scale_simple(pixbuf_unscaled, newImageWidth, newImgHeight, GDK_INTERP_BILINEAR); + // gtk_image_set_from_pixbuf(target, scaledPixBuf); - g_object_unref(scaledPixBuf); + // g_object_unref(scaledPixBuf); return 1; } @@ -1531,30 +1531,30 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ }break; case YON_PAGE_INSTALL_COMMON: { - GtkTreeModel *model; - GtkTreeIter iter; - if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->CommonInstallationDevicesTree)),&model,&iter)){ - yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_DEVICE_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); - yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(widgets->CommonInstallationDevicesTree)); - return; - } - char *file_system_type = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(widgets->CommonInstallationFilesystemTypeCombo)); - char *device_name = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->CommonInstallationSectionNameEntry)); - char *device; - yon_config_remove_by_key(part_parameter); - gtk_tree_model_get(model,&iter,0,&device,-1); - yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"fast"); - yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,device); - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->CommonSectionSensitiveCheck))){ - yon_config_register(device_label_parameter,device_label_parameter_command,device_name); - } else { - yon_config_remove_by_key(device_label_parameter); - } - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->CommonFilesystemSensitiveCheck))){ - yon_config_register(part_type_parameter,part_type_parameter_command,file_system_type); - } else { - yon_config_remove_by_key(part_type_parameter); - } + // GtkTreeModel *model; + // GtkTreeIter iter; + // if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->CommonInstallationDevicesTree)),&model,&iter)){ + // yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_DEVICE_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + // yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(widgets->CommonInstallationDevicesTree)); + // return; + // } + // char *file_system_type = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(widgets->CommonInstallationFilesystemTypeCombo)); + // char *device_name = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->CommonInstallationSectionNameEntry)); + // char *device; + // yon_config_remove_by_key(part_parameter); + // gtk_tree_model_get(model,&iter,0,&device,-1); + // yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"fast"); + // yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,device); + // if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->CommonSectionSensitiveCheck))){ + // yon_config_register(device_label_parameter,device_label_parameter_command,device_name); + // } else { + // yon_config_remove_by_key(device_label_parameter); + // } + // if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->CommonFilesystemSensitiveCheck))){ + // yon_config_register(part_type_parameter,part_type_parameter_command,file_system_type); + // } else { + // yon_config_remove_by_key(part_type_parameter); + // } if (!main_config.configure_mode) gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION_BEGIN); @@ -2688,8 +2688,8 @@ main_window *yon_main_window_complete(){ } // if (size) yon_char_parsed_free(models,size); gtk_builder_connect_signals(builder,NULL); - yon_load_proceed(YON_CONFIG_DEFAULT); - yon_interface_update(widgets); + // yon_load_proceed(YON_CONFIG_DEFAULT); + // yon_interface_update(widgets); return widgets; }