feat: warn user about stopped endless custom module

This commit is contained in:
Alexis 2018-12-03 09:35:10 +01:00
parent 691fb88057
commit 1d96d57b75
4 changed files with 4 additions and 3 deletions

View File

@ -12,7 +12,7 @@ namespace waybar::modules::SNI {
class Tray : public IModule { class Tray : public IModule {
public: public:
Tray(const Bar& bar, const Json::Value&); Tray(const Json::Value&);
auto update() -> void; auto update() -> void;
operator Gtk::Widget &(); operator Gtk::Widget &();
private: private:

View File

@ -33,7 +33,7 @@ waybar::IModule* waybar::Factory::makeModule(const std::string &name) const
} }
#ifdef HAVE_DBUSMENU #ifdef HAVE_DBUSMENU
if (ref == "tray") { if (ref == "tray") {
return new waybar::modules::SNI::Tray(bar_, config_[name]); return new waybar::modules::SNI::Tray(config_[name]);
} }
#endif #endif
#ifdef HAVE_LIBNL #ifdef HAVE_LIBNL

View File

@ -49,6 +49,7 @@ void waybar::modules::Custom::continuousWorker()
pclose(fp); pclose(fp);
thread_.stop(); thread_.stop();
output_ = { 1, "" }; output_ = { 1, "" };
std::cerr << name_ " just stopped, is it endless?" << std::endl;
dp.emit(); dp.emit();
return; return;
} }

View File

@ -2,7 +2,7 @@
#include <iostream> #include <iostream>
waybar::modules::SNI::Tray::Tray(const Bar& bar, const Json::Value &config) waybar::modules::SNI::Tray::Tray(const Json::Value &config)
: config_(config), watcher_(), host_(nb_hosts_, config, : config_(config), watcher_(), host_(nb_hosts_, config,
std::bind(&Tray::onAdd, this, std::placeholders::_1), std::bind(&Tray::onAdd, this, std::placeholders::_1),
std::bind(&Tray::onRemove, this, std::placeholders::_1)) std::bind(&Tray::onRemove, this, std::placeholders::_1))