]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Dialogs.C
Lars says _(_(b)) is a bug ... fix
[lyx.git] / src / frontends / Dialogs.C
index e3c1687c862f27b525976a4a3fc85efd30864484..7e77b7d9be428c8097630e2349981c218d434793 100644 (file)
@@ -1,17 +1,12 @@
-/* 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"
 
-void Dialogs::add(DialogBase * ptr)
-{
-       lyx::Assert(ptr);
-       dialogs_.push_back(db_ptr(ptr));
-}
+// 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_;
+};
+
 
-void Dialogs::destroySplash()
+boost::signal0<void> & Dialogs::redrawGUI()
 {
-       splash_.reset();
+        static BugfixSignal<boost::signal0<void> > thesignal;
+        return thesignal();
 }