Factor the export code between the two Dispatch methods, update .lyx and .sgml file headers, de.po updates.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@382 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 1999-12-15 17:42:22 +00:00
parent a320e34382
commit c32b845a53
7 changed files with 198 additions and 286 deletions

View File

@ -1,5 +1,23 @@
1999-12-15 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* src/buffer.C (writeFile): change once again the top comment in a
.lyx file to point to www.lyx.org and to use LYX_DOCVERSION
instead of an hardcoded version number.
(makeDocBookFile): ditto
* src/version.h: add new define LYX_DOCVERSION
* po/de.po: update from Pit Sütterlin
* lib/bind/de_menus.bind: ditto.
* src/lyxfunc.C (Dispatch): call MenuExport()
* src/buffer.C (Dispatch): ditto
* src/lyx_cb.C (MenuMakeHTML): new function, moved from
LyXFunc::Dispatch().
(MenuExport): new function, moved from
LyXFunc::Dispatch().
* src/trans_mgr.C (insert): small cleanup
* src/chset.C (loadFile): ditto

View File

@ -54,7 +54,7 @@
\bind "M-d p" "buffer-view-ps"
\bind "M-d i" "buffer-typeset"
\bind "M-d k" "buffer-typeset-ps"
\bind "M-d e" "build-program"
\bind "M-d r" "build-program"
\bind "M-d d" "buffer-print"
\bind "M-d f" "buffer-fax"
\bind "M-d m l" "buffer-import latex"

188
po/de.po
View File

@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: LyX 1.0.4\n"
"POT-Creation-Date: 1999-12-13 23:06+0100\n"
"PO-Revision-Date: 1999-12-01 00:20+01:00\n"
"PO-Revision-Date: 1999-12-15 00:20+01:00\n"
"Last-Translator: Peter Sütterlin <P.Suetterlin@astro.uu.nl>\n"
"Language-Team: German <de@li.org>\n"
"MIME-Version: 1.0\n"
@ -22,10 +22,9 @@ msgstr "Fehler!"
#: src/buffer.C:255
msgid "Specified file is unreadable: "
msgstr ""
msgstr "Die angegebene Datei ist nicht lesbar: "
#: src/buffer.C:265
#, fuzzy
msgid "Cannot open specified file: "
msgstr "Die angegebene Datei kann nicht geöffnet werden:"
@ -100,9 +99,8 @@ msgid "Error! Cannot write file: "
msgstr "Fehler! Die Datei kann nicht geschrieben werden: "
#: src/buffer.C:1240 src/buffer.C:1243
#, fuzzy
msgid "Error! Cannot open file: "
msgstr "Fehler! Die Datei kann nicht geschrieben werden: "
msgstr "Fehler! Die Datei kann nicht geöffnet werden: "
#: src/buffer.C:1291
msgid "Error: Cannot write file:"
@ -113,9 +111,8 @@ msgid "Error: Cannot open temporary file:"
msgstr "Fehler: Temporäre Datei kann nicht angelegt werden: "
#: src/buffer.C:1614
#, fuzzy
msgid "Error: Cannot open file: "
msgstr "Fehler! Die Datei kann nicht geschrieben werden werden: "
msgstr "Fehler! Die Datei kann nicht geöffnet werden: "
#: src/buffer.C:2187 src/buffer.C:2777 src/buffer.C:3604 src/buffer.C:3626
#: src/paragraph.C:3577
@ -822,32 +819,28 @@ msgstr "Leerzeichen, '#', '~', '$' oder '%'."
#. / what appears in the minibuffer when opening
#: src/insets/figinset.h:51
#, fuzzy
msgid "Opened figure"
msgstr "Einfügung geöffnet"
msgstr "Abbildungs-Einfügung geöffnet"
#: src/insets/form_url.C:19
#, fuzzy
msgid "Url"
msgstr "Url: "
msgstr "Url"
#: src/insets/form_url.C:20
msgid "Url|#U"
msgstr "Url|#U"
#: src/insets/form_url.C:23
#, fuzzy
msgid "Name"
msgstr "Name:|#N"
msgstr "Name"
#: src/insets/form_url.C:24 src/lyx.C:171
msgid "Name|#N"
msgstr "Name:|#N"
#: src/insets/form_url.C:27
#, fuzzy
msgid "HTML type"
msgstr "HTML-Typ|#H"
msgstr "HTML-Typ"
#: src/insets/form_url.C:28
msgid "HTML type|#H"
@ -981,9 +974,8 @@ msgid "Index"
msgstr "Index"
#: src/insets/insetindex.C:111
#, fuzzy
msgid "Idx"
msgstr "Index"
msgstr "Idx"
#: src/insets/insetindex.C:139
msgid "PrintIndex"
@ -1000,9 +992,8 @@ msgstr "Schlie
#. / what appears in the minibuffer when opening
#: src/insets/insetinfo.h:60
#, fuzzy
msgid "Opened note"
msgstr "Einfügung geöffnet"
msgstr "Notiz geöffnet"
#. /
#: src/insets/insetloa.h:37
@ -1050,9 +1041,8 @@ msgstr "Url: "
#. /
#: src/insets/inseturl.h:61
#, fuzzy
msgid "Opened Url"
msgstr "Zeige Fehlermeldung"
msgstr "URL geöffnet"
#. / what appears in the minibuffer when opening
#: src/insets/lyxinset.h:95
@ -1084,9 +1074,8 @@ msgid "Running BibTeX."
msgstr "Starte BibTeX."
#: src/LaTeXLog.C:44
#, fuzzy
msgid "Unable to show log file!"
msgstr "Die Datei kann nicht gelesen werden!"
msgstr "Die Protokoll-Datei kann nicht angezeigt werden!"
#: src/LaTeXLog.C:47
msgid "NO LATEX LOG FILE!"
@ -1598,19 +1587,16 @@ msgid "Special Column Alignment"
msgstr "Besonderes Spaltenformat"
#: src/Literate.C:57
#, fuzzy
msgid "Weaving document"
msgstr "Dokument wird gespeichert"
msgstr "Dokument wird mit weave bearbeitet"
#: src/Literate.C:87
#, fuzzy
msgid "Building program"
msgstr "Starte Build"
#: src/LyXAction.C:92
#, fuzzy
msgid "Insert appendix"
msgstr "Marke einfügen"
msgstr "Anhang einfügen"
#: src/LyXAction.C:93
msgid "Describe command"
@ -1653,9 +1639,8 @@ msgid "Select to end of document"
msgstr "Auswählen bis zum Ende des Dokuments"
#: src/LyXAction.C:119
#, fuzzy
msgid "Export to"
msgstr "|Exportieren%m%l"
msgstr "Exportieren nach"
#: src/LyXAction.C:120
msgid "Fax"
@ -1690,9 +1675,8 @@ msgid "Revert to saved"
msgstr "Gespeicherte Version wiederherstellen"
#: src/LyXAction.C:136
#, fuzzy
msgid "Toggle read-only"
msgstr "Fett an/aus"
msgstr "Schreibschutz an/aus"
#: src/LyXAction.C:137
msgid "Update DVI"
@ -1855,19 +1839,16 @@ msgid "Insert hyphenation point"
msgstr "Trennmöglichkeit einfügen"
#: src/LyXAction.C:203
#, fuzzy
msgid "Insert index item"
msgstr "Randnotiz einfügen"
msgstr "Index-Element einfügen"
#: src/LyXAction.C:205
#, fuzzy
msgid "Insert last index item"
msgstr "Randnotiz einfügen"
msgstr "Letztes Index-Element einfügen"
#: src/LyXAction.C:206
#, fuzzy
msgid "Insert index list"
msgstr "BibTeX einfügen"
msgstr "Indexliste einfügen"
#: src/LyXAction.C:207
msgid "Turn off keymap"
@ -1890,9 +1871,8 @@ msgid "Insert Label"
msgstr "Marke einfügen"
#: src/LyXAction.C:214
#, fuzzy
msgid "View LaTeX log"
msgstr "LaTeX Protokoll"
msgstr "LaTeX Protokoll anzeigen"
#: src/LyXAction.C:218
msgid "Copy paragraph environment type"
@ -1919,19 +1899,16 @@ msgid "Select to end of line"
msgstr "Auswählen bis zum Ende der Zeile"
#: src/LyXAction.C:238
#, fuzzy
msgid "Insert list of algorithms"
msgstr "Liste der Algorithmen"
msgstr "Liste der Algorithmen einfügen"
#: src/LyXAction.C:240
#, fuzzy
msgid "Insert list of figures"
msgstr "Liste der Abbildungen"
msgstr "Liste der Abbildungen einfügen"
#: src/LyXAction.C:242
#, fuzzy
msgid "Insert list of tables"
msgstr "Liste der Tabellen"
msgstr "Liste der Tabellen einfügen"
#: src/LyXAction.C:243
msgid "Exit"
@ -1946,9 +1923,8 @@ msgid "Math Greek"
msgstr "Griechische Zeichen"
#: src/LyXAction.C:254
#, fuzzy
msgid "Insert math symbol"
msgstr "Marke einfügen"
msgstr "Mathematik-Symbol einfügen"
#: src/LyXAction.C:259
msgid "Math mode"
@ -2007,14 +1983,12 @@ msgid "Toggle TeX style"
msgstr "TeX Modus an/aus"
#: src/LyXAction.C:317
#, fuzzy
msgid "Insert table of contents"
msgstr "Inhaltsverzeichnis"
msgstr "Inhaltsverzeichnis einfügen"
#: src/LyXAction.C:319
#, fuzzy
msgid "View table of contents"
msgstr "Inhaltsverzeichnis"
msgstr "Inhaltsverzeichnis anzeigen"
#: src/LyXAction.C:321
msgid "Toggle cursor does/doesn't follow the scrollbar"
@ -2026,7 +2000,7 @@ msgstr "R
#: src/LyXAction.C:333
msgid "Register document under version control"
msgstr ""
msgstr "Dokument in Versionskontrolle registrieren"
#: src/LyXAction.C:555
msgid "No description available!"
@ -2270,10 +2244,9 @@ msgstr "Einzuf
#: src/lyx_cb.C:1166
msgid "Error! Specified file is unreadable: "
msgstr ""
msgstr "Fehler! Die angegebene Datei kann nicht gelesen werden: "
#: src/lyx_cb.C:1173
#, fuzzy
msgid "Error! Cannot open specified file: "
msgstr "Fehler! Die angegebene Datei kann nicht geöffnet werden:"
@ -2761,32 +2734,29 @@ msgid "Default"
msgstr "Standard"
#: src/lyxfr1.C:157 src/lyxfr1.C:213
#, fuzzy
msgid "Sorry!"
msgstr "Sorry."
msgstr "Sorry!"
#: src/lyxfr1.C:157 src/lyxfr1.C:213
msgid "You cannot replace a single space, nor an empty character."
msgstr ""
msgstr "Einzelne Leerzeichen und andere leere Zeichen können "
"nicht ersetzt werden"
#: src/lyxfr1.C:263 src/lyxfr1.C:328
#, fuzzy
msgid "String not found!"
msgstr "Der Zeichensatz wurde nicht gefunden!"
msgstr "Die Zeichenkette wurde nicht gefunden!"
#: src/lyxfr1.C:266
#, fuzzy
msgid "1 string has been replaced."
msgstr "Neukonfiguration wurde durchgeführt."
msgstr "Eine Zeichenkette wurde ersetzt."
#: src/lyxfr1.C:269
msgid " strings have been replaced."
msgstr ""
msgstr " Zeichenketten wurden ersetzt."
#: src/lyxfr1.C:324
#, fuzzy
msgid "Found."
msgstr "wurde geladen."
msgstr "Gefunden."
#: src/lyxfunc.C:295
msgid "Unknown sequence:"
@ -2812,12 +2782,11 @@ msgstr "Textmodus"
#: src/lyxfunc.C:837 src/lyxfunc.C:2920
msgid "Document exported as HTML to file `"
msgstr ""
msgstr "Dokument als HTML-Datei exportiert: `"
#: src/lyxfunc.C:840 src/lyxfunc.C:2923
#, fuzzy
msgid "Unable to convert to HTML the file `"
msgstr "Die Datei kann nicht gelesen werden!"
msgstr "Die Datei kann nicht nach HTML konvertiert werden: `"
#: src/lyxfunc.C:846 src/lyxfunc.C:2929
msgid "Unknown export type: "
@ -3128,9 +3097,8 @@ msgstr ""
"Falls Probleme auftreten, starten Sie LyX unter angabe des vollen Pfades."
#: src/lyx_main.C:269
#, fuzzy
msgid "LYX_DIR_11x environment variable no good."
msgstr "Die Umgebungsvariable LYX_DIR_10x ist unbrauchbar."
msgstr "Die Umgebungsvariable LYX_DIR_11x ist unbrauchbar."
#: src/lyx_main.C:271
msgid "System directory set to: "
@ -3145,9 +3113,8 @@ msgid "Try the '-sysdir' command line parameter or"
msgstr "Verwenden Sie die Kommandozeilenoption `-sysdir' oder setzen"
#: src/lyx_main.C:281
#, fuzzy
msgid "set the environment variable LYX_DIR_11x to the LyX system directory"
msgstr "Sie die Umgebungsvariable LYX_DIR_10x auf das LyX Systemverzeichnis,"
msgstr "Sie die Umgebungsvariable LYX_DIR_11x auf das LyX Systemverzeichnis,"
#: src/lyx_main.C:283
msgid "containing the file `chkconfig.ltx'."
@ -3238,36 +3205,53 @@ msgid ""
"\n"
"Check the LyX man page for more options."
msgstr ""
"Aufruf: lyx [ Befehlsoptionen ] [ name.lyx ... ]\n"
"Kommandozeilenoptionen (groß/klein beachten):\n"
"\t-help LyX Benutzung zusammenfassen\n"
"\t-sysdir x Setze das Systemverzeichnis auf x\n"
"\t-width x Legt die Breite des LyX Fensters fest\n"
"\t-height y Legt die Höhe des LyX Fensters fest\n"
"\t-xpos x Legt die hor. Position des LyX Fensters fest\n"
"\t-ypos y Legt die vert. Position des LyX Fensters fest\n"
"\t-dbg Feature[,Feature]...\n"
" Wählt die Themenbereiche aus, für die eine\n"
" ausführliche Fehlermeldung aktiviert wird.\n"
" Mit `lyx -dbg' erhalten Sie eine Liste der\n"
" vorhandenen Bereiche.\n"
"\t-Reverse Vertauscht Vordergrund- und Hintergrundfarben\n"
"\t-Mono Startet LyX im Schwarz-Weiß Modus\n"
"\t-FastSelection Verwendet eine schnellere Routine, um markierte\n"
" Bereiche anzuzeigen\n"
"\n"
"Weitere Optionen sind in der Online-Hilfe (man lyx) aufgeführt."
#: src/lyx_main.C:485
msgid "List of supported debug flags:"
msgstr ""
msgstr "Liste der unterstützten Debug Optionen:"
#: src/lyx_main.C:504
msgid "Missing directory for -sysdir switch!"
msgstr "Die Option -sysdir benötigt ein Verzeichnis!"
#: src/lyx_main.C:530
#, fuzzy
msgid "Missing command string after -x switch!"
msgstr "Die Option -dbg benötigt eine Zahl!"
msgstr "Die Option -x benötigt einen Befehl als Argument!"
#: src/lyx_main.C:556
#, fuzzy
msgid "Unknown file type '"
msgstr "Unbekannter Export-Typ: "
msgstr "Unbekannter Datei-Typ `"
#: src/lyx_main.C:557
msgid "' after "
msgstr ""
msgstr "' nach der "
#: src/lyx_main.C:558 src/lyx_main.C:563
msgid " switch!"
msgstr ""
msgstr " Option"
#: src/lyx_main.C:561
msgid "Missing file type [eg latex, ps...] after "
msgstr ""
msgstr "Fehlender Datei-Typ [zB latex, ps...] nach "
#: src/lyx_sendfax.C:21
msgid "Fax no.:|#F"
@ -3347,60 +3331,55 @@ msgid "Send Document to Command"
msgstr "Dokument an Shell-Befehl senden"
#: src/lyxvc.C:89 src/lyxvc.C:119
#, fuzzy
msgid "Save document and proceed?"
msgstr "Dokument speichern?"
msgstr "Dokument speichern und fortfahren?"
#: src/lyxvc.C:101
msgid "LyX VC: Initial description"
msgstr ""
msgstr "LyX VK: Anfängliche BEschreibung"
#: src/lyxvc.C:102
msgid "(no initial description)"
msgstr ""
msgstr "(keine anfängliche Beschreibung)"
#: src/lyxvc.C:105
#, fuzzy
msgid "Info"
msgstr "Ignorieren"
msgstr "Info"
#: src/lyxvc.C:105
msgid "This document has NOT been registered."
msgstr ""
msgstr "Dieses Dokument wurde NICHT registriert."
#: src/lyxvc.C:131
msgid "LyX VC: Log Message"
msgstr ""
msgstr "LyX VK: Protokollmeldung"
#: src/lyxvc.C:145
msgid "Ignore changes and proceed with check out?"
msgstr ""
msgstr "Änderungen ignorieren und mit Check-Out fortfahren?"
#. Here we should check if the buffer is dirty. And if it is
#. we should warn the user that reverting will discard all
#. changes made since the last check in.
#: src/lyxvc.C:160
msgid "When you revert, you will loose all changes made"
msgstr ""
msgstr "Mit Rückgängig verlieren Sie alle Änderungen, die an dem "
#: src/lyxvc.C:161
msgid "to the document since the last check in."
msgstr ""
msgstr "Dokument seit dem letzten Check-In durchgeführt wurden."
#: src/lyxvc.C:162
#, fuzzy
msgid "Do you still want to do it?"
msgstr "Möchten Sie das Dokument öffnen?"
msgstr "Möchten Sie trotzdem weitermachen?"
#: src/lyxvc.C:265
#, fuzzy
msgid "No VC History!"
msgstr "|Entwicklung anzeigen%x56"
msgstr "Keine Entwicklungsgeschichte der VK!"
#: src/lyxvc.C:272
#, fuzzy
msgid "VC History"
msgstr "|Entwicklung anzeigen%x56"
msgstr "Entwicklungsgeschichte VK"
#: src/LyXView.C:379 src/minibuffer.C:218
msgid " (Changed)"
@ -3436,9 +3415,8 @@ msgstr "Makro: "
#. / what appears in the minibuffer when opening
#: src/mathed/formulamacro.h:62
#, fuzzy
msgid "Math macro editor mode"
msgstr "Mathematik Modus"
msgstr "Mathematik Modus: Makro Editor"
#: src/mathed/math_forms.C:19
msgid "Close "
@ -3623,7 +3601,6 @@ msgid "FIM|Nn#n#N"
msgstr "FIM|Nn#n#N"
#: src/menus.C:489
#, fuzzy
msgid ""
"Export%t|as LaTeX...%x40|as DVI...%x41|as PostScript...%x42|as Ascii "
"Text...%x43|as HTML...%x44|Custom...%x45"
@ -3666,7 +3643,7 @@ msgstr "FEX|Tt#t#T"
#: src/menus.C:516
#, fuzzy
msgid "FEX|Hh#h#H"
msgstr "EMV|hH#h#H"
msgstr "FEX|Hh#h#H"
#: src/menus.C:517
msgid "FEX|mM#m#M"
@ -4243,9 +4220,8 @@ msgstr ""
"%l%x74|Algorithmus%x75"
#: src/menus.C:1594
#, fuzzy
msgid "IMF|gG#g#G"
msgstr "IM|Aa#a#A"
msgstr "IMF|Aa#a#A"
#: src/menus.C:1595
msgid "IMF|Tt#t#T"
@ -4570,9 +4546,8 @@ msgid "Senseless with this layout!"
msgstr "Unnötig mit diesem Layout!"
#: src/ParagraphExtra.C:147
#, fuzzy
msgid "Document is read-only. No changes to layout permitted."
msgstr "Schreibgeschütztes Dokument, keine Änderung möglich."
msgstr "Schreibgeschütztes Dokument, keine Änderung am Layout möglich."
#: src/ParagraphExtra.C:166
msgid "ParagraphExtra Layout"
@ -4846,9 +4821,8 @@ msgid "Error: Could not change to directory: "
msgstr "Fehler: Konnte nicht in das Verzeichnis wechseln: "
#: src/support/path.h:37
#, fuzzy
msgid "Error: Dir already popped: "
msgstr "Das Dokument ist bereits geöffnet:"
msgstr "Fehler! Das Verzeichnis wurde bereits vom Stapel genommen: "
#: src/TableLayout.C:416
msgid "Table Extra Form"

View File

@ -51,6 +51,7 @@ using std::setw;
#include "lyx_cb.h"
#include "minibuffer.h"
#include "lyxfont.h"
#include "version.h"
#include "mathed/formulamacro.h"
#include "insets/lyxinset.h"
#include "insets/inseterror.h"
@ -104,13 +105,7 @@ extern void SmallUpdate(signed char);
extern unsigned char GetCurrentTextClass();
extern void BeforeChange();
extern void MenuMakeLaTeX(Buffer *);
extern void MenuMakeLinuxDoc(Buffer *);
extern void MenuMakeDocBook(Buffer *);
extern void MenuRunLaTeX(Buffer *);
extern void MenuPrint(Buffer *);
extern void MenuMakeAscii(Buffer *);
extern void MenuSendto();
extern void MenuExport(Buffer *, string const &);
extern LyXAction lyxaction;
@ -1245,12 +1240,10 @@ bool Buffer::writeFile(string const & filename, bool flag)
return false;
}
// The top of the file should not be written by params.
// collect some very important information
string userName(getUserName()) ;
// write out a comment in the top of the file
ofs << "#LyX 1.1 Copyright 1995-1999 Matthias Ettrich"
" and the LyX Team\n";
ofs << '#' << LYX_DOCVERSION
<< " created this file. For more info see http://www.lyx.org/\n";
ofs.setf(ios::showpoint|ios::fixed);
ofs.precision(2);
ofs << "\\lyxformat " << setw(4) << LYX_FORMAT << "\n";
@ -2789,9 +2782,8 @@ void Buffer::makeDocBookFile(string const & filename, int column)
else
ofs << "\n [ " << params.preamble << " \n]>\n\n";
string userName(getUserName());
ofs << "<!-- DocBook file was created by LyX 1.1 (C) 1995-1999\n"
<< "by <" << userName << "> " << date() << " -->\n";
ofs << "<!-- DocBook file was created by " << LYX_DOCVERSION
<< "\n See http://www.lyx.org/ for more information -->\n";
if(params.options.empty())
sgmlOpenTag(ofs, 0, top_element);
@ -4204,86 +4196,10 @@ void Buffer::Dispatch(const string & command)
void Buffer::Dispatch(int action, const string & argument)
{
switch (action) {
case LFUN_EXPORT: {
// latex
if (argument == "latex") {
// make sure that this buffer is not linuxdoc
MenuMakeLaTeX(this);
}
// linuxdoc
else if (argument == "linuxdoc") {
// make sure that this buffer is not latex
MenuMakeLinuxDoc(this);
}
// docbook
else if (argument == "docbook") {
// make sure that this buffer is not latex or linuxdoc
MenuMakeDocBook(this);
}
// dvi
else if (argument == "dvi") {
// Run LaTeX as "Update dvi..." Bernhard.
// We want the dvi in the current directory. This
// is achieved by temporarily disabling use of
// temp directory. As a side-effect, we get
// *.log and *.aux files also. (Asger)
bool flag = lyxrc->use_tempdir;
lyxrc->use_tempdir = false;
MenuRunLaTeX(this);
lyxrc->use_tempdir = flag;
}
// postscript
else if (argument == "postscript") {
// Start Print-dialog. Not as good as dvi... Bernhard.
MenuPrint(this);
// Since the MenuPrint is a pop-up, we can't use
// the same trick as above. (Asger)
// MISSING: Move of ps-file :-|
}
// ascii
else if (argument == "ascii") {
MenuMakeAscii(this);
}
else if (argument == "custom") {
MenuSendto();
break;
}
// HTML
else if (argument == "html" && lyxrc->html_command != "none") {
// First, create LaTeX file
MenuMakeLaTeX(this);
// And now, run the converter
string file = fileName();
Path path(OnlyPath(file));
// the tex file name has to be correct for
// latex, but the html file name can be
// anything.
string result = ChangeExtension(file, ".html", false);
file = ChangeExtension(MakeLatexName(file), ".tex", false);
string tmp = lyxrc->html_command;
tmp = subst(tmp, "$$FName", file);
tmp = subst(tmp, "$$OutName", result);
Systemcalls one;
/*int res = */ one.startscript(Systemcalls::System, tmp);
//
// Hi, Asger. This time I plead guilty and I promise to clean it up
//
// if (res == 0) {
// setMessage(N_("Document exported as HTML to file `")
// + MakeDisplayPath(result) +'\ '');
// } else {
// setErrorMessage(N_("Unable to convert to HTML the file `")
// + MakeDisplayPath(file)
// + '\'');
// }
}
else {
// setErrorMessage(N_("Unknown export type: ")
// + argument);
}
}
break;
case LFUN_EXPORT:
MenuExport(this, argument);
break;
break;
default:
lyxerr << "A truly unknown func!" << endl;

View File

@ -87,6 +87,7 @@ extern BufferView * current_view; // called too many times in this file...
extern void DeleteSimpleCutBuffer(); /* for the cleanup when exiting */
extern bool send_fax(string const & fname, string const & sendcmd);
extern void MenuSendto();
extern LyXServer * lyxserver;
extern FontLoader fontloader;
@ -1016,6 +1017,88 @@ void MenuPrint(Buffer * buffer)
}
}
void MenuMakeHTML(Buffer * buffer)
{
// First, create LaTeX file
MenuMakeLaTeX(buffer);
// And now, run the converter
string file = buffer->fileName();
Path path(OnlyPath(file));
// the tex file name has to be correct for
// latex, but the html file name can be
// anything.
string result = ChangeExtension(file, ".html", false);
string infile = buffer->getLatexName();
string tmp = lyxrc->html_command;
tmp = subst(tmp, "$$FName", infile);
tmp = subst(tmp, "$$OutName", result);
Systemcalls one;
int res = one.startscript(Systemcalls::System, tmp);
if (res == 0) {
minibuffer->Set(_("Document exported as HTML to file `")
+ MakeDisplayPath(result) +'\'');
} else {
minibuffer->Set(_("Unable to convert to HTML the file `")
+ MakeDisplayPath(infile)
+ '\'');
}
}
void MenuExport(Buffer * buffer, string const & extyp)
{
// latex
if (extyp == "latex") {
// make sure that this buffer is not linuxdoc
MenuMakeLaTeX(buffer);
}
// linuxdoc
else if (extyp == "linuxdoc") {
// make sure that this buffer is not latex
MenuMakeLinuxDoc(buffer);
}
// docbook
else if (extyp == "docbook") {
// make sure that this buffer is not latex or linuxdoc
MenuMakeDocBook(buffer);
}
// dvi
else if (extyp == "dvi") {
// Run LaTeX as "Update dvi..." Bernhard.
// We want the dvi in the current directory. This
// is achieved by temporarily disabling use of
// temp directory. As a side-effect, we get
// *.log and *.aux files also. (Asger)
bool flag = lyxrc->use_tempdir;
lyxrc->use_tempdir = false;
MenuRunLaTeX(buffer);
lyxrc->use_tempdir = flag;
}
// postscript
else if (extyp == "postscript") {
// Start Print-dialog. Not as good as dvi... Bernhard.
MenuPrint(buffer);
// Since the MenuPrint is a pop-up, we can't use
// the same trick as above. (Asger)
// MISSING: Move of ps-file :-(
}
// ascii
else if (extyp == "ascii") {
MenuMakeAscii(buffer);
}
else if (extyp == "custom") {
MenuSendto();
}
// HTML
else if (extyp == "html") {
MenuMakeHTML(buffer);
}
else {
minibuffer->Set(_("Unknown export type: ")+ extyp);
}
}
void QuitLyX()
{

View File

@ -90,10 +90,7 @@ extern void MenuPrint(Buffer*);
extern void MenuSendto();
extern void QuitLyX();
extern void MenuFax(Buffer *);
extern void MenuMakeLaTeX(Buffer *);
extern void MenuMakeLinuxDoc(Buffer *);
extern void MenuMakeDocBook(Buffer *);
extern void MenuMakeAscii(Buffer *);
extern void MenuExport(Buffer *,string const &);
extern void MenuPasteSelection(char at);
extern LyXAction lyxaction;
// (alkis)
@ -768,86 +765,8 @@ string LyXFunc::Dispatch(int ac,
break;
case LFUN_EXPORT:
{
//needs argument as string
string extyp = argument;
// latex
if (extyp == "latex") {
// make sure that this buffer is not linuxdoc
MenuMakeLaTeX(owner->buffer());
}
// linuxdoc
else if (extyp == "linuxdoc") {
// make sure that this buffer is not latex
MenuMakeLinuxDoc(owner->buffer());
}
// docbook
else if (extyp == "docbook") {
// make sure that this buffer is not latex or linuxdoc
MenuMakeDocBook(owner->buffer());
}
// dvi
else if (extyp == "dvi") {
// Run LaTeX as "Update dvi..." Bernhard.
// We want the dvi in the current directory. This
// is achieved by temporarily disabling use of
// temp directory. As a side-effect, we get
// *.log and *.aux files also. (Asger)
bool flag = lyxrc->use_tempdir;
lyxrc->use_tempdir = false;
MenuRunLaTeX(owner->buffer());
lyxrc->use_tempdir = flag;
}
// postscript
else if (extyp == "postscript") {
// Start Print-dialog. Not as good as dvi... Bernhard.
MenuPrint(owner->buffer());
// Since the MenuPrint is a pop-up, we can't use
// the same trick as above. (Asger)
// MISSING: Move of ps-file :-(
}
// ascii
else if (extyp == "ascii") {
MenuMakeAscii(owner->buffer());
}
else if (extyp == "custom") {
MenuSendto();
break;
}
// HTML
else if (extyp == "html" && lyxrc->html_command != "none") {
// First, create LaTeX file
MenuMakeLaTeX(owner->buffer());
// And now, run the converter
string file = owner->buffer()->fileName();
Path path(OnlyPath(file));
// the tex file name has to be correct for
// latex, but the html file name can be
// anything.
string result = ChangeExtension(file, ".html", false);
string infile = owner->buffer()->getLatexName();
string tmp = lyxrc->html_command;
tmp = subst(tmp, "$$FName", infile);
tmp = subst(tmp, "$$OutName", result);
Systemcalls one;
int res = one.startscript(Systemcalls::System, tmp);
if (res == 0) {
setMessage(N_("Document exported as HTML to file `")
+ MakeDisplayPath(result) +'\'');
} else {
setErrorMessage(N_("Unable to convert to HTML the file `")
+ MakeDisplayPath(infile)
+ '\'');
}
}
else {
setErrorMessage(N_("Unknown export type: ")
+ extyp);
}
}
break;
MenuExport(owner->buffer(), argument);
break;
case LFUN_IMPORT:
{

View File

@ -1,3 +1,5 @@
/* Version and release date definition */
#define LYX_VERSION "1.1.4cvs"
#define LYX_RELEASE "Mon, Dec 13, 1999"
/* This version string is intended to be used in files created by LyX */
#define LYX_DOCVERSION "LyX 1.1"