mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-01-30 23:48:44 +03:00
Fixed a bug where the device list button could not be added properly when certain language characters were included
This commit is contained in:
@@ -2058,7 +2058,7 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
|
|||||||
size_t new_selection = tab == (size_t)(-1) ? m_last_selected_tab : (m_layout == ESettingsLayout::Dlg && tab != 0) ? tab - 1 : tab;
|
size_t new_selection = tab == (size_t)(-1) ? m_last_selected_tab : (m_layout == ESettingsLayout::Dlg && tab != 0) ? tab - 1 : tab;
|
||||||
//B4
|
//B4
|
||||||
if (m_tabpanel->GetSelection() == 4) {
|
if (m_tabpanel->GetSelection() == 4) {
|
||||||
//B45 //B58
|
//B45 //B59 //B60
|
||||||
PresetBundle &preset_bundle = *wxGetApp().preset_bundle;
|
PresetBundle &preset_bundle = *wxGetApp().preset_bundle;
|
||||||
const PhysicalPrinterCollection &ph_printers = preset_bundle.physical_printers;
|
const PhysicalPrinterCollection &ph_printers = preset_bundle.physical_printers;
|
||||||
struct PhysicalPrinterPresetData
|
struct PhysicalPrinterPresetData
|
||||||
@@ -2070,6 +2070,7 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
|
|||||||
std::string model_id;
|
std::string model_id;
|
||||||
wxString host;
|
wxString host;
|
||||||
bool is_QIDI;
|
bool is_QIDI;
|
||||||
|
std::string preset_name;
|
||||||
};
|
};
|
||||||
std::vector<PhysicalPrinterPresetData> preset_data;
|
std::vector<PhysicalPrinterPresetData> preset_data;
|
||||||
for (PhysicalPrinterCollection::ConstIterator it = ph_printers.begin(); it != ph_printers.end(); ++it) {
|
for (PhysicalPrinterCollection::ConstIterator it = ph_printers.begin(); it != ph_printers.end(); ++it) {
|
||||||
@@ -2084,7 +2085,7 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
|
|||||||
else
|
else
|
||||||
model_id = preset->config.opt_string("printer_model");
|
model_id = preset->config.opt_string("printer_model");
|
||||||
}
|
}
|
||||||
//B58
|
//B59 //B60
|
||||||
wxStringTokenizer tokenizer(wxString::FromUTF8(it->get_full_name(preset_name)), "*");
|
wxStringTokenizer tokenizer(wxString::FromUTF8(it->get_full_name(preset_name)), "*");
|
||||||
std::string tem_name = (into_u8(tokenizer.GetNextToken().Trim().mb_str()));
|
std::string tem_name = (into_u8(tokenizer.GetNextToken().Trim().mb_str()));
|
||||||
auto * printer = preset_bundle.physical_printers.find_printer(tem_name);
|
auto * printer = preset_bundle.physical_printers.find_printer(tem_name);
|
||||||
@@ -2105,7 +2106,7 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
|
|||||||
}
|
}
|
||||||
preset_data.push_back({printer_name, wxString::FromUTF8(preset_name),
|
preset_data.push_back({printer_name, wxString::FromUTF8(preset_name),
|
||||||
wxString::FromUTF8(it->get_full_name(preset_name)), ph_printers.is_selected(it, preset_name),
|
wxString::FromUTF8(it->get_full_name(preset_name)), ph_printers.is_selected(it, preset_name),
|
||||||
model_id, host, (host_type == htMoonraker)});
|
model_id, host, (host_type == htMoonraker), preset_name});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2116,7 +2117,7 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
|
|||||||
for (auto it = m_buttons.begin(); it != m_buttons.end();) {
|
for (auto it = m_buttons.begin(); it != m_buttons.end();) {
|
||||||
bool foundPreset = false;
|
bool foundPreset = false;
|
||||||
for (const PhysicalPrinterPresetData &data : preset_data) {
|
for (const PhysicalPrinterPresetData &data : preset_data) {
|
||||||
//B58
|
//B59
|
||||||
if ((*it)->getLabel() == data.fullname && (*it)->getIPLabel() == data.host && (*it)->getIsQIDI() == data.is_QIDI) {
|
if ((*it)->getLabel() == data.fullname && (*it)->getIPLabel() == data.host && (*it)->getIsQIDI() == data.is_QIDI) {
|
||||||
foundPreset = true;
|
foundPreset = true;
|
||||||
break;
|
break;
|
||||||
@@ -2147,10 +2148,10 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
|
|||||||
missingPresets.push_back(&data);
|
missingPresets.push_back(&data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//B58
|
//B59 //B60
|
||||||
for (const PhysicalPrinterPresetData *data : missingPresets) {
|
for (const PhysicalPrinterPresetData *data : missingPresets) {
|
||||||
|
|
||||||
Preset *preset = m_collection->find_preset((data->name).ToStdString());
|
Preset *preset = m_collection->find_preset((data->preset_name));
|
||||||
if (!preset || !preset->is_visible)
|
if (!preset || !preset->is_visible)
|
||||||
continue;
|
continue;
|
||||||
wxStringTokenizer tokenizer((data->fullname), "*");
|
wxStringTokenizer tokenizer((data->fullname), "*");
|
||||||
|
|||||||
@@ -665,7 +665,7 @@ void PrinterWebView::OnEditButtonClick(wxCommandEvent &event) {
|
|||||||
button->SetNameText((wxString::FromUTF8(printer_name)));
|
button->SetNameText((wxString::FromUTF8(printer_name)));
|
||||||
button->SetIPText(host);
|
button->SetIPText(host);
|
||||||
button->SetLabel(fullname);
|
button->SetLabel(fullname);
|
||||||
//B58
|
//B59
|
||||||
const auto opt = cfg_t->option<ConfigOptionEnum<PrintHostType>>("host_type");
|
const auto opt = cfg_t->option<ConfigOptionEnum<PrintHostType>>("host_type");
|
||||||
const auto host_type = opt != nullptr ? opt->value : htOctoPrint;
|
const auto host_type = opt != nullptr ? opt->value : htOctoPrint;
|
||||||
bool isQIDI = (host_type == htMoonraker);
|
bool isQIDI = (host_type == htMoonraker);
|
||||||
@@ -691,7 +691,7 @@ void PrinterWebView::OnEditButtonClick(wxCommandEvent &event) {
|
|||||||
wxString Machine_Name = Machine_Name.Format("%s%s", model_id, "_thumbnail");
|
wxString Machine_Name = Machine_Name.Format("%s%s", model_id, "_thumbnail");
|
||||||
|
|
||||||
button->SetBitMap(get_bmp_bundle(std::string(Machine_Name.mb_str()), 80)->GetBitmapFor(this));
|
button->SetBitMap(get_bmp_bundle(std::string(Machine_Name.mb_str()), 80)->GetBitmapFor(this));
|
||||||
//B58
|
//B59
|
||||||
load_url(formattedHost);
|
load_url(formattedHost);
|
||||||
UpdateLayout();
|
UpdateLayout();
|
||||||
Refresh();
|
Refresh();
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public:
|
|||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
//B58
|
//B59
|
||||||
void SetIsQIDI(const bool &text)
|
void SetIsQIDI(const bool &text)
|
||||||
{
|
{
|
||||||
m_is_QIDI = text;
|
m_is_QIDI = text;
|
||||||
@@ -226,7 +226,7 @@ private:
|
|||||||
wxString m_state_text;
|
wxString m_state_text;
|
||||||
wxString m_progress_text;
|
wxString m_progress_text;
|
||||||
std::function<void(wxMouseEvent &)> m_handlerl;
|
std::function<void(wxMouseEvent &)> m_handlerl;
|
||||||
//B58
|
//B59
|
||||||
bool m_is_QIDI;
|
bool m_is_QIDI;
|
||||||
wxDECLARE_EVENT_TABLE();
|
wxDECLARE_EVENT_TABLE();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user