]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiDocument.cpp
Remove the .aux and .bbl files and update the citation labels
[lyx.git] / src / frontends / qt4 / GuiDocument.cpp
index bb643dae45893201f688ddabf995cb21f1b87242..2f8eb7d794d4a44a9e3051b9cc391082c59640aa 100644 (file)
@@ -710,6 +710,8 @@ GuiDocument::GuiDocument(GuiView & lv)
                this, SLOT(change_adaptor()));
        connect(textLayoutModule->twoColumnCB, SIGNAL(clicked()),
                this, SLOT(setColSep()));
+       connect(textLayoutModule->justCB, SIGNAL(clicked()),
+               this, SLOT(change_adaptor()));
 
        textLayoutModule->lspacingLE->setValidator(new QDoubleValidator(
                textLayoutModule->lspacingLE));
@@ -768,6 +770,8 @@ GuiDocument::GuiDocument(GuiView & lv)
                this, SLOT(change_adaptor()));
        connect(outputModule->strictCB, SIGNAL(stateChanged(int)),
                this, SLOT(change_adaptor()));
+       connect(outputModule->cssCB, SIGNAL(stateChanged(int)),
+               this, SLOT(change_adaptor()));
        connect(outputModule->mathoutCB, SIGNAL(currentIndexChanged(int)),
                this, SLOT(change_adaptor()));
 
@@ -1102,22 +1106,26 @@ GuiDocument::GuiDocument(GuiView & lv)
        connect(biblioModule->citeNatbibRB, SIGNAL(toggled(bool)),
                biblioModule->citeStyleCO, SLOT(setEnabled(bool)));
        connect(biblioModule->citeDefaultRB, SIGNAL(clicked()),
-               this, SLOT(change_adaptor()));
+               this, SLOT(biblioChanged()));
        connect(biblioModule->citeNatbibRB, SIGNAL(clicked()),
-               this, SLOT(change_adaptor()));
+               this, SLOT(biblioChanged()));
        connect(biblioModule->citeStyleCO, SIGNAL(activated(int)),
-               this, SLOT(change_adaptor()));
+               this, SLOT(biblioChanged()));
        connect(biblioModule->citeJurabibRB, SIGNAL(clicked()),
-               this, SLOT(change_adaptor()));
+               this, SLOT(biblioChanged()));
        connect(biblioModule->bibtopicCB, SIGNAL(clicked()),
-               this, SLOT(change_adaptor()));
+               this, SLOT(biblioChanged()));
        connect(biblioModule->bibtexCO, SIGNAL(activated(int)),
                this, SLOT(bibtexChanged(int)));
        connect(biblioModule->bibtexOptionsLE, SIGNAL(textChanged(QString)),
-               this, SLOT(change_adaptor()));
+               this, SLOT(biblioChanged()));
+       connect(biblioModule->bibtexStyleLE, SIGNAL(textChanged(QString)),
+               this, SLOT(biblioChanged()));
 
        biblioModule->bibtexOptionsLE->setValidator(new NoNewLineValidator(
                biblioModule->bibtexOptionsLE));
+       biblioModule->bibtexStyleLE->setValidator(new NoNewLineValidator(
+               biblioModule->bibtexStyleLE));
 
        biblioModule->citeStyleCO->addItem(qt_("Author-year"));
        biblioModule->citeStyleCO->addItem(qt_("Numerical"));
@@ -1980,11 +1988,19 @@ void GuiDocument::languagePackageChanged(int i)
 }
 
 
+void GuiDocument::biblioChanged()
+{
+       buffer().invalidateBibinfoCache();
+       buffer().removeBiblioTempFiles();
+       changed();
+}
+
+
 void GuiDocument::bibtexChanged(int n)
 {
        biblioModule->bibtexOptionsLE->setEnabled(
                biblioModule->bibtexCO->itemData(n).toString() != "default");
-       changed();
+       biblioChanged();
 }
 
 
@@ -2236,6 +2252,8 @@ void GuiDocument::applyView()
        bp_.use_bibtopic =
                biblioModule->bibtopicCB->isChecked();
 
+       bp_.biblio_style = fromqstr(biblioModule->bibtexStyleLE->text());
+
        string const bibtex_command =
                fromqstr(biblioModule->bibtexCO->itemData(
                        biblioModule->bibtexCO->currentIndex()).toString());
@@ -2246,8 +2264,6 @@ void GuiDocument::applyView()
        else
                bp_.bibtex_command = bibtex_command + " " + bibtex_options;
 
-       buffer().removeBiblioTempFiles();
-
        // Indices
        indicesModule->apply(bp_);
 
@@ -2426,6 +2442,8 @@ void GuiDocument::applyView()
        else
                bp_.columns = 1;
 
+       bp_.justification = textLayoutModule->justCB->isChecked();
+
        if (textLayoutModule->indentRB->isChecked()) {
                // if paragraphs are separated by an indentation
                bp_.paragraph_separation = BufferParams::ParagraphIndentSeparation;
@@ -2514,6 +2532,7 @@ void GuiDocument::applyView()
        bp_.useNonTeXFonts = nontexfonts;
 
        bp_.output_sync = outputModule->outputsyncCB->isChecked();
+       
        bp_.output_sync_macro = fromqstr(outputModule->synccustomCB->currentText());
 
        int mathfmt = outputModule->mathoutCB->currentIndex();
@@ -2523,6 +2542,7 @@ void GuiDocument::applyView()
                static_cast<BufferParams::MathOutput>(mathfmt);
        bp_.html_math_output = mo;
        bp_.html_be_strict = outputModule->strictCB->isChecked();
+       bp_.html_css_as_file = outputModule->cssCB->isChecked();
        bp_.html_math_img_scale = outputModule->mathimgSB->value();
 
        // fonts
@@ -2663,6 +2683,8 @@ void GuiDocument::paramsToDialog()
        biblioModule->bibtopicCB->setChecked(
                bp_.use_bibtopic);
 
+       biblioModule->bibtexStyleLE->setText(toqstr(bp_.biblio_style));
+
        string command;
        string options =
                split(bp_.bibtex_command, command, ' ');
@@ -2872,6 +2894,7 @@ void GuiDocument::paramsToDialog()
 
        textLayoutModule->twoColumnCB->setChecked(
                bp_.columns == 2);
+       textLayoutModule->justCB->setChecked(bp_.justification);
 
        if (!bp_.options.empty()) {
                latexModule->optionsLE->setText(
@@ -2960,6 +2983,7 @@ void GuiDocument::paramsToDialog()
        outputModule->mathimgSB->setValue(bp_.html_math_img_scale);
        outputModule->mathoutCB->setCurrentIndex(bp_.html_math_output);
        outputModule->strictCB->setChecked(bp_.html_be_strict);
+       outputModule->cssCB->setChecked(bp_.html_css_as_file);
 
        // Fonts
        updateFontsize(documentClass().opt_fontsize(),
@@ -3087,6 +3111,10 @@ void GuiDocument::paramsToDialog()
        // PDF support
        PDFOptions const & pdf = bp_.pdfoptions();
        pdfSupportModule->use_hyperrefGB->setChecked(pdf.use_hyperref);
+       if (bp_.documentClass().provides("hyperref"))
+               pdfSupportModule->use_hyperrefGB->setTitle(qt_("C&ustomize Hyperref Options"));
+       else
+               pdfSupportModule->use_hyperrefGB->setTitle(qt_("&Use Hyperref Support"));
        pdfSupportModule->titleLE->setText(toqstr(pdf.title));
        pdfSupportModule->authorLE->setText(toqstr(pdf.author));
        pdfSupportModule->subjectLE->setText(toqstr(pdf.subject));