X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiDocument.cpp;h=dcc118de19c589df76857ec6bb5f3a99916f1672;hb=d45ca67d1d3e2d4fdc344cd2a1517725bc91723a;hp=4d97a78cd4346c4ad67fb9401817aef5835efc64;hpb=e5ae1a4b75ee4ac162db9d1b254968d2072938c6;p=lyx.git diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 4d97a78cd4..dcc118de19 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -71,15 +71,21 @@ namespace { char const * const tex_graphics[] = { - "default", "dvips", "dvitops", "emtex", - "ln", "oztex", "textures", "none", "" + "default", "dvialw", "dvilaser", "dvipdf", "dvipdfm", "dvipdfmx", + "dvips", "dvipsone", "dvitops", "dviwin", "dviwindo", "dvi2ps", "emtex", + "ln", "oztex", "pctexhp", "pctexps", "pctexwin", "pctex32", "pdftex", + "psprint", "pubps", "tcidvi", "textures", "truetex", "vtex", "xdvi", + "xetex", "none", "" }; char const * const tex_graphics_gui[] = { - N_("Default"), "Dvips", "DVItoPS", "EmTeX", - "LN", "OzTeX", "Textures", N_("None"), "" + N_("Default"), "dvialw", "DviLaser", "dvipdf", "DVIPDFM", "DVIPDFMx", + "Dvips", "DVIPSONE", "DVItoPS", "DVIWIN", "DVIWindo", "dvi2ps", "EmTeX", + "LN", "OzTeX", "pctexhp", "pctexps", "pctexwin", "PCTeX32", "pdfTeX", + "psprint", "pubps", "tcidvi", "Textures", "TrueTeX", "VTeX", "xdvi", + "XeTeX", N_("None"), "" }; @@ -890,6 +896,8 @@ GuiDocument::GuiDocument(GuiView & lv) // latex class connect(latexModule->optionsLE, SIGNAL(textChanged(QString)), this, SLOT(change_adaptor())); + connect(latexModule->defaultOptionsCB, SIGNAL(clicked()), + this, SLOT(change_adaptor())); connect(latexModule->psdriverCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); connect(latexModule->classCO, SIGNAL(activated(int)), @@ -907,7 +915,7 @@ GuiDocument::GuiDocument(GuiView & lv) connect(latexModule->childDocPB, SIGNAL(clicked()), this, SLOT(browseMaster())); - selectionManager = + selectionManager = new ModuleSelectionManager(latexModule->availableLV, latexModule->selectedLV, latexModule->addPB, latexModule->deletePB, @@ -1342,13 +1350,14 @@ void GuiDocument::classChanged() applyView(); } bp_.useClassDefaults(); - paramsToDialog(bp_); } // FIXME There's a little bug here connected with auto_reset, namely, // that, if the preceding is skipped and the user has changed the // modules before changing the class, those changes will be lost on // update. But maybe that's what we want? updateSelectedModules(); + bp_.makeDocumentClass(); + paramsToDialog(bp_); } @@ -1588,9 +1597,9 @@ void GuiDocument::apply(BufferParams & params) params.addLayoutModule(modules_sel_model_.getIDString(i)); // update the list of removed modules params.clearRemovedModules(); - set const & reqmods = params.baseClass()->defaultModules(); - set::const_iterator rit = reqmods.begin(); - set::const_iterator ren = reqmods.end(); + list const & reqmods = params.baseClass()->defaultModules(); + list::const_iterator rit = reqmods.begin(); + list::const_iterator ren = reqmods.end(); // check each of the required modules for (; rit != ren; rit++) { vector::const_iterator mit = params.getModules().begin(); @@ -1694,6 +1703,9 @@ void GuiDocument::apply(BufferParams & params) params.options = fromqstr(latexModule->optionsLE->text()); + params.use_default_options = + latexModule->defaultOptionsCB->isChecked(); + if (latexModule->childDocGB->isChecked()) params.master = fromqstr(latexModule->childDocLE->text()); @@ -1989,6 +2001,24 @@ void GuiDocument::paramsToDialog(BufferParams const & params) latexModule->optionsLE->setText(QString()); } + latexModule->defaultOptionsCB->setChecked( + params.use_default_options); + + if (!documentClass().options().empty()) { + latexModule->defaultOptionsLE->setText( + toqstr(documentClass().options())); + } else { + latexModule->defaultOptionsLE->setText( + toqstr(_("[No options predefined]"))); + } + + latexModule->defaultOptionsLE->setEnabled( + params.use_default_options + && !documentClass().options().empty()); + + latexModule->defaultOptionsCB->setEnabled( + !documentClass().options().empty()); + if (!params.master.empty()) { latexModule->childDocGB->setChecked(true); latexModule->childDocLE->setText( @@ -2216,7 +2246,7 @@ char const * GuiDocument::fontfamilies_gui[5] = { bool GuiDocument::initialiseParams(string const &) { - BufferView * view = bufferview(); + BufferView const * view = bufferview(); if (!view) { bp_ = BufferParams(); paramsToDialog(bp_); @@ -2305,7 +2335,7 @@ void GuiDocument::dispatchParams() support::onlyPath(buffer().absFileName())); if (isLyXFilename(master_file.absFilename())) { Buffer * master = checkAndLoadLyXFile(master_file); - buffer().setParent(master); + const_cast(buffer()).setParent(master); } } @@ -2328,7 +2358,8 @@ void GuiDocument::dispatchParams() "assign branch")); } // FIXME: If we used an LFUN, we would not need those two lines: - bufferview()->processUpdateFlags(Update::Force | Update::FitCursor); + BufferView * bv = const_cast(bufferview()); + bv->processUpdateFlags(Update::Force | Update::FitCursor); }