FIX: Interactive UI for installing network plugins
jira: none Change-Id: I2a99917cab90eda26335be38cccbf17cd2d5342b
This commit is contained in:
parent
f91bbc4f7c
commit
a415ab0c71
|
@ -148,14 +148,25 @@ bool DownloadProgressDialog::Show(bool show)
|
||||||
m_upgrade_job->set_event_handle(this);
|
m_upgrade_job->set_event_handle(this);
|
||||||
m_status_bar->set_progress(0);
|
m_status_bar->set_progress(0);
|
||||||
Bind(EVT_UPGRADE_NETWORK_SUCCESS, [this](wxCommandEvent& evt) {
|
Bind(EVT_UPGRADE_NETWORK_SUCCESS, [this](wxCommandEvent& evt) {
|
||||||
m_status_bar->change_button_label(_L("OK"));
|
if (wxGetApp().check_networking_version()) {
|
||||||
on_finish();
|
m_status_bar->change_button_label(_L("OK"));
|
||||||
m_status_bar->set_cancel_callback_fina(
|
on_finish();
|
||||||
[this]() {
|
m_status_bar->set_cancel_callback_fina(
|
||||||
this->Close();
|
[this]() {
|
||||||
wxGetApp().request_login();
|
this->Close();
|
||||||
}
|
wxGetApp().request_login();
|
||||||
);
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
on_finish();
|
||||||
|
m_status_bar->change_button_label(_L("Close"));
|
||||||
|
m_status_bar->set_cancel_callback_fina(
|
||||||
|
[this]() {
|
||||||
|
this->Close();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//download failed
|
//download failed
|
||||||
|
|
|
@ -4233,8 +4233,29 @@ std::string GUI_App::handle_web_request(std::string cmd)
|
||||||
|
|
||||||
if (mainframe && mainframe->m_webview) { mainframe->m_webview->OpenOneMakerlab(strUrl); }
|
if (mainframe && mainframe->m_webview) { mainframe->m_webview->OpenOneMakerlab(strUrl); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (command_str.compare("makerworld_model_open") == 0)
|
else if (command_str.compare("homepage_need_networkplugin") == 0){
|
||||||
|
if (mainframe){
|
||||||
|
if (mainframe->m_confirm_download_plugin_dlg == nullptr) {
|
||||||
|
mainframe->m_confirm_download_plugin_dlg = new SecondaryCheckDialog(mainframe, wxID_ANY, _L("Install network plug-in"), SecondaryCheckDialog::ButtonStyle::ONLY_CONFIRM);
|
||||||
|
mainframe->m_confirm_download_plugin_dlg->SetSize(wxSize(270, 158));
|
||||||
|
mainframe->m_confirm_download_plugin_dlg->update_text(_L("Please Install network plug-in before log in."));
|
||||||
|
mainframe->m_confirm_download_plugin_dlg->update_btn_label(_L("Install Network Plug-in"), _L(""));
|
||||||
|
|
||||||
|
mainframe->m_confirm_download_plugin_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent& e) {
|
||||||
|
mainframe->m_confirm_download_plugin_dlg->Close();
|
||||||
|
ShowDownNetPluginDlg();
|
||||||
|
return;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
auto dlg_width = mainframe->m_confirm_download_plugin_dlg->GetSize();
|
||||||
|
int xPos = mainframe->GetRect().GetX() + (mainframe->GetSize().x - dlg_width.x) / 2;
|
||||||
|
int yPos = mainframe->GetRect().GetY() + (mainframe->GetSize().y - dlg_width.y) / 2;
|
||||||
|
mainframe->m_confirm_download_plugin_dlg->SetPosition(wxPoint(xPos, yPos));
|
||||||
|
mainframe->m_confirm_download_plugin_dlg->on_show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (command_str.compare("makerworld_model_open") == 0)
|
||||||
{
|
{
|
||||||
if (root.get_child_optional("model") != boost::none) {
|
if (root.get_child_optional("model") != boost::none) {
|
||||||
pt::ptree data_node = root.get_child("model");
|
pt::ptree data_node = root.get_child("model");
|
||||||
|
|
|
@ -1045,6 +1045,9 @@ void MainFrame::init_tabpanel()
|
||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
int xPos = GetRect().GetX() + (GetSize().x - m_confirm_download_plugin_dlg->GetSize().x) / 2;
|
||||||
|
int yPos = GetRect().GetY() + (GetSize().y - m_confirm_download_plugin_dlg->GetSize().y) / 2;
|
||||||
|
m_confirm_download_plugin_dlg->SetPosition(wxPoint(xPos, yPos));
|
||||||
m_confirm_download_plugin_dlg->on_show();
|
m_confirm_download_plugin_dlg->on_show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4926,7 +4926,21 @@ void EditDevNameDialog::on_edit_name(wxCommandEvent &e)
|
||||||
void PinCodePanel::on_mouse_left_up(wxMouseEvent& evt)
|
void PinCodePanel::on_mouse_left_up(wxMouseEvent& evt)
|
||||||
{
|
{
|
||||||
if (m_type == 0) {
|
if (m_type == 0) {
|
||||||
wxGetApp().popup_ping_bind_dialog();
|
if (wxGetApp().getAgent() && wxGetApp().getAgent()->is_user_login()){
|
||||||
|
wxGetApp().popup_ping_bind_dialog();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
auto m_confirm_login_dlg = new SecondaryCheckDialog(nullptr, wxID_ANY, _L("Bind with Pin Code"), SecondaryCheckDialog::ButtonStyle::ONLY_CONFIRM, wxDefaultPosition);
|
||||||
|
m_confirm_login_dlg->SetSize(wxSize(FromDIP(270), FromDIP(158)));
|
||||||
|
m_confirm_login_dlg->update_text(_L("Please log in before binding your device with a PIN code.\nAlternatively, you can use LAN mode to bind your device. Learn about LAN mode."));
|
||||||
|
m_confirm_login_dlg->update_btn_label(_L("Go to Login"), _L(""));
|
||||||
|
m_confirm_login_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent& e) {
|
||||||
|
//m_confirm_login_dlg->on_hide();
|
||||||
|
wxGetApp().request_login();
|
||||||
|
return;
|
||||||
|
});
|
||||||
|
m_confirm_login_dlg->on_show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (m_type == 1) {
|
else if (m_type == 1) {
|
||||||
InputIpAddressDialog dlgo;
|
InputIpAddressDialog dlgo;
|
||||||
|
|
Loading…
Reference in New Issue