Skip to content

Commit 8b83646

Browse files
committed
Learn tab on Linux
makefile + include webview library in linker setup-linux.sh + compile webview in initial configure source/globals.h + increase version source/interface_derived.cpp - remove preprocessor that disables learn tab and web view on linux source/interface_derived.hpp - remove calls to hide learn tab on Linux
1 parent 4de9324 commit 8b83646

File tree

6 files changed

+4
-15
lines changed

6 files changed

+4
-15
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ This application stores its own files in an application data directory. If the a
4242
3. Build.
4343
### Linux
4444
1. In the repository root folder, run `make`. The app will compile to `linux-build/`. If you are missing a dependency, the build system will stop and alert you with which dependency is missing.
45+
- You will need to have the webkit2gtk3 package installed for your system. For Fedora, this can be installed with `sudo dnf install webkit2gtk3-devel.x86_64`
4546

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

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# flags needed to build the target (compiler, target name, and compiler flags)
22
CC = g++
3-
CFLAGS := `wxWidgets/build/linux/wx-config --cxxflags --libs` -Wl,-rpath,wxWidgets/build/linux/lib/
3+
CFLAGS := `wxWidgets/build/linux/wx-config --cxxflags --libs std, webview` -Wl,-rpath,wxWidgets/build/linux/lib/
44
target = UnityHubNative
55

66
# location of source files

setup-linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ cd build/linux;
3636
echoStatus "configure" "Running configure script"
3737
# run the configure script
3838
success=0;
39-
../../configure --enable-unicode --disable-shared && success=1
39+
../../configure --enable-unicode --disable-shared --enable-webviewwebkit && success=1
4040

4141
# check success
4242
if [ $success = 0 ]; then

source/globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ using namespace std;
1616
static const string projectsFile = "projects.txt";
1717
static const string editorPathsFile = "editorPaths.txt";
1818
static const string templatePrefix = "com.unity.template";
19-
static const string AppVersion = "v1.35";
19+
static const string AppVersion = "v1.36";
2020

2121
//structure for representing an editor and for locating it
2222
struct editor{

source/interface_derived.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,13 @@ EVT_LIST_ITEM_ACTIVATED(wxID_HARDDISK, MainFrameDerived::OnOpenProject)
4545
EVT_LISTBOX_DCLICK(wxID_FLOPPY,MainFrameDerived::OnRevealEditor)
4646
EVT_LISTBOX_DCLICK(wxID_HOME,MainFrameDerived::OnRevealInstallLocation)
4747

48-
#if defined __APPLE__ || defined _WIN32
4948
EVT_NOTEBOOK_PAGE_CHANGED(NOTEBOOK, MainFrameDerived::OnPageChanging)
5049
EVT_BUTTON(Nav_Back, MainFrameDerived::OnNavigateBack)
5150
EVT_BUTTON(Nav_Forward, MainFrameDerived::OnNavigateForwards)
5251
EVT_BUTTON(Nav_Home, MainFrameDerived::OnNavigateHome)
5352
EVT_WEBVIEW_NAVIGATED(WEBVIEW,MainFrameDerived::OnNavigationComplete)
5453
EVT_WEBVIEW_NEWWINDOW(WEBVIEW, MainFrameDerived::OnNavigationNewWindow)
5554
EVT_TIMER(TIMER, MainFrameDerived::OnTimerExpire)
56-
#endif
5755

5856
wxEND_EVENT_TABLE()
5957

@@ -84,14 +82,8 @@ MainFrameDerived::MainFrameDerived() : MainFrame(NULL){
8482
}
8583
//if no projects to load, the interface will be blank
8684

87-
#if defined __APPLE__ || defined _WIN32
8885
timeout = new wxTimer(this, TIMER);
8986

90-
#elif defined __linux__
91-
//hide the learn tab on Linux
92-
notebook->DeletePage(notebook->GetPageCount() - 1);
93-
launchHubBtn->Hide();
94-
#endif
9587
//show current version in titlebar
9688
this->SetLabel("Unity Hub Native " + AppVersion);
9789
}
@@ -198,7 +190,6 @@ void MainFrameDerived::OnAddProject(wxCommandEvent& event){
198190
}
199191
}
200192

201-
#if defined __APPLE__ || defined _WIN32
202193
/**
203194
Called when the top segmented control switches pages
204195
@param event the wxBookCtrlEvent sent by the segmented control. Used to get the currently selected page
@@ -229,7 +220,6 @@ void MainFrameDerived::OnPageChanging(wxBookCtrlEvent& event){
229220
}
230221
}
231222
}
232-
#endif
233223
/**
234224
Loads an editor search path into the app, updating the UI and the vector
235225
@param path the string path to laod

source/interface_derived.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class MainFrameDerived : public MainFrame{
4646
vector<project> projects;
4747
vector<string> installPaths;
4848
vector<editor> editors;
49-
#if defined __APPLE__ || defined _WIN32
5049
wxWebView* learnView = NULL;
5150
const string homeurl = "https://learn.unity.com";
5251
wxString lastURL = wxString(homeurl);
@@ -86,7 +85,6 @@ class MainFrameDerived : public MainFrame{
8685
delete learnView;
8786
learnView = NULL;
8887
}
89-
#endif
9088
//window events
9189
void OnAbout(wxCommandEvent& event);
9290
void OnAddProject(wxCommandEvent& event);

0 commit comments

Comments
 (0)