remove noload/don't typeset

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5243 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2002-09-09 17:32:53 +00:00
parent f3541d37db
commit 5a15177281
14 changed files with 60 additions and 161 deletions

View File

@ -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);

View File

@ -1,3 +1,13 @@
2002-09-09 John Levon <levon@movementarian.org>
* 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 <jug@sad.it>
* text.C (getColumnNearX): fix form Michael this is most

View File

@ -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<InsetInclude &>(*it);
if (inc.isIncludeOnly()) {
if (!lst.empty())
lst += delim;
lst += inc.getRelFileBaseName();
}
}
}
lyxerr[Debug::INFO] << "Includeonly(" << lst << ')' << endl;
return lst;
}
vector<string> const Buffer::getLabelList() const
{
/// if this is a child document and the parent is already loaded

View File

@ -265,8 +265,6 @@ public:
*/
void validate(LaTeXFeatures &) const;
///
string const getIncludeonlyList(char delim = ',');
///
std::vector<std::pair<string, string> > const getBibkeyList() const;
///

View File

@ -1,3 +1,8 @@
2002-09-09 John Levon <levon@movementarian.org>
* ControlInclude.C: fix file masks. Get rid of noload,
remove stupid warning
2002-09-09 John Levon <levon@movementarian.org>
* ControlMath.h:

View File

@ -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;
}

View File

@ -1,3 +1,8 @@
2002-09-09 John Levon <levon@movementarian.org>
* FormInclude.C:
* forms/form_include.fd: reorder, remove noload
2002-09-09 John Levon <levon@movementarian.org>
* FormMathDeco.C: move latex_deco into ControlMath

View File

@ -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;

View File

@ -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

View File

@ -1,3 +1,8 @@
2002-09-09 John Levon <levon@movementarian.org>
* insetinclude.h:
* insetinclude.C: remove noload, default to input
2002-09-29 Martin Vermeer <martin.vermeer@hut.fi>
* insetgraphics.C: disfuscated use of ']' in built output string.

View File

@ -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()))

View File

@ -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

View File

@ -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"

View File

@ -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"