]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gnome/FormRef.C
Remove unneeded files, we have switched to use the libglade and there is no
[lyx.git] / src / frontends / gnome / FormRef.C
index 25a4e3a8a9910ddd5908da5a85e4d74e4180db5d..0664824c0c25977600cd3de6e72d0e57e9c0f9ef 100644 (file)
 #include "mainapp.h"
 extern GLyxAppWin * mainAppWin;
 
-using SigC::bind;
+namespace anon {
 
 // configuration keys
-static string const CONF_ENTRY_NAME("FormRef_name");
+string const CONF_ENTRY_NAME("FormRef_name");
 
 // goto button labels
-static string const GOTO_REF_LABEL(N_("Goto reference"));
-static string const GOTO_BACK_LABEL(N_("Go back"));
+string const GOTO_REF_LABEL(N_("Goto reference"));
+string const GOTO_BACK_LABEL(N_("Go back"));
+
+} // namespace anon
+
 
 FormRef::FormRef(LyXView * lv, Dialogs * d)
-       : lv_(lv), d_(d), inset_(0), u_(0), h_(0), ih_(0), dialog_(NULL)
+       : lv_(lv), d_(d), inset_(0), u_(0), h_(0), ih_(0), dialog_(0)
 {
   // let the dialog be shown
   // These are permanent connections so we won't bother
@@ -66,10 +69,10 @@ FormRef::~FormRef()
 
 void FormRef::showInset( InsetCommand * const inset )
 {
-  if( dialog_!=NULL || inset == 0 ) return;
+  if( dialog_!=0 || inset == 0 ) return;
   
   inset_ = inset;
-  ih_ = inset_->hide.connect(slot(this, &FormRef::hide));
+  ih_ = inset_->hideDialog.connect(slot(this, &FormRef::hide));
 
   acttype_ = EDIT;
   
@@ -80,7 +83,7 @@ void FormRef::showInset( InsetCommand * const inset )
 
 void FormRef::createInset( string const & arg )
 {
-  if( dialog_!=NULL ) return;
+  if( dialog_!=0 ) return;
   
   acttype_ = INSERT;
 
@@ -122,7 +125,7 @@ void FormRef::showStageError(string const & mess)
       b_cancel->clicked.connect(slot(mainAppWin, &GLyxAppWin::remove_action));
       dialog_->destroy.connect(slot(this, &FormRef::free));
 
-      u_ = d_->updateBufferDependent.connect(slot(this, &FormRef::update));
+      u_ = d_->updateBufferDependent.connect(slot(this, &FormRef::updateSlot));
       h_ = d_->hideBufferDependent.connect(slot(this, &FormRef::hide));
     }
 }
@@ -197,7 +200,7 @@ void FormRef::showStageSelect()
 
       dialog_->destroy.connect(slot(this, &FormRef::free));
 
-      u_ = d_->updateBufferDependent.connect(slot(this, &FormRef::update));
+      u_ = d_->updateBufferDependent.connect(slot(this, &FormRef::updateSlot));
       h_ = d_->hideBufferDependent.connect(slot(this, &FormRef::hide));
     }
 }
@@ -324,26 +327,26 @@ void FormRef::showStageAction()
 
       dialog_->destroy.connect(slot(this, &FormRef::free));
 
-      u_ = d_->updateBufferDependent.connect(slot(this, &FormRef::update));
+      u_ = d_->updateBufferDependent.connect(slot(this, &FormRef::updateSlot));
       h_ = d_->hideBufferDependent.connect(slot(this, &FormRef::hide));
     }
 }
 
-void FormRef::update(bool buffchanged)
+void FormRef::updateSlot(bool buffchanged)
 {
   if (buffchanged) hide();
 }
 
 void FormRef::hide()
 {
-  if (dialog_!=NULL) mainAppWin->remove_action();
+  if (dialog_!=0) mainAppWin->remove_action();
 }
 
 void FormRef::free()
 {
-  if (dialog_!=NULL)
+  if (dialog_!=0)
     {
-      dialog_ = NULL;
+      dialog_ = 0;
       u_.disconnect();
       h_.disconnect();
       inset_ = 0;
@@ -364,7 +367,7 @@ void FormRef::gotoRef()
     }
   case GOBACK:
     {
-      lv_->getLyXFunc()->Dispatch(LFUN_REF_BACK);
+      lv_->getLyXFunc()->Dispatch(LFUN_BOOKMARK_GOTO, "0");
 
       gototype_ = GOREF;
       b_goto->set_text(GOTO_REF_LABEL);
@@ -394,6 +397,7 @@ void FormRef::apply()
     {
       lv_->getLyXFunc()->Dispatch(LFUN_REF_INSERT,
                                  params.getAsString());
+      lv_->getLyXFunc()->Dispatch(LFUN_BOOKMARK_SAVE, "0");
     }
 
   // save configuration