Skip to content

Commit

Permalink
Merge pull request #187 from jsakkine/master
Browse files Browse the repository at this point in the history
#183 ("Suggestion: fix sorting of patches in submenus to be A->Z?")
  • Loading branch information
baconpaul authored Jan 4, 2019
2 parents e95b670 + 5741b6f commit ffff327
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/common/SurgeStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ void SurgeStorage::refresh_patchlist()
patch_list.clear();

refreshPatchlistAddDir(false, "patches_factory");
patch_category_split[0] = patch_category.size();
firstThirdPartyCategory = patch_category.size();
refreshPatchlistAddDir(false, "patches_3rdparty");
patch_category_split[1] = patch_category.size();
firstUserCategory = patch_category.size();
refreshPatchlistAddDir(true, "");
}

Expand Down
3 changes: 2 additions & 1 deletion src/common/SurgeStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,9 @@ class SurgeStorage
void errorbox(string message);

vector<patchlist_category> patch_category, wt_category;
int firstThirdPartyCategory;
int firstUserCategory;
vector<patchlist_entry> patch_list, wt_list;
int patch_category_split[2];
string wtpath;
string datapath;
string userDataPath;
Expand Down
3 changes: 2 additions & 1 deletion src/common/gui/CPatchBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ CMouseEventResult CPatchBrowser::onMouseDown(CPoint& where, const CButtonState&
if ((!single_category) || (c == last_category))
{
if (!single_category &&
((c == storage->patch_category_split[0]) || (c == storage->patch_category_split[1])))
((c == storage->firstThirdPartyCategory) ||
(c == storage->firstUserCategory)))
contextMenu->addEntry("-");

vector<int> ctge;
Expand Down
2 changes: 1 addition & 1 deletion src/common/gui/SurgeGUIEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2020,7 +2020,7 @@ void SurgeGUIEditor::valueChanged(CControl* control)
patchComment->setText(p.comments.c_str());

showPatchStoreDialog(&p, &synth->storage.patch_category,
synth->storage.patch_category_split[1]);
synth->storage.firstUserCategory);
}
break;
case tag_store_cancel:
Expand Down

0 comments on commit ffff327

Please sign in to comment.