- if (crea::wx2std(file) == "")
- result = new std::string("Folder not specified.");
- wxMessageBox(crea::std2wx(result->c_str()), wxT("Plug BBTK Packages - Error!"), wxICON_ERROR);
- return;
+ wxString file = crea::std2wx(this->project->GetBuildPath());
+ if(isDir == wxNO)
+ {
+ file = wxDirSelector(
+ wxT("Please select the folder containing the bbtkPackage file you want to use. Usually it is where you built your project."),
+ crea::std2wx(this->project->GetBuildPath())
+ );
+ }
+
+ if(!file.IsEmpty())
+ {
+ if(!this->project->Connect(result, crea::wx2std(file)))
+ {
+ wxMessageBox(crea::std2wx(result->c_str()), wxT("Plug BBTK Packages - Error!"), wxICON_ERROR);
+ return;
+ }
+ else
+ {
+ wxMessageBox(crea::std2wx("The connection was executed successfully. Please check the console to see the compilation result.\n Also, don't forget to restart the BBTK Graphical Editor (if already opened) to see the plugged packages."), wxT("Plug Package"));
+ }
+
+ }
+