1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-19 17:11:12 +02:00

Should fix the single instance detection on OSX

The problem was that different temp directories can
be specified when using Portable Settings.  This caused
the single instance checker to look for it's lock file
in different locations so it was unable to detect that
another instance was running.

This changes the directory for the lock file to be the
user's home directory (which is the default for the checker
anyway).  This allow the user to still specify different
temp directories in the Portable Settings and ensure's 
that only one instance (per user) ever runs.

It now checks the single instance before initializing
preferences since preferences are modified during initialization
which could interere with an already running instance.

In addition, the Mac now uses the DDE IPC startup to 
ensure all files are opened by the single Audacity instance.
Normally this is not needed since we also support the OSX
mechanism for opening by an existing process.  But, that
only works if the exact same Audacity.app is used.  There
are instances when this is not always the case.

I also ran across a problem with language initialization.

Since preferences were initialized before the locale was set,
dialogs would be shown in English.  I've made a change that sets
the language to the system language until the preferences are
loaded and then resets it to the user selected language.
This commit is contained in:
lllucius
2015-01-07 19:39:44 +00:00
parent 70285448c9
commit 945e68ba89
2 changed files with 59 additions and 88 deletions

View File

@@ -220,16 +220,15 @@ class AudacityApp:public wxApp {
void DeInitCommandHandler();
bool InitTempDir();
bool CreateSingleInstanceChecker(wxString dir);
bool CreateSingleInstanceChecker();
/* utility method for printing the command line help message */
void PrintCommandLineHelp(void);
bool mWindowRectAlreadySaved;
#if defined(__WXMSW__) || defined(__WXGTK__)
IPCServ *mIPCServ;
#endif
public:
DECLARE_EVENT_TABLE()
};