diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-31 14:05:28 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-31 14:05:28 +0100 |
| commit | d0e8abf2c50286733fc7c7d03d3ad752555194a0 (patch) | |
| tree | 271d992f640f37b3287338752318ff42a67d6fc6 /src/ochess.cpp | |
| parent | aadfef20c89599ad2091811f3c25926fdf175253 (diff) | |
Versioning configuration file
Diffstat (limited to 'src/ochess.cpp')
| -rw-r--r-- | src/ochess.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ochess.cpp b/src/ochess.cpp index 7e212f8..bf3a2ce 100644 --- a/src/ochess.cpp +++ b/src/ochess.cpp @@ -5,8 +5,21 @@ bool MyApp::OnInit() { wxImage::AddHandler(new wxPNGHandler); + // Check config version + CONFIG_OPEN(conf); + wxString version=conf->Read("version",CONFIG_VERSION); + conf->Write("version",version); // Setup config file version + wxLogDebug("Starting ochess with configuration file version %s",version); + CONFIG_CLOSE(conf); + + // Advertise for configuration file version + if(version != CONFIG_VERSION) + SHOW_DIALOG_INFO("Configuration files version missmatch. Expected "+std::string(CONFIG_VERSION)+" but got "+version+".\nPlease remove the current configuration file as it may crash the application."); + + // Main frame MainWindow *frame = new MainWindow(); frame->Show(true); + return true; } |
