Skip to content

Commit 17c6780

Browse files
committed
Multi-select for add existing projects
1 parent 0813131 commit 17c6780

File tree

3 files changed

+33
-24
lines changed

3 files changed

+33
-24
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Install Dependencies
1313
run: |
1414
sudo apt-get update
15-
sudo apt-get install cmake clang ninja-build libx11-dev libgtk-3-dev libssl-dev webkit2gtk-driver libsecret-1-dev libc6-dev libsoup2.4-dev libxtst-dev libwebkit2gtk-4.0-dev -y --no-install-recommends
15+
sudo apt-get install cmake ninja-build libx11-dev libgtk-3-dev -y --no-install-recommends
1616
- name: Configure
1717
run: |
1818
mkdir -p build
@@ -22,8 +22,6 @@ jobs:
2222
run: |
2323
cd build
2424
cmake --build . --config release --target install
25-
- name: Compress App
26-
run: cd build/Release && zip -r -9 UnityHubNative-Linux.zip *.AppImage
2725
- name: Archive and upload artifacts
2826
uses: actions/upload-artifact@v2
2927
with:

source/activation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void DisplayLicenseOutput(){
7070
auto cpy = line;
7171
transform(cpy.begin(), cpy.end(), cpy.begin(), ::tolower);
7272
// filter for license-related lines
73-
if (cpy.find("license") != decltype(line)::npos){
73+
if (cpy.find("licens") != decltype(line)::npos){
7474
output += line;
7575
}
7676
}

source/interface_derived.cpp

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -195,26 +195,37 @@ void MainFrameDerived::OnAbout(wxCommandEvent& event)
195195
}
196196

197197
void MainFrameDerived::OnAddProject(wxCommandEvent& event){
198-
string msg ="Select the folder containing the Unity Project";
199-
string path = GetPathFromDialog(msg);
200-
if (path != ""){
201-
//check that the project does not already exist
202-
for(project& p : projects){
203-
if (p.path == path){
204-
wxMessageBox( "This project has already been added.", "Cannot add project", wxOK | wxICON_WARNING );
205-
return;
206-
}
207-
}
208-
209-
//add it to the projects list
210-
try{
211-
project p = LoadProject(path);
212-
AddProject(p,"");
213-
}
214-
catch(runtime_error& e){
215-
wxMessageBox(e.what(),"Unable to add project",wxOK | wxICON_ERROR);
216-
}
217-
}
198+
auto msg ="Select the folder(s) containing the Unity Project";
199+
200+
wxDirDialog dlg(NULL, msg, "", wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST | wxDD_MULTIPLE);
201+
if (dlg.ShowModal() == wxID_CANCEL) {
202+
return string("");
203+
}
204+
//get the path and return the standard string version
205+
wxArrayString paths;
206+
dlg.GetPaths(paths);
207+
208+
for (const auto& p : paths){
209+
auto path = p.ToStdString();
210+
if (path != ""){
211+
//check that the project does not already exist
212+
for(project& p : projects){
213+
if (p.path == path){
214+
wxMessageBox( "This project has already been added.", "Cannot add project", wxOK | wxICON_WARNING );
215+
return;
216+
}
217+
}
218+
219+
//add it to the projects list
220+
try{
221+
project p = LoadProject(path);
222+
AddProject(p,"");
223+
}
224+
catch(runtime_error& e){
225+
wxMessageBox(e.what(),"Unable to add project",wxOK | wxICON_ERROR);
226+
}
227+
}
228+
}
218229
}
219230

220231
/**

0 commit comments

Comments
 (0)