mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-25 07:37:37 +08:00
In AboutDialog added "Copy Version Info" button (FR #4990)
This commit is contained in:
parent
7e3d8c3142
commit
acd1782910
@ -297,6 +297,11 @@ AboutDialog::AboutDialog()
|
|||||||
auto copy_rights_btn = new wxButton(this, m_copy_rights_btn_id, _L("Portions copyright")+dots);
|
auto copy_rights_btn = new wxButton(this, m_copy_rights_btn_id, _L("Portions copyright")+dots);
|
||||||
buttons->Insert(0, copy_rights_btn, 0, wxLEFT, 5);
|
buttons->Insert(0, copy_rights_btn, 0, wxLEFT, 5);
|
||||||
copy_rights_btn->Bind(wxEVT_BUTTON, &AboutDialog::onCopyrightBtn, this);
|
copy_rights_btn->Bind(wxEVT_BUTTON, &AboutDialog::onCopyrightBtn, this);
|
||||||
|
|
||||||
|
m_copy_version_btn_id = NewControlId();
|
||||||
|
auto copy_version_btn = new wxButton(this, m_copy_version_btn_id, _L("Copy Version Info"));
|
||||||
|
buttons->Insert(1, copy_version_btn, 0, wxLEFT, 5);
|
||||||
|
copy_version_btn->Bind(wxEVT_BUTTON, &AboutDialog::onCopyToClipboard, this);
|
||||||
|
|
||||||
this->SetEscapeId(wxID_CLOSE);
|
this->SetEscapeId(wxID_CLOSE);
|
||||||
this->Bind(wxEVT_BUTTON, &AboutDialog::onCloseDialog, this, wxID_CLOSE);
|
this->Bind(wxEVT_BUTTON, &AboutDialog::onCloseDialog, this, wxID_CLOSE);
|
||||||
@ -348,5 +353,12 @@ void AboutDialog::onCopyrightBtn(wxEvent &)
|
|||||||
dlg.ShowModal();
|
dlg.ShowModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AboutDialog::onCopyToClipboard(wxEvent&)
|
||||||
|
{
|
||||||
|
wxTheClipboard->Open();
|
||||||
|
wxTheClipboard->SetData(new wxTextDataObject(_L("Version") + " " + std::string(SLIC3R_VERSION)));
|
||||||
|
wxTheClipboard->Close();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace GUI
|
} // namespace GUI
|
||||||
} // namespace Slic3r
|
} // namespace Slic3r
|
||||||
|
@ -60,6 +60,7 @@ class AboutDialog : public DPIDialog
|
|||||||
wxHtmlWindow* m_html;
|
wxHtmlWindow* m_html;
|
||||||
wxStaticBitmap* m_logo;
|
wxStaticBitmap* m_logo;
|
||||||
int m_copy_rights_btn_id { wxID_ANY };
|
int m_copy_rights_btn_id { wxID_ANY };
|
||||||
|
int m_copy_version_btn_id { wxID_ANY };
|
||||||
public:
|
public:
|
||||||
AboutDialog();
|
AboutDialog();
|
||||||
|
|
||||||
@ -70,6 +71,7 @@ private:
|
|||||||
void onLinkClicked(wxHtmlLinkEvent &event);
|
void onLinkClicked(wxHtmlLinkEvent &event);
|
||||||
void onCloseDialog(wxEvent &);
|
void onCloseDialog(wxEvent &);
|
||||||
void onCopyrightBtn(wxEvent &);
|
void onCopyrightBtn(wxEvent &);
|
||||||
|
void onCopyToClipboard(wxEvent&);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace GUI
|
} // namespace GUI
|
||||||
|
Loading…
x
Reference in New Issue
Block a user