diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index 02e32ea..b44f98b 100755 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -195,9 +195,13 @@ void MainWindow::fill_in_view() { list_store_kernel = Gtk::ListStore::create(m_columns); list_store_IPT = Gtk::ListStore::create(m_columns); list_store_OTT = Gtk::ListStore::create(m_columns); + list_store_user = Gtk::ListStore::create(m_columns_user); + list_store_music = Gtk::ListStore::create(m_columns_music); treeViewKernel->set_model(list_store_kernel); treeViewIPT->set_model(list_store_IPT); treeViewOTT->set_model(list_store_OTT); + treeViewUser->set_model(list_store_user); + treeViewMusic->set_model(list_store_music); vec_Option_kernel = this->read_file_and_view(kernel_csv, row_kernel, list_store_kernel); vec_Option_IPT = this->read_file_and_view(IPT_csv, row_IPT, list_store_IPT); @@ -208,8 +212,31 @@ void MainWindow::fill_in_view() { this->view_add_colums(*treeViewKernel); this->view_add_colums(*treeViewIPT); this->view_add_colums(*treeViewOTT); + this->view_add_colums_user(*treeViewUser); + this->view_add_colums_music(*treeViewMusic); } +void MainWindow::view_add_colums_user(Gtk::TreeView &treeView) { + treeView.append_column_editable(str_administrator, m_columns_user.check_button); + treeView.append_column(str_user, m_columns_user.name); + treeView.append_column(str_password, m_columns_user.password); +} + +void MainWindow::view_add_colums_music(Gtk::TreeView &treeView) { + treeView.append_column_editable(str_active, m_columns_music.check_button); + treeView.append_column(str_option, m_columns_music.title); + treeView.append_column(str_melody_code, m_columns_music.melody_code); +} + +/* +void MainWindow::view_add_cell_111(Gtk::TreeModel::Row &row, Glib::RefPtr list_store_m) { + row = *(list_store_m->append()); + row[m_columns.check_button] = false; + row[m_columns.name] = ""; + row[m_columns.description] = ""; +} +*/ + void MainWindow::item_selected_kernel(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&) { auto selection_IPT = treeViewIPT->get_selection(); auto selection_OTT = treeViewOTT->get_selection(); @@ -497,6 +524,11 @@ void MainWindow::get_builder() { builder->get_widget("wndShowWeb", wndShowWeb); builder->get_widget("btnOpenMenuOS", btnOpenMenuOS); builder->get_widget("entrListOS", entrListOS); + builder->get_widget("treeViewUser", treeViewUser); + builder->get_widget("treeViewMusic", treeViewMusic); + builder->get_widget("lblBootMenuUsers", lblBootMenuUsers); + builder->get_widget("lblRingtoneStartup", lblRingtoneStartup); + } void MainWindow::localization(){ @@ -514,6 +546,9 @@ void MainWindow::localization(){ lblHeaderName->set_text(name_app); aboutWindows->set_comments(system_boot); lblHeaderAboutTopic->set_label(str_about); + lblBootMenuUsers->set_text(str_title_Boot_Menu_Users); + lblRingtoneStartup->set_text(str_title_Ringtone_Startup); + aboutWindows->set_website_label(project_Home_page); lblInfoCommand->set_text(command_line_parameters); lblInfoCommand1->set_text(command_line_parameters); @@ -754,11 +789,10 @@ void MainWindow::event(){ entryKernel->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_kernel)); entryIPT->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_IPT)); entryOTT->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_OTT)); - // entryKernel->signal_focus_in_event().connect(sigc::mem_fun(*this, &MainWindow::focus_in_txt_kernel)); - // entryIPT->signal_focus_in_event().connect(sigc::mem_fun(*this, &MainWindow::focus_in_txt_IPT)); - // entryOTT->signal_focus_in_event().connect(sigc::mem_fun(*this, &MainWindow::focus_in_txt_OTT)); + entryKernel->signal_focus_in_event().connect(sigc::mem_fun(*this, &MainWindow::focus_in_txt_kernel)); + entryIPT->signal_focus_in_event().connect(sigc::mem_fun(*this, &MainWindow::focus_in_txt_IPT)); + entryOTT->signal_focus_in_event().connect(sigc::mem_fun(*this, &MainWindow::focus_in_txt_OTT)); } - this->signal_delete_event().connect(sigc::mem_fun(*this, &MainWindow::gui_exit)); chbLoadVariantSelectionTimer->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::set_active_boot_second)); } diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index c4c5abb..85d8e10 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -93,7 +93,16 @@ void me_thread(string cmd); #define program_as_root _("The program must be run as root") #define str_active _("Active") #define str_option _("Option") +#define str_title _("Title") +#define str_user _("User") +#define str_password _("Password") +#define str_administrator _("Administrator") +#define str_select _("Select") +#define str_melody_code _("Melody code") +#define str_ringtone_at_startup _("Ringtone at startup") #define str_description _("Description") +#define str_title_Boot_Menu_Users _("Boot Menu Users") +#define str_title_Ringtone_Startup _("Ringtone at startup") #define str_help_h _("GTK settings bootloader for UBLinux\n" \ "\n" \ "Usage: ubl-settings-bootloader [OPTIONS...]\n" \ @@ -158,9 +167,40 @@ public: Gtk::TreeModelColumn name; Gtk::TreeModelColumn description; }; + class ModelColumnsUser : public Gtk::TreeModel::ColumnRecord + { + public: + ModelColumnsUser() + { + add(check_button), add(name); + add(password); + } + // Gtk::TreeModelColumn check_button; + Gtk::TreeModelColumn check_button; + Gtk::TreeModelColumn name; + Gtk::TreeModelColumn password; + }; + class ModelColumnsMusic : public Gtk::TreeModel::ColumnRecord + { + public: + ModelColumnsMusic() + { + add(check_button), add(title); + add(melody_code); + } + // Gtk::TreeModelColumn check_button; + Gtk::TreeModelColumn check_button; + Gtk::TreeModelColumn title; + Gtk::TreeModelColumn melody_code; + }; + ModelColumns m_columns; + ModelColumnsUser m_columns_user; + ModelColumnsMusic m_columns_music; Glib::RefPtr builder; Gtk::SpinButton *spbSecond; + Gtk::Label *lblBootMenuUsers; + Gtk::Label *lblRingtoneStartup; Gtk::Label *lblInfoSeconds; Gtk::Label *lblInfoDefaultDonw; Gtk::Label *lblInfoCommand; @@ -199,6 +239,8 @@ public: Gtk::TreeView *treeViewKernel; Gtk::TreeView *treeViewIPT; Gtk::TreeView *treeViewOTT; + Gtk::TreeView *treeViewUser; + Gtk::TreeView *treeViewMusic; Gtk::Image *imgBG; Gtk::Overlay *overHead; Gtk::ComboBoxText *cmbDownloadMode; @@ -225,16 +267,18 @@ public: Glib::RefPtr list_store_kernel; Glib::RefPtr list_store_IPT; Glib::RefPtr list_store_OTT; + Glib::RefPtr list_store_user; + Glib::RefPtr list_store_music; #ifdef WEBKIT_FOUND Gtk::Window *wndWeb; Gtk::Widget *three; WebKitWebView *one; #endif - - void set_entry_to_tree_view(Glib::RefPtr &list_store, Gtk::Entry &entry, std::vector &vec_Option, int size, string key); Gtk::TreeModel::Row row_kernel; Gtk::TreeModel::Row row_IPT; Gtk::TreeModel::Row row_OTT; + Gtk::TreeModel::Row row_user; + Gtk::TreeModel::Row row_music; std::map map_cmd_selection; std::map map_global_cmd_selection; std::map map_local_cmd_selection; @@ -260,8 +304,7 @@ public: Glib::RefPtr boxInfo; string str_cmd_error = ""; template - struct Result - { + struct Result { Type response; int error; }; @@ -271,6 +314,7 @@ public: MainWindow(Glib::RefPtr const &builder); ~MainWindow(); void open_browser(); + void set_entry_to_tree_view(Glib::RefPtr &list_store, Gtk::Entry &entry, std::vector &vec_Option, int size, string key); void get_menu_boot(std::map &map_temp); void set_row_all(std::map &map_cmd, Glib::RefPtr &list_store, vector &list_params, size_t size, string key); void set_row(Glib::RefPtr &list_store, int size, std::string name, bool flag_chbox); @@ -282,6 +326,8 @@ public: void localization(); void event(); void settings(); + void view_add_colums_user(Gtk::TreeView &treeView); + void view_add_colums_music(Gtk::TreeView &treeView); void set_bat_save(Gtk::Button *btnSave); string pars_last_launched_os(); vector pars_os(vector &os_control_list); diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade index 760c6d7..2494146 100644 --- a/ubl-settings-bootloader.glade +++ b/ubl-settings-bootloader.glade @@ -576,7 +576,7 @@ specified priority False True - 3 + 2 @@ -624,7 +624,7 @@ specified priority False True - 4 + 3 @@ -669,12 +669,304 @@ specified priority + + False + True + 4 + + + + + True + False + 0.019999999552965164 + in + + + True + False + + + True + False + 12 + + + True + False + vertical + + + 70 + True + True + 5 + 5 + in + + + True + False + + + -1 + True + True + + + + + + + + + + False + True + 0 + + + + + + + True + True + 0 + + + + + True + False + vertical + + + True + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + True + False + list-add + + + + + False + True + 0 + + + + + True + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + True + False + gtk-remove + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Boot Menu Users + start + + + False True 5 + + + True + False + 0.019999999552965164 + in + + + True + False + + + True + False + 12 + + + True + False + vertical + + + 70 + True + True + 5 + 5 + in + + + True + False + + + -1 + True + True + + + + + + + + + + False + True + 0 + + + + + + + True + True + 0 + + + + + True + False + vertical + + + True + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + True + False + list-add + + + + + False + True + 0 + + + + + True + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + True + False + gtk-remove + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Ringtone at startup + start + + + + + False + True + 6 + + diff --git a/ubl-settings-bootloader.pot b/ubl-settings-bootloader.pot index a9e2e24..bfdacc3 100644 --- a/ubl-settings-bootloader.pot +++ b/ubl-settings-bootloader.pot @@ -17,6 +17,30 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +msgid "Boot Menu Users" +msgstr "" + +msgid "Title" +msgstr "" + +msgid "" +msgstr "" + +msgid "Password" +msgstr "" + +msgid "Administrator" +msgstr "" + +msgid "Select" +msgstr "" + +msgid "Melody code" +msgstr "" + +msgid "Ringtone at startup" +msgstr "" + #: source/ubl-settings-bootloader.h:53 source/ubl-settings-bootloader.h:52 #: source/ubl-settings-bootloader.cc:431 source/ubl-settings-bootloader.cc:301 msgid "About" diff --git a/ubl-settings-bootloader_ru.po b/ubl-settings-bootloader_ru.po index 9b3017d..f7b168f 100644 --- a/ubl-settings-bootloader_ru.po +++ b/ubl-settings-bootloader_ru.po @@ -349,6 +349,30 @@ msgstr "Прочитать онлайн" msgid "Save" msgstr "Сохранить" +msgid "Boot Menu Users" +msgstr "Пользователи меню загрузчика" + +msgid "Title" +msgstr "Название" + +msgid "User" +msgstr "Пользователь" + +msgid "Password" +msgstr "Пароль" + +msgid "Administrator" +msgstr "Администратор" + +msgid "Select" +msgstr "Выбор" + +msgid "Melody code" +msgstr "Код мелодии" + +msgid "Ringtone at startup" +msgstr "Мелодия при загрузки" + #: source/ubl-settings-bootloader.h:58 source/ubl-settings-bootloader.h:57 #: source/ubl-settings-bootloader.cc:434 source/ubl-settings-bootloader.cc:304 msgid "Save in global configuration"