GUIRuntime init ?
Hi, we still have gui code in main.C My question is what would break if this was moved into the ctor for LyXGUI, making GUIRuntime a non-static, with LyXGUI storing a pointer to it ? Would the Gnome stuff break ? Marko ? This seems the nicest solution (?). Alternatively a static init() method could be added to GUIRunTime ? thanks john -- "Premature generalization is the root of all evil." - Karl Fogel
Re: The default language
On Fri, Sep 08, 2000 at 03:22:07PM +0200, Juergen Vigna wrote: You also would have seen that the save-file format is exactly the same so the .lyx format didn't change because of this, just now it IS possible to see that the language in LyXFont IS the document wide language and so I can see that also without having to compare it to the buffer-language. IMO THIS is much cleaner! But you do compare the language to the buffer's language. For example, at LyXText::draw: if (lyxrc.mark_foreign_language + font.language()-lang() != "default" font.language() != bview-buffer()-params.language_info) { while the old code didn't have the '+' line. Overall, your changed ADDED 19 new lines, so I wouldn't call the new code cleaner! Moreover, (and I've already said that), I think that we need to delete the "default" language from the document languages list. This option only leads to confusion. No because the default is the language of your LaTeX installation, if you don't like the "default" as default then just save it in your local profile and tell us which real language your new files should have, this is already implemented! But what happens when you send the file to someone whose default LaTex language is different ? BTW: I need the "default" language otherwise the language of old tabulars when converted will always been american independent of the language of the document, I could have fixed this in another way, but IMO this way is the cleanest. When you insert a table in a paragraph with a language different than the buffer's language, and you begin typing in a cell, the language you get is the buffer's language, and not the paragraph's language as you might expect. Fixing this problem may fix the problem of reading old files, without the need for the "default" language.
Re: New export code
On Thu, Sep 07, 2000 at 12:26:45PM +0100, Jose Abilio Oliveira Matos wrote: On Wed, Sep 06, 2000 at 12:45:29AM +0300, Dekel Tsur wrote: On Tue, Sep 05, 2000 at 04:27:54PM +0100, Jose Abilio Oliveira Matos wrote: Also is it possible to have different viewers for docbook and linuxdoc. Example: most of the times the lyx file, when converted from docbook (or linuxdoc) to html generates a directory. I was aware of the problem, and I will fix it soon (I'm thinking of adding a converter flag which tells that the output of the converter is put in a directory). That will be very usefull, for latex to html also. Here is a patch that solves this problem (and others). A \\converter line in lyxrc has 4 parameters from, to ,flags where flags is a list of comma separated flags. Known flags are - originaldir : The converter must be invoked in the directory of the lyx file and not in the temporary directory. This is needed for tex-html converters in order to be able to read the eps files. - needaux : The converted uses the .aux file, so we need to call latex before running the converter. - resultdir=dir : The converter put all the files in dir. Using "resultdir" is same as "resultdir=$$Basename". Note: When exporting, the whole directory will be moved from the temporary directory to the target directory. - resultfile=file : Name of main file in the result directory, for example "index.html" or "$$BaseName.html" If "resultfile" is omitted, the name of this file is assumed to be "index.format" Examples: (1) \converter tex html "latex2html -no_subdir -split 0 $$FName" "originaldir,needaux" (2) \converter tex html "latex2html -split 0 $$FName" "originaldir,needaux,resultdir" (3) \converter tex html "latex2html -dir $$BaseName_html $$FName" "originaldir,needaux,resultdir=$$BaseName_html" Suppose we convert the file foo.tex to html In (1), we will call "netscape TMPDIR/foo.html" to view the file, and when exporting we will move "TMPDIR/foo.html" to "ORIGDIR/foo.html" In (2) we will call "netscape TMPDIR/foo/index.html" to view the file, and when exporting we will move "TMPDIR/foo" to "ORIGDIR/foo" In (2) we will call "netscape TMPDIR/foo_html/index.html" to view the file, and when exporting we will move "TMPDIR/foo_html" to "ORIGDIR/foo_html" PS: There is a problem with the export code when TMPDIR and ORIGDIR are not on same file system. How can this be tested? patch.gz
Re: GUIRuntime init ?
On Sat, 9 Sep 2000, John Levon wrote: My question is what would break if this was moved into the ctor for LyXGUI, making GUIRuntime a non-static, with LyXGUI storing a pointer to it ? Would the Gnome stuff break ? Marko ? no problem. it should be very similar to kde. marko
subscribe lyx-devel
subscribe lyx-devel
GUIRuntime init ?
Hi, we still have gui code in main.C My question is what would break if this was moved into the ctor for LyXGUI, making GUIRuntime a non-static, with LyXGUI storing a pointer to it ? Would the Gnome stuff break ? Marko ? This seems the nicest solution (?). Alternatively a static init() method could be added to GUIRunTime ? thanks john -- "Premature generalization is the root of all evil." - Karl Fogel
Re: The "default" language
On Fri, Sep 08, 2000 at 03:22:07PM +0200, Juergen Vigna wrote: > You also would have seen that the save-file format is exactly the same > so the .lyx format didn't change because of this, just now it IS possible > to see that the language in LyXFont IS the document wide language and so > I can see that also without having to compare it to the buffer->language. > > IMO THIS is much cleaner! But you do compare the language to the buffer's language. For example, at LyXText::draw: if (lyxrc.mark_foreign_language && + font.language()->lang() != "default" && font.language() != bview->buffer()->params.language_info) { while the old code didn't have the '+' line. Overall, your changed ADDED 19 new lines, so I wouldn't call the new code cleaner! > > Moreover, (and I've already said that), I think that we need to > > delete the "default" language from the document languages list. > > This option only leads to confusion. > > No because the default is the language of your LaTeX installation, if > you don't like the "default" as default then just save it in your local > profile and tell us which real language your new files should have, this > is already implemented! But what happens when you send the file to someone whose default LaTex language is different ? > BTW: I need the "default" language otherwise the language of old tabulars > when converted will always been american independent of the language > of the document, I could have fixed this in another way, but IMO this > way is the cleanest. When you insert a table in a paragraph with a language different than the buffer's language, and you begin typing in a cell, the language you get is the buffer's language, and not the paragraph's language as you might expect. Fixing this problem may fix the problem of reading old files, without the need for the "default" language.
Re: New export code
On Thu, Sep 07, 2000 at 12:26:45PM +0100, Jose Abilio Oliveira Matos wrote: > On Wed, Sep 06, 2000 at 12:45:29AM +0300, Dekel Tsur wrote: > > On Tue, Sep 05, 2000 at 04:27:54PM +0100, Jose Abilio Oliveira Matos wrote: > > > Also is it possible to have different viewers for docbook and linuxdoc. > > > Example: most of the times the lyx file, when converted from docbook (or > > > linuxdoc) to html generates a directory. > > > > > I was aware of the problem, and I will fix it soon (I'm thinking of adding a > > converter flag which tells that the output of the converter is put in a > > directory). > > That will be very usefull, for latex to html also. Here is a patch that solves this problem (and others). A \\converter line in lyxrc has 4 parameters from, to ,flags where flags is a list of comma separated flags. Known flags are - originaldir : The converter must be invoked in the directory of the lyx file and not in the temporary directory. This is needed for tex->html converters in order to be able to read the eps files. - needaux : The converted uses the .aux file, so we need to call latex before running the converter. - resultdir=dir : The converter put all the files in dir. Using "resultdir" is same as "resultdir=$$Basename". Note: When exporting, the whole directory will be moved from the temporary directory to the target directory. - resultfile=file : Name of main file in the result directory, for example "index.html" or "$$BaseName.html" If "resultfile" is omitted, the name of this file is assumed to be "index.format" Examples: (1) \converter tex html "latex2html -no_subdir -split 0 $$FName" "originaldir,needaux" (2) \converter tex html "latex2html -split 0 $$FName" "originaldir,needaux,resultdir" (3) \converter tex html "latex2html -dir $$BaseName_html $$FName" "originaldir,needaux,resultdir=$$BaseName_html" Suppose we convert the file foo.tex to html In (1), we will call "netscape TMPDIR/foo.html" to view the file, and when exporting we will move "TMPDIR/foo.html" to "ORIGDIR/foo.html" In (2) we will call "netscape TMPDIR/foo/index.html" to view the file, and when exporting we will move "TMPDIR/foo" to "ORIGDIR/foo" In (2) we will call "netscape TMPDIR/foo_html/index.html" to view the file, and when exporting we will move "TMPDIR/foo_html" to "ORIGDIR/foo_html" PS: There is a problem with the export code when TMPDIR and ORIGDIR are not on same file system. How can this be tested? patch.gz
Re: GUIRuntime init ?
On Sat, 9 Sep 2000, John Levon wrote: > My question is what would break if this was moved into the ctor > for LyXGUI, making GUIRuntime a non-static, with LyXGUI storing a pointer > to it ? > > Would the Gnome stuff break ? Marko ? no problem. it should be very similar to kde. marko
subscribe lyx-devel
subscribe lyx-devel