Skip to content

Commit 94891b3

Browse files
committed
Begin work on 1.5
- remove useless Learn tab (removes dependency on webview) + create templates for activation dialogs + bump version + create activation buttons and hook up events
1 parent d564a06 commit 94891b3

File tree

11 files changed

+4398
-3535
lines changed

11 files changed

+4398
-3535
lines changed

CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
3131

3232
#wxwidgets
3333
set(wxBUILD_SHARED OFF CACHE INTERNAL "")
34+
set(wxUSE_STL ON CACHE INTERNAL "")
35+
set(wxUSE_REGEX OFF CACHE INTERNAL "")
3436
add_subdirectory("wxWidgets" EXCLUDE_FROM_ALL)
3537

3638
# libcurl
@@ -69,7 +71,6 @@ target_link_libraries("${PROJECT_NAME}"
6971
PUBLIC
7072
wx::base
7173
wx::core
72-
wx::webview
7374
CURL::libcurl
7475
fmt
7576
)
@@ -116,3 +117,12 @@ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT "
116117
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} ${CMAKE_BUILD_TYPE}/${PROJECT_NAME}.app/Contents/MacOS/${PROJECT_NAME})
117118
endif()
118119
endif ()
120+
121+
macro(enable_unity targets)
122+
foreach(target ${targets})
123+
set_target_properties("${target}" PROPERTIES UNITY_BUILD ON)
124+
endforeach()
125+
endmacro()
126+
127+
set(all_unity "wxcore;wxbase;fmt")
128+
enable_unity("${all_unity}")

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ mkdir build && cd build
3838
cmake ..
3939
cmake --build . --config Release --target install
4040
```
41-
Note for linux users: you will need to have the `webkit2gtk3` development package installed for your system. For Fedora, this can be installed with `sudo dnf install webkit2gtk3-devel.x86_64` and for Debian/Ubuntu it can be installed with `sudo apt install webkit2gtk-driver`
4241

4342
## Issues
4443
Please report all problems in the [Issues](https://github.com/Ravbug/wxWidgetsTemplate/issues) section of this repository.

source/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<key>CFBundlePackageType</key>
2929
<string>APPL</string>
3030
<key>CFBundleShortVersionString</key>
31-
<string>1.42</string>
31+
<string>1.5</string>
3232
<key>CFBundleSignature</key>
3333
<string>????</string>
3434
<key>CFBundleVersion</key>

source/activation.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include "interface_derived.hpp"
2+
#include "activation.hpp""
3+
4+
void MainFrameDerived::OnActivatePersonal(wxCommandEvent& event) {
5+
auto dlg = new PersonalActivationDlgBase(this);
6+
dlg->Show();
7+
}
8+
9+
void MainFrameDerived::OnActivateProPlus(wxCommandEvent& event) {
10+
auto dlg = new PlusProActivationDlgBase(this);
11+
dlg->Show();
12+
}

source/activation.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#pragma once
2+
#include "interface.h"
3+
4+
class PlusProActivationDlg : public PlusProActivationDlgBase {
5+
public:
6+
PlusProActivationDlg(wxWindow* parent) : PlusProActivationDlgBase(parent) {}
7+
};
8+
9+
class PersonalActivationDlg : public PersonalActivationDlgBase {
10+
public:
11+
PersonalActivationDlg(wxWindow* parent) : PersonalActivationDlgBase(parent) {}
12+
};

source/form.fbp

Lines changed: 4185 additions & 3390 deletions
Large diffs are not rendered by default.

source/globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
static const std::string projectsFile = "projects.txt";
1515
static const std::string editorPathsFile = "editorPaths.txt";
1616
static const std::string templatePrefix = "com.unity.template";
17-
static const std::string AppVersion = "v1.42";
17+
static const std::string AppVersion = "v1.5";
1818

1919
//structure for representing an editor and for locating it
2020
struct editor{

source/interface.cpp

Lines changed: 110 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co
115115
reloadInstalls = new wxButton( installs_pane, wxID_RELOAD, wxT("Reload"), wxDefaultPosition, wxDefaultSize, 0 );
116116
bSizer5->Add( reloadInstalls, 0, wxALL|wxEXPAND, 5 );
117117

118+
activateProPlusBtn = new wxButton( installs_pane, ACTIV_PROPLUS, wxT("Activate (Plus/Pro)"), wxDefaultPosition, wxDefaultSize, 0 );
119+
bSizer5->Add( activateProPlusBtn, 0, wxALL|wxEXPAND, 5 );
120+
121+
activatePersonalBtn = new wxButton( installs_pane, ACTIV_PERSONAL, wxT("Activate (Personal)"), wxDefaultPosition, wxDefaultSize, 0 );
122+
bSizer5->Add( activatePersonalBtn, 0, wxALL|wxEXPAND, 5 );
123+
118124

119125
MainSizer->Add( bSizer5, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxEXPAND, 5 );
120126

@@ -127,55 +133,6 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co
127133
installs_pane->Layout();
128134
MainSizer->Fit( installs_pane );
129135
notebook->AddPage( installs_pane, wxT("Editor Versions"), false );
130-
learn_pane = new wxPanel( notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
131-
learnSizer = new wxGridBagSizer( 0, 0 );
132-
learnSizer->SetFlexibleDirection( wxBOTH );
133-
learnSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
134-
135-
backBtn = new wxButton( learn_pane, Nav_Back, wxT("<"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
136-
learnSizer->Add( backBtn, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
137-
138-
titleLabel = new wxStaticText( learn_pane, wxID_ANY, wxT("Loading Page"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT|wxST_ELLIPSIZE_END|wxST_NO_AUTORESIZE );
139-
titleLabel->Wrap( -1 );
140-
learnSizer->Add( titleLabel, wxGBPosition( 0, 3 ), wxGBSpan( 1, 2 ), wxALL|wxEXPAND, 5 );
141-
142-
forwardBtn = new wxButton( learn_pane, Nav_Forward, wxT(">"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
143-
learnSizer->Add( forwardBtn, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
144-
145-
homeBtn = new wxButton( learn_pane, Nav_Home, wxT("Home"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
146-
learnSizer->Add( homeBtn, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALL, 5 );
147-
148-
webSizer = new wxBoxSizer( wxVERTICAL );
149-
150-
151-
learnSizer->Add( webSizer, wxGBPosition( 1, 0 ), wxGBSpan( 1, 4 ), wxEXPAND, 5 );
152-
153-
wxBoxSizer* warningSizer;
154-
warningSizer = new wxBoxSizer( wxHORIZONTAL );
155-
156-
wxStaticText* m_staticText9;
157-
m_staticText9 = new wxStaticText( learn_pane, wxID_ANY, wxT("Do not use to fill forms or sign into accounts"), wxDefaultPosition, wxDefaultSize, 0 );
158-
m_staticText9->Wrap( -1 );
159-
m_staticText9->SetFont( wxFont( 10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
160-
161-
warningSizer->Add( m_staticText9, 0, wxALL, 5 );
162-
163-
openInBrowserCtrl = new wxHyperlinkCtrl( learn_pane, wxID_ANY, wxT("Open current page in default browser"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
164-
openInBrowserCtrl->SetFont( wxFont( 10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
165-
166-
warningSizer->Add( openInBrowserCtrl, 0, wxALL, 5 );
167-
168-
169-
learnSizer->Add( warningSizer, wxGBPosition( 2, 0 ), wxGBSpan( 1, 4 ), wxEXPAND, 5 );
170-
171-
172-
learnSizer->AddGrowableCol( 2 );
173-
learnSizer->AddGrowableRow( 1 );
174-
175-
learn_pane->SetSizer( learnSizer );
176-
learn_pane->Layout();
177-
learnSizer->Fit( learn_pane );
178-
notebook->AddPage( learn_pane, wxT("Learn"), false );
179136

180137
main_sizer->Add( notebook, 1, wxEXPAND | wxALL, 5 );
181138

@@ -246,6 +203,60 @@ MainFrame::~MainFrame()
246203
{
247204
}
248205

206+
PersonalActivationDlgBase::PersonalActivationDlgBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
207+
{
208+
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
209+
210+
wxFlexGridSizer* fgSizer2;
211+
fgSizer2 = new wxFlexGridSizer( 0, 3, 0, 0 );
212+
fgSizer2->SetFlexibleDirection( wxBOTH );
213+
fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
214+
215+
m_staticText14 = new wxStaticText( this, wxID_ANY, wxT("1."), wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE );
216+
m_staticText14->Wrap( -1 );
217+
fgSizer2->Add( m_staticText14, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
218+
219+
m_staticText15 = new wxStaticText( this, wxID_ANY, wxT("Create and save license request"), wxDefaultPosition, wxDefaultSize, 0 );
220+
m_staticText15->Wrap( -1 );
221+
fgSizer2->Add( m_staticText15, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
222+
223+
m_button24 = new wxButton( this, wxID_ANY, wxT("Create"), wxDefaultPosition, wxDefaultSize, 0 );
224+
fgSizer2->Add( m_button24, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
225+
226+
m_staticText16 = new wxStaticText( this, wxID_ANY, wxT("2."), wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE );
227+
m_staticText16->Wrap( -1 );
228+
fgSizer2->Add( m_staticText16, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
229+
230+
m_staticText17 = new wxStaticText( this, wxID_ANY, wxT("Upload License File"), wxDefaultPosition, wxDefaultSize, 0 );
231+
m_staticText17->Wrap( -1 );
232+
fgSizer2->Add( m_staticText17, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
233+
234+
m_hyperlink2 = new wxHyperlinkCtrl( this, wxID_ANY, wxT("license.unity3d.com"), wxT("https://license.unity3d.com/manual "), wxDefaultPosition, wxDefaultSize, wxHL_ALIGN_CENTRE|wxHL_DEFAULT_STYLE );
235+
fgSizer2->Add( m_hyperlink2, 0, wxALL|wxALIGN_RIGHT|wxEXPAND, 5 );
236+
237+
m_staticText19 = new wxStaticText( this, wxID_ANY, wxT("3."), wxDefaultPosition, wxDefaultSize, 0 );
238+
m_staticText19->Wrap( -1 );
239+
fgSizer2->Add( m_staticText19, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
240+
241+
m_staticText20 = new wxStaticText( this, wxID_ANY, wxT("Activate Downloaded License File"), wxDefaultPosition, wxDefaultSize, 0 );
242+
m_staticText20->Wrap( -1 );
243+
fgSizer2->Add( m_staticText20, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
244+
245+
m_button25 = new wxButton( this, wxID_ANY, wxT("Choose and Activate"), wxDefaultPosition, wxDefaultSize, 0 );
246+
fgSizer2->Add( m_button25, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
247+
248+
249+
this->SetSizer( fgSizer2 );
250+
this->Layout();
251+
fgSizer2->Fit( this );
252+
253+
this->Centre( wxBOTH );
254+
}
255+
256+
PersonalActivationDlgBase::~PersonalActivationDlgBase()
257+
{
258+
}
259+
249260
CreateProjectDialog::CreateProjectDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
250261
{
251262
this->SetSizeHints( wxSize( 350,230 ), wxDefaultSize );
@@ -416,3 +427,53 @@ AddNewInstallDlgBase::AddNewInstallDlgBase( wxWindow* parent, wxWindowID id, con
416427
AddNewInstallDlgBase::~AddNewInstallDlgBase()
417428
{
418429
}
430+
431+
PlusProActivationDlgBase::PlusProActivationDlgBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
432+
{
433+
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
434+
435+
wxFlexGridSizer* fgSizer1;
436+
fgSizer1 = new wxFlexGridSizer( 0, 2, 0, 0 );
437+
fgSizer1->AddGrowableCol( 1 );
438+
fgSizer1->SetFlexibleDirection( wxBOTH );
439+
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
440+
441+
m_staticText9 = new wxStaticText( this, wxID_ANY, wxT("Username"), wxDefaultPosition, wxDefaultSize, 0 );
442+
m_staticText9->Wrap( -1 );
443+
fgSizer1->Add( m_staticText9, 0, wxALL, 5 );
444+
445+
plusProActivUsernameCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
446+
fgSizer1->Add( plusProActivUsernameCtrl, 0, wxALL|wxEXPAND, 5 );
447+
448+
m_staticText10 = new wxStaticText( this, wxID_ANY, wxT("Password"), wxDefaultPosition, wxDefaultSize, 0 );
449+
m_staticText10->Wrap( -1 );
450+
fgSizer1->Add( m_staticText10, 0, wxALL, 5 );
451+
452+
plusProActivPasswordCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD );
453+
fgSizer1->Add( plusProActivPasswordCtrl, 0, wxALL|wxEXPAND, 5 );
454+
455+
m_staticText11 = new wxStaticText( this, wxID_ANY, wxT("Serial Number"), wxDefaultPosition, wxDefaultSize, 0 );
456+
m_staticText11->Wrap( -1 );
457+
fgSizer1->Add( m_staticText11, 0, wxALL, 5 );
458+
459+
plusProActivationSerialCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
460+
fgSizer1->Add( plusProActivationSerialCtrl, 0, wxALL|wxEXPAND, 5 );
461+
462+
m_staticText13 = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
463+
m_staticText13->Wrap( -1 );
464+
fgSizer1->Add( m_staticText13, 0, wxALL, 5 );
465+
466+
m_button23 = new wxButton( this, wxID_ANY, wxT("Activate"), wxDefaultPosition, wxDefaultSize, 0 );
467+
fgSizer1->Add( m_button23, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 );
468+
469+
470+
this->SetSizer( fgSizer1 );
471+
this->Layout();
472+
fgSizer1->Fit( this );
473+
474+
this->Centre( wxBOTH );
475+
}
476+
477+
PlusProActivationDlgBase::~PlusProActivationDlgBase()
478+
{
479+
}

source/interface.h

Lines changed: 59 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
#include <wx/panel.h>
2525
#include <wx/stattext.h>
2626
#include <wx/listbox.h>
27-
#include <wx/hyperlink.h>
2827
#include <wx/notebook.h>
2928
#include <wx/menu.h>
3029
#include <wx/frame.h>
30+
#include <wx/hyperlink.h>
31+
#include <wx/dialog.h>
3132
#include <wx/textctrl.h>
3233
#include <wx/choice.h>
33-
#include <wx/dialog.h>
3434
#include <wx/srchctrl.h>
3535
#include <wx/dataview.h>
3636

@@ -42,12 +42,11 @@
4242
#define OPEN_WITH 1003
4343
#define wxID_FLOPPY 1004
4444
#define wxID_RELOAD 1005
45-
#define Nav_Back 1006
46-
#define Nav_Forward 1007
47-
#define Nav_Home 1008
48-
#define wxID_TOP 1009
49-
#define VERSIONS_LIST 1010
50-
#define INSTALLVIAHUB 1011
45+
#define ACTIV_PROPLUS 1006
46+
#define ACTIV_PERSONAL 1007
47+
#define wxID_TOP 1008
48+
#define VERSIONS_LIST 1009
49+
#define INSTALLVIAHUB 1010
5150

5251
///////////////////////////////////////////////////////////////////////////////
5352
/// Class MainFrame
@@ -63,25 +62,44 @@ class MainFrame : public wxFrame
6362
wxListBox* installsPathsList;
6463
wxButton* launchHubBtn;
6564
wxButton* removeInstallBtn;
66-
wxPanel* learn_pane;
67-
wxGridBagSizer* learnSizer;
68-
wxButton* backBtn;
69-
wxStaticText* titleLabel;
70-
wxButton* forwardBtn;
71-
wxButton* homeBtn;
72-
wxBoxSizer* webSizer;
73-
wxHyperlinkCtrl* openInBrowserCtrl;
65+
wxButton* activateProPlusBtn;
66+
wxButton* activatePersonalBtn;
7467
wxMenuBar* menubar;
7568
wxMenuItem* menuReveal;
7669

7770
public:
7871

79-
MainFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Unity Hub Native"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 560,320 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
72+
MainFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Unity Hub Native"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 921,492 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
8073

8174
~MainFrame();
8275

8376
};
8477

78+
///////////////////////////////////////////////////////////////////////////////
79+
/// Class PersonalActivationDlgBase
80+
///////////////////////////////////////////////////////////////////////////////
81+
class PersonalActivationDlgBase : public wxDialog
82+
{
83+
private:
84+
85+
protected:
86+
wxStaticText* m_staticText14;
87+
wxStaticText* m_staticText15;
88+
wxButton* m_button24;
89+
wxStaticText* m_staticText16;
90+
wxStaticText* m_staticText17;
91+
wxHyperlinkCtrl* m_hyperlink2;
92+
wxStaticText* m_staticText19;
93+
wxStaticText* m_staticText20;
94+
wxButton* m_button25;
95+
96+
public:
97+
98+
PersonalActivationDlgBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Personal License Manual Activation"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
99+
~PersonalActivationDlgBase();
100+
101+
};
102+
85103
///////////////////////////////////////////////////////////////////////////////
86104
/// Class CreateProjectDialog
87105
///////////////////////////////////////////////////////////////////////////////
@@ -144,3 +162,27 @@ class AddNewInstallDlgBase : public wxDialog
144162

145163
};
146164

165+
///////////////////////////////////////////////////////////////////////////////
166+
/// Class PlusProActivationDlgBase
167+
///////////////////////////////////////////////////////////////////////////////
168+
class PlusProActivationDlgBase : public wxDialog
169+
{
170+
private:
171+
172+
protected:
173+
wxStaticText* m_staticText9;
174+
wxTextCtrl* plusProActivUsernameCtrl;
175+
wxStaticText* m_staticText10;
176+
wxTextCtrl* plusProActivPasswordCtrl;
177+
wxStaticText* m_staticText11;
178+
wxTextCtrl* plusProActivationSerialCtrl;
179+
wxStaticText* m_staticText13;
180+
wxButton* m_button23;
181+
182+
public:
183+
184+
PlusProActivationDlgBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Activate Plus/Pro License"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
185+
~PlusProActivationDlgBase();
186+
187+
};
188+

0 commit comments

Comments
 (0)