From 8a10a9af3c81b1e25a339b6cee5c6573e2e1dbe6 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Fri, 21 Apr 2023 14:39:37 +0600 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20webView,=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=BE=D0=BA=D0=BD=D0=BE=20=D0=BE=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- #ubl-settings-bootloader.glade# | 1326 +++++++++++++++++++++++++++++ source/CMakeLists.txt | 7 +- source/my_cmd.h | 6 +- source/ubl-settings-bootloader.cc | 22 +- source/ubl-settings-bootloader.h | 6 + ubl-settings-bootloader.glade | 72 +- ubl-settings-bootloader_ru.po | 3 + 7 files changed, 1421 insertions(+), 21 deletions(-) create mode 100644 #ubl-settings-bootloader.glade# diff --git a/#ubl-settings-bootloader.glade# b/#ubl-settings-bootloader.glade# new file mode 100644 index 0000000..baa9878 --- /dev/null +++ b/#ubl-settings-bootloader.glade# @@ -0,0 +1,1326 @@ + + + + + + both + True + + + + + False + False + True + center + com.ublinux.ubl-settings-diskquota + dialog + True + True + ubl-settings-bootloader + 1.0 + Copyright © 2022 - 2023, UBSoft LLC + ubl-settings-bootloader + https://ublinux.ru/ + Project Home Page + Это приложение распространяется без каких-либо гарантий. +Подробнее в <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, версии 2 или позднее</a>. + UBGroup + UBGroup + UBGroup + UBGroup + com.ublinux.ubl-settings-bootloader + True + gpl-2-0 + + + True + False + vertical + 2 + + + False + end + + + False + False + 1 + + + + + + + + + + True + False + True + + + True + False + 5 + 5 + 5 + 5 + 2 + ubl-settings-bootloader + + + + + + + + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 69 + com.ublinux.ubl-settings-bootloader + + + False + True + 0 + + + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Running applications as a user with a +specified priority + + + + + + + + True + True + 1 + + + + + True + False + False + False + 4 + + + True + False + Load global configuration + + + + + + True + False + Load local configuration + + + + + + True + False + False + False + 4 + + + True + False + Help + + + + + + True + False + About + + + + + + True + False + False + False + 4 + + + True + False + Save to global and local configuration + + + + + + True + False + Save global configuration + + + + + + True + False + Save local configuration + + + + + + 750 + 550 + False + com.ublinux.ubl-settings-bootloader + + + True + False + vertical + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 25 + 1 + + + False + True + 0 + + + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + + + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + + + 81 + True + False + start + + + -1 + + + + + False + True + 1 + + + + + True + True + never + in + + + True + False + + + True + False + vertical + + + True + False + vertical + + + True + False + 0.019999999552965164 + in + + + True + False + 12 + + + True + False + vertical + + + True + False + + + Boot selection menu timer + True + True + False + 3 + 5 + 3 + 5 + 6 + 6 + True + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + False + True + 1 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Seconds + + + False + True + 2 + + + + + False + True + 0 + + + + + True + False + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Default load + start + 0 + + + False + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Load screen display mode: + start + 0 + + + False + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 1 + + + + + False + True + 3 + + + + + True + False + + + Boot menu user name: + True + True + False + 2 + 5 + 2 + 5 + 6 + 6 + True + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 2 + + + + + False + True + 4 + + + + + True + False + + + Boot menu user password: + True + True + False + 2 + 5 + 2 + 5 + 6 + 6 + True + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 2 + + + + + False + True + 5 + + + + + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Download menu + + + + + False + True + 0 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 12 + + + True + False + vertical + + + 140 + True + True + 5 + 5 + in + + + True + False + + + -1 + True + True + + + + + + + + + + False + True + 0 + + + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Command line parameters: + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 1 + + + + + False + True + 10 + + + + + + + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Parameters passed to the kernel + start + + + + + False + True + 1 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 12 + + + True + False + vertical + + + 140 + True + True + 5 + 5 + in + + + True + False + + + True + True + + + + + + + + + + False + True + 1 + + + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Command line parameters: + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 1 + + + + + False + True + 7 + + + + + + + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Terminal for input + start + + + + + False + True + 2 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 12 + + + True + False + vertical + + + 140 + True + True + 5 + 5 + in + + + True + False + + + True + True + + + + + + + + + + False + True + 0 + + + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Command line parameters: + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 1 + + + + + False + True + 7 + + + + + + + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Terminal for output + start + + + + + False + True + 3 + + + + + False + True + 5 + + + + + + + + + True + True + 2 + + + + + + + True + False + True + + + True + False + ubl-settings-bootloader + + + + + + + + True + False + 32 + com.ublinux.ubl-settings-bootloader + + + + + True + False + + + True + False + + + True + True + False + True + True + menu2 + none + + + True + False + + + True + False + 5 + 5 + 5 + 5 + Save + + + + False + True + 0 + + + + + True + False + pan-down-symbolic + + + False + True + 1 + + + + + + + False + True + 0 + + + + + True + True + False + True + True + menu1 + none + + + True + False + open-menu-symbolic + + + + + False + True + 1 + + + + + + False + True + 0 + + + + + end + 1 + + + + + True + False + + + True + True + False + True + True + menu + none + + + True + False + + + True + False + 5 + 5 + 5 + 5 + Load + + + False + True + 0 + + + + + True + False + pan-down-symbolic + + + False + True + 1 + + + + + + + False + True + 0 + + + + + + 2 + + + + + + + both + True + + + + + + + + both + True + + + + + + + + + + False + Внимание! + center + dialog + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 50 + gtk-dialog-warning + + + True + True + 0 + + + + + 160 + True + False + start + center + 5 + 5 + 5 + 5 + 6 + 6 + Warning! + + + True + True + 1 + + + + + False + True + 1 + + + + + OK + True + True + True + 5 + 5 + 5 + 5 + 3 + 3 + + + False + True + 1 + + + + + + + 800 + 600 + False + True + True + com.ublinux.ubl-settings-datetime + + + + + + True + False + True + + + True + False + + + + + True + False + 32 + com.ublinux.ubl-settings-bootloader + 5 + + + + + + diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 93b3c4d..34ed8ce 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -8,6 +8,11 @@ include_directories(${GTK_INCLUDE_DIRS}) link_directories(${GTK_LIBRARY_DIRS}) add_definitions(${GTK_CFLAGS_OTHER}) +pkg_check_modules(WEBKIT REQUIRED webkit2gtk-4.0 webkit2gtk-web-extension-4.0) +include_directories(${WEBKIT_INCLUDE_DIRS}) +link_directories(${WEBKIT_LIBRARY_DIRS}) +add_definitions(${WEBKIT_CFLAGS_OTHER}) + #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a -g") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \ -O2 -pipe -fno-plt -fexceptions \ @@ -35,5 +40,5 @@ set(LIBRARIES pthread) add_executable(ubl-settings-bootloader ${SOURCE_FILES}) -target_link_libraries(ubl-settings-bootloader ${LIBRARIES}) +target_link_libraries(ubl-settings-bootloader ${LIBRARIES} ${WEBKIT_LIBRARIES}) install(TARGETS ubl-settings-bootloader DESTINATION bin) diff --git a/source/my_cmd.h b/source/my_cmd.h index 268e218..43d9705 100644 --- a/source/my_cmd.h +++ b/source/my_cmd.h @@ -1,5 +1,5 @@ -#ifndef CMD_H -#define CMD_H +#ifndef MY_CMD_H +#define MY_CMD_H #define global_load "ubconfig --default --source global get boot" #define system_load "ubconfig --default --source system get boot" @@ -9,7 +9,7 @@ #define system_save "ubconfig --target system set boot " #define global_remove "ubconfig --target global remove boot " #define system_remove "ubconfig --target system remove boot " -#define open_link "xdg-open " +#define link_doc "https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/ubl-settings-bootloader" #define other_user "su -l {} -c \" DISPLAY=$DISPLAY {} \"" #endif \ No newline at end of file diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index d1d4614..b080100 100755 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -90,6 +90,9 @@ void MainWindow::settings(){ overHead->add_overlay(*boxWidget); btnBoxAboutDialog->set_visible(false); ubl_make_plugs(boxSave,boxButton, socket_ext_id_I, socket_trd_id_I); + one = WEBKIT_WEB_VIEW( webkit_web_view_new() ); + three = Glib::wrap( GTK_WIDGET( one ) ); + wndWeb->add( *three ); this->flag_block_gui(); if (this->check_root() == 0) { spbSecond->set_range(1, 60); @@ -367,7 +370,8 @@ void MainWindow::view_add_cell(Gtk::TreeModel::Row &row, Glib::RefPtrget_widget("lblHeaderAboutTopic", lblHeaderAboutTopic); builder->get_widget("chbLoadVariantSelectionTimer", chbLoadVariantSelectionTimer); builder->get_widget("lblInfoCommand", lblInfoCommand); builder->get_widget("lblInfoCommand1", lblInfoCommand1); @@ -418,14 +422,16 @@ void MainWindow::get_builder(){ builder->get_widget("entryPasswordProtecc", entryPasswordProtecc); builder->get_widget("entrySecurityLogin", entrySecurityLogin); builder->get_widget("cmbDefaultDonw", cmbDefaultDonw); - + builder->get_widget("wndWeb", wndWeb); + builder->get_widget("lblHeadeWndWeb", lblHeadeWndWeb); } void MainWindow::localization(){ time_t now = time(0); tm *ltm = localtime(&now); unsigned int year = 1900+ ltm->tm_year; - string str_authors = string(_("Copyright © UBSoft LLC, 2022 - ")) + to_string(year); + string str_authors = string(_("Copyright © UBSoft LLC, 2022 - ")) + to_string(year); + aboutWindows->set_program_name(gettext("ubl-settings-bootloader")); aboutWindows->set_copyright(str_authors); aboutWindows->set_comments(_("ubl-settings-bootloader")); aboutWindows->set_website(_("https://wiki.ublinux.com")); @@ -434,6 +440,7 @@ void MainWindow::localization(){ lblInfoHead->set_text(_("Configuring system boot parameters")); lblHeaderName->set_text(_("ubl-settings-bootloader")); aboutWindows->set_comments(_("System boot")); + lblHeaderAboutTopic->set_label(gettext("About ubl-settings-bootloader")); aboutWindows->set_website_label(_("Project Home Page")); lblInfoCommand->set_text(_("Command line parameters:")); lblInfoCommand1->set_text(_("Command line parameters:")); @@ -446,6 +453,7 @@ void MainWindow::localization(){ chbLoadVariantSelectionTimer->set_label(_("Boot selection menu timer")); btnSynopsis->set_label(_("Help")); btnAbout->set_label(_("About")); + lblHeadeWndWeb->set_text(_("ubl-settings-bootloader")); btnSaveLocalGlob->set_label(_("Save to global and local configuration")); btnSaveLocal->set_label(_("Save local configuration")); btnSaveGlob->set_label(_("Save global configuration")); @@ -878,12 +886,8 @@ void MainWindow::set_row(Glib::RefPtr &list_store, int size, std } void MainWindow::synopsis_show() { - string cmd = open_link + string(_("https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/")) + app_name; - if (geteuid() == 0) { - string response_user = getlogin(); - cmd = "su -l " + response_user + " -c \" DISPLAY=$DISPLAY " + cmd + " \""; - } - obj_process_system.call(cmd, "&"); + webkit_web_view_load_uri(one, link_doc); + wndWeb->show_all(); } diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index a50f0b5..20ba41a 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -17,6 +17,7 @@ #include "util.h" #include "save.h" #include "load.h" +#include #include "my_process.h" using namespace std; @@ -62,6 +63,7 @@ class MainWindow : public Gtk::ApplicationWindow { Gtk::Label *lblInfoDefaultDonw; Gtk::Label *lblInfoCommand; Gtk::Label *lblInfoCommand1; + Gtk::Label *lblHeaderAboutTopic; Gtk::Label *lblInfoCommand2; Gtk::Label *lblLoadMenu; Gtk::Label *lblInfoInputTerminal; @@ -103,6 +105,7 @@ class MainWindow : public Gtk::ApplicationWindow { Gtk::CheckButton *chbPasswordProtecc; Gtk::Entry *entrySecurityLogin; Gtk::Entry *entryPasswordProtecc; + Gtk::Label *lblHeadeWndWeb; std::vector vec_Option_kernel; std::vector vec_Option_IPT; @@ -111,6 +114,9 @@ class MainWindow : public Gtk::ApplicationWindow { Glib::RefPtr list_store_kernel; Glib::RefPtr list_store_IPT; Glib::RefPtr list_store_OTT; + Gtk::Window *wndWeb; + Gtk::Widget *three; + WebKitWebView * one; void set_entry_to_tree_view(Glib::RefPtr &list_store, Gtk::Entry &entry, std::vector &vec_Option, int size); Gtk::TreeModel::Row row_kernel; Gtk::TreeModel::Row row_IPT; diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade index 3082b74..87b585c 100644 --- a/ubl-settings-bootloader.glade +++ b/ubl-settings-bootloader.glade @@ -10,28 +10,31 @@ False - О Программе False True center - ubl-settings-bootloader + com.ublinux.ubl-settings-diskquota dialog + True True ubl-settings-bootloader - 1.2 - Copyright © 2023 - UBSoft Software LLC + 1.0 + Copyright © 2022 - 2023, UBSoft LLC ubl-settings-bootloader https://ublinux.ru/ Project Home Page Это приложение распространяется без каких-либо гарантий. Подробнее в <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, версии 2 или позднее</a>. UBGroup + UBGroup + UBGroup UBGroup com.ublinux.ubl-settings-bootloader True gpl-2-0 + True False vertical 2 @@ -39,14 +42,11 @@ False end - - - False False - 0 + 1 @@ -54,6 +54,28 @@ + + + True + False + True + + + True + False + 5 + 5 + 5 + 5 + 2 + ubl-settings-bootloader + + + + + + + True @@ -1268,4 +1290,38 @@ specified priority + + 800 + 600 + False + True + True + com.ublinux.ubl-settings-datetime + + + + + + True + False + True + + + True + False + ubl-settings-datetime + + + + + True + False + 32 + com.ublinux.ubl-settings-bootloader + 5 + + + + + diff --git a/ubl-settings-bootloader_ru.po b/ubl-settings-bootloader_ru.po index b73d9bb..eeb6861 100644 --- a/ubl-settings-bootloader_ru.po +++ b/ubl-settings-bootloader_ru.po @@ -17,6 +17,9 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +msgid "About ubl-settings-bootloader" +msgstr "О программе Загрузка системы" + #: source/ubl-settings-bootloader.cc:431 source/ubl-settings-bootloader.cc:301 msgid "About" msgstr "О программе"