]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/wxCDMFileDescriptionPanel.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / wxCDMFileDescriptionPanel.cpp
index 4f48a4f8ba57ee828dbcf71b41407ef0d4371cc4..001bb2a2a5f549f7a9f41c878074dfbf8e6881c6 100644 (file)
@@ -43,8 +43,8 @@
 
 BEGIN_EVENT_TABLE(wxCDMFileDescriptionPanel, wxPanel)
 EVT_BUTTON(ID_BUTTON_PREV, wxCDMFileDescriptionPanel::OnBtnReturn)
-EVT_MENU(ID_BUTTON_OPEN_FOLDER, wxCDMFileDescriptionPanel::OnBtnOpenFolder)
-EVT_MENU(ID_BUTTON_OPEN_COMMAND, wxCDMFileDescriptionPanel::OnBtnOpenWithCommand)
+EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMFileDescriptionPanel::OnBtnOpenFolder)
+EVT_BUTTON(ID_BUTTON_OPEN_COMMAND, wxCDMFileDescriptionPanel::OnBtnOpenWithCommand)
 END_EVENT_TABLE()
 
 wxCDMFileDescriptionPanel::wxCDMFileDescriptionPanel(
@@ -162,14 +162,24 @@ void wxCDMFileDescriptionPanel::OnBtnReturn(wxCommandEvent& event)
 
 void wxCDMFileDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
 {
-  //TODO: implement method
-  std::cerr << "Event OnBtnOpenContainingFolder not implemented" << std::endl;
-  event.Skip();
+  std::string* result;
+  if(!this->file->OpenInFileExplorer(result))
+    wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
 }
 
 void wxCDMFileDescriptionPanel::OnBtnOpenWithCommand(wxCommandEvent& event)
 {
-  //TODO: implement method
-  std::cerr << "Event OnBtnOpenWithCommand not implemented" << std::endl;
-  event.Skip();
+  //get command
+  wxString commandEx = wxGetTextFromUser(
+      _T("Enter the command to execute file"),
+      _T("Execute File - creaDevManager"),
+      _T("")
+  );
+  //check name
+  if(commandEx.Len() > 0)
+    {
+      std::string* result;
+      if(!this->file->OpenFile(result, crea::wx2std(commandEx)))
+        wxMessageBox(crea::std2wx(*result),_T("Execute File - Error!"),wxOK | wxICON_ERROR);
+    }
 }