mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 22:06:15 +00:00
Kayvan and Dekel's patch + some small fixes to xforms/
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1065 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0e3405dbf7
commit
0e86ed5583
27
ChangeLog
27
ChangeLog
@ -1,3 +1,30 @@
|
||||
2000-10-02 Allan Rae <rae@lyx.org>
|
||||
|
||||
* src/frontends/xforms/FormPreferences.[Ch] (restore): D'oh.
|
||||
Left this one out by accident.
|
||||
|
||||
* src/frontends/xforms/FormBase.h (restore): default to calling
|
||||
update() since that will restore the original/currently-applied values.
|
||||
Any input() triggered error messages will require the derived classes
|
||||
to redefine restore().
|
||||
|
||||
* src/frontends/xforms/FormDocument.C: initialize a few variables to
|
||||
avoid a segfault. combo_doc_class is the main concern.
|
||||
|
||||
2000-10-01 Kayvan A. Sylvan <kayvan@camel.internal.sylvan.com>
|
||||
|
||||
* Simplify build-listerrors in view of GUI-less export ability!
|
||||
|
||||
2000-10-01 Dekel Tsur <dekelts@tau.ac.il>
|
||||
|
||||
* src/lyx_main.C (easyParse): Disable gui when exporting
|
||||
|
||||
* src/insets/figinset.C:
|
||||
* src/LaTeX.C
|
||||
* src/converter.C
|
||||
* src/lyx_gui_misc.C
|
||||
* src/tabular.C: Changes to allow no-gui.
|
||||
|
||||
2000-10-02 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
|
||||
* src/support/utility.hpp: removed file
|
||||
|
@ -3,81 +3,17 @@
|
||||
# Attempt to build listerrors (see examples/Literate.lyx) at build-time
|
||||
#
|
||||
# Author: Kayvan Sylvan <kayvan@sylvan.com>
|
||||
|
||||
fakeprogram()
|
||||
{
|
||||
L=listerrors
|
||||
echo "#!/bin/sh" > $L
|
||||
echo 'echo "This is NOT the listerrors program."' >> $L
|
||||
echo 'echo ""' >> $L
|
||||
echo 'echo "Here was the problem when we tried to build listerrors:"' >> $L
|
||||
echo echo "$1" >> $L
|
||||
chmod +x $L
|
||||
exit 0
|
||||
}
|
||||
|
||||
mywhich()
|
||||
{
|
||||
arg=$1
|
||||
for i in `echo $PATH | sed 's/:/ /g'`
|
||||
do
|
||||
if [ -x $i/$arg ]
|
||||
then
|
||||
echo $i/$arg
|
||||
fi
|
||||
done
|
||||
}
|
||||
#
|
||||
# Assume notangle is on the path
|
||||
|
||||
if [ -r ../src/lyx ]
|
||||
then
|
||||
lyx=../src/lyx
|
||||
else
|
||||
lyx=`mywhich lyx`
|
||||
# Assumed to be on the path
|
||||
lyx=lyx
|
||||
fi
|
||||
|
||||
if [ -z "$lyx" ]
|
||||
then
|
||||
echo "You must build lyx first to build listerrors."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
notangle=`mywhich notangle`
|
||||
|
||||
if [ -z "$notangle" ]
|
||||
then
|
||||
fakeprogram "The NOWEB notangle was not found."
|
||||
fi
|
||||
|
||||
vncserver=`mywhich vncserver`
|
||||
if [ -z "$vncserver" ]
|
||||
then
|
||||
# See if DISPLAY is set
|
||||
#
|
||||
if [ -z "$DISPLAY" ]
|
||||
then
|
||||
fakeprogram "Could not export Literate.nw. Export needs GUI, fix lyx!"
|
||||
else
|
||||
$lyx --export tex examples/Literate.lyx
|
||||
fi
|
||||
else
|
||||
# Use the vncserver to make a silent export
|
||||
if [ -r $HOME/.vnc/passwd ]
|
||||
then
|
||||
had_vnc_passwd=1
|
||||
else
|
||||
mkdir $HOME/.vnc > /dev/null 2>&1
|
||||
had_vnc_passwd=0
|
||||
touch $HOME/.vnc/passwd; chmod 700 $HOME/.vnc/passwd
|
||||
fi
|
||||
$vncserver :10 -depth 16
|
||||
DISPLAY=:10
|
||||
export DISPLAY
|
||||
$lyx --export tex examples/Literate.lyx
|
||||
$vncserver -kill :10
|
||||
if [ $had_vnc_passwd -eq 0 ]
|
||||
then
|
||||
rm $HOME/.vnc/passwd
|
||||
fi
|
||||
fi
|
||||
$lyx --export tex examples/Literate.lyx
|
||||
mv examples/Literate.tex Literate.nw
|
||||
$notangle -Rbuild-script Literate.nw | sh
|
||||
notangle -Rbuild-script Literate.nw | sh
|
||||
|
@ -43,6 +43,7 @@ src/frontends/kde/FormToc.C
|
||||
src/frontends/kde/formtocdialog.C
|
||||
src/frontends/kde/FormUrl.C
|
||||
src/frontends/kde/formurldialog.C
|
||||
src/frontends/xforms/FormBase.h
|
||||
src/frontends/xforms/FormCitation.C
|
||||
src/frontends/xforms/form_citation.C
|
||||
src/frontends/xforms/FormCopyright.C
|
||||
|
25
src/LaTeX.C
25
src/LaTeX.C
@ -31,6 +31,7 @@
|
||||
#include "bufferlist.h"
|
||||
#include "minibuffer.h"
|
||||
#include "gettext.h"
|
||||
#include "lyx_gui_misc.h"
|
||||
|
||||
using std::ifstream;
|
||||
using std::getline;
|
||||
@ -152,8 +153,8 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
||||
<< "Dependency file has changed" << endl;
|
||||
lyxerr[Debug::LATEX]
|
||||
<< "Run #" << count << endl;
|
||||
minib->Set(string(_("LaTeX run number ")) + tostr(count));
|
||||
minib->Store();
|
||||
WriteStatus(minib,
|
||||
string(_("LaTeX run number ")) + tostr(count));
|
||||
this->operator()();
|
||||
scanres = scanLogFile(terr);
|
||||
if (scanres & LaTeX::ERRORS) {
|
||||
@ -177,8 +178,8 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
||||
lyxerr[Debug::LATEX]
|
||||
<< "Run #" << count << endl;
|
||||
head.insert(file, true);
|
||||
minib->Set(string(_("LaTeX run number ")) + tostr(count));
|
||||
minib->Store();
|
||||
WriteStatus(minib,
|
||||
string(_("LaTeX run number ")) + tostr(count));
|
||||
this->operator()();
|
||||
scanres = scanLogFile(terr);
|
||||
if (scanres & LaTeX::ERRORS) {
|
||||
@ -203,8 +204,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
||||
if (head.haschanged(OnlyFilename(ChangeExtension(file, ".idx")))) {
|
||||
// no checks for now
|
||||
lyxerr[Debug::LATEX] << "Running MakeIndex." << endl;
|
||||
minib->Set(_("Running MakeIndex."));
|
||||
minib->Store();
|
||||
WriteStatus(minib, _("Running MakeIndex."));
|
||||
rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx")));
|
||||
}
|
||||
|
||||
@ -217,8 +217,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
||||
// tags is found -> run bibtex and set rerun = true;
|
||||
// no checks for now
|
||||
lyxerr[Debug::LATEX] << "Running BibTeX." << endl;
|
||||
minib->Set(_("Running BibTeX."));
|
||||
minib->Store();
|
||||
WriteStatus(minib, _("Running BibTeX."));
|
||||
rerun = runBibTeX(OnlyFilename(ChangeExtension(file, ".aux")),
|
||||
head);
|
||||
}
|
||||
@ -242,8 +241,8 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
||||
<< "Dep. file has changed or rerun requested" << endl;
|
||||
lyxerr[Debug::LATEX]
|
||||
<< "Run #" << count << endl;
|
||||
minib->Set(string(_("LaTeX run number ")) + tostr(count));
|
||||
minib->Store();
|
||||
WriteStatus(minib,
|
||||
string(_("LaTeX run number ")) + tostr(count));
|
||||
this->operator()();
|
||||
scanres = scanLogFile(terr);
|
||||
if (scanres & LaTeX::ERRORS) {
|
||||
@ -270,8 +269,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
||||
if (head.haschanged(OnlyFilename(ChangeExtension(file, ".idx")))) {
|
||||
// no checks for now
|
||||
lyxerr[Debug::LATEX] << "Running MakeIndex." << endl;
|
||||
minib->Set(_("Running MakeIndex."));
|
||||
minib->Store();
|
||||
WriteStatus(minib, _("Running MakeIndex."));
|
||||
rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx")));
|
||||
}
|
||||
|
||||
@ -292,8 +290,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
||||
rerun = false;
|
||||
++count;
|
||||
lyxerr[Debug::LATEX] << "Run #" << count << endl;
|
||||
minib->Set(string(_("LaTeX run number ")) + tostr(count));
|
||||
minib->Store();
|
||||
WriteStatus(minib, string(_("LaTeX run number ")) + tostr(count));
|
||||
this->operator()();
|
||||
scanres = scanLogFile(terr);
|
||||
if (scanres & LaTeX::ERRORS) {
|
||||
|
@ -435,36 +435,39 @@ bool Converter::runLaTeX(Buffer * buffer, string const & command)
|
||||
{
|
||||
|
||||
BufferView * bv = buffer->getUser();
|
||||
|
||||
if (!bv->text) return 0;
|
||||
|
||||
ProhibitInput(bv);
|
||||
|
||||
string name = buffer->getLatexName();
|
||||
bool need_redraw = false;
|
||||
|
||||
bv->owner()->getMiniBuffer()->Set(_("Running LaTeX..."));
|
||||
if (bv) {
|
||||
ProhibitInput(bv);
|
||||
bv->owner()->getMiniBuffer()->Set(_("Running LaTeX..."));
|
||||
// Remove all error insets
|
||||
need_redraw = bv->removeAutoInsets();
|
||||
}
|
||||
|
||||
// Remove all error insets
|
||||
bool a = bv->removeAutoInsets();
|
||||
|
||||
// do the LaTex run(s)
|
||||
TeXErrors terr;
|
||||
LaTeX latex(command, name, buffer->filepath);
|
||||
int result = latex.run(terr,
|
||||
bv->owner()->getMiniBuffer()); // running latex
|
||||
bv ? bv->owner()->getMiniBuffer() : 0);
|
||||
|
||||
if ((result & LaTeX::ERRORS)) {
|
||||
// Insert all errors as errors boxes
|
||||
bv->insertErrors(terr);
|
||||
|
||||
if (bv) {
|
||||
if ((result & LaTeX::ERRORS)) {
|
||||
// Insert all errors as errors boxes
|
||||
bv->insertErrors(terr);
|
||||
need_redraw = true;
|
||||
}
|
||||
|
||||
// if we removed error insets before we ran LaTeX or if we inserted
|
||||
// error insets after we ran LaTeX this must be run:
|
||||
if (need_redraw) {
|
||||
bv->redraw();
|
||||
bv->fitCursor(bv->text);
|
||||
}
|
||||
}
|
||||
|
||||
// if we removed error insets before we ran LaTeX or if we inserted
|
||||
// error insets after we ran LaTeX this must be run:
|
||||
if (a || (result & LaTeX::ERRORS)){
|
||||
bv->redraw();
|
||||
bv->fitCursor(bv->text);
|
||||
}
|
||||
|
||||
// check return value from latex.run().
|
||||
if ((result & LaTeX::NO_LOGFILE)) {
|
||||
WriteAlert(_("LaTeX did not work!"),
|
||||
@ -484,7 +487,9 @@ bool Converter::runLaTeX(Buffer * buffer, string const & command)
|
||||
WriteAlert(_("There were errors during the LaTeX run."),
|
||||
s, t);
|
||||
}
|
||||
AllowInput(bv);
|
||||
|
||||
if (bv)
|
||||
AllowInput(bv);
|
||||
|
||||
return (result & (LaTeX::NO_LOGFILE | LaTeX::ERRORS)) == 0;
|
||||
|
||||
|
@ -97,7 +97,9 @@ protected:
|
||||
hide();
|
||||
}
|
||||
/// Restore from dialog
|
||||
virtual void restore() {}
|
||||
virtual void restore() {
|
||||
update();
|
||||
}
|
||||
/// delete derived class variables when hide()ing
|
||||
virtual void clearStore() {}
|
||||
/// Pointer to the actual instantiation of xform's form
|
||||
|
@ -61,14 +61,13 @@ FormDocument::FormDocument(LyXView * lv, Dialogs * d)
|
||||
: FormBase(lv, d, BUFFER_DEPENDENT, _("Document Layout"),
|
||||
new NoRepeatedApplyReadOnlyPolicy),
|
||||
dialog_(0), paper_(0), class_(0), language_(0), options_(0),
|
||||
bullets_(0)
|
||||
bullets_(0), current_bullet_panel(0), current_bullet_depth(0),
|
||||
fbullet(0), combo_language(0), combo_doc_class(0)
|
||||
{
|
||||
// let the popup be shown
|
||||
// This is a permanent connection so we won't bother
|
||||
// storing a copy because we won't be disconnecting.
|
||||
d->showLayoutDocument.connect(slot(this, &FormDocument::show));
|
||||
current_bullet_depth = 0;
|
||||
current_bullet_panel = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -523,3 +523,12 @@ void FormPreferences::ok()
|
||||
FormBase::ok();
|
||||
lv_->getLyXFunc()->Dispatch(LFUN_SAVEPREFERENCES);
|
||||
}
|
||||
|
||||
|
||||
void FormPreferences::restore()
|
||||
{
|
||||
update();
|
||||
// if I add an error message line to the dialog it'll have to be controlled
|
||||
// within input(). I don't need it yet so I'll leave it commented out.
|
||||
// bc_.valid(input(0));
|
||||
}
|
||||
|
@ -52,6 +52,8 @@ private:
|
||||
virtual void ok();
|
||||
/// Apply from dialog
|
||||
virtual void apply();
|
||||
/// Restore from dialog
|
||||
virtual void restore();
|
||||
/// Filter the inputs -- return true if entries are valid
|
||||
virtual bool input(long);
|
||||
/// Build the dialog
|
||||
|
@ -905,6 +905,9 @@ void RegisterFigure(InsetFig * fi)
|
||||
static
|
||||
void UnregisterFigure(InsetFig * fi)
|
||||
{
|
||||
if (!lyxrc.use_gui)
|
||||
return;
|
||||
|
||||
Figref * tmpfig = fi->figure;
|
||||
|
||||
if (tmpfig->data) freefigdata(tmpfig->data);
|
||||
@ -1415,6 +1418,9 @@ void InsetFig::TempRegenerate()
|
||||
|
||||
void InsetFig::Recompute()
|
||||
{
|
||||
if (!lyxrc.use_gui)
|
||||
return;
|
||||
|
||||
bool changed = changedfname;
|
||||
int newx, newy, nraw_x, nraw_y;
|
||||
|
||||
|
@ -265,6 +265,16 @@ char const * flyx_ident_extract(char const * sc)
|
||||
}
|
||||
|
||||
|
||||
void WriteStatus(MiniBuffer * minib, string const & s)
|
||||
{
|
||||
if (minib) {
|
||||
minib->Set(s);
|
||||
minib->Store();
|
||||
} else
|
||||
lyxerr << s << endl;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
void WriteAlert(string const & s1, string const & s2, string const & s3)
|
||||
{
|
||||
@ -272,14 +282,17 @@ void WriteAlert(string const & s1, string const & s2, string const & s3)
|
||||
if (current_view && current_view->owner())
|
||||
minibuffer = current_view->owner()->getMiniBuffer();
|
||||
if (minibuffer) {
|
||||
/// Write to minibuffer
|
||||
ProhibitInput(current_view);
|
||||
minibuffer->Set(s1, s2, s3);
|
||||
}
|
||||
|
||||
fl_set_resource("flAlert.dismiss.label", _("Dismiss"));
|
||||
fl_show_alert(s1.c_str(), s2.c_str(), s3.c_str(), 0);
|
||||
if (minibuffer) {
|
||||
fl_set_resource("flAlert.dismiss.label", _("Dismiss"));
|
||||
fl_show_alert(s1.c_str(), s2.c_str(), s3.c_str(), 0);
|
||||
AllowInput(current_view);
|
||||
} else {
|
||||
/// Write to lyxerr
|
||||
lyxerr << "----------------------------------------" << endl
|
||||
<< s1 << endl << s2 << endl << s3 << endl
|
||||
<< "----------------------------------------" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include "LString.h"
|
||||
#include <utility> /* needed for pair<> definition */
|
||||
|
||||
class MiniBuffer;
|
||||
|
||||
/// Prevents LyX from being killed when the close box is pressed in a popup.
|
||||
extern "C" int CancelCloseBoxCB(FL_FORM *, void *);
|
||||
/// Prevents LyX from being killed when the close box is pressed in a popup.
|
||||
@ -45,6 +47,9 @@ char const * flyx_ident_extract(char const * sc);
|
||||
/// Shortcut for flyx_ident_extract
|
||||
#define idex flyx_ident_extract
|
||||
|
||||
/// Show status message
|
||||
void WriteStatus(MiniBuffer * minib, string const & s);
|
||||
|
||||
/// Show message
|
||||
void WriteAlert(string const & s1, string const & s2 = string(),
|
||||
string const & s3 = string());
|
||||
|
@ -742,6 +742,7 @@ bool LyX::easyParse(int * argc, char * argv[])
|
||||
string type(argv[i+1]);
|
||||
removeargs = 2;
|
||||
batch_command = "buffer-export " + type;
|
||||
gui = false;
|
||||
} else
|
||||
lyxerr << _("Missing file type [eg latex, "
|
||||
"ps...] after ")
|
||||
|
@ -1417,7 +1417,7 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl)
|
||||
par->InsertChar(i, ' ');
|
||||
}
|
||||
}
|
||||
par->CopyIntoMinibuffer(current_view->buffer()->params, i);
|
||||
par->CopyIntoMinibuffer(owner_->BufferOwner()->params, i);
|
||||
inset->par->InsertFromMinibuffer(inset->par->Last());
|
||||
}
|
||||
delete par;
|
||||
|
Loading…
Reference in New Issue
Block a user