From d46975bf766e8b7d81fbc17b804724a426918cca Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 21 Apr 2017 18:29:06 +0200 Subject: Fix reload logic. --- plugingui/diskstreamingframecontent.cc | 7 ++++++- plugingui/diskstreamingframecontent.h | 1 + plugingui/drumkitframecontent.cc | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/plugingui/diskstreamingframecontent.cc b/plugingui/diskstreamingframecontent.cc index 87e8b8b..33367de 100644 --- a/plugingui/diskstreamingframecontent.cc +++ b/plugingui/diskstreamingframecontent.cc @@ -59,6 +59,9 @@ DiskstreamingframeContent::DiskstreamingframeContent(Widget* parent, CONNECT(&button, clickNotifier, this, &DiskstreamingframeContent::reloadClicked); + CONNECT(this, settings_notifier.reload_counter, + this, &DiskstreamingframeContent::reloaded); + // TODO: // CONNECT(this, settings_notifier.disk_cache_chunk_size, // this, &DGWindow::chunkSettingsValueChanged); @@ -118,9 +121,11 @@ void DiskstreamingframeContent::limitValueChanged(float value) void DiskstreamingframeContent::reloadClicked() { settings.reload_counter++; +} +void DiskstreamingframeContent::reloaded(std::size_t) +{ button.setEnabled(false); } - } // GUI:: diff --git a/plugingui/diskstreamingframecontent.h b/plugingui/diskstreamingframecontent.h index bc26806..0f9a098 100644 --- a/plugingui/diskstreamingframecontent.h +++ b/plugingui/diskstreamingframecontent.h @@ -51,6 +51,7 @@ private: void limitSettingsValueChanged(std::size_t value); void limitValueChanged(float value); void reloadClicked(); + void reloaded(std::size_t); // For now the maximum disk streaming limit is 4GB static constexpr std::size_t min_limit = 1024.0 * 1024.0 * 32; diff --git a/plugingui/drumkitframecontent.cc b/plugingui/drumkitframecontent.cc index fc0b120..3752cc3 100644 --- a/plugingui/drumkitframecontent.cc +++ b/plugingui/drumkitframecontent.cc @@ -189,6 +189,7 @@ void DrumkitframeContent::selectKitFile(const std::string& filename) config.save(); settings.drumkit_file.store(filename); + settings.reload_counter++; } void DrumkitframeContent::selectMapFile(const std::string& filename) -- cgit v1.2.3