Add RAII listener blocking utility
* Added for ToolPanel listener and Adjuster * Follows style of ConnectionBlocker for sigc::connection
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
#include "rtimage.h"
|
||||
#include "rtscalable.h"
|
||||
#include "multilangmgr.h"
|
||||
#include "adjuster.h"
|
||||
#include "toolpanel.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
@@ -77,6 +79,34 @@ void IdleRegister::destroy()
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
BlockAdjusterEvents::BlockAdjusterEvents(Adjuster* adjuster) : adj(adjuster)
|
||||
{
|
||||
if (adj) {
|
||||
adj->block(true);
|
||||
}
|
||||
}
|
||||
|
||||
BlockAdjusterEvents::~BlockAdjusterEvents()
|
||||
{
|
||||
if (adj) {
|
||||
adj->block(false);
|
||||
}
|
||||
}
|
||||
|
||||
DisableListener::DisableListener(ToolPanel* panelToDisable) : panel(panelToDisable)
|
||||
{
|
||||
if (panel) {
|
||||
panel->disableListener();
|
||||
}
|
||||
}
|
||||
|
||||
DisableListener::~DisableListener()
|
||||
{
|
||||
if (panel) {
|
||||
panel->enableListener();
|
||||
}
|
||||
}
|
||||
|
||||
Glib::ustring escapeHtmlChars(const Glib::ustring &src)
|
||||
{
|
||||
|
||||
|
Reference in New Issue
Block a user