From 5a15177281516f21416c3c123ae994a6d9d4c67d Mon Sep 17 00:00:00 2001 From: John Levon Date: Mon, 9 Sep 2002 17:32:53 +0000 Subject: [PATCH] remove noload/don't typeset git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5243 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView_pimpl.C | 3 +- src/ChangeLog | 10 +++++ src/buffer.C | 24 +---------- src/buffer.h | 2 - src/frontends/controllers/ChangeLog | 5 +++ src/frontends/controllers/ControlInclude.C | 16 ++----- src/frontends/xforms/ChangeLog | 5 +++ src/frontends/xforms/FormInclude.C | 25 ++--------- src/frontends/xforms/forms/form_include.fd | 28 +++---------- src/insets/ChangeLog | 5 +++ src/insets/insetinclude.C | 24 +---------- src/insets/insetinclude.h | 49 ++++++++-------------- src/lyxfunc.C | 23 +--------- src/paragraph.C | 2 - 14 files changed, 60 insertions(+), 161 deletions(-) diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 163629c76a..86621ce149 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -1177,7 +1177,8 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev) case LFUN_CHILD_INSERT: { InsetInclude::Params p; - p.cparams.setFromString(ev.argument); + if (!ev.argument.empty()) + p.cparams.setFromString(ev.argument); p.masterFilename_ = buffer_->fileName(); InsetInclude * inset = new InsetInclude(p); diff --git a/src/ChangeLog b/src/ChangeLog index 8f9a4bdc47..55700ef398 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2002-09-09 John Levon + + * BufferView_pimpl.C: Don't use empty arg for LFUN_CHILD_INSERT + + * buffer.h: + * buffer.C: remove getIncludeonlyList() + + * paragraph.C: + * lyxfunc.C: remove headers + 2002-09-09 Juergen Vigna * text.C (getColumnNearX): fix form Michael this is most diff --git a/src/buffer.C b/src/buffer.C index 0861295770..7538be4e6d 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -1159,8 +1159,8 @@ bool Buffer::readFile(LyXLex & lex, Paragraph * par) } else if (file_format > LYX_FORMAT) { // future format Alert::alert(_("Warning!"), - _("LyX file format is newer that what"), - _("is supported in this LyX version. Expect some problems.")); + _("The file was created with a newer version of" + "LyX. This is likely to cause problems.")); } else if (file_format < LYX_FORMAT) { // old formats @@ -3151,26 +3151,6 @@ void Buffer::validate(LaTeXFeatures & features) const } -// This function should be in Buffer because it's a buffer's property (ale) -string const Buffer::getIncludeonlyList(char delim) -{ - string lst; - for (inset_iterator it = inset_iterator_begin(); - it != inset_iterator_end(); ++it) { - if (it->lyxCode() == Inset::INCLUDE_CODE) { - InsetInclude & inc = static_cast(*it); - if (inc.isIncludeOnly()) { - if (!lst.empty()) - lst += delim; - lst += inc.getRelFileBaseName(); - } - } - } - lyxerr[Debug::INFO] << "Includeonly(" << lst << ')' << endl; - return lst; -} - - vector const Buffer::getLabelList() const { /// if this is a child document and the parent is already loaded diff --git a/src/buffer.h b/src/buffer.h index b571466dc8..6e5a97c29e 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -265,8 +265,6 @@ public: */ void validate(LaTeXFeatures &) const; - /// - string const getIncludeonlyList(char delim = ','); /// std::vector > const getBibkeyList() const; /// diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 9751be4a90..abce1b5306 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,8 @@ +2002-09-09 John Levon + + * ControlInclude.C: fix file masks. Get rid of noload, + remove stupid warning + 2002-09-09 John Levon * ControlMath.h: diff --git a/src/frontends/controllers/ControlInclude.C b/src/frontends/controllers/ControlInclude.C index d24e071c4f..d8f9c7d2b1 100644 --- a/src/frontends/controllers/ControlInclude.C +++ b/src/frontends/controllers/ControlInclude.C @@ -55,7 +55,7 @@ string const ControlInclude::Browse(string const & in_name, Type in_type) string pattern; switch (in_type) { case INPUT: - pattern = _("*.tex| LaTeX Documents (*.tex)"); + pattern = _("*.(tex|lyx)| LaTeX/LyX Documents"); break; case VERBATIM: @@ -63,7 +63,7 @@ string const ControlInclude::Browse(string const & in_name, Type in_type) break; case INCLUDE: - pattern = _("*.lyx| LyX Documents (*.lyx)"); + pattern = _("*.(tex|lyx)| LaTeX/LyX Documents"); break; } @@ -87,18 +87,8 @@ bool ControlInclude::fileExists(string const & file) string const fileWithAbsPath = MakeAbsPath(file, OnlyPath(params().masterFilename_)); - if (params().noload) { - - if (prefixIs(file, "../") || prefixIs(file, "/")) - Alert::alert(_("Warning!"), - _("On some systems, with this options only relative path names"), - _("inside the master file dir are allowed. You might get a LaTeX error!")); - } - if (IsFileReadable(fileWithAbsPath)) return true; - else - Alert::alert(_("Warning!"), _("Specified file doesn't exist")); - return false; + return false; } diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index da05be52f0..ec8e9c272b 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,8 @@ +2002-09-09 John Levon + + * FormInclude.C: + * forms/form_include.fd: reorder, remove noload + 2002-09-09 John Levon * FormMathDeco.C: move latex_deco into ControlMath diff --git a/src/frontends/xforms/FormInclude.C b/src/frontends/xforms/FormInclude.C index 1cc6e18e5e..8eb2329fee 100644 --- a/src/frontends/xforms/FormInclude.C +++ b/src/frontends/xforms/FormInclude.C @@ -17,6 +17,8 @@ #pragma implementation #endif +#include "debug.h" + #include "xformsBC.h" #include "ControlInclude.h" #include "FormInclude.h" @@ -46,7 +48,6 @@ void FormInclude::build() bc().addReadOnly(dialog_->button_browse); bc().addReadOnly(dialog_->radio_verbatim); - bc().addReadOnly(dialog_->check_typeset); bc().addReadOnly(dialog_->radio_useinput); bc().addReadOnly(dialog_->radio_useinclude); } @@ -54,30 +55,12 @@ void FormInclude::build() void FormInclude::update() { - #if 0 - // I believe this is not needed. - // Anyway, it is plain wrong (JSpitzm 3/7/02) - if (controller().params().noload) { - fl_set_input(dialog_->input_filename, ""); - fl_set_button(dialog_->check_typeset, 0); - fl_set_button(dialog_->radio_useinput, 0); - fl_set_button(dialog_->radio_useinclude, 1); - fl_set_button(dialog_->radio_verbatim, 0); - fl_set_button(dialog_->check_visiblespace, 0); - fl_deactivate_object(dialog_->check_visiblespace); - fl_set_object_lcol(dialog_->check_visiblespace, FL_INACTIVE); - return; - } - #endif - fl_set_input(dialog_->input_filename, controller().params().cparams.getContents().c_str()); string const cmdname = controller().params().cparams.getCmdName(); - fl_set_button(dialog_->check_typeset, - int(controller().params().noload)); - + lyxerr << cmdname << endl; if (cmdname == "input") fl_set_button(dialog_->check_preview, int(controller().params().cparams.preview())); @@ -106,7 +89,6 @@ void FormInclude::update() void FormInclude::apply() { - controller().params().noload = fl_get_button(dialog_->check_typeset); controller().params().cparams .preview(fl_get_button(dialog_->check_preview)); @@ -151,7 +133,6 @@ ButtonPolicy::SMInput FormInclude::input(FL_OBJECT * ob, long) } else if (ob == dialog_->button_load) { string const in_name = fl_get_input(dialog_->input_filename); if (!rtrim(in_name).empty() && controller().fileExists(in_name)) { -// ApplyButton(); controller().OKButton(); controller().load(rtrim(in_name)); action = ButtonPolicy::SMI_NOOP; diff --git a/src/frontends/xforms/forms/form_include.fd b/src/frontends/xforms/forms/form_include.fd index 191d673725..a987f07a27 100644 --- a/src/frontends/xforms/forms/form_include.fd +++ b/src/frontends/xforms/forms/form_include.fd @@ -10,7 +10,7 @@ Unit of measure: FL_COORD_PIXEL Name: form_include Width: 340 Height: 250 -Number of Objects: 15 +Number of Objects: 14 -------------------- class: FL_BOX @@ -66,24 +66,6 @@ name: button_browse callback: C_FormBaseInputCB argument: 0 --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 180 70 150 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Don't typeset|#D -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: check_typeset -callback: C_FormBaseInputCB -argument: 0 - -------------------- class: FL_BUTTON type: RETURN_BUTTON @@ -159,7 +141,7 @@ argument: 0 -------------------- class: FL_CHECKBUTTON type: PUSH_BUTTON -box: 180 100 150 30 +box: 180 70 150 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER @@ -213,7 +195,7 @@ argument: 0 -------------------- class: FL_ROUND3DBUTTON type: RADIO_BUTTON -box: 10 100 160 30 +box: 10 70 160 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER @@ -231,7 +213,7 @@ argument: 0 -------------------- class: FL_ROUND3DBUTTON type: RADIO_BUTTON -box: 10 70 160 30 +box: 10 100 160 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER @@ -267,7 +249,7 @@ argument: -------------------- class: FL_CHECKBUTTON type: PUSH_BUTTON -box: 180 130 150 30 +box: 180 100 150 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 6456d9ce62..39b7cda955 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2002-09-09 John Levon + + * insetinclude.h: + * insetinclude.C: remove noload, default to input + 2002-09-29 Martin Vermeer * insetgraphics.C: disfuscated use of ']' in built output string. diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index 9f40fd4bd2..307a19457a 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -113,7 +113,7 @@ InsetInclude::Params const & InsetInclude::params() const bool InsetInclude::Params::operator==(Params const & o) const { if (cparams == o.cparams && flag == o.flag && - noload == o.noload && masterFilename_ == o.masterFilename_) + masterFilename_ == o.masterFilename_) return true; return false; @@ -130,26 +130,6 @@ void InsetInclude::set(Params const & p) { params_ = p; - // Just to be safe... - string command; - - switch (params_.flag) { - case INCLUDE: - command="include"; - break; - case VERB: - command="verbatiminput"; - break; - case INPUT: - command="input"; - break; - case VERBAST: - command="verbatiminput*"; - break; - } - - params_.cparams.setCmdName(command); - if (preview_->monitoring()) preview_->stopMonitoring(); @@ -252,7 +232,7 @@ string const InsetInclude::getMasterFilename() const bool InsetInclude::loadIfNeeded() const { - if (params_.noload || isVerbatim()) + if (isVerbatim()) return false; if (!IsLyXFilename(getFileName())) diff --git a/src/insets/insetinclude.h b/src/insets/insetinclude.h index 1f527ffa39..feb810ff18 100644 --- a/src/insets/insetinclude.h +++ b/src/insets/insetinclude.h @@ -1,12 +1,11 @@ // -*- C++ -*- -/* This file is part of* - * ====================================================== +/** + * \file insetinclude.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * LyX, The Document Processor - * - * Copyright 1997 LyX Team (this file was created this year) - * - * ====================================================== */ + * Full author contact details are available in file CREDITS + */ #ifndef INSET_INCLUDE_H #define INSET_INCLUDE_H @@ -25,32 +24,27 @@ struct LaTeXFeatures; // Created by AAS 970521 -/** Used to include files - */ +/// for including tex/lyx files class InsetInclude: public InsetButton, boost::noncopyable { public: /// the type of inclusion enum Flags { - /// - INCLUDE = 0, - /// - VERB = 1, - /// - INPUT = 2, - /// - VERBAST = 3 + INCLUDE = 0, //< + VERB = 1, //< + INPUT = 2, //< + VERBAST = 3 //< }; struct Params { - Params(InsetCommandParams const & cp = InsetCommandParams(), - Flags f = INCLUDE, + Params(InsetCommandParams const & cp = InsetCommandParams("input"), + Flags f = INPUT, bool nl = false, string const & name = string()) - : cparams(cp), flag(f), noload(nl), + : cparams(cp), flag(f), masterFilename_(name) {} + InsetCommandParams cparams; Flags flag; - bool noload; string masterFilename_; /// @@ -63,7 +57,7 @@ public: InsetInclude(Params const &); /// InsetInclude(InsetCommandParams const &, Buffer const &); - /// + ~InsetInclude(); /// Override these InsetButton methods if Previewing @@ -121,9 +115,6 @@ public: /// return the filename stub of the included file string const getRelFileBaseName() const; - /// return true if the included file is not loaded - bool isIncludeOnly() const; - /// return true if the file is or got loaded. bool loadIfNeeded() const; @@ -160,10 +151,4 @@ inline bool InsetInclude::isVerbatim() const return params_.flag == VERB || params_.flag == VERBAST; } - -inline bool InsetInclude::isIncludeOnly() const -{ - return params_.flag == INCLUDE && params_.noload; -} - -#endif +#endif // INSETINCLUDE_H diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 17ef4856dd..968c5225ca 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -45,29 +45,8 @@ #include "undo_funcs.h" #include "ParagraphParameters.h" -#include "insets/inseturl.h" -#include "insets/insetlatexaccent.h" -#include "insets/insettoc.h" -#include "insets/insetref.h" -#include "insets/insetparent.h" -#include "insets/insetindex.h" -#include "insets/insetinclude.h" -#include "insets/insetbib.h" -#include "insets/insetcite.h" -#include "insets/insettext.h" -#include "insets/insetert.h" -#include "insets/insetexternal.h" -#include "insets/insetgraphics.h" -#include "insets/insetfoot.h" -#include "insets/insetmarginal.h" -#include "insets/insetminipage.h" -#include "insets/insetfloat.h" -#if 0 -#include "insets/insetlist.h" -#include "insets/insettheorem.h" -#endif +#include "insets/insetcommand.h" #include "insets/insettabular.h" -#include "insets/insetcaption.h" #include "mathed/formulamacro.h" #include "mathed/math_cursor.h" diff --git a/src/paragraph.C b/src/paragraph.C index 1779d7482a..e425d46f4d 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -29,9 +29,7 @@ #include "ParameterStruct.h" #include "gettext.h" -#include "insets/insetinclude.h" #include "insets/insetbib.h" -#include "insets/insettext.h" #include "insets/insetoptarg.h" #include "support/filetools.h" -- 2.39.2