* Add OrcaCloud sync platform and preset bundle sharing system Introduce OrcaCloud, a cloud sync platform for user presets, alongside a preset bundle system that enables sharing printer/filament/process profiles as local exportable bundles or subscribed cloud bundles. OrcaCloud platform: - Auth to Orca Cloud - Encrypted token storage (file-based or system keychain) - User preset sync with - Profile migration from default/bambu folders on first login - Homepage integration with entrance to cloud.orcaslicer.com Preset bundles: - Local bundle import/export with bundle_structure.json metadata - Subscribed cloud bundles with version-based update checking - Thread-safe concurrent bundle access with read-write mutex - Canonical bundle preset naming (_local/<id>/... and _subscribed/<id>/...) - Bundle presets are read-only; grouped under subheaders in combo boxes - PresetBundleDialog with auto-sync toggle, refresh, update notifications - Hyperlinked bundle names to cloud bundle pages Co-authored-by: Sabriel Koh <sabrielkcr@gmail.com> Co-authored-by: Derrick <derrick992110@gmail.com> Co-authored-by: Mykola Nahirnyi <mnahirnyi@amcbridge.com> Co-authored-by: Ian Chua <iancrb00@gmail.com> Co-authored-by: Draginraptor <draginraptor@gmail.com> Co-authored-by: ExPikaPaka <112851715+ExPikaPaka@users.noreply.github.com> Co-authored-by: Ian Bassi <ian.bassi@outlook.com> Co-authored-by: Ocraftyone <Ocraftyone@users.noreply.github.com> Co-authored-by: yw4z <ywsyildiz@gmail.com> Co-authored-by: peterm-m <101202951+peterm-m@users.noreply.github.com> * Fixed an issue on Windows it failed to login Orca Cloud with Google account
120 lines
3.7 KiB
C++
120 lines
3.7 KiB
C++
#ifndef slic3r_GUI_ComboBox_hpp_
|
|
#define slic3r_GUI_ComboBox_hpp_
|
|
|
|
#include "TextInput.hpp"
|
|
#include "DropDown.hpp"
|
|
|
|
#define CB_NO_DROP_ICON DD_NO_CHECK_ICON
|
|
#define CB_NO_TEXT DD_NO_TEXT
|
|
|
|
class ComboBox : public wxWindowWithItems<TextInput, wxItemContainer>
|
|
{
|
|
typedef DropDown::Item Item;
|
|
std::vector<Item> items;
|
|
|
|
DropDown drop;
|
|
bool drop_down = false;
|
|
bool text_off = false;
|
|
bool is_replace_text_to_image = false;
|
|
wxString replace_text;
|
|
wxString image_for_text;
|
|
|
|
public:
|
|
ComboBox(wxWindow * parent,
|
|
wxWindowID id,
|
|
const wxString &value = wxEmptyString,
|
|
const wxPoint & pos = wxDefaultPosition,
|
|
const wxSize & size = wxDefaultSize,
|
|
int n = 0,
|
|
const wxString choices[] = NULL,
|
|
long style = 0);
|
|
|
|
DropDown & GetDropDown() { return drop; }
|
|
|
|
virtual bool SetFont(wxFont const & font) override;
|
|
|
|
public:
|
|
int Append(const wxString &item, const wxBitmap &bitmap = wxNullBitmap, int item_style = 0);
|
|
int Append(const wxString &item, const wxBitmap &bitmap, void *clientData, int item_style = 0);
|
|
int Append(const wxString &item, const wxBitmap &bitmap, const wxString &group, void *clientData = nullptr, int item_style = 0);
|
|
int Append(const wxString& item,
|
|
const wxBitmap& bitmap,
|
|
const wxString& group_key,
|
|
const wxString& group_label,
|
|
void* clientData = nullptr,
|
|
int item_style = 0);
|
|
|
|
int SetItems(const std::vector<DropDown::Item>& the_items);
|
|
|
|
void set_replace_text(wxString text, wxString image_name);
|
|
unsigned int GetCount() const override;
|
|
|
|
int GetSelection() const override;
|
|
|
|
void SetSelection(int n) override;
|
|
|
|
void SelectAndNotify(int n);
|
|
|
|
virtual void Rescale() override;
|
|
|
|
wxString GetValue() const;
|
|
void SetValue(const wxString &value);
|
|
|
|
void SetLabel(const wxString &label) override;
|
|
wxString GetLabel() const override;
|
|
|
|
int GetFlag(unsigned int n);
|
|
void SetFlag(unsigned int n, int value);
|
|
|
|
void SetTextLabel(const wxString &label);
|
|
wxString GetTextLabel() const;
|
|
|
|
wxString GetString(unsigned int n) const override;
|
|
void SetString(unsigned int n, wxString const &value) override;
|
|
|
|
wxString GetItemTooltip(unsigned int n) const;
|
|
void SetItemTooltip(unsigned int n, wxString const &value);
|
|
|
|
wxString GetItemAlias(unsigned int n) const;
|
|
void SetItemAlias(unsigned int n, wxString const &value);
|
|
|
|
wxBitmap GetItemBitmap(unsigned int n);
|
|
void SetItemBitmap(unsigned int n, wxBitmap const &bitmap);
|
|
bool is_drop_down(){return drop_down;}
|
|
void DeleteOneItem(unsigned int pos) { DoDeleteOneItem(pos); }
|
|
|
|
void ForceDropdownOpen();
|
|
|
|
protected:
|
|
virtual int DoInsertItems(const wxArrayStringsAdapter &items,
|
|
unsigned int pos,
|
|
void ** clientData,
|
|
wxClientDataType type) override;
|
|
virtual void DoClear() override;
|
|
|
|
void DoDeleteOneItem(unsigned int pos) override;
|
|
|
|
void *DoGetItemClientData(unsigned int n) const override;
|
|
void DoSetItemClientData(unsigned int n, void *data) override;
|
|
|
|
void OnEdit() override;
|
|
|
|
void sendComboBoxEvent();
|
|
|
|
#ifdef __WIN32__
|
|
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) override;
|
|
#endif
|
|
|
|
private:
|
|
|
|
// some useful events
|
|
void mouseDown(wxMouseEvent &event);
|
|
void mouseWheelMoved(wxMouseEvent &event);
|
|
void keyDown(wxKeyEvent &event);
|
|
void onMove(wxMoveEvent &event);
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
};
|
|
|
|
#endif // !slic3r_GUI_ComboBox_hpp_
|