summaryrefslogtreecommitdiff
path: root/plugingui
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2019-07-25 17:49:16 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2019-09-28 20:37:47 +0200
commit9d1ea1e7cfa256c7f5cac027382d92f658734ccb (patch)
tree39ec7cdaa8ed571137430ccbbc0a391bb27427a3 /plugingui
parentcd9af98abdce1fe3759e786d6b010a7fe3395e2c (diff)
Add generic logger interface for propagating messages while loading drumkits to the commandline
and/or plugin UI.
Diffstat (limited to 'plugingui')
-rw-r--r--plugingui/statusframecontent.cc20
-rw-r--r--plugingui/statusframecontent.h7
2 files changed, 18 insertions, 9 deletions
diff --git a/plugingui/statusframecontent.cc b/plugingui/statusframecontent.cc
index 34903e8..d457dee 100644
--- a/plugingui/statusframecontent.cc
+++ b/plugingui/statusframecontent.cc
@@ -29,9 +29,9 @@
namespace GUI
{
-StatusframeContent::StatusframeContent(
- Widget* parent, SettingsNotifier& settings_notifier)
- : Widget(parent), settings_notifier(settings_notifier)
+StatusframeContent::StatusframeContent(Widget* parent,
+ SettingsNotifier& settings_notifier)
+ : Widget(parent), settings_notifier(settings_notifier)
{
CONNECT(this, settings_notifier.drumkit_load_status,
this, &StatusframeContent::updateDrumkitLoadStatus);
@@ -48,6 +48,9 @@ StatusframeContent::StatusframeContent(
CONNECT(this, settings_notifier.number_of_underruns,
this, &StatusframeContent::updateNumberOfUnderruns);
+ CONNECT(this, settings_notifier.load_status_text,
+ this, &StatusframeContent::loadStatusTextChanged);
+
text_field.move(0, 0);
text_field.setReadOnly(true);
@@ -95,21 +98,21 @@ void StatusframeContent::updateDrumkitLoadStatus(LoadStatus load_status)
updateContent();
}
-void StatusframeContent::updateDrumkitName(std::string const& drumkit_name)
+void StatusframeContent::updateDrumkitName(const std::string& drumkit_name)
{
this->drumkit_name = drumkit_name;
updateContent();
}
-void StatusframeContent::updateDrumkitDescription(std::string const& drumkit_description)
+void StatusframeContent::updateDrumkitDescription(const std::string& drumkit_description)
{
this->drumkit_description = drumkit_description;
updateContent();
}
-void StatusframeContent::updateDrumkitVersion(std::string const& drumkit_version)
+void StatusframeContent::updateDrumkitVersion(const std::string& drumkit_version)
{
this->drumkit_version = drumkit_version;
@@ -151,4 +154,9 @@ void StatusframeContent::updateNumberOfUnderruns(std::size_t number_of_underruns
updateContent();
}
+void StatusframeContent::loadStatusTextChanged(const std::string& text)
+{
+ text_field.setText(text);
+}
+
} // GUI::
diff --git a/plugingui/statusframecontent.h b/plugingui/statusframecontent.h
index 4ca4f63..dd44907 100644
--- a/plugingui/statusframecontent.h
+++ b/plugingui/statusframecontent.h
@@ -46,12 +46,13 @@ public:
void updateContent();
void updateDrumkitLoadStatus(LoadStatus load_status);
- void updateDrumkitName(std::string const& drumkit_name);
- void updateDrumkitDescription(std::string const& drumkit_description);
- void updateDrumkitVersion(std::string const& drumkit_version);
+ void updateDrumkitName(const std::string& drumkit_name);
+ void updateDrumkitDescription(const std::string& drumkit_description);
+ void updateDrumkitVersion(const std::string& drumkit_version);
void updateMidimapLoadStatus(LoadStatus load_status);
void updateBufferSize(std::size_t buffer_size);
void updateNumberOfUnderruns(std::size_t number_of_underruns);
+ void loadStatusTextChanged(const std::string& text);
private:
TextEdit text_field{this};