Skip to content

Commit

Permalink
Fixed size of the Organ Selection Dialog #1215 (#1221)
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg68 authored Oct 16, 2022
1 parent 4f9f0ee commit 4305b0f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 23 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Fixed size of the Organ Selection Dialog https://github.com/GrandOrgue/grandorgue/issues/1215
- Fixed generals buttons behaviour with the crescendo in add mode https://github.com/GrandOrgue/grandorgue/issues/1209
- Fixed an empty stop set to a general combination https://github.com/GrandOrgue/grandorgue/issues/1212
# 3.8.0 (2022-09-15)
Expand Down
Binary file modified help/images/known_organs_list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 25 additions & 23 deletions src/grandorgue/dialogs/GOSelectOrganDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,33 +39,13 @@ GOSelectOrganDialog::GOSelectOrganDialog(
wxDefaultSize,
wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_HRULES | wxLC_VRULES);
m_Organs->InsertColumn(0, _("Church"));
m_Organs->InsertColumn(1, _("Builder"));
m_Organs->InsertColumn(2, _("Recording"));
m_Organs->InsertColumn(3, _("Organ package"));
m_Organs->InsertColumn(4, _("ODF Path"));
m_Organs->InsertColumn(1, _("Organ package"));
m_Organs->InsertColumn(2, _("Organ path"));
topSizer->Add(m_Organs, 1, wxEXPAND | wxALL, 5);

for (unsigned i = 0, j = 0; j < m_OrganList.GetOrganList().size(); j++) {
const GOOrgan *o = m_OrganList.GetOrganList()[j];
if (!o->IsUsable(m_OrganList))
continue;
m_Organs->InsertItem(i, o->GetChurchName());
m_Organs->SetItemPtrData(i, (wxUIntPtr)o);
m_Organs->SetItem(i, 1, o->GetOrganBuilder());
m_Organs->SetItem(i, 2, o->GetRecordingDetail());
m_Organs->SetItem(i, 4, o->GetODFPath());
if (o->GetArchiveID() != wxEmptyString) {
const GOArchiveFile *a = m_OrganList.GetArchiveByID(o->GetArchiveID());
m_Organs->SetItem(i, 3, a ? a->GetName() : o->GetArchiveID());
}
i++;
}

m_Organs->SetColumnWidth(0, 150);
m_Organs->SetColumnWidth(1, 150);
m_Organs->SetColumnWidth(2, 250);
m_Organs->SetColumnWidth(3, wxLIST_AUTOSIZE);
m_Organs->SetColumnWidth(4, wxLIST_AUTOSIZE);
m_Organs->SetColumnWidth(2, 300);

topSizer->AddSpacer(5);
topSizer->Add(
Expand All @@ -74,6 +54,28 @@ GOSelectOrganDialog::GOSelectOrganDialog(
SetSizerAndFit(topSizer);
}

bool GOSelectOrganDialog::TransferDataToWindow() {
for (unsigned i = 0, j = 0; j < m_OrganList.GetOrganList().size(); j++) {
const GOOrgan *o = m_OrganList.GetOrganList()[j];

if (o->IsUsable(m_OrganList)) {
const bool isArchive = o->GetArchiveID() != wxEmptyString;

m_Organs->InsertItem(i, o->GetChurchName());
m_Organs->SetItemPtrData(i, (wxUIntPtr)o);
if (isArchive) {
const GOArchiveFile *a = m_OrganList.GetArchiveByID(o->GetArchiveID());

m_Organs->SetItem(i, 1, a ? a->GetName() : o->GetArchiveID());
}
m_Organs->SetItem(
i, 2, isArchive ? o->GetArchivePath() : o->GetODFPath());
i++;
}
}
return true;
}

void GOSelectOrganDialog::OnOK(wxCommandEvent &event) {
if (m_Organs->GetItemData(m_Organs->GetFirstSelected()) == 0) {
wxMessageBox(
Expand Down
2 changes: 2 additions & 0 deletions src/grandorgue/dialogs/GOSelectOrganDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class GOSelectOrganDialog : public wxDialog {
GOSelectOrganDialog(
wxWindow *parent, wxString title, const GOOrganList &organList);

bool TransferDataToWindow() override;

const GOOrgan *GetSelection();

DECLARE_EVENT_TABLE()
Expand Down

0 comments on commit 4305b0f

Please sign in to comment.