From cf6cf2a807dfc8c593d0ed13fa948445c20e48fc Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Fri, 19 May 2023 16:03:56 +0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=BE=D1=82=D0=BA=D1=80=D1=8B=D1=82=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=B1=D1=80=D0=B0=D1=83=D0=B7=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-bootloader.cc | 18 +++++++++--------- source/ubl-settings-bootloader.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index e8e50b2..3eeda34 100644 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -247,11 +247,6 @@ void MainWindow::settings() { overHead->add_overlay(*boxWidget); btnBoxAboutDialog->set_visible(false); ubl_make_plugs(boxSave,boxButton, socket_ext_id_I, socket_trd_id_I); - #ifdef WEBKIT_FOUND - one = WEBKIT_WEB_VIEW(webkit_web_view_new()); - three = Glib::wrap(GTK_WIDGET(one)); - wndWeb->add(*three); - #endif this->flag_block_gui(); if (this->check_root() == 0) { spbSecond->set_range(1, 60); @@ -1444,7 +1439,15 @@ void MainWindow::open_help() { void MainWindow::open_browser() { #ifdef WEBKIT_FOUND - webkit_web_view_load_uri(one, _(global_lick_doc.c_str())); + if (my_web_kit) { + gtk_widget_destroy(GTK_WIDGET(my_web_kit)); + } + my_web_kit = WEBKIT_WEB_VIEW(webkit_web_view_new()); + three = Glib::wrap(GTK_WIDGET(my_web_kit)); + wndWeb->add(*three); + webkit_web_view_load_uri(my_web_kit, _(global_lick_doc.c_str())); + wndWeb->show_all(); + webkit_web_view_load_uri(my_web_kit, _(global_lick_doc.c_str())); wndWeb->show_all(); #else this->template_open_browser(global_lick_doc); @@ -1524,9 +1527,6 @@ void MainWindow::info_warning_error(int mess) { } } MainWindow::~MainWindow() { - #ifdef WEBKIT_FOUND - free(one); - #endif } void MainWindow::add_CSS() { diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index 70c3090..38f86e9 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -339,7 +339,7 @@ public: #ifdef WEBKIT_FOUND Gtk::Window *wndWeb; Gtk::Widget *three; - WebKitWebView *one; + WebKitWebView *my_web_kit = NULL; #endif Gtk::TreeModel::Row row_kernel; Gtk::TreeModel::Row row_IPT;