1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-02 18:04:23 +01:00

Detect failure to reconnect to temp project when first saving it

This commit is contained in:
Paul Licameli
2020-12-06 22:14:54 -05:00
parent 41eb66fccf
commit aa0b33dc8f
5 changed files with 62 additions and 15 deletions

View File

@@ -45,6 +45,11 @@ using BlockIDs = std::unordered_set<SampleBlockID>;
wxDECLARE_EXPORTED_EVENT( AUDACITY_DLL_API,
EVT_CHECKPOINT_FAILURE, wxCommandEvent );
// An event processed by the project in the main thread after failure to
// reconnect to the database, after temporary close and attempted file movement
wxDECLARE_EXPORTED_EVENT( AUDACITY_DLL_API,
EVT_RECONNECTION_FAILURE, wxCommandEvent );
///\brief Object associated with a project that manages reading and writing
/// of Audacity project file formats, and autosave
class ProjectFileIO final
@@ -179,6 +184,10 @@ public:
// 0 for success or non-zero to stop the query
using ExecCB = std::function<int(int cols, char **vals, char **names)>;
//! Return true if a connetion is now open
bool HasConnection() const;
//! Return a reference to a connection, creating it as needed on demand; throw on failure
DBConnection &GetConnection();
private: