+ void WxGUIScriptingInterface::DoRegenerateBoxesLists()
+ {
+ std::string command;
+#if defined(WIN32)
+ command = "\"";
+#endif
+ command += ConfigurationFile::GetInstance().Get_bin_path();
+ command += ConfigurationFile::GetInstance().Get_file_separator();
+ command += "bbRegenerateBoxesLists";
+#if defined(WIN32)
+ command += "\"";
+#endif
+ command += " -q";
+ bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
+
+ if ( ! system ( command.c_str() ) )
+ {
+ wxMessageBox(_T("Done !"),_T("Regenerate boxes lists"),
+ wxOK | wxICON_INFORMATION);
+ }
+ else
+ {
+ wxString err(_T("An error occured while running '"));
+ err += bbtk::std2wx(command) + _T("'");
+ wxMessageBox(err,_T("Regenerate boxes lists"),wxOK | wxICON_ERROR);
+ }
+ }
+
+ //================================================================
+ void WxGUIScriptingInterface::OnMenuRegenerateBoxesLists(wxCommandEvent& WXUNUSED(event))
+ {
+ DoRegenerateBoxesLists();
+ }
+ //================================================================
+
+ //================================================================
+ void WxGUIScriptingInterface::OnMenuRegenerateAll(wxCommandEvent& WXUNUSED(event))
+ {
+
+ DoRegeneratePackageDoc("-a");
+ DoRegenerateBoxesLists();
+ }
+ //================================================================
+
+
+ //================================================================
+ void WxGUIScriptingInterface::OnMenuPlugPackage(wxCommandEvent& WXUNUSED(event))
+ {
+ long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
+ wxDirDialog* FD =
+ new wxDirDialog( 0,
+ _T("Select package directory"),
+ _T(""),
+ style);
+
+ if (FD->ShowModal()==wxID_OK)
+ {
+ std::string path = wx2std (FD->GetPath()) ;
+ std::string fname = path + "/bbtkPackage";
+ if ( ! Utilities::FileExists( fname ) )
+ {
+ wxString err(_T("The directory does not contain a 'bbtkPackage' file"));
+ wxMessageBox(err,_T("Plug package"),wxOK | wxICON_ERROR);
+ return;
+ }
+
+ std::ifstream f;
+ f.open(fname.c_str());
+ std::string pname;
+ f >> pname;
+ f.close();
+
+
+ bbtk::ConfigurationFile::GetInstance().AddPackagePathsAndWrite( path );
+
+ DoRegeneratePackageDoc(pname);
+ DoRegenerateBoxesLists();
+
+ }
+ }
+ //================================================================
+