Re: r21001 - /lyx-devel/trunk/src/frontends/qt4/GuiPrefs.cpp

2007-10-16 Thread Bo Peng
On 10/17/07, Andre Poenitz <[EMAIL PROTECTED]> wrote:
> On Wed, Oct 17, 2007 at 01:04:39AM -0500, Bo Peng wrote:
> > > The implementation may be awkward, but all LFUNs are now listed
> > > correctly. Please test and comment.
> >
> > BTW, I can only print out C-1 for bookmark-goto 1, whereas its
> > definition is C-~S-1 in cua.bind. What is this ~S? Can anyone help me
> > output C-~S-1 in the dialog?
>
> It means '... and don't care about the state of the shift key'.
>
> That's e.g. for people that like to access '1' by pressing Shift + some
> key.
>
> I am not sure that this is reversable. Maybe the keybindings would need
> to store an extra flag.
>

To avoid this problem, I think this should be replaced by

\bind C-1 blah
\bind C-S-1 blah

Bo


Re: close tab button...

2007-10-16 Thread Bennett Helm

On Oct 15, 2007, at 12:03 PM, Jürgen Spitzmüller wrote:


Bennett Helm wrote:

Do you know the filename of the icon?


No.


I've found one -- actually three, which correspond to the normal  
button appearance, its appearance when the mouse hovers over it, and  
its appearance when pressed. I'm not sure if that behavior can be  
replicated, but if not tab_close_hover.png is probably the best one  
to use.


These icons were converted from .tiff files found in the Camino web  
browser. I'm not sure about whether there are licensing issues. This  
is from Camino's web page (and I could find no more specific  
information):


Graphics Licensing

Graphics within Camino and on the Camino website are currently  
licensed from their authors. Work is underway to license all graphics  
in Camino, excluding the Camino logo, under the [MPL/LGPL/GPL] Tri- 
License used elsewhere.





Bennett


<><><>

Re: r21001 - /lyx-devel/trunk/src/frontends/qt4/GuiPrefs.cpp

2007-10-16 Thread Andre Poenitz
On Wed, Oct 17, 2007 at 01:04:39AM -0500, Bo Peng wrote:
> > The implementation may be awkward, but all LFUNs are now listed
> > correctly. Please test and comment.
> 
> BTW, I can only print out C-1 for bookmark-goto 1, whereas its
> definition is C-~S-1 in cua.bind. What is this ~S? Can anyone help me
> output C-~S-1 in the dialog?

It means '... and don't care about the state of the shift key'.

That's e.g. for people that like to access '1' by pressing Shift + some
key.

I am not sure that this is reversable. Maybe the keybindings would need
to store an extra flag.

Andre'


Re: Are graphics being cached?

2007-10-16 Thread Andre Poenitz
On Wed, Oct 17, 2007 at 01:14:41AM +0200, Enrico Forestieri wrote:
> On Tue, Oct 16, 2007 at 05:49:57PM -0400, Paul A. Rubin wrote:
> 
> > Juergen Spitzmueller wrote:
> > > Paul A. Rubin wrote:
> > > 
> > >> I'm not the only one experiencing this, but I'm on Win XP and the person
> > >> who pointed it out to me is on Vista, so possibly it's
> > >> Windows-specific.  Any thoughts?
> > > 
> > > This is probably http://bugzilla.lyx.org/show_bug.cgi?id=3172
> > > 
> > 
> > I think you are right.  I searched for a bug report using keyword 
> > 'graphics' but not 'lyxsum'.
> > 
> > I struggled a bit reading all the comments; some were out of context 
> > since I do not know the source code.  (As we say here, "ignorance is 
> > bliss".)  I don't know if the following observations will shed any light:
> > 
> > 1.  It happened to me with the document and image files all in a 
> > directory (C:/temp) with no spaces in the path.
> > 
> > 2.  When I closed/restarted LyX and reopened the document, the LyX temp 
> > buffer had the new version of the PNG file but the old version of the 
> > converted EPS file.
> > 
> > 3.  After assorted messing around, I found my way to C:\Documents and 
> > Settings\\Application Data\lyx15\cache.  In there I 
> 
> Use "%APPDATA%\lyx15" to refer to the user dir. It works with every
> Windows version.

Where is this cache coming from btw?

I seemingly missed the patch discussed on the list and yesterday found
per chance the cache on disk as I was trying to figure out why I still
have 375 stat64 calls on startup although I used icons compiled into the
binary.

Could it be that everything that's found in the cache is read/touched on
startup?

Andre'


Re: r21001 - /lyx-devel/trunk/src/frontends/qt4/GuiPrefs.cpp

2007-10-16 Thread Bo Peng
> The implementation may be awkward, but all LFUNs are now listed
> correctly. Please test and comment.

BTW, I can only print out C-1 for bookmark-goto 1, whereas its
definition is C-~S-1 in cua.bind. What is this ~S? Can anyone help me
output C-~S-1 in the dialog?

Thanks.
Bo


Re: r21001 - /lyx-devel/trunk/src/frontends/qt4/GuiPrefs.cpp

2007-10-16 Thread Bo Peng
On 10/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Author: bpeng
> Date: Wed Oct 17 07:13:34 2007
> New Revision: 21001
>
> URL: http://www.lyx.org/trac/changeset/21001
> Log:
> PrefShortcuts: iteratively add all LFUN to different categories
>
> Modified:
> lyx-devel/trunk/src/frontends/qt4/GuiPrefs.cpp

The implementation may be awkward, but all LFUNs are now listed
correctly. Please test and comment.

Bo


Re: Are graphics being cached?

2007-10-16 Thread Enrico Forestieri
On Tue, Oct 16, 2007 at 05:49:57PM -0400, Paul A. Rubin wrote:

> Juergen Spitzmueller wrote:
> > Paul A. Rubin wrote:
> > 
> >> I'm not the only one experiencing this, but I'm on Win XP and the person
> >> who pointed it out to me is on Vista, so possibly it's
> >> Windows-specific.  Any thoughts?
> > 
> > This is probably http://bugzilla.lyx.org/show_bug.cgi?id=3172
> > 
> 
> I think you are right.  I searched for a bug report using keyword 
> 'graphics' but not 'lyxsum'.
> 
> I struggled a bit reading all the comments; some were out of context 
> since I do not know the source code.  (As we say here, "ignorance is 
> bliss".)  I don't know if the following observations will shed any light:
> 
> 1.  It happened to me with the document and image files all in a 
> directory (C:/temp) with no spaces in the path.
> 
> 2.  When I closed/restarted LyX and reopened the document, the LyX temp 
> buffer had the new version of the PNG file but the old version of the 
> converted EPS file.
> 
> 3.  After assorted messing around, I found my way to C:\Documents and 
> Settings\\Application Data\lyx15\cache.  In there I 

Use "%APPDATA%\lyx15" to refer to the user dir. It works with every
Windows version.

> found the old version of the EPS file (with the uninformative name 
> 4044890618-eps).  I modified the entry in the index file to disguise 
> what the source of that EPS was, and lo and behold the next time I ran 
> LyX it produced the correct output.  It also rewrote the index file and 
> overwrote 4044890618-eps with the correct version of the image.
> 
> So it is in fact some sort of caching problem within LyX.  (I wasn't 
> sure if the discussion in the bugzilla entry had reached that 
> conclusion.)  Now if only we had a "purge the cache" button ...

This must be a problem with MSVC, as I cannot reproduce the bug with
a mingw build.

-- 
Enrico


Re: [Fwd: help: LyX crashes on startup... every time]

2007-10-16 Thread Enrico Forestieri
Florian Verhein wrote:

> Hello,
> 
> I would really apreciate some help with this, as LyX (v1.5.1-1 for Windows)
> crashes every time I try to run it (either by double-clicking on a lyx file
> or opening lyx directly).
> Here is what happens:
> 
> 
> 
> creating doc/LaTeXConfig.lyx
> LyX: Done!
> Assertion triggered in __thiscall lyx::support::FileName::FileName(const
> class std::basic_string,class
> std::allocator > &) by failing check "empty() || absolutePath(name_)"
> in file D:\LyX\lyx-1.5.1\src\support\FileName.cpp:47
> 
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
> 
> 
> This started happening all of a sudden, and EVERY time I start it. I have
> uninstalled and reinstalled LyX, but the problem persists. 
> 
> I did get a similar crash a couple of times before-hand while the
> application was running (can't remember if it was the same cause), but now
> it's simply not working at all.  
> 
> Amongst other things, I'm writing my thesis in LyX... so I have a big
> problem :( 
> 
> Thanks in advance,
>   Florian. 

Please, open a terminal, issue the following command:

move "%APPDATA%\lyx15\preferences" "%APPDATA%\lyx15\preferences.old"

then try restarting LyX.

-- 
Enrico


Re: [Patch] use Qt resources

2007-10-16 Thread Andre Poenitz
On Tue, Oct 16, 2007 at 11:11:23PM +0200, Andre Poenitz wrote:
> 
> Could somebody on Windows please try this one?
> 
> [It should work]
> 
> Also anu observations on startup speed are welcome.

Slightly more complete patch attached.

Andre'
Index: GuiToolbar.cpp
===
--- GuiToolbar.cpp  (revision 20995)
+++ GuiToolbar.cpp  (working copy)
@@ -33,7 +33,6 @@
 #include "qt_helpers.h"
 #include "InsertTableWidget.h"
 
-#include "support/filetools.h"
 #include "support/lstrings.h"
 #include "support/lyxalgo.h" // sorted
 
@@ -43,20 +42,28 @@
 #include 
 #include 
 
+
+static void initializeResources()
+{
+   extern void qInitResources();
+   static bool initialized = false;
+   if (!initialized) {
+   qInitResources();
+   initialized = true;
+   }
+}
+
+
 namespace lyx {
+namespace frontend {
 
 using std::string;
 using std::endl;
 
-using support::FileName;
-using support::libFileSearch;
 using support::subst;
 using support::compare;
 
 
-namespace frontend {
-
-
 namespace {
 
 struct PngMap {
@@ -152,8 +159,7 @@
LYXERR(Debug::GUI) << "find_png(" << name << ")\n"
   << "Looking for math PNG called \""
   << png_name << '"' << std::endl;
-
-   return libFileSearch("images/math/", png_name, "png").absFilename();
+   return png_name;
 }
 
 } // namespace anon
@@ -162,44 +168,41 @@
 /// return a icon for the given action
 static QIcon getIcon(FuncRequest const & f, bool unknown)
 {
-   string fullname;
+   initializeResources();
+   QPixmap pm;
+   string name1;
+   string name2;
 
switch (f.action) {
case LFUN_MATH_INSERT:
if (!f.argument().empty())
-   fullname = find_png(to_utf8(f.argument()).substr(1));
+   name1 = "math/" + 
find_png(to_utf8(f.argument()).substr(1));
break;
case LFUN_MATH_DELIM:
case LFUN_MATH_BIGDELIM:
-   fullname = find_png(to_utf8(f.argument()));
+   name1 = find_png(to_utf8(f.argument()));
break;
default:
-   string const name = lyxaction.getActionName(f.action);
-   string png_name = name;
+   name2 = lyxaction.getActionName(f.action);
+   name1 = name2;
 
if (!f.argument().empty())
-   png_name = subst(name + ' ' + to_utf8(f.argument()), ' 
', '_');
+   name1 = subst(name2 + ' ' + to_utf8(f.argument()), ' ', 
'_');
+   }
 
-   fullname = libFileSearch("images", png_name, 
"png").absFilename();
+   if (pm.load(":/images/" + toqstr(name1) + ".png"))
+   return pm;
 
-   if (fullname.empty()) {
-   // try without the argument
-   fullname = libFileSearch("images", name, 
"png").absFilename();
-   }
-   }
+   if (pm.load(":/images/" + toqstr(name2) + ".png"))
+   return pm;
 
-   if (!fullname.empty()) {
-   LYXERR(Debug::GUI) << "Full icon name is `"
-  << fullname << '\'' << endl;
-   return QIcon(toqstr(fullname));
-   }
-
LYXERR(Debug::GUI) << "Cannot find icon for command \""
   << lyxaction.getActionName(f.action)
   << '(' << to_utf8(f.argument()) << ")\"" << endl;
if (unknown)
-   return QIcon(toqstr(libFileSearch("images", "unknown", 
"png").absFilename()));
-   return QIcon();
+   pm.load(":/images/unknown.png");
+
+   return pm;
 }
 
 
@@ -261,8 +264,7 @@
TextClass::const_iterator const end = tc.end();
for (; it != end; ++it) {
// ignore obsolete entries
-   if ((*it)->obsoleted_by().empty())
-   addItem(toqstr(translateIfPossible((*it)->name(;
+   addItem(toqstr(translateIfPossible((*it)->name(;
}
 
// needed to recalculate size hint
@@ -290,8 +292,7 @@
return;
}
}
-   lyxerr << "ERROR (layoutSelected): layout not found!"
-  << endl;
+   lyxerr << "ERROR (layoutSelected): layout not found!" << endl;
 }
 
 
@@ -396,8 +397,7 @@
tb->setToolTip(qt_(to_ascii(item.label_)));
tb->setStatusTip(qt_(to_ascii(item.label_)));
tb->setText(qt_(to_ascii(item.label_)));
-   FileName icon_path = libFileSearch("images/math", item.name_, 
"png");
-   tb->setIcon(QIcon(toqstr(icon_path.absFilename(;
+   tb->setIcon(QPixmap(":images/math/" + toqstr(item.name_) + 
".png"));
connect(this, SIGNAL(iconSizeChanged(QSize)),
tb, SLOT(setIconSize(QSize)));
 


Re: Are graphics being cached?

2007-10-16 Thread Paul A. Rubin

Juergen Spitzmueller wrote:

Paul A. Rubin wrote:


I'm not the only one experiencing this, but I'm on Win XP and the person
who pointed it out to me is on Vista, so possibly it's
Windows-specific.  Any thoughts?


This is probably http://bugzilla.lyx.org/show_bug.cgi?id=3172



I think you are right.  I searched for a bug report using keyword 
'graphics' but not 'lyxsum'.


I struggled a bit reading all the comments; some were out of context 
since I do not know the source code.  (As we say here, "ignorance is 
bliss".)  I don't know if the following observations will shed any light:


1.  It happened to me with the document and image files all in a 
directory (C:/temp) with no spaces in the path.


2.  When I closed/restarted LyX and reopened the document, the LyX temp 
buffer had the new version of the PNG file but the old version of the 
converted EPS file.


3.  After assorted messing around, I found my way to C:\Documents and 
Settings\\Application Data\lyx15\cache.  In there I 
found the old version of the EPS file (with the uninformative name 
4044890618-eps).  I modified the entry in the index file to disguise 
what the source of that EPS was, and lo and behold the next time I ran 
LyX it produced the correct output.  It also rewrote the index file and 
overwrote 4044890618-eps with the correct version of the image.


So it is in fact some sort of caching problem within LyX.  (I wasn't 
sure if the discussion in the bugzilla entry had reached that 
conclusion.)  Now if only we had a "purge the cache" button ...


/Paul



Re: autopackage?

2007-10-16 Thread José Matos
On Tuesday 16 October 2007 21:55:54 [EMAIL PROTECTED] wrote:
> Would this be useful in order to provide a single package for *nix
> distribusion rather than several
>
>   http://www.autopackage.org/
> /Christian

That question comes with several years of delay. Actually it was already done 
before.

Forget it, the format never took off. It is the first time in years that I 
hear to talk about it again. :-)

-- 
José Abílio


[Patch] use Qt resources

2007-10-16 Thread Andre Poenitz

Could somebody on Windows please try this one?

[It should work]

Also anu observations on startup speed are welcome.

Andre'
Index: GuiToolbar.cpp
===
--- GuiToolbar.cpp  (revision 20995)
+++ GuiToolbar.cpp  (working copy)
@@ -43,6 +43,8 @@
 #include 
 #include 
 
+extern void qInitResources();
+
 namespace lyx {
 
 using std::string;
@@ -162,6 +164,11 @@
 /// return a icon for the given action
 static QIcon getIcon(FuncRequest const & f, bool unknown)
 {
+   static bool initialized = false;
+   if (!initialized) {
+   ::qInitResources();
+   initialized = true;
+   }
string fullname;
 
switch (f.action) {
@@ -180,12 +187,13 @@
if (!f.argument().empty())
png_name = subst(name + ' ' + to_utf8(f.argument()), ' 
', '_');
 
-   fullname = libFileSearch("images", png_name, 
"png").absFilename();
+   QPixmap pm;
+   if (pm.load(":/images/" + toqstr(png_name) + ".png"))
+   return pm;
 
-   if (fullname.empty()) {
-   // try without the argument
-   fullname = libFileSearch("images", name, 
"png").absFilename();
-   }
+   // try without the argument
+   if (pm.load(":/images/" + toqstr(name) + ".png"))
+   return pm;
}
 
if (!fullname.empty()) {


autopackage?

2007-10-16 Thread christian . ridderstrom
Would this be useful in order to provide a single package for *nix 
distribusion rather than several


http://www.autopackage.org/
/Christian

--
Christian Ridderström, +46-8-768 39 44   http://www.md.kth.se/~chr

Re: [Cvslog] r20977 - /lyx-devel/trunk/lib/configure.py

2007-10-16 Thread Juergen Spitzmueller
Enrico Forestieri wrote:

> The DraftDVI entry was specifying "document,vector" as an editor
> for the DVI format. Now the editor is unspecified and the flag
> is simply set to "vector" in order to not have DraftDVI in the
> "View" menu.

OK.

Jürgen



Re: Are graphics being cached?

2007-10-16 Thread Juergen Spitzmueller
Paul A. Rubin wrote:

> I'm not the only one experiencing this, but I'm on Win XP and the person
> who pointed it out to me is on Vista, so possibly it's
> Windows-specific.  Any thoughts?

This is probably http://bugzilla.lyx.org/show_bug.cgi?id=3172

Jürgen



Re: [Fwd: help: LyX crashes on startup... every time]

2007-10-16 Thread Andre Poenitz
On Tue, Oct 16, 2007 at 09:45:30PM +0200, Alfredo Braunstein wrote:
> Andre Poenitz wrote:
> 
> >> > Writing the emergency file is only part of what I want. I also want to
> >> > present the user with a dialog telling him about the error and giving
> >> > him the option to continue at his own risk.
> >> > 
> >> > There is absolutely no reason to abort if i.e. s&r or loading of an
> >> > icon failed.
> >> 
> >> s&r what?
> > 
> > Search and replace.
> 
> I mean, we don't assert normally when the search string is not found (now
> that's an idea!), there's surely something worse happening. 
>  
> >> It may be that failure of loading of an icon has no consequences,
> >> it may be that it leads to memory corruption, it depends on details of
> >> how the code is written. Same thing goes for some s&r assert failure.
> > 
> > Let the user choose.
> 
> The user can choose to rerun the program anyways.

That's not a real choice. _We_ choose to crash.

Andre'


Re: [Fwd: help: LyX crashes on startup... every time]

2007-10-16 Thread Alfredo Braunstein
Andre Poenitz wrote:

>> > Writing the emergency file is only part of what I want. I also want to
>> > present the user with a dialog telling him about the error and giving
>> > him the option to continue at his own risk.
>> > 
>> > There is absolutely no reason to abort if i.e. s&r or loading of an
>> > icon failed.
>> 
>> s&r what?
> 
> Search and replace.

I mean, we don't assert normally when the search string is not found (now
that's an idea!), there's surely something worse happening. 
 
>> It may be that failure of loading of an icon has no consequences,
>> it may be that it leads to memory corruption, it depends on details of
>> how the code is written. Same thing goes for some s&r assert failure.
> 
> Let the user choose.

The user can choose to rerun the program anyways.

>> And in any case, that's still fine by me. I'm only saying that if the
>> choices are a) abort on all current asserts and b) ignore all current
>> asserts; then my choice is a). I don't think the dialog is really useful
>> for me. If the emergency file is written, then clicking "continue" will
>> be equivalent to rerun lyx and reload file (C-R lyx in the terminal where
>> I started lyx normally), clicking "abort" equivalent to doing nothing.
>> It's not that I have anything against it either.
> 
> Even DOS had "Abort/Retry/Ignore" and gave you the possibility to insert
> the correct disk...

Not really the same isn't it. cp is a simple program that relies on system
calls; it wasn't aborting after detecting some inconsistent internal state
like it's our case in lyx, it was just reporting a well defined physical io
error as returned by the system call. I don't see how continuing after
detecting an inconsistent internal state could be really useful (specially
for cp)

A/




Re: Is there a way to get the string representation of a LFUN?

2007-10-16 Thread Edwin Leuven

Bo Peng wrote:

So how about: getActionName(FuncRequest.action) + FuncRequest.argument()?


This works well. Thanks.


btw, did you check how the command buffer gets the command strings?


Re: r20991 - in /lyx-devel/trunk/src: KeyMap.h frontends/qt4/...

2007-10-16 Thread Andre Poenitz
On Tue, Oct 16, 2007 at 01:56:54PM -0500, Bo Peng wrote:
> > - what is that empty 1st column?
> 
> I plan to use Qt::ItemIsUserCheckable to allow a user to disable
> certain items, but this flag is not usable for TreeWidgetItem. I then
> though of using a checkbox in the first column, but this is too
> cumbersome. I guess in the end I will remove the first column and add
> a remove button.

What about a QStandardItemModel in a TreeView (not TreeWidet)?

Andre'


Re: Lyx 1.5.2 compilation problems on OSX 10.3.9

2007-10-16 Thread Honest Guvnor
On 10/16/07, Honest Guvnor <[EMAIL PROTECTED]> wrote:
> Enrico wrote:
> > Have you seen the following post?
> >
> > http://article.gmane.org/gmane.editors.lyx.devel/96913/
> >
> > I think you are using wrong flags for gcc.
>
> Yes I had read the post but I am not explicitly setting any optimising
> flags for gcc.

I have checked config.log and indeed a substantial number of tests are
failing because of incorrect flags and not because of what is being
tested.


Re: [Fwd: help: LyX crashes on startup... every time]

2007-10-16 Thread Alfredo Braunstein
Abdelrazak Younes wrote:

>> Oh, you don't agree with me.
> 
> See Alfredo? I can now parse Andre' pretty well ;-)

Haha you're right. Maybe you can give a talk about it some time ;-)

A/




Re: Lyx 1.5.2 compilation problems on OSX 10.3.9

2007-10-16 Thread Honest Guvnor
Enrico wrote:
> Have you seen the following post?
>
> http://article.gmane.org/gmane.editors.lyx.devel/96913/
>
> I think you are using wrong flags for gcc.

Yes I had read the post but I am not explicitly setting any optimising
flags for gcc. I am letting configure do its natural thing but I would
agree that it is clearly failing to function correctly and this may be
due to incorrect flags. Unfortunately, if the lyx written code
requires gcc 4.0 which is not part of the gcc compiler on OSX 10.3
then I am unable to compile lyx anyway without considerable effort. In
addition, the knowledge gained would be largely useless because all
the others with OSX 10.3 would not be able to compile without
repeating the same efforts. Lyx would seem to require the latest
version of OSX and the behaviour I am seeing with the binary may well
be related to this.


Re: r20991 - in /lyx-devel/trunk/src: KeyMap.h frontends/qt4/...

2007-10-16 Thread Bo Peng
> - what is that empty 1st column?

I plan to use Qt::ItemIsUserCheckable to allow a user to disable
certain items, but this flag is not usable for TreeWidgetItem. I then
though of using a checkbox in the first column, but this is too
cumbersome. I guess in the end I will remove the first column and add
a remove button.

> - why is sorting disabled?

I plan to sort shortcuts by category. Like math-insert, view blah,...

> - why do i see a lot of empty rows when i scroll down?

I do not know. The list does not look quite right now.

> i like the shortcuts editor in the kde control panel (regional &
> accessibilty -> keyboard shortcuts) perhaps you can check it out for
> some inspiration...

I will check that out.

Cheers,
Bo


Re: [Fwd: help: LyX crashes on startup... every time]

2007-10-16 Thread Andre Poenitz
On Tue, Oct 16, 2007 at 08:34:03PM +0200, Alfredo Braunstein wrote:
> Andre Poenitz wrote:
> 
> >> I agree with Andre'. We should abort ASAP with an emergency file, with
> >> e.g. memory corruption. So IMO asserts are fine in the final release.
> > 
> > Oh, you don't agree with me.
> 
> I don't?
>  
> > Writing the emergency file is only part of what I want. I also want to
> > present the user with a dialog telling him about the error and giving him
> > the option to continue at his own risk.
> > 
> > There is absolutely no reason to abort if i.e. s&r or loading of an icon
> > failed.
> 
> s&r what?

Search and replace.

> It may be that failure of loading of an icon has no consequences,
> it may be that it leads to memory corruption, it depends on details of how
> the code is written. Same thing goes for some s&r assert failure.

Let the user choose.

> And in any case, that's still fine by me. I'm only saying that if the
> choices are a) abort on all current asserts and b) ignore all current
> asserts; then my choice is a). I don't think the dialog is really useful
> for me. If the emergency file is written, then clicking "continue" will be
> equivalent to rerun lyx and reload file (C-R lyx in the terminal where I
> started lyx normally), clicking "abort" equivalent to doing nothing. It's
> not that I have anything against it either.

Even DOS had "Abort/Retry/Ignore" and gave you the possibility to insert
the correct disk...

Andre'


Re: r20991 - in /lyx-devel/trunk/src: KeyMap.h frontends/qt4/...

2007-10-16 Thread Edwin Leuven

Bo Peng wrote:

Lfun and shortcuts can be edited in place so shortcut modification can
be done in this way. If I add an empty item, new shortcut can be
inserted. I guess I can also categorize these shortcuts.

Any comments?


i like the direction this is going.

have some quick (first impression) questions:

- what is that empty 1st column?
- why is sorting disabled?
- why do i see a lot of empty rows when i scroll down?

i like the shortcuts editor in the kde control panel (regional & 
accessibilty -> keyboard shortcuts) perhaps you can check it out for 
some inspiration...


Re: [Fwd: help: LyX crashes on startup... every time]

2007-10-16 Thread Alfredo Braunstein
Andre Poenitz wrote:

>> I agree with Andre'. We should abort ASAP with an emergency file, with
>> e.g. memory corruption. So IMO asserts are fine in the final release.
> 
> Oh, you don't agree with me.

I don't?
 
> Writing the emergency file is only part of what I want. I also want to
> present the user with a dialog telling him about the error and giving him
> the option to continue at his own risk.
> 
> There is absolutely no reason to abort if i.e. s&r or loading of an icon
> failed.

s&r what? It may be that failure of loading of an icon has no consequences,
it may be that it leads to memory corruption, it depends on details of how
the code is written. Same thing goes for some s&r assert failure.

And in any case, that's still fine by me. I'm only saying that if the
choices are a) abort on all current asserts and b) ignore all current
asserts; then my choice is a). I don't think the dialog is really useful
for me. If the emergency file is written, then clicking "continue" will be
equivalent to rerun lyx and reload file (C-R lyx in the terminal where I
started lyx normally), clicking "abort" equivalent to doing nothing. It's
not that I have anything against it either.

A/




Re: [Fwd: help: LyX crashes on startup... every time]

2007-10-16 Thread Abdelrazak Younes

Andre Poenitz wrote:

On Tue, Oct 16, 2007 at 10:50:07AM +0200, Alfredo Braunstein wrote:

Abdelrazak Younes wrote:

 

But it's the least helpful and the most annoying approach.
We should change that.

Sure but for trunk.

I agree with Andre'. We should abort ASAP with an emergency file, with e.g.
memory corruption. So IMO asserts are fine in the final release.


Oh, you don't agree with me.


See Alfredo? I can now parse Andre' pretty well ;-)

Abdel.



Re: r20991 - in /lyx-devel/trunk/src: KeyMap.h frontends/qt4/...

2007-10-16 Thread Richard Heck

Bo Peng wrote:

On 10/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
  

Author: bpeng
Date: Tue Oct 16 19:48:37 2007
New Revision: 20991

URL: http://www.lyx.org/trac/changeset/20991
Log:
List currently used shortcuts in the shortcuts panel of the preference dialog


Lfun and shortcuts can be edited in place so shortcut modification can
be done in this way. If I add an empty item, new shortcut can be
inserted. I guess I can also categorize these shortcuts.
  

Let me check this out

rh

--
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: r20991 - in /lyx-devel/trunk/src: KeyMap.h frontends/qt4/...

2007-10-16 Thread Bo Peng
On 10/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Author: bpeng
> Date: Tue Oct 16 19:48:37 2007
> New Revision: 20991
>
> URL: http://www.lyx.org/trac/changeset/20991
> Log:
> List currently used shortcuts in the shortcuts panel of the preference dialog

Lfun and shortcuts can be edited in place so shortcut modification can
be done in this way. If I add an empty item, new shortcut can be
inserted. I guess I can also categorize these shortcuts.

Any comments?

Bo


Re: Is there a way to get the string representation of a LFUN?

2007-10-16 Thread Bo Peng
> So how about: getActionName(FuncRequest.action) + FuncRequest.argument()?

This works well. Thanks.

Bo


Re: [Cvslog] r20977 - /lyx-devel/trunk/lib/configure.py

2007-10-16 Thread Enrico Forestieri
On Tue, Oct 16, 2007 at 08:42:35AM +0200, Jürgen Spitzmüller wrote:

> Enrico Forestieri wrote:
> > Jürgen, this is also needed in branch.
> 
> What was wrong?

The DraftDVI entry was specifying "document,vector" as an editor
for the DVI format. Now the editor is unspecified and the flag
is simply set to "vector" in order to not have DraftDVI in the
"View" menu.

-- 
Enrico


Re: Lyx 1.5.2 compilation problems on OSX 10.3.9

2007-10-16 Thread Enrico Forestieri
On Tue, Oct 16, 2007 at 07:26:38AM +0200, Honest Guvnor wrote:

> On 10/16/07, Bennett Helm <[EMAIL PROTECTED]> wrote:
> >
> > I haven't had any of these problems on Intel, and neither has Anders
> > on PPC.
> 
> Possibly but somone using a Sun was reporting similar problems a few
> threads below.

Have you seen the following post?
http://article.gmane.org/gmane.editors.lyx.devel/96913/

I think you are using wrong flags for gcc.

-- 
Enrico


Re: Is there a way to get the string representation of a LFUN?

2007-10-16 Thread Richard Heck

Bo Peng wrote:

As title. "ostream << LFUN" yeilds something like 'action: 31 arg: x',
and I need something like math-insert \alpha.
  

LyXAction::getActionName?


getActionName(kb_action), I need blah(FuncRequest).
  

So how about: getActionName(FuncRequest.action) + FuncRequest.argument()?

rh

--
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: Is there a way to get the string representation of a LFUN?

2007-10-16 Thread Bo Peng
On 10/16/07, Bo Peng <[EMAIL PROTECTED]> wrote:
> > > As title. "ostream << LFUN" yeilds something like 'action: 31 arg: x',
> > > and I need something like math-insert \alpha.
> > >
> > LyXAction::getActionName?
>
> getActionName(kb_action), I need blah(FuncRequest).

Let me see, FuncReqest has a public member named action...

Bo


Re: Is there a way to get the string representation of a LFUN?

2007-10-16 Thread Bo Peng
> > As title. "ostream << LFUN" yeilds something like 'action: 31 arg: x',
> > and I need something like math-insert \alpha.
> >
> LyXAction::getActionName?

getActionName(kb_action), I need blah(FuncRequest).

Bo


Re: Is there a way to get the string representation of a LFUN?

2007-10-16 Thread Richard Heck

Bo Peng wrote:

As title. "ostream << LFUN" yeilds something like 'action: 31 arg: x',
and I need something like math-insert \alpha.
  

LyXAction::getActionName?

rh

--
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: [Fwd: help: LyX crashes on startup... every time]

2007-10-16 Thread Andre Poenitz
On Tue, Oct 16, 2007 at 10:50:07AM +0200, Alfredo Braunstein wrote:
> Abdelrazak Younes wrote:
> 
>  
> >> But it's the least helpful and the most annoying approach.
> >> We should change that.
> > 
> > Sure but for trunk.
> 
> I agree with Andre'. We should abort ASAP with an emergency file, with e.g.
> memory corruption. So IMO asserts are fine in the final release.

Oh, you don't agree with me.

Writing the emergency file is only part of what I want. I also want to
present the user with a dialog telling him about the error and giving him
the option to continue at his own risk.

There is absolutely no reason to abort if i.e. s&r or loading of an icon
failed.

Andre'


Is there a way to get the string representation of a LFUN?

2007-10-16 Thread Bo Peng
As title. "ostream << LFUN" yeilds something like 'action: 31 arg: x',
and I need something like math-insert \alpha.

Cheers,
Bo


Are graphics being cached?

2007-10-16 Thread Paul A. Rubin

Hi all,

I'm about to file a bug report, but I'd like to nail down the facts. 
Are graphic files being cached after conversion?  The symptoms I'm 
experiencing are as follows:


1.  Create a LyX doc and insert an image.  (Call this the old image.) 
The correct image appears in the GUI and View->DVI.


2.  Change the image file.  Close/reopen the document.  The new image 
appears in the GUI.  View->DVI still shows the old image (as does 
exporting the DVI).


3.  Close the document, close LyX, restart LyX, reopen document.  The 
GUI shows the new image, but View->DVI *still* shows the old image. 
View->PDF shows the new image ... after which View->DVI still shows the 
old image.


I haven't gotten around to rebooting the PC to see if I can get rid of 
the old image.  :-)


I'm not the only one experiencing this, but I'm on Win XP and the person 
who pointed it out to me is on Vista, so *possibly* it's 
Windows-specific.  Any thoughts?


Thanks,
Paul



Re: Support request for Japanese without CJK

2007-10-16 Thread Koji Yokota

Jean-Marc Lasgouttes wrote:

Bt can platex handle all non-japanese documents that latex can handle?
In other words, can we really use platex as a replacement for latex
when it is available?
  


platex can handle English -- 7bit code -- perfectly, so probably there 
is no problem in using it for configuration purpose.


However, we need to be careful in using it for math preview. README2 in 
the platex distribution says:


> Current pTeX may recognize a sequence of 8bit codes as a 16bit code.
> Therefore, it cannot handle a TeX source or a hyphen pattern which
> contains a sequence of 8bit codes such as French or Cyrillic.
>
> Threfore, pLaTeX2e has its own hyphen.cfg in the directory
> $TEXMF/tex/platex/base so that it doesn't load other hyphen patterns
> which may cause a problem.

But, conversion of the documents that contain 8bit codes to a 16bit code 
such as EUC will probably raise a problem in itself and stops 
(correct?). Should we allow lyx to use platex for preview purpose, once 
the document succeeds in conversion because a problematic document fails 
in conversion anyway?


Koji


Re: Support request for Japanese without CJK

2007-10-16 Thread Koji Yokota

Koji Yokota wrote:
However, I found that Kanji code can be modified using an option 
"-kanji":


ps. This feature can only be used with newer version of ptex than p3.0.4.

   > This is pTeX, Version 3.1415-p3.0.4 (euc) (Web2C 7.3.9)


Koji


Re: Support request for Japanese without CJK

2007-10-16 Thread Koji Yokota

Koji Yokota wrote:
For pTeX, the output of 'ptex -version' (or 'platex -version') 
contains a line:


> pTeX 3.141592-p3.1.9 (EUC) (Web2C 7.5.4)


Dear Uwe,

Possible outputs of the above are: EUC, SJIS and JIS.

However, I found that Kanji code can be modified using an option "-kanji":

   > $ platex -kanji=euc
   > This is pTeX, Version 3.141592-p3.1.9 (euc) (Web2C 7.5.4)
   > $ platex -kanji=jis
   > This is pTeX, Version 3.141592-p3.1.9 (jis) (Web2C 7.5.4)
   > $ platex -kanji=sjis
   > This is pTeX, Version 3.141592-p3.1.9 (sjis) (Web2C 7.5.4)

So, the kanji code need not be fixed by configure.py, but can be changed 
from the menu of encoding setting using the above option.



Koji


Re: Lyx 1.5.2 compilation problems on OSX 10.3.9

2007-10-16 Thread Jean-Marc Lasgouttes
"Honest Guvnor" <[EMAIL PROTECTED]> writes:

> I was not disputing the dependency on gcc 4.0 but asking if it can be
> avoided by building an X version (i.e. using essentially the same code
> as linux) and avoiding the OSX-specific code. I am asking because the
> main INSTALL file does not appear to have the dependency.

I think the exact required version is not clear today. All I can say
is that I build LyX on gcc 3.4.1 on linux without any problem.

Many of the problems with older gcc versions can probably be solved
(at least for the X11 version) with a little help from the people who
encounter problems.

JMarc


Re: Lyx 1.5.2 compilation problems on OSX 10.3.9

2007-10-16 Thread Honest Guvnor
On 10/16/07, Bennett Helm <[EMAIL PROTECTED]> wrote:
> On Oct 16, 2007, at 9:00 AM, Honest Guvnor wrote:
>
> >> That's the problem. You need 4.0 or greater.
> >
> > How can lyx depend on gcc 4.0? It was only released 5 minutes ago.
>
> I believe gcc 4.0 has been out for over 2 years on Mac.

I suspect we come from rather different generations of programmers.

> > The main INSTALL file says gcc 2.8 does not work and so is gcc 4.0
> > only a requirement peculiar to the OSX port? If so, will the X build
> > work?
>
> INSTALL.MacOSX says:

I was not disputing the dependency on gcc 4.0 but asking if it can be
avoided by building an X version (i.e. using essentially the same code
as linux) and avoiding the OSX-specific code. I am asking because the
main INSTALL file does not appear to have the dependency.


Re: Support request for Japanese without CJK

2007-10-16 Thread Jean-Marc Lasgouttes
Koji Yokota <[EMAIL PROTECTED]> writes:

> platex is a latex binary that can handle Japanese characters (in EUC,
> JIS or SJIS) which is derived from the original latex. The platex
> system comes with latex binary as well, but the search path for platex
> set in web2c/texmf.cnf of the platex distribution is independent from
> the one for latex:

Bt can platex handle all non-japanese documents that latex can handle?
In other words, can we really use platex as a replacement for latex
when it is available?

JMarc


Re: Lyx 1.5.2 compilation problems on OSX 10.3.9

2007-10-16 Thread Bennett Helm

On Oct 16, 2007, at 9:00 AM, Honest Guvnor wrote:


That's the problem. You need 4.0 or greater.


How can lyx depend on gcc 4.0? It was only released 5 minutes ago.


I believe gcc 4.0 has been out for over 2 years on Mac.


The main INSTALL file says gcc 2.8 does not work and so is gcc 4.0
only a requirement peculiar to the OSX port? If so, will the X build
work?


INSTALL.MacOSX says:

You will need the MacOSX development tools. The procedure described
here builds LyX linked with a static Qt library. Also note that
building LyX/Mac requires gcc version 4.0 or higher. (You can check
your version  by entering "gcc -v" in the Terminal; you can change
your gcc version to version 4.0, for example, by entering
"sudo gcc_select 4.0".)


Bennett


Re: Support request for Japanese without CJK

2007-10-16 Thread Koji Yokota

Jean-Marc Lasgouttes wrote:

What is the difference between platex and latex?
  


platex is a latex binary that can handle Japanese characters (in EUC, 
JIS or SJIS) which is derived from the original latex. The platex system 
comes with latex binary as well, but the search path for platex set in 
web2c/texmf.cnf of the platex distribution is independent from the one 
for latex:


> TEXINPUTS.latex  = .;$TEXMF/tex/{latex,generic,}//
> TEXINPUTS.platex = .;$TEXMF/{ptex/{platex,generic,}, \
   
tex/{latex,generic,}}//


Therefore, latex fails to find out the default directory of Japanese 
standard classes. platex must be used instead.


Koji


Re: Support request for Japanese without CJK

2007-10-16 Thread Jean-Marc Lasgouttes
Alfredo Braunstein <[EMAIL PROTECTED]> writes:

>> What is the difference between platex and latex?
>
> p
>
> *ducks*

Alfredo, always useful... So tell us more about this p :-p

JMarc


Re: Support request for Japanese without CJK

2007-10-16 Thread Alfredo Braunstein
Jean-Marc Lasgouttes wrote:

> Koji Yokota <[EMAIL PROTECTED]>
> writes:
> 
>> Currently, platex cannot find these classes with configure.py because
>> it is not recognized as a latex binary. Could you apply the attached
>> patches (or else) so that it can find the classes (and also preview of
>> math to work)?
> 
> What is the difference between platex and latex?

p


*ducks*



Re: Lyx 1.5.2 compilation problems on OSX 10.3.9

2007-10-16 Thread Honest Guvnor
> That's the problem. You need 4.0 or greater.

How can lyx depend on gcc 4.0? It was only released 5 minutes ago.

The main INSTALL file says gcc 2.8 does not work and so is gcc 4.0
only a requirement peculiar to the OSX port? If so, will the X build
work?


Re: Support request for Japanese without CJK

2007-10-16 Thread Jean-Marc Lasgouttes
Koji Yokota <[EMAIL PROTECTED]> writes:

> Currently, platex cannot find these classes with configure.py because
> it is not recognized as a latex binary. Could you apply the attached
> patches (or else) so that it can find the classes (and also preview of
> math to work)?

What is the difference between platex and latex?

JMarc


Re: Lyx 1.5.2 compilation problems on OSX 10.3.9

2007-10-16 Thread Bennett Helm

On Oct 16, 2007, at 1:26 AM, Honest Guvnor wrote:


On 10/16/07, Bennett Helm <[EMAIL PROTECTED]> wrote:


What version of gcc are you using?


bolt:~/pub/lyx-1.5.2 andy$ gcc --version
gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1495)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.   
There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR  
PURPOSE.


That's the problem. You need 4.0 or greater.

Bennett


Re: [patch] Re: frames in toc when using beamer

2007-10-16 Thread José Matos
On Sunday 14 October 2007 15:56:38 Jürgen Spitzmüller wrote:
> I'd like to commit this to branch and trunk nevertheless.
> What do others think?

  Is this in?

  I like it. :-)

> Jürgen

-- 
José Abílio


Re: Support request for Japanese without CJK

2007-10-16 Thread Koji Yokota

Koji Yokota wrote:

Uwe Stöhr wrote:
I implemented JMarcs suggestion that the japanese packaeg is only 
loaded when a textclass doesn't already provide it.


Thank you. I attach layout files for standard Japanese classes using 
this feature. Could you include these in trunk?


Currently, platex cannot find these classes with configure.py because it 
is not recognized as a latex binary. Could you apply the attached 
patches (or else) so that it can find the classes (and also preview of 
math to work)?


Koji
--- lib/configure.py.orig	Tue Oct 16 00:25:55 2007
+++ lib/configure.py	Tue Oct 16 00:44:52 2007
@@ -202,7 +202,7 @@
 \converter dvi2   dvi"python -tt $$s/scripts/clean_dvi.py $$i $$o"	""'''
 else:
 converter_entry = r'\converter latex  dvi"%%"	"latex"'
-path, LATEX = checkProg('a Latex2e program', ['pplatex $$i', 'latex $$i', 'latex2e $$i'],
+path, LATEX = checkProg('a Latex2e program', ['pplatex $$i', 'platex $$i', 'latex $$i', 'latex2e $$i'],
 rc_entry = [converter_entry])
 # no latex
 if LATEX != '':
--- lib/scripts/legacy_lyxpreview2ppm.py.orig	Wed Jul 11 16:40:55 2007
+++ lib/scripts/legacy_lyxpreview2ppm.py	Tue Oct 16 00:44:52 2007
@@ -234,7 +234,7 @@
 
 # External programs used by the script.
 path = string.split(os.environ["PATH"], os.pathsep)
-latex   = find_exe_or_terminate(["pplatex", "latex2e", "latex"], path)
+latex   = find_exe_or_terminate(["pplatex", "platex", "latex2e", "latex"], path)
 dvips   = find_exe_or_terminate(["dvips"], path)
 gs  = find_exe_or_terminate(["gswin32c", "gs"], path)
 pnmcrop = find_exe(["pnmcrop"], path)
--- lib/scripts/lyxpreview2bitmap.py.orig	Wed Jul 11 16:40:55 2007
+++ lib/scripts/lyxpreview2bitmap.py	Tue Oct 16 00:44:52 2007
@@ -150,7 +150,7 @@
 
 # External programs used by the script.
 path = string.split(os.environ["PATH"], os.pathsep)
-latex = find_exe_or_terminate(["pplatex", "latex2e", "latex"], path)
+latex = find_exe_or_terminate(["pplatex", "platex", "latex2e", "latex"], path)
 
 # This can go once dvipng becomes widespread.
 dvipng = find_exe(["dvipng"], path)


Re: [Fwd: help: LyX crashes on startup... every time]

2007-10-16 Thread Alfredo Braunstein
Abdelrazak Younes wrote:

> Alfredo Braunstein wrote:
>> Abdelrazak Younes wrote:
>> 
>>  
 But it's the least helpful and the most annoying approach.
 We should change that.
>>> Sure but for trunk.
>> 
>> I agree with Andre'. We should abort ASAP with an emergency file, with
>> e.g. memory corruption. So IMO asserts are fine in the final release.
> 
> I am not sure but that's not Andre's point...

It seemed to me, maybe I was wrong.

> I disagree because there are cases (such as this one) where we use
> asserts instead of handling the errors gracefully. We should avoid
> aborting as much as possible.

I agree, but this means we should substitute asserts with graceful error
handling when possible. It doesn't mean we should mass-disable asserts in
the final release. 

IMO the risk of dataloss by *ignoring* an important assert is much worse
than the eventual gain of ignoring unimportant ones.

A/




Re: [Fwd: help: LyX crashes on startup... every time]

2007-10-16 Thread Abdelrazak Younes

Alfredo Braunstein wrote:

Abdelrazak Younes wrote:

 

But it's the least helpful and the most annoying approach.
We should change that.

Sure but for trunk.


I agree with Andre'. We should abort ASAP with an emergency file, with e.g.
memory corruption. So IMO asserts are fine in the final release.


I am not sure but that's not Andre's point...

I disagree because there are cases (such as this one) where we use 
asserts instead of handling the errors gracefully. We should avoid 
aborting as much as possible.


Abdel.



Re: [Fwd: help: LyX crashes on startup... every time]

2007-10-16 Thread Alfredo Braunstein
Abdelrazak Younes wrote:

 
>> But it's the least helpful and the most annoying approach.
>> We should change that.
> 
> Sure but for trunk.

I agree with Andre'. We should abort ASAP with an emergency file, with e.g.
memory corruption. So IMO asserts are fine in the final release.

A/




Re: [Cvslog] r20980 - in /lyx-devel/trunk/src/frontends/qt4: GuiView.c...

2007-10-16 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] writes:

> Author: younes
> Date: Tue Oct 16 08:50:09 2007
> New Revision: 20980
>
> URL: http://www.lyx.org/trac/changeset/20980
> Log:
> Reduce use of dynamic_cast.

Thanks.

JMarc