-/* This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
- *
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-2001 The LyX Team.
+/**
+ * \file frontends/Dialogs.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ * \author Angus Leeming
*
- * ======================================================
+ * Full author contact details are available in file CREDITS
*
- * \file Dialogs.C
- * \author Angus Leeming <a.leeming@ic.ac.uk>
- *
- * Methods common to all frontends' Dialogs that should not be inline
+ * Common to all frontends' Dialogs
*/
#include <config.h>
#endif
#include "Dialogs.h"
-#include "support/LAssert.h"
-// Signal enabling all visible dialogs to be redrawn if so desired.
-// E.g., when the GUI colours have been remapped.
-SigC::Signal0<void> Dialogs::redrawGUI;
+// Note that static boost signals break some compilers, so this wrapper
+// initialises the signal dynamically when it is first invoked.
+template<typename Signal>
+class BugfixSignal {
+public:
+ Signal & operator()() { return thesignal(); }
+ Signal const & operator()() const { return thesignal(); }
+
+private:
+ Signal & thesignal() const
+ {
+ if (!signal_.get())
+ signal_.reset(new Signal);
+ return *signal_;
+ }
+ mutable boost::scoped_ptr<Signal> signal_;
+};
-// toggle tooltips on/off in all dialogs.
-SigC::Signal0<void> Dialogs::toggleTooltips;
-void Dialogs::add(DialogBase * ptr)
+boost::signal0<void> & Dialogs::redrawGUI()
{
- lyx::Assert(ptr);
- dialogs_.push_back(db_ptr(ptr));
+ static BugfixSignal<boost::signal0<void> > thesignal;
+ return thesignal();
}