]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormCitation.C
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / FormCitation.C
index dc3feea29cef848d5ca3f0b85a49269db929c120..ffa4567d73021d658117884fb5f2b8065905731c 100644 (file)
@@ -6,33 +6,33 @@
  * \author Angus Leeming
  * \author Rob Lahaye
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
-#include <algorithm>
 
-
-#include "xformsBC.h"
-#include "ControlCitation.h"
 #include "FormCitation.h"
+#include "ControlCitation.h"
 #include "forms/form_citation.h"
-#include "Kernel.h"
+
 #include "Tooltips.h"
-#include "helper_funcs.h"
 #include "xforms_helpers.h"
-#include "lyx_forms.h"
+#include "xformsBC.h"
 
-#include "gettext.h"
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 
+#include "lyx_forms.h"
+
+using lyx::support::getStringFromVector;
+using lyx::support::getVectorFromString;
+using lyx::support::trim;
+
 using std::find;
 using std::max;
-using std::min;
-using std::pair;
-using std::sort;
+
 using std::vector;
+using std::string;
+
 
 namespace {
 
@@ -115,6 +115,9 @@ void FormCitation::apply()
        controller().params().setCmdName(command);
        controller().params().setContents(getStringFromVector(citekeys));
 
+       string const before  = getString(dialog_->input_before);
+       controller().params().setSecOptions(before);
+       
        string const after  = getString(dialog_->input_after);
        controller().params().setOptions(after);
 }
@@ -449,7 +452,8 @@ void FormCitation::update()
        bool const natbib = controller().usingNatbib();
        setEnabled(dialog_->check_full_author_list, natbib);
        setEnabled(dialog_->check_force_uppercase, natbib);
-       setEnabled(dialog_->choice_style, natbib);
+       setEnabled(dialog_->choice_style, natbib || controller().usingJurabib());
+       setEnabled(dialog_->input_before, natbib || controller().usingJurabib());
 
        // No keys have been selected yet, so...
        fl_clear_browser(dialog_->browser_info);
@@ -457,12 +461,11 @@ void FormCitation::update()
        setCiteButtons(OFF);
 
        // Natbib can have comments before and after the citation.
-       // This is not yet supported. After only.
        fl_set_input(dialog_->input_after,
                     controller().params().getOptions().c_str());
 
-       fl_set_input(dialog_->input_before, _("Not yet supported").c_str());
-       setEnabled(dialog_->input_before, false);
+       fl_set_input(dialog_->input_before, 
+                    controller().params().getSecOptions().c_str());
 }