|
|
|
|
@ -46,6 +46,9 @@ SettingsPlug::SettingsPlug(::Window p_socketID, Glib::RefPtr<Gtk::Builder> build
|
|
|
|
|
MainWindow* wnd = nullptr;
|
|
|
|
|
builder->get_widget_derived("window", wnd);
|
|
|
|
|
builder->get_widget("plugBox", plugBox);
|
|
|
|
|
wnd->settings();
|
|
|
|
|
wnd->set_plug(plugBox);
|
|
|
|
|
wnd->event();
|
|
|
|
|
plugBox->get_parent()->remove(*plugBox);
|
|
|
|
|
add(*plugBox);
|
|
|
|
|
show_all_children();
|
|
|
|
|
@ -61,12 +64,10 @@ int MainWindow::check_root() {
|
|
|
|
|
MainWindow::MainWindow(BaseObjectType* obj, Glib::RefPtr<Gtk::Builder> const& builder)
|
|
|
|
|
: Gtk::ApplicationWindow(obj), builder{builder} {
|
|
|
|
|
this->builder = builder;
|
|
|
|
|
this->settings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MainWindow::MainWindow(Glib::RefPtr<Gtk::Builder> const& builder) {
|
|
|
|
|
this->builder = builder;
|
|
|
|
|
this->settings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::settings() {
|
|
|
|
|
@ -89,6 +90,7 @@ void MainWindow::settings() {
|
|
|
|
|
overHead->add_overlay(*boxWidget);
|
|
|
|
|
btnBoxAboutDialog->set_visible(false);
|
|
|
|
|
ubl_make_plugs(boxSave,boxButton, socket_ext_id_I, socket_trd_id_I);
|
|
|
|
|
|
|
|
|
|
#ifdef WEBKIT_FOUND
|
|
|
|
|
one = WEBKIT_WEB_VIEW(webkit_web_view_new());
|
|
|
|
|
three = Glib::wrap(GTK_WIDGET(one));
|
|
|
|
|
@ -125,7 +127,10 @@ void MainWindow::settings() {
|
|
|
|
|
this->set_active_boot_second();
|
|
|
|
|
this->fill_in_view();
|
|
|
|
|
}
|
|
|
|
|
this->event();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::set_plug(Gtk::Widget *plug) {
|
|
|
|
|
this->plug = plug;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vector<tuple<string, vector<string>>> MainWindow::format_os_list(vector<string> &os_control_list) {
|
|
|
|
|
@ -520,13 +525,11 @@ void MainWindow::localization() {
|
|
|
|
|
btnSave->set_label(str_save);
|
|
|
|
|
btnLoad->set_label(str_load);
|
|
|
|
|
this->set_title(name_app);
|
|
|
|
|
// Todo: check
|
|
|
|
|
lblDownloadMode->set_text(boot_screen_display_mode);
|
|
|
|
|
cmbDownloadMode->append(loading_animation_with);
|
|
|
|
|
cmbDownloadMode->append(loading_animation_without);
|
|
|
|
|
cmbDownloadMode->append(no_loading_animation);
|
|
|
|
|
cmbDownloadMode->append(lack_loading_animation);
|
|
|
|
|
|
|
|
|
|
lblDownloadMode->set_text(boot_screen_display_mode);
|
|
|
|
|
lblhelpHeader->set_text(read_documentation_web);
|
|
|
|
|
lblhelpText->set_text(_(redirected_documentation));
|
|
|
|
|
btnReadHelp->set_label(read_online);
|
|
|
|
|
@ -676,6 +679,45 @@ void MainWindow::event() {
|
|
|
|
|
}
|
|
|
|
|
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));
|
|
|
|
|
if (plug == NULL) {
|
|
|
|
|
this->signal_check_resize().connect(sigc::mem_fun(*this, &MainWindow::check_resize_window));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
plug->get_parent()->signal_check_resize().connect(sigc::mem_fun(*this, &MainWindow::check_resize_window));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::check_resize_window() {
|
|
|
|
|
int height = 0;
|
|
|
|
|
int width = 0;
|
|
|
|
|
if (plug == NULL) {
|
|
|
|
|
height = this->get_window()->get_height();
|
|
|
|
|
width = this->get_window()->get_width();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
height = plug->get_window()->get_height();
|
|
|
|
|
width = plug->get_window()->get_width();
|
|
|
|
|
// lblInfoHead->set_text(to_string(height));
|
|
|
|
|
}
|
|
|
|
|
if (height != old_height) {
|
|
|
|
|
if (minimal_height >= height) {
|
|
|
|
|
cmbDownloadMode->remove_all();
|
|
|
|
|
cmbDownloadMode->append(loading_animation_with);
|
|
|
|
|
cmbDownloadMode->append(loading_animation_without);
|
|
|
|
|
cmbDownloadMode->append(no_loading_animation_800_600);
|
|
|
|
|
cmbDownloadMode->append(lack_loading_animation_800_600);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
cmbDownloadMode->remove_all();
|
|
|
|
|
cmbDownloadMode->append(loading_animation_with);
|
|
|
|
|
cmbDownloadMode->append(loading_animation_without);
|
|
|
|
|
cmbDownloadMode->append(no_loading_animation);
|
|
|
|
|
cmbDownloadMode->append(lack_loading_animation);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
old_height = height;
|
|
|
|
|
old_width = width;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::set_tree_view_user() {
|
|
|
|
|
@ -747,6 +789,7 @@ void MainWindow::set_init_data_user(std::map<string, string> &map_temp) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Glib::RefPtr<Gtk::TreeModel> treeViewUserModel = treeViewUser->get_model();
|
|
|
|
|
treeViewUser->signal_cursor_changed().connect(sigc::mem_fun(*this, &MainWindow::check_space_user));
|
|
|
|
|
treeViewUserModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::select_line_user));
|
|
|
|
|
this->view_add_colums_user(*treeViewUser);
|
|
|
|
|
}
|
|
|
|
|
@ -849,6 +892,7 @@ void MainWindow::set_init_data_melody(std::map<string, string> &map_temp) {
|
|
|
|
|
this->set_add_data_melody(row_melody, flag, name, code);
|
|
|
|
|
}
|
|
|
|
|
Glib::RefPtr<Gtk::TreeModel> treeViewMelodyModel = treeViewMelody->get_model();
|
|
|
|
|
treeViewMelody->signal_cursor_changed().connect(sigc::mem_fun(*this, &MainWindow::check_space_melody));
|
|
|
|
|
treeViewMelodyModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::select_line_melody));
|
|
|
|
|
this->view_add_colums_melody(*treeViewMelody);
|
|
|
|
|
}
|
|
|
|
|
@ -908,13 +952,7 @@ void MainWindow::remove_melody() {
|
|
|
|
|
flag_validate_del_melody = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::select_line_user(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter) {
|
|
|
|
|
treeViewKernel->get_selection()->unselect_all();
|
|
|
|
|
treeViewOTT->get_selection()->unselect_all();
|
|
|
|
|
treeViewIPT->get_selection()->unselect_all();
|
|
|
|
|
treeViewMelody->get_selection()->unselect_all();
|
|
|
|
|
iter_user_del = iter;
|
|
|
|
|
flag_validate_del_user = true;
|
|
|
|
|
void MainWindow::check_space_user() {
|
|
|
|
|
bool flag_error = false;
|
|
|
|
|
string name = "";
|
|
|
|
|
string password = "";
|
|
|
|
|
@ -943,16 +981,8 @@ void MainWindow::select_line_user(const Gtk::TreeModel::Path&, const Gtk::TreeMo
|
|
|
|
|
lblWarning->set_text(str_add_user);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
len_old_user = len_new_user;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::select_line_melody(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter) {
|
|
|
|
|
treeViewKernel->get_selection()->unselect_all();
|
|
|
|
|
treeViewOTT->get_selection()->unselect_all();
|
|
|
|
|
treeViewIPT->get_selection()->unselect_all();
|
|
|
|
|
treeViewUser->get_selection()->unselect_all();
|
|
|
|
|
iter_melody_del = iter;
|
|
|
|
|
flag_validate_del_melody = true;
|
|
|
|
|
void MainWindow::check_space_melody() {
|
|
|
|
|
string code_melodyes = "";
|
|
|
|
|
string melody_title = "";
|
|
|
|
|
size_t len_new_melody = 0;
|
|
|
|
|
@ -980,6 +1010,37 @@ void MainWindow::select_line_melody(const Gtk::TreeModel::Path&, const Gtk::Tree
|
|
|
|
|
lblWarning->set_text(str_add_melody);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::select_line_user(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter) {
|
|
|
|
|
treeViewKernel->get_selection()->unselect_all();
|
|
|
|
|
treeViewOTT->get_selection()->unselect_all();
|
|
|
|
|
treeViewIPT->get_selection()->unselect_all();
|
|
|
|
|
treeViewMelody->get_selection()->unselect_all();
|
|
|
|
|
iter_user_del = iter;
|
|
|
|
|
size_t len_new_user = 0;
|
|
|
|
|
flag_validate_del_user = true;
|
|
|
|
|
Glib::RefPtr<Gtk::TreeModel> treeViewUser_model = treeViewUser->get_model();
|
|
|
|
|
Gtk::TreeModel::Children children = treeViewUser_model->children();
|
|
|
|
|
for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) {
|
|
|
|
|
len_new_user += 1;
|
|
|
|
|
}
|
|
|
|
|
len_old_user = len_new_user;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::select_line_melody(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter) {
|
|
|
|
|
treeViewKernel->get_selection()->unselect_all();
|
|
|
|
|
treeViewOTT->get_selection()->unselect_all();
|
|
|
|
|
treeViewIPT->get_selection()->unselect_all();
|
|
|
|
|
treeViewUser->get_selection()->unselect_all();
|
|
|
|
|
iter_melody_del = iter;
|
|
|
|
|
size_t len_new_melody = 0;
|
|
|
|
|
flag_validate_del_melody = true;
|
|
|
|
|
Glib::RefPtr<Gtk::TreeModel> treeViewMelody_model = treeViewMelody->get_model();
|
|
|
|
|
Gtk::TreeModel::Children children = treeViewMelody_model->children();
|
|
|
|
|
for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) {
|
|
|
|
|
len_new_melody += 1;
|
|
|
|
|
}
|
|
|
|
|
this->validate_melody();
|
|
|
|
|
len_old_melody = len_new_melody;
|
|
|
|
|
}
|
|
|
|
|
|