Skip to content

Commit e41cb39

Browse files
author
larspalo
committed
Updated readme file and incremented version number in preparation for new release. Improved close operation if un-saved modifications exist.
1 parent 5f64777 commit e41cb39

File tree

4 files changed

+47
-4
lines changed

4 files changed

+47
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ cmake_minimum_required(VERSION 3.10)
1919
# Set the project name and info
2020
project(
2121
GOODF
22-
VERSION 0.7.1
22+
VERSION 0.7.2
2323
DESCRIPTION "GOODF - Software for creating and editing GrandOrgue ODFs"
2424
LANGUAGES CXX C
2525
)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ Creation of an usable odf for GrandOrgue with GOODF fully works, though it's pos
1313

1414
Note that the way to "save" the work done on an organ is by writing out the ODF (from file menu in the software or Ctrl+S), Save as is accomplished just by changing the organ definition file name. Since version 0.4 it's possible to also read/edit already existing .organ files. **However**, **be very mindful when using this feature!** It's possible that some bugs still exist that could potentially corrupt an ODF file. **Always work on copies or on files you don't mind having destroyed!** Also note that GOODF always will convert older type of .organ files to conform to the new panel format - *which means that older .organ files will be modified*! To ensure correct reading of (numerical) values from the .organ files, any leading or trailing whitespace as well as comments on the same line as a key/value pair will be stripped, even in the read source file! **Again, work on copies** as it's better to be safe than sorry. **You have been warned!** All that said, if you encounter problems that are repeatable, please report them as issues at https://github.com/larspalo/GOODF/issues so that the software might be improved.
1515

16-
A basic rendering of the GUI panels is now possible, but it likely still needs more work before it's fully reliable and usable. Presently only the transparency of .png files are likely to work, the masks of .bmp files needs more work to implement. Possibility to adjust positioning of smaller images and GUI elements directly on the graphical rendering is implemented since 0.7. Changing order of switches is implemented with drag and drop in the tree, note that in GrandOrgue it's only possible for a switch to reference another switch with a lower number than itself. If you drag switches to other positions references can be invalidated and removed (only the reference is removed, not any switch). Re-ordering of many other elements is possible with drag and drop since version 0.7.1.
16+
Rendering of the GUI panels is now possible, but it likely needs more work before it's fully reliable. Possibility to adjust positioning of smaller images and GUI elements directly on the graphical rendering is implemented since 0.7 either with mouse or with arrow keys. Changing order of switches is implemented with drag and drop in the tree, note that in GrandOrgue it's only possible for a switch to reference another switch with a lower number than itself. If you drag switches to other positions references can be invalidated and removed (only the reference is removed, not any switch). Re-ordering of many other elements in the [Organ] tree with drag and drop can also be done.
1717

1818
## Future plans
19-
Testing the ability to both write and read .organ files will need to continue so that they both works really well without any bugs. The graphical rendering of panels most likely needs more work so that it should display the panels exactly like GrandOrgue will. Improving/implementing new ways to assign properties/references to multiple elements instead of doing it one at a time is on the wish list.
19+
Testing the ability to both write and read .organ files will need to continue so that they both works really well without any bugs. The graphical rendering of panels most likely still needs more work so that it should display the panels exactly like GrandOrgue will. Improving/implementing new ways to assign properties/references to multiple elements instead of doing it one at a time is on the wish list, this includes more flexible auto loading of pipes and copying options.
2020

2121
## Building from sources
2222
Normal development tools for c++ is needed as well as cmake, imagemagic and wxWidgets.

src/GOODFFrame.cpp

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ BEGIN_EVENT_TABLE(GOODFFrame, wxFrame)
5555
EVT_BUTTON(ID_ADD_GENERAL_BTN, GOODFFrame::OnAddNewGeneral)
5656
EVT_BUTTON(ID_ADD_REVERSIBLE_PISTON_BTN, GOODFFrame::OnAddNewReversiblePiston)
5757
EVT_BUTTON(ID_ADD_PANEL_BTN, GOODFFrame::OnAddNewPanel)
58+
EVT_CLOSE(GOODFFrame::OnClose)
5859
END_EVENT_TABLE()
5960

6061
GOODFFrame::GOODFFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title) {
@@ -353,13 +354,54 @@ void GOODFFrame::OnHelp(wxCommandEvent& WXUNUSED(event)) {
353354
}
354355

355356
void GOODFFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) {
357+
/*
358+
if (m_organ->isModified()) {
359+
// Ask if user wants to save/write the organ file
360+
wxMessageDialog dlg(this, wxT("ODF file is modified. Do you want to save/write it?"), wxT("ODF file is modified"), wxYES_NO|wxCENTRE|wxICON_EXCLAMATION);
361+
if (dlg.ShowModal() == wxID_YES) {
362+
// Try triggering save/write by posting an event
363+
wxCommandEvent evt(wxEVT_MENU, ID_WRITE_ODF);
364+
wxPostEvent(this, evt);
365+
366+
if (m_organ->isModified()) {
367+
// This means that the save failed, ask if the user wants to abort the quitting to fix the issue
368+
wxMessageDialog confirmDlg(this, wxT("ODF file couldn't be saved/written! Do you want to return to fix it before quitting?"), wxT("ODF file couldn't be saved"), wxYES_NO|wxCENTRE|wxICON_ERROR);
369+
if (confirmDlg.ShowModal() == wxID_YES) {
370+
return;
371+
}
372+
}
373+
}
374+
} */
356375
// Destroy the frame
357376
Close();
358377
}
359378

379+
void GOODFFrame::OnClose(wxCloseEvent& event) {
380+
if (event.CanVeto() && m_organ->isModified()) {
381+
// Ask if user wants to save/write the organ file
382+
wxMessageDialog dlg(this, wxT("ODF file is modified. Do you want to save/write it?"), wxT("ODF file is modified"), wxYES_NO|wxCENTRE|wxICON_EXCLAMATION);
383+
if (dlg.ShowModal() == wxID_YES) {
384+
// Try triggering save/write by posting an event
385+
wxCommandEvent evt(wxEVT_MENU, ID_WRITE_ODF);
386+
wxPostEvent(this, evt);
387+
388+
if (m_organ->isModified()) {
389+
// This means that the save failed, ask if the user wants to abort the quitting to fix the issue
390+
wxMessageDialog confirmDlg(this, wxT("ODF file couldn't be saved/written! Do you want to return to fix it before quitting?"), wxT("ODF file couldn't be saved"), wxYES_NO|wxCENTRE|wxICON_ERROR);
391+
if (confirmDlg.ShowModal() == wxID_YES) {
392+
event.Veto();
393+
return;
394+
}
395+
}
396+
}
397+
}
398+
// Destroy the frame
399+
Destroy();
400+
}
401+
360402
void GOODFFrame::OnWriteODF(wxCommandEvent& WXUNUSED(event)) {
361403
if (m_organPanel->getOdfPath().IsEmpty() || m_organPanel->getOdfName().IsEmpty()) {
362-
wxMessageDialog incomplete(this, wxT("Path and name for ODF must be set!"), wxT("Cannot write ODF"), wxOK|wxCENTRE);
404+
wxMessageDialog incomplete(this, wxT("Both path (location) and name for ODF must be set!"), wxT("Cannot write ODF"), wxOK|wxCENTRE);
363405
incomplete.ShowModal();
364406
return;
365407
}

src/GOODFFrame.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class GOODFFrame : public wxFrame {
5353
~GOODFFrame();
5454

5555
void OnQuit(wxCommandEvent& event);
56+
void OnClose(wxCloseEvent& event);
5657
void OnAbout(wxCommandEvent& event);
5758
void OnHelp(wxCommandEvent& event);
5859
void OnWriteODF(wxCommandEvent& event);

0 commit comments

Comments
 (0)