Добавлен webView, исправлено окно о программе

pull/11/head
Igor Belitskiy 3 years ago
parent 17f053d5a7
commit 8a10a9af3c

File diff suppressed because it is too large Load Diff

@ -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)

@ -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

@ -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);
@ -368,6 +371,7 @@ void MainWindow::view_add_cell(Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListS
}
void MainWindow::get_builder() {
builder->get_widget("lblHeaderAboutTopic", lblHeaderAboutTopic);
builder->get_widget("chbLoadVariantSelectionTimer", chbLoadVariantSelectionTimer);
builder->get_widget("lblInfoCommand", lblInfoCommand);
builder->get_widget("lblInfoCommand1", lblInfoCommand1);
@ -418,7 +422,8 @@ 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(){
@ -426,6 +431,7 @@ void MainWindow::localization(){
tm *ltm = localtime(&now);
unsigned int year = 1900+ ltm->tm_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<Gtk::ListStore> &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();
}

@ -17,6 +17,7 @@
#include "util.h"
#include "save.h"
#include "load.h"
#include <webkit2/webkit2.h>
#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<std::string> vec_Option_kernel;
std::vector<std::string> vec_Option_IPT;
@ -111,6 +114,9 @@ class MainWindow : public Gtk::ApplicationWindow {
Glib::RefPtr<Gtk::ListStore> list_store_kernel;
Glib::RefPtr<Gtk::ListStore> list_store_IPT;
Glib::RefPtr<Gtk::ListStore> list_store_OTT;
Gtk::Window *wndWeb;
Gtk::Widget *three;
WebKitWebView * one;
void set_entry_to_tree_view(Glib::RefPtr<Gtk::ListStore> &list_store, Gtk::Entry &entry, std::vector<std::string> &vec_Option, int size);
Gtk::TreeModel::Row row_kernel;
Gtk::TreeModel::Row row_IPT;

@ -10,28 +10,31 @@
<object class="GtkSizeGroup"/>
<object class="GtkAboutDialog" id="aboutWindows">
<property name="can-focus">False</property>
<property name="title" translatable="yes">О Программе</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="window-position">center</property>
<property name="icon-name">ubl-settings-bootloader</property>
<property name="icon-name">com.ublinux.ubl-settings-diskquota</property>
<property name="type-hint">dialog</property>
<property name="skip-taskbar-hint">True</property>
<property name="urgency-hint">True</property>
<property name="program-name">ubl-settings-bootloader</property>
<property name="version">1.2</property>
<property name="copyright" translatable="yes">Copyright © 2023 - UBSoft Software LLC</property>
<property name="version">1.0</property>
<property name="copyright" translatable="yes">Copyright © 2022 - 2023, UBSoft LLC</property>
<property name="comments" translatable="yes">ubl-settings-bootloader</property>
<property name="website">https://ublinux.ru/</property>
<property name="website-label" translatable="yes">Project Home Page</property>
<property name="license" translatable="yes">Это приложение распространяется без каких-либо гарантий.
Подробнее в &lt;a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html"&gt;GNU General Public License, версии 2 или позднее&lt;/a&gt;.</property>
<property name="authors">UBGroup</property>
<property name="documenters">UBGroup</property>
<property name="translator-credits" translatable="yes">UBGroup</property>
<property name="artists">UBGroup</property>
<property name="logo-icon-name">com.ublinux.ubl-settings-bootloader</property>
<property name="wrap-license">True</property>
<property name="license-type">gpl-2-0</property>
<child internal-child="vbox">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
@ -39,14 +42,11 @@
<object class="GtkButtonBox" id="btnBoxAboutDialog">
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="position">1</property>
</packing>
</child>
<child>
@ -54,6 +54,28 @@
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="show-close-button">True</property>
<child type="title">
<object class="GtkLabel" id="lblHeaderAboutTopic">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-bottom">2</property>
<property name="label" translatable="yes">ubl-settings-bootloader</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
</child>
</object>
<object class="GtkBox" id="boxColor">
<property name="visible">True</property>
@ -1268,4 +1290,38 @@ specified priority</property>
</object>
</child>
</object>
<object class="GtkWindow" id="wndWeb">
<property name="width-request">800</property>
<property name="height-request">600</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="icon-name">com.ublinux.ubl-settings-datetime</property>
<child>
<placeholder/>
</child>
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="show-close-button">True</property>
<child type="title">
<object class="GtkLabel" id="lblHeadeWndWeb">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">ubl-settings-datetime</property>
</object>
</child>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixel-size">32</property>
<property name="icon-name">com.ublinux.ubl-settings-bootloader</property>
<property name="icon_size">5</property>
</object>
</child>
</object>
</child>
</object>
</interface>

@ -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 "О программе"

Loading…
Cancel
Save