1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Bug 2052 - Remove lock file, even if read only

The line breaks in the second message are also changed.
They are not changed in the first message, as that message is already translated.
This commit is contained in:
James Crook 2019-10-04 11:31:23 +01:00
parent 3bce6f1c21
commit 85a3e9880c

View File

@ -1902,22 +1902,25 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
#ifdef __WXMAC__
// Bug 2052
// On mac, the lock file may persist and stop Audacity starting properly.
wxString lockFileName = dir + "/" + name;
int action = AudacityMessageBox(wxString::Format( _("If you're sure another copy of Audacity isn't running, Audacity\ncan skip the test for 'Audacity already running' next time\nby removing the lock file:\n\n%s\n\nDo you want to do that?"),
lockFileName
auto lockFileName = wxFileName(dir,name);
bool bIsLocked = lockFileName.IsOk() && lockFileName.FileExists();
if( bIsLocked ){
int action = AudacityMessageBox(wxString::Format( _("If you're sure another copy of Audacity isn't\nrunning, Audacity can skip the test for\n'Audacity already running' next time\nby removing the lock file:\n\n%s\n\nDo you want to do that?"),
lockFileName.GetFullName()
),
_("Possible Lock File Problem"),
wxYES_NO | wxICON_EXCLAMATION,
NULL);
if (action == wxYES){
::wxRemoveFile( lockFileName );
// If locked, unlock.
lockFileName.SetPermissions( wxS_DEFAULT );
::wxRemoveFile( lockFileName.GetFullName() );
}
}
#endif
return false;
}
#if defined(__WXMSW__)
// Create the DDE IPC server
mIPCServ = std::make_unique<IPCServ>(IPC_APPL);