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:
parent
3bce6f1c21
commit
85a3e9880c
@ -1902,22 +1902,25 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
|
|||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
// Bug 2052
|
// Bug 2052
|
||||||
// On mac, the lock file may persist and stop Audacity starting properly.
|
// On mac, the lock file may persist and stop Audacity starting properly.
|
||||||
wxString lockFileName = dir + "/" + name;
|
auto lockFileName = wxFileName(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?"),
|
bool bIsLocked = lockFileName.IsOk() && lockFileName.FileExists();
|
||||||
lockFileName
|
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?"),
|
||||||
_("Possible Lock File Problem"),
|
lockFileName.GetFullName()
|
||||||
wxYES_NO | wxICON_EXCLAMATION,
|
),
|
||||||
NULL);
|
_("Possible Lock File Problem"),
|
||||||
if (action == wxYES){
|
wxYES_NO | wxICON_EXCLAMATION,
|
||||||
::wxRemoveFile( lockFileName );
|
NULL);
|
||||||
|
if (action == wxYES){
|
||||||
|
// If locked, unlock.
|
||||||
|
lockFileName.SetPermissions( wxS_DEFAULT );
|
||||||
|
::wxRemoveFile( lockFileName.GetFullName() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(__WXMSW__)
|
#if defined(__WXMSW__)
|
||||||
// Create the DDE IPC server
|
// Create the DDE IPC server
|
||||||
mIPCServ = std::make_unique<IPCServ>(IPC_APPL);
|
mIPCServ = std::make_unique<IPCServ>(IPC_APPL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user