]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetparent.C
fix #832
[lyx.git] / src / insets / insetparent.C
index 2620275fe04cad374d63605b73521bd0b6b1e4b0..7f1097ba6f7560743f59e9dac0e52ca20c81c460 100644 (file)
 
 #include <config.h>
 
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "insetparent.h"
-#include "support/filetools.h"
 #include "BufferView.h"
 #include "frontends/LyXView.h"
 #include "support/LOstream.h"
@@ -27,6 +21,9 @@
 #include "buffer.h"
 #include "gettext.h"
 
+#include "support/filetools.h"
+#include "support/lstrings.h"
+
 using std::ostream;
 
 
@@ -40,19 +37,19 @@ InsetParent::InsetParent(InsetCommandParams const & p, Buffer const & bf, bool)
 
 string const InsetParent::getScreenLabel(Buffer const *) const
 {
-       return string(_("Parent:")) + getContents();
-}
-
-
-void InsetParent::edit(BufferView * bv, int, int, mouse_button::state)
-{    
-       bv->owner()->dispatch(FuncRequest(LFUN_CHILDOPEN, getContents()));
+       return bformat(_("Parent: %1$s"), getContents());
 }
 
 
-void InsetParent::edit(BufferView * bv, bool)
+dispatch_result InsetParent::localDispatch(FuncRequest const & cmd)
 {
-       edit(bv, 0, 0, mouse_button::none);
+       switch (cmd.action) {
+               case LFUN_INSET_EDIT:
+                       cmd.view()->owner()->dispatch(FuncRequest(LFUN_CHILDOPEN, getContents()));
+                       return DISPATCHED;
+               default:
+                       return UNDISPATCHED;
+       }
 }