Skip to content

Commit

Permalink
MacOSX: Correctly handle OSX dock "reopen-application" event and Coco…
Browse files Browse the repository at this point in the history
…a openFiles message instead of the deprecated Carbon "open-document" event
  • Loading branch information
idrassi committed Apr 6, 2015
1 parent ae28d51 commit 4a80407
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
16 changes: 13 additions & 3 deletions src/Main/GraphicUserInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,20 @@ namespace VeraCrypt
}

#ifdef TC_MACOSX
void GraphicUserInterface::MacOpenFile (const wxString &fileName)
void GraphicUserInterface::MacOpenFiles (const wxArrayString &fileNames)
{
OpenVolumeSystemRequestEventArgs eventArgs (fileName);
OpenVolumeSystemRequestEvent.Raise (eventArgs);
if (fileNames.GetCount() > 0)
{
// we can only put one volume path at a time on the text field
// so we take the first on the list
OpenVolumeSystemRequestEventArgs eventArgs (fileNames[0]);
OpenVolumeSystemRequestEvent.Raise (eventArgs);
}
}

void GraphicUserInterface::MacReopenApp ()
{
SetBackgroundMode (false);
}
#endif

Expand Down
3 changes: 2 additions & 1 deletion src/Main/GraphicUserInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ namespace VeraCrypt
void ExecuteWaitThreadRoutine (wxWindow *parent, WaitThreadRoutine *pRoutine) const;

#ifdef TC_MACOSX
virtual void MacOpenFile (const wxString &fileName);
virtual void MacOpenFiles (const wxArrayString &fileNames);
virtual void MacReopenApp ();
#endif

template <class T>
Expand Down

0 comments on commit 4a80407

Please sign in to comment.