Hi everyone.
I updated the patch for the i18n comment that Jean-Marc made.
It's still not right, though. It's almost correct.
Can someone tell me what I missed in this patch? I'm trying to get the
keyboard shortcuts for File->Import->Noweb to work right (``Alt-f i n'')
but the only thing that shows up for ``Alt-f i'' is ``a l p'' (no
"n"). I must have missed another step.
Index: src/Makefile.in
===================================================================
RCS file: /usr/local/lyxsrc/cvsroot/lyx-1_0_x/src/Makefile.in,v
retrieving revision 1.9
diff -u -r1.9 Makefile.in
--- Makefile.in 1999/04/06 22:09:42 1.9
+++ Makefile.in 1999/05/04 16:45:01
@@ -103,7 +103,7 @@
ParagraphExtra.C FontInfo.C FontLoader.C insetparent.C \
LyXSendto.C Bullet.C bullet_forms.C bullet_forms_cb.C insetloa.C \
trans_mgr.C chset.C Chktex.C insetspecialchar.C lyxlookup.C \
- ImportLaTeX.C Literate.C
+ ImportLaTeX.C ImportNoweb.C Literate.C
OBJS = main.o lyx_main.o lyx_gui.o lyx.o lyx_cb.o lyxfr0.o lyxfr1.o \
inset.o lyxfont.o \
@@ -129,7 +129,7 @@
ParagraphExtra.o FontInfo.o FontLoader.o insetparent.o \
LyXSendto.o Bullet.o bullet_forms.o bullet_forms_cb.o insetloa.o \
trans_mgr.o chset.o Chktex.o insetspecialchar.o lyxlookup.o \
- ImportLaTeX.o Literate.o
+ ImportLaTeX.o ImportNoweb.o Literate.o
# for replacement functions like strerror()
LIBOBJS = @LIBOBJS@
@@ -313,7 +313,7 @@
formula.h toolbar.h combox.h spellchecker.h minibuffer.h LyXView.h \
menus.h insetindex.h insetinclude.h filetools.h filedlg.h \
lyx_gui_misc.h FileInfo.h lyxrc.h trans_mgr.h trans_decl.h \
- ImportLaTeX.h
+ ImportLaTeX.h ImportNoweb.h
credits.o: credits.C credits.h credits_form.h LString.h filetools.h \
error.h lyx_gui_misc.h gettext.h
menus.o: menus.C menus.h lyx.h lyx_cb.h version.h lyxfont.h LString.h \
@@ -715,6 +715,13 @@
lyxdraw.h error.h LaTeXFeatures.h
lyxlookup.o: lyxlookup.C error.h LString.h
ImportLaTeX.o: ImportLaTeX.C ImportLaTeX.h LString.h lyxrc.h toolbar.h \
+ lyxfunc.h commandtags.h kbmap.h tex-accent.h LyXAction.h lyxinset.h \
+ definitions.h gettext.h lyxfont.h lyxlex.h lyxscreen.h lyxdraw.h \
+ combox.h syscall.h filetools.h error.h bufferlist.h buffer.h undo.h \
+ lyxparagraph.h table.h textutils.h vspace.h insetbib.h insetcommand.h \
+ BufferView.h lyxvc.h latexoptions.h bufferparams.h Spacing.h Bullet.h \
+ insetquotes.h texrow.h lyxtext.h layout.h lyxrow.h lyxcursor.h
+ImportNoweb.o: ImportNoweb.C ImportNoweb.h LString.h lyxrc.h toolbar.h \
lyxfunc.h commandtags.h kbmap.h tex-accent.h LyXAction.h lyxinset.h \
definitions.h gettext.h lyxfont.h lyxlex.h lyxscreen.h lyxdraw.h \
combox.h syscall.h filetools.h error.h bufferlist.h buffer.h undo.h \
Index: src/lyxfunc.C
===================================================================
RCS file: /usr/local/lyxsrc/cvsroot/lyx-1_0_x/src/lyxfunc.C,v
retrieving revision 1.13
diff -u -r1.13 lyxfunc.C
--- lyxfunc.C 1999/04/08 05:12:32 1.13
+++ lyxfunc.C 1999/05/04 16:45:32
@@ -57,6 +57,7 @@
#include "gettext.h"
#include "trans_mgr.h"
#include "ImportLaTeX.h"
+#include "ImportNoweb.h"
// $Id: lyxfunc.C,v 1.7 1998/10/13 22:40:55 asger Exp $
@@ -742,13 +743,16 @@
// latex
if (imtyp == "latex") {
- doImportLaTeX();
+ doImportLaTeX(false);
}
// ascii
else if (imtyp == "ascii") {
doImportASCII(false);
} else if (imtyp == "asciiparagraph") {
doImportASCII(true);
+ // noweb
+ } else if (imtyp == "noweb") {
+ doImportLaTeX(true);
} else {
setErrorMessage(LString(N_("Unknown import type: "))
+ imtyp);
@@ -2638,7 +2642,7 @@
}
-void LyXFunc::doImportLaTeX()
+void LyXFunc::doImportLaTeX(bool isnoweb)
{
LString initpath = lyxrc->document_path;
LyXFileDlg fileDlg;
@@ -2655,8 +2659,15 @@
fileDlg.SetButton(0, _("Documents"), lyxrc->document_path);
fileDlg.SetButton(1, _("Examples"),
AddPath(system_lyxdir, "examples"));
- LString filename = fileDlg.Select(_("Select LaTeX file to Import"),
+ LString filename;
+ if (isnoweb) {
+ filename = fileDlg.Select(_("Select Noweb file to Import"),
+ initpath, "*.nw");
+ } else {
+ filename = fileDlg.Select(_("Select LaTeX file to Import"),
initpath, "*.tex");
+ }
+
AllowInput();
// check selected filename
@@ -2701,17 +2712,28 @@
}
// loads document
- owner->getMiniBuffer()->Set(_("Importing LaTeX file"),
- MakeDisplayPath(filename), "...");
- ImportLaTeX myImport(filename);
- Buffer * openbuf = myImport.run();
+ Buffer * openbuf;
+ if (!isnoweb) {
+ owner->getMiniBuffer()->Set(_("Importing LaTeX file"),
+ MakeDisplayPath(filename), "...");
+ ImportLaTeX myImport(filename);
+ openbuf = myImport.run();
+ } else {
+ owner->getMiniBuffer()->Set(_("Importing Noweb file"),
+ MakeDisplayPath(filename), "...");
+ ImportNoweb myImport(filename);
+ openbuf = myImport.run();
+ }
if (openbuf) {
owner->currentView()->setBuffer(openbuf);
- owner->getMiniBuffer()->Set(_("LateX file "),
+ owner->getMiniBuffer()->Set(isnoweb ?
+ _("Noweb file ") : _("LateX file "),
MakeDisplayPath(filename),
_("imported."));
} else {
- owner->getMiniBuffer()->Set(_("Could not import LaTeX file"),
+ owner->getMiniBuffer()->Set(isnoweb ?
+ _("Could not import Noweb file") :
+ _("Could not import LaTeX file"),
MakeDisplayPath(filename));
}
}
Index: src/lyxfunc.h
===================================================================
RCS file: /usr/local/lyxsrc/cvsroot/lyx-1_0_x/src/lyxfunc.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 lyxfunc.h
--- lyxfunc.h 1998/10/26 22:18:36 1.1.1.1
+++ lyxfunc.h 1999/05/04 16:45:33
@@ -117,7 +117,7 @@
void MenuOpen();
///
- void doImportLaTeX();
+ void doImportLaTeX(bool);
///
void doImportASCII(bool);
Index: src/menus.C
===================================================================
RCS file: /usr/local/lyxsrc/cvsroot/lyx-1_0_x/src/menus.C,v
retrieving revision 1.11
diff -u -r1.11 menus.C
--- menus.C 1999/04/26 21:48:36 1.11
+++ menus.C 1999/05/04 16:45:41
@@ -407,10 +407,12 @@
_("Import%t"
"|LaTeX...%x30"
"|Ascii Text as Lines...%x31"
- "|Ascii Text as Paragraphs%x32"));
+ "|Ascii Text as Paragraphs%x32"
+ "|Noweb%x33"));
fl_setpup_shortcut(SubFileImport, 30, scex(_("FIM|Ll#l#L")));
fl_setpup_shortcut(SubFileImport, 31, scex(_("FIM|Aa#a#A")));
fl_setpup_shortcut(SubFileImport, 32, scex(_("FIM|Pp#p#P")));
+ fl_setpup_shortcut(SubFileImport, 33, scex(_("FIM|Ll#l#L")));
// Export sub-menu
@@ -495,8 +497,9 @@
bool hasReLyX = lyxrc->relyx_command != "none";
if (!hasReLyX) {
- // Disable import LaTeX
+ // Disable import LaTeX and Noweb
fl_setpup_mode(SubFileImport, 30, FL_PUP_GREY);
+ fl_setpup_mode(SubFileImport, 33, FL_PUP_GREY);
}
if (!hasLaTeX) {
@@ -566,6 +569,8 @@
break;
case 32: tmpfunc->Dispatch(LFUN_IMPORT, "asciiparagraph");
break;
+ case 33: tmpfunc->Dispatch(LFUN_IMPORT, "noweb");
+ break;
case 16: // export menu
case 40:
if (!LinuxDoc)
@@ -621,15 +626,18 @@
_("Import%t"
"|LaTeX...%x15"
"|Ascii Text as Lines...%x16"
- "|Ascii Text as Paragraphs...%x17"));
+ "|Ascii Text as Paragraphs...%x17"
+ "|Noweb...%x18"));
fl_setpup_shortcut(SubFileImport, 15, scex(_("FIM|Ll#l#L")));
fl_setpup_shortcut(SubFileImport, 16, scex(_("FIM|Aa#a#A")));
fl_setpup_shortcut(SubFileImport, 17, scex(_("FIM|Pp#p#P")));
+ fl_setpup_shortcut(SubFileImport, 18, scex(_("FIM|Ll#l#L")));
bool hasReLyX = lyxrc->relyx_command != "none";
if (!hasReLyX) {
- // Disable import LaTeX
+ // Disable import LaTeX and Noweb
fl_setpup_mode(SubFileImport, 15, FL_PUP_GREY);
+ fl_setpup_mode(SubFileImport, 18, FL_PUP_GREY);
}
// This can be done cleaner later.
@@ -691,6 +699,8 @@
case 16: tmpfunc->Dispatch(LFUN_IMPORT, "ascii");
break;
case 17: tmpfunc->Dispatch(LFUN_IMPORT, "asciiparagraph");
+ break;
+ case 18: tmpfunc->Dispatch(LFUN_IMPORT, "noweb");
break;
case 5:
tmpfunc->Dispatch(LFUN_QUIT);