| 735 | return std::nullopt; |
| 736 | } |
| 737 | std::optional<Tab> Window::setSortMode(const std::uint32_t &id, Enums::SortMode sortMode) |
| 738 | { |
| 739 | auto tab = Globals::gData.getTab(id); |
| 740 | if (tab) |
| 741 | { |
| 742 | tab->sortMode = sortMode; |
| 743 | tab->sounds = getTabContent(*tab); |
| 744 | auto newTab = Globals::gData.setTab(id, *tab); |
| 745 | if (newTab) |
| 746 | { |
| 747 | return newTab; |
| 748 | } |
| 749 | } |
| 750 | |
| 751 | Fancy::fancy.logTime().failure() << "Failed to change sortMode for tab " << id << " tab does not exist" |
| 752 | << std::endl; |
| 753 | onError(Enums::ErrorCode::TabDoesNotExist); |
| 754 | return std::nullopt; |
| 755 | } |
| 756 | std::optional<Sound> Window::setHotkey(const std::uint32_t &id, const std::vector<int> &hotkeys) |
| 757 | { |
| 758 | auto sound = Globals::gData.getSound(id); |