From dd63a66c2fe13d96dca8f9675b97b68f8a496b78 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 18 May 2023 17:59:47 +0600 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D1=87=D0=B0=D1=82=D0=B0=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D0=BF=D0=BE=20=D0=BE=D0=BA?= =?UTF-8?q?=D0=BD=D1=83=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-bootloader.cc | 79 ++++++- source/ubl-settings-bootloader.h | 46 +++- ubl-settings-bootloader.glade | 342 +++++++++++++++++++++++++++++- 3 files changed, 461 insertions(+), 6 deletions(-) diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index c6cfffa..081d48c 100644 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -61,6 +61,77 @@ int MainWindow::check_root() { return 0; } +// ================================================================= +View_edit_add_table::View_edit_add_table() { + builder = Gtk::Builder::create_from_file(path_glade); + this->settings(); +} + +void View_edit_add_table::settings() { + this->get_builder(); + this->localization(); + this->event(); + +} + +void View_edit_add_table::event() { + btnCancel->signal_clicked().connect([&]() {cancel();}); + btnSave->signal_clicked().connect([&]() {save();}); +} + +void View_edit_add_table::localization() { + +} +void View_edit_add_table::get_builder() { + builder->get_widget("wndQuotasAddProject", wndQuotasAddProject); + builder->get_widget("btnCancel", btnCancel); + builder->get_widget("btnSave", btnSave); + builder->get_widget("chkAddEdit", chkAddEdit); + builder->get_widget("entryCol1", entryCol1); + builder->get_widget("entryCol2", entryCol2); + builder->get_widget("lblAddEditTitle", lblAddEditTitle); + builder->get_widget("lblAddEditCheckBox", lblAddEditCheckBox); + builder->get_widget("lblAddEditCol1", lblAddEditCol1); + builder->get_widget("lblAddEditCol2", lblAddEditCol2); + builder->get_widget("lblAddEdittTableName", lblAddEdittTableName); +} + +void View_edit_add_table::cancel() { + wndQuotasAddProject->hide(); + flag_save = false; +} + +void View_edit_add_table::save() { + wndQuotasAddProject->hide(); + flag_save = true; +} +struct Data View_edit_add_table::get_data() { + if (flag_save == true) { + return new_data; + } + return old_data; +} +void Data View_edit_add_table::show() { + flag_save = false; + wndQuotasAddProject->show(); +} + +void View_edit_add_table::set_data(bool check, string colmn1, string colmn2) { + old_data.check = check; + old_data.colmn1 = colmn1; + old_data.colomn2 = colomn2; +} + +void View_edit_add_table::show_edit() { + this->show(); +} + +void View_edit_add_table::show_add() { + this->show(); +} + +// ================================================================= + MainWindow::MainWindow(BaseObjectType* obj, Glib::RefPtr const& builder) : Gtk::ApplicationWindow(obj), builder{builder} { this->builder = builder; @@ -70,6 +141,8 @@ MainWindow::MainWindow(Glib::RefPtr const& builder) { this->builder = builder; } + + void MainWindow::settings() { obj_main = this; map_cmd_error[""] = ""; @@ -487,6 +560,10 @@ void MainWindow::get_builder() { builder->get_widget("btnRemoveUser", btnRemoveUser); builder->get_widget("btnAddMusic", btnAddMusic); builder->get_widget("btnRemoveMusic", btnRemoveMusic); + builder->get_widget("btnEditMusic", btnEditMusic); + builder->get_widget("btnEditUser", btnEditUser); + + } void MainWindow::localization() { @@ -533,7 +610,7 @@ void MainWindow::localization() { lblhelpHeader->set_text(read_documentation_web); lblhelpText->set_text(_(redirected_documentation)); btnReadHelp->set_label(read_online); - btnCancelHelp->set_label(cancel); + btnCancelHelp->set_label(str_cancel); chkAlwaysOpenHelp->set_label(always_redirect); lblwebHeaderName->set_label(name_app); btnRemoveMusic->set_tooltip_text(str_tooltip_del_melody); diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index dea3d24..3a0938f 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -67,7 +67,7 @@ void me_thread(string cmd); #define load_global _("Load global configuration") #define load_local _("Load local configuration") #define read_online _("Read online") -#define cancel _("Cancel") +#define str_cancel _("Cancel") #define always_redirect _("Always redirect") #define boot_screen_display_mode _("Boot screen display mode:") #define no_loading_animation_800_600 _("No loading animation,\nfull log") @@ -158,6 +158,47 @@ void me_thread(string cmd); #define str_del_user _("User deleted") #define str_del_melody _("Melody deleted") +class View_edit_add_table { +private: + Glib::RefPtr builder; + Gtk::Window* wndQuotasAddProject; + Gtk::Button* btnCancel; + Gtk::Button* btnSave; + Gtk::CheckButton* chkAddEdit; + Gtk::Entry* entryCol1; + Gtk::Entry* entryCol2; + Gtk::Label* lblAddEditTitle; + Gtk::Label* lblAddEditCheckBox; + Gtk::Label* lblAddEditCol1; + Gtk::Label* lblAddEditCol2; + Gtk::Label* lblAddEdittTableName; + +private: + View_edit_add_table(); + ~View_edit_add_table(); + struct Data { + bool check; + string colomn1; + string colomn2; + }; + struct Data old_data; + struct Data new_data; + string flag_save = false; +public: + void settings(); + void event(); + void localization(); + void cancel(); + void save(); + void set_data(bool check, string colmn1, string colmn2); + void get_data(); + void show(); + void get_builder(); + void show_edit(); + void show_add(); +}; + + class CmdArgParser : public Glib::OptionGroup { public: @@ -234,6 +275,8 @@ public: Gtk::Button *btnRemoveUser; Gtk::Button *btnAddMusic; Gtk::Button *btnRemoveMusic; + Gtk::Button *btnEditUser; + Gtk::Button *btnEditMusic; Gtk::CheckButton *chbVgaText; Gtk::CheckButton *chbLoadVariantSelectionTimer; Gtk::Entry *entryKernel; @@ -313,6 +356,7 @@ public: vector vec_param_names; My_Process::My_Process_system obj_process_system = My_Process::My_Process_system(); My_Process::My_Process_call obj_process_call = My_Process::My_Process_call(); + View_edit_add_table obj_view_edit_add_table = View_edit_add_table(); bool flag_load = false; bool flag_save_all = false; bool flag_blocked_tree_view = false; diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade index 3569cfc..796e699 100644 --- a/ubl-settings-bootloader.glade +++ b/ubl-settings-bootloader.glade @@ -623,7 +623,7 @@ vertical - 65 + 100 True True 3 @@ -689,6 +689,31 @@ 0 + + + True + True + True + 5 + 10 + 5 + 10 + 3 + 5 + + + True + False + gtk-select-all + + + + + False + True + 1 + + True @@ -711,7 +736,7 @@ False True - 1 + 2 @@ -773,7 +798,7 @@ vertical - 65 + 100 True True 5 @@ -839,6 +864,31 @@ 0 + + + True + True + True + 5 + 10 + 5 + 10 + 3 + 5 + + + True + False + gtk-select-all + + + + + False + True + 1 + + True @@ -861,7 +911,7 @@ False True - 1 + 2 @@ -1724,6 +1774,290 @@ + + False + True + True + com.ublinux.ubl-settings-datetime + + + True + False + vertical + + + True + False + + + True + False + label + + + False + True + 0 + + + + + True + False + label + + + False + True + 1 + + + + + + + + False + True + 0 + + + + + True + False + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + label + + + False + True + 0 + + + + + True + True + False + 5 + 5 + 5 + 5 + 7 + 5 + True + + + + + + False + True + 1 + + + + + True + True + 0 + + + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + label + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 5 + 5 + + + False + True + 1 + + + + + True + True + 1 + + + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + label + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 5 + 5 + + + False + True + 1 + + + + + True + True + 2 + + + + + True + True + 1 + + + + + True + False + end + 5 + True + + + gtk-cancel + True + True + True + 5 + 5 + 5 + 5 + 5 + 5 + True + + + False + True + 0 + + + + + gtk-save + True + True + True + 5 + 5 + 5 + 5 + 5 + 5 + True + + + False + True + 1 + + + + + False + True + 2 + + + + + + + True + False + + + True + False + ubl-settings-bootloader + + + + + True + False + 32 + com.ublinux.ubl-settings-bootloader + 5 + + + + + False start