mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-01 08:29:27 +02:00
Move version keys from AudacityApp to AudacityPrefs
This commit is contained in:
parent
a1ff74b5bb
commit
236c8ed51e
@ -127,12 +127,6 @@ class AudacityApp final : public wxApp {
|
||||
|
||||
#endif
|
||||
|
||||
// Set and Get values of the version major/minor/micro keys in audacity.cfg when Audacity first opens
|
||||
void SetVersionKeysInit( int major, int minor, int micro)
|
||||
{ mVersionMajorKeyInit = major; mVersionMinorKeyInit = minor; mVersionMicroKeyInit = micro;}
|
||||
void GetVersionKeysInit( int& major, int& minor, int& micro) const
|
||||
{ major = mVersionMajorKeyInit; minor = mVersionMinorKeyInit; micro = mVersionMicroKeyInit;}
|
||||
|
||||
|
||||
private:
|
||||
std::unique_ptr<CommandHandler> mCmdHandler;
|
||||
@ -158,11 +152,6 @@ class AudacityApp final : public wxApp {
|
||||
std::unique_ptr<wxSocketServer> mIPCServ;
|
||||
#endif
|
||||
|
||||
// values of the version major/minor/micro keys in audacity.cfg when Audacity first opens
|
||||
int mVersionMajorKeyInit{};
|
||||
int mVersionMinorKeyInit{};
|
||||
int mVersionMicroKeyInit{};
|
||||
|
||||
public:
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
@ -261,7 +261,7 @@ void InitPreferences()
|
||||
int vMinor = gPrefs->Read(wxT("/Version/Minor"), (long) 0);
|
||||
int vMicro = gPrefs->Read(wxT("/Version/Micro"), (long) 0);
|
||||
|
||||
wxGetApp().SetVersionKeysInit(vMajor, vMinor, vMicro); // make a note of these initial values
|
||||
gPrefs->SetVersionKeysInit(vMajor, vMinor, vMicro); // make a note of these initial values
|
||||
// for use by ToolManager::ReadConfig()
|
||||
|
||||
// These integer version keys were introduced april 4 2011 for 1.3.13
|
||||
|
20
src/Prefs.h
20
src/Prefs.h
@ -58,6 +58,26 @@ public:
|
||||
long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE,
|
||||
const wxMBConv& conv = wxConvAuto());
|
||||
bool GetEditClipsCanMove();
|
||||
|
||||
// Set and Get values of the version major/minor/micro keys in audacity.cfg when Audacity first opens
|
||||
void SetVersionKeysInit( int major, int minor, int micro)
|
||||
{
|
||||
mVersionMajorKeyInit = major;
|
||||
mVersionMinorKeyInit = minor;
|
||||
mVersionMicroKeyInit = micro;
|
||||
}
|
||||
void GetVersionKeysInit( int& major, int& minor, int& micro) const
|
||||
{
|
||||
major = mVersionMajorKeyInit;
|
||||
minor = mVersionMinorKeyInit;
|
||||
micro = mVersionMicroKeyInit;
|
||||
}
|
||||
|
||||
// values of the version major/minor/micro keys in audacity.cfg
|
||||
// when Audacity first opens
|
||||
int mVersionMajorKeyInit{};
|
||||
int mVersionMinorKeyInit{};
|
||||
int mVersionMicroKeyInit{};
|
||||
};
|
||||
|
||||
/// Packages a table of user-visible choices each with an internal code string,
|
||||
|
@ -52,8 +52,6 @@
|
||||
#include <wx/minifram.h>
|
||||
#include <wx/popupwin.h>
|
||||
|
||||
#include "../AudacityApp.h"
|
||||
|
||||
#include "ControlToolBar.h"
|
||||
#include "DeviceToolBar.h"
|
||||
#include "EditToolBar.h"
|
||||
@ -672,7 +670,7 @@ void ToolManager::ReadConfig()
|
||||
ToolBarConfiguration::Legacy topLegacy, botLegacy;
|
||||
|
||||
int vMajor, vMinor, vMicro;
|
||||
wxGetApp().GetVersionKeysInit(vMajor, vMinor, vMicro);
|
||||
gPrefs->GetVersionKeysInit(vMajor, vMinor, vMicro);
|
||||
bool useLegacyDock = false;
|
||||
// note that vMajor, vMinor, and vMicro will all be zero if either it's a new audacity.cfg file
|
||||
// or the version is less than 1.3.13 (when there were no version keys according to the comments in
|
||||
|
Loading…
x
Reference in New Issue
Block a user