Исправил очитку браузера

pull/121/head
Igor Belitskiy 3 years ago
parent 3a69082dcf
commit 1b040263da

@ -94,11 +94,6 @@ void MainWindow::settings() {
day = 0; day = 0;
this->lacalization(); this->lacalization();
btnBoxAboutDialog->set_visible(false); btnBoxAboutDialog->set_visible(false);
#ifdef WEBKIT_FOUND
one = WEBKIT_WEB_VIEW( webkit_web_view_new() );
three = Glib::wrap(GTK_WIDGET(one));
wndWeb->add(*three);
#endif
if (geteuid() == 0) { if (geteuid() == 0) {
numTimeHrs->set_range(0, 23); numTimeHrs->set_range(0, 23);
numTimeMin->set_range(0, 59); numTimeMin->set_range(0, 59);
@ -430,7 +425,15 @@ void MainWindow::open_help() {
void MainWindow::open_browser() { void MainWindow::open_browser() {
#ifdef WEBKIT_FOUND #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(); wndWeb->show_all();
#else #else
this->template_open_browser(global_lick_doc); this->template_open_browser(global_lick_doc);

@ -237,7 +237,7 @@ class MainWindow : public Gtk::ApplicationWindow {
#ifdef WEBKIT_FOUND #ifdef WEBKIT_FOUND
Gtk::Window *wndWeb; Gtk::Window *wndWeb;
Gtk::Widget *three; Gtk::Widget *three;
WebKitWebView *one; WebKitWebView *my_web_kit = NULL;
#endif #endif
string array_hw[2]; string array_hw[2];
string array_hw_local[2]; string array_hw_local[2];

Loading…
Cancel
Save