Re: translate float names (bug 5798)

2009-06-07 Thread Guenter Milde
On 2009-06-06, Georg Baum wrote:
> --nextPart1318722.ek2OaluMbA
> Content-Type: text/plain; charset=iso-8859-15
> Content-Transfer-Encoding: 8Bit

> Currently, LyX does not translate the names of automatically generated
> floats. It creates code like

> \floatname{algorithm}{Algorithm}

> The attached patch changes that along the same lines as the AMS theorem
> translations:

> \providecommand{\algorithmname}{Algorithm}
> \floatname{algorithm}{\protect\Algorithm}

> where \algorithmname is redefined by babel if needed. OK to go in?

Maybe I am missing something, but if \algorithmname is redefined by
babel, how would \Algorithm realize this change?

Günter



Re: GuiProgess

2009-06-07 Thread Abdelrazak Younes

On 07/06/2009 17:44, Peter Kuemmel wrote:

Until nobody proves me wrong I assume QProcess is not usable
synchronously.
   

Well I've used these signals successfully both on windows and Linux so I
am inclined to think that there might be some problems in your code.Your
excessive use of processEvents might be the root of all the perceived
problem. I don't really understand why you need that but I unfortunately
don't have the time to do much today :-(
 


Yes, the signals work, but not the functions to force synchronous control-flow.
   


In my experience these methods work fine too. But it's better to use the 
signals anyway because the process can become asynchronous later on.


Abdel.



Re: GuiProgess

2009-06-07 Thread Peter Kuemmel
And here the patch with some cosmetic for the textoutput in the progress widget.

Peter
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
Index: src/frontends/qt4/GuiProgress.cpp
===
--- src/frontends/qt4/GuiProgress.cpp	(Revision 0)
+++ src/frontends/qt4/GuiProgress.cpp	(Revision 0)
@@ -0,0 +1,229 @@
+// -*- C++ -*-
+/**
+ * \file GuiProgress.cpp
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Peter KÃŒmmel
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include 
+
+#include "GuiProgress.h"
+
+#include "qt_helpers.h"
+
+#include "support/Systemcall.h"
+
+#include 
+#include 
+
+
+namespace lyx {
+namespace frontend {
+
+
+static void processEvents()
+{
+	// QEventLoop::ExcludeUserInputEvents: 
+	// don't allow user inputs while processing a document
+	// if we allow it, we open will Pandora's Box of multithreading
+	static bool busy = false;
+	if (!busy) {
+	  busy = true;
+	  QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+	  busy = false;
+	}
+}
+
+
+GuiProgress::GuiProgress(GuiView & parent, Qt::DockWidgetArea area, 
+	Qt::WindowFlags flags) : DockView(parent, "progress", "External tools output", area, flags)
+{
+	setWindowTitle(qt_("External process monitoring"));
+	setWidget(&text_edit);
+	text_edit.setReadOnly(true);
+}
+
+
+void GuiProgress::progessStarted()
+{
+	appendMessage("\n");
+}
+
+
+void GuiProgress::progessFinished()
+{
+	appendMessage("");
+}
+
+
+void GuiProgress::appendMessage(QString const & msg)
+{
+	if (msg.endsWith("\n"))
+		text_edit.insertPlainText(msg);
+	else
+		text_edit.insertPlainText(msg + "\n");
+	text_edit.ensureCursorVisible();
+	processEvents();
+}
+
+
+void GuiProgress::appendError(QString const & msg)
+{
+	appendMessage(msg + "\n");
+}
+
+
+void GuiProgress::clearMessages()
+{
+	text_edit.clear();
+	processEvents();
+}
+
+
+void GuiProgress::showEvent(QShowEvent*)
+{
+	// don't show splash when progress window is visible
+	support::ProgressInterface::setInstance(this);
+}
+
+
+void GuiProgress::hideEvent(QHideEvent*)
+{
+	// show splash when no progress window is visible
+	support::ProgressInterface::setInstance(GuiProgressSplash::instance());
+}
+
+
+void GuiProgress::update()
+{
+	processEvents();
+}
+
+
+
+Dialog * createGuiProgress(GuiView & lv)
+{
+	GuiView & guiview = static_cast(lv);
+#ifdef Q_WS_MACX
+	// TODO where to show up on the Mac?
+	//return new GuiProgress(guiview, Qt::RightDockWidgetArea, Qt::Drawer);
+#else
+	return new GuiProgress(guiview, Qt::BottomDockWidgetArea);
+#endif
+}
+
+
+
+GuiProgressSplash::GuiProgressSplash() : 
+  QSplashScreen(QPixmap(":/images/lyx.png").scaled(400,200, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), 
+Qt::WindowStaysOnTopHint ),
+  show_counter(0)
+{
+	wait.setSingleShot(true);
+	// wait before show
+	wait.setInterval(2000);
+	connect(&wait, SIGNAL(timeout()), this, SLOT(showSplash()), Qt::DirectConnection);
+	connect(this, SIGNAL(triggerHide()), this, SLOT(hideSplash()), Qt::DirectConnection);
+}
+
+
+void GuiProgressSplash::showSplash()
+{
+	show();
+}
+
+
+
+void GuiProgressSplash::hideSplash()
+{
+	hide();
+}
+
+
+void GuiProgressSplash::progessStarted()
+{
+	show_counter++;
+	if (!wait.isActive()) {
+		// does not work if we block the gui thread
+		// therefore call call update()
+		wait.start();
+	}
+}
+
+
+void GuiProgressSplash::progessFinished()
+{
+	if (show_counter > 0)
+		show_counter--;
+	if (show_counter == 0) {
+		wait.stop();
+		triggerHide();
+		processEvents();
+	}
+}
+
+
+void GuiProgressSplash::mousePressEvent(QMouseEvent *)
+{
+//overwrite hide from QSplashScreen ?
+triggerHide();
+}
+
+
+
+void GuiProgressSplash::update()
+{
+	processEvents();
+}
+
+
+void GuiProgressSplash::appendMessage(QString const & msg)
+{
+//qDebug() << "void GuiProgressSplash::appendMessage";
+//qDebug() << msg;
+	QStringList lines = msg.split("\n");
+	while (lines.last().isEmpty() && !lines.isEmpty()) {
+		lines.pop_back();
+	}
+	showMessage(lines.last(), Qt::AlignLeft | Qt::AlignBottom);
+	processEvents();
+}
+
+
+void GuiProgressSplash::appendError(QString const & msg)
+{
+	appendMessage(msg);
+	processEvents();
+}
+
+
+void GuiProgressSplash::clearMessages()
+{
+	showMessage(QString(), Qt::AlignLeft | Qt::AlignBottom);
+	processEvents();
+}
+
+
+
+
+GuiProgressSplash* GuiProgressSplash::splash_instance = 0;
+
+void GuiProgressSplash::setInstance(GuiProgressSplash* splash)
+{
+	splash_instance = splash;	
+}
+
+GuiProgressSplash* GuiProgressSplash::instance()
+{
+	return splash_instance;
+}
+
+
+} // namespace frontend
+} // namespace lyx
+
+#include "moc_GuiProgress.cpp"
\ No newline at end of file
Index: src/frontends/qt4/GuiView.cpp
===
--- src/frontends/qt4/GuiView.cpp	(Revision 3000

Re: GuiProgess

2009-06-07 Thread Pavel Sanda
Peter Kuemmel wrote:
> > > Until nobody proves me wrong I assume QProcess is not usable
> > > synchronously.
> > 
> > Well I've used these signals successfully both on windows and Linux so I 
> > am inclined to think that there might be some problems in your code.Your 
> > excessive use of processEvents might be the root of all the perceived 
> > problem. I don't really understand why you need that but I unfortunately 
> > don't have the time to do much today :-(
> 
> Yes, the signals work, but not the functions to force synchronous 
> control-flow. 
> 
> Attached a patch which hopefully solves the problems. 
> There I've implemented the wait functions by myself.
> Nothing mystically, and I wonder why these functions are implemented so 
> complicated and os-dependend in Qt. Looks like thy don't trust their own 
> signals. And as I understand it, the signals do not depend on the 
> waitForFinished() function, so why not using them for the implementation of 
> waitForFinished()?
> But I'm not the details of QProcess, it's maybe not that simple.

i wanted to make some testing, but its difficult to apply your changes since
the patching process has the problem of deal with adding/removing new files.
can we move to the new branch?

pavel


Re: Broken reverse search

2009-06-07 Thread Jürgen Spitzmüller
Uwe Stöhr wrote:
> I've added a list of the maintainers:
> http://wiki.lyx.org/LyX/DocumentationDevelopment#maintain

Thanks.

> - When you are not the maintainer of a documentation file, use Change
> Tracking - Only the maintainer of a document accepts changes

I've added this info to that page.

Jürgen


Re: GuiProgess

2009-06-07 Thread Peter Kuemmel

 Original-Nachricht 
> Datum: Sun, 7 Jun 2009 16:24:22 +0200
> Von: Andre Poenitz 
> An: Peter Kuemmel 
> CC: lyx-devel@lists.lyx.org
> Betreff: Re: GuiProgess

> On Sat, Jun 06, 2009 at 10:36:31PM +0200, Peter Kuemmel wrote:
> > > > 1. QProcess::waitForFinished() sometimes crashes 
> > > > 2. QProcess::waitForFinished() sometimes does not return (splash
> does
> > > not disappear)
> > > > 3. QProcess::started() is emitted twice (see disconnect in patch)
> > > > 
> > > > Until nobody proves me wrong I assume QProcess is not usable
> > > > synchronously. Then I try it again with Qt 7.0.
> 
> Would be nice to have that reproducible with a minimal example.
> QProcess (also the synchroneous version) seems to work well on the
> supported platforms (yes, Enrico, Cygwin is none of them) for the rest
> of the world, so all of the problems you mentioned would rank as the
> equivalent of "must fix".
> 
> Andre'

Minimal example word be hard, but minimal changes in LyX are simple, 
see my last patch of Systemcall.cpp:

+   if (!d.waitWhile(SystemcallPrivate::Running, 18)) {
+   //if (!process->waitForFinished(18)) { // <--- THIS DOES NOT WORK 

Peter

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01


Re: GuiProgess

2009-06-07 Thread Peter Kuemmel
> > Until nobody proves me wrong I assume QProcess is not usable
> > synchronously.
> 
> Well I've used these signals successfully both on windows and Linux so I 
> am inclined to think that there might be some problems in your code.Your 
> excessive use of processEvents might be the root of all the perceived 
> problem. I don't really understand why you need that but I unfortunately 
> don't have the time to do much today :-(

Yes, the signals work, but not the functions to force synchronous control-flow. 

Attached a patch which hopefully solves the problems. 
There I've implemented the wait functions by myself.
Nothing mystically, and I wonder why these functions are implemented so 
complicated and os-dependend in Qt. Looks like thy don't trust their own 
signals. And as I understand it, the signals do not depend on the 
waitForFinished() function, so why not using them for the implementation of 
waitForFinished()?
But I'm not the details of QProcess, it's maybe not that simple.

Peter
-- 
GMX FreeDSL mit DSL 6.000 Flatrate und Telefonanschluss nur 17,95 Euro/mtl.!
http://dslspecial.gmx.de/freedsl-aktionspreis/?ac=OM.AD.PD003K11308T4569a
Index: src/frontends/qt4/GuiProgress.cpp
===
--- src/frontends/qt4/GuiProgress.cpp	(Revision 0)
+++ src/frontends/qt4/GuiProgress.cpp	(Revision 0)
@@ -0,0 +1,226 @@
+// -*- C++ -*-
+/**
+ * \file GuiProgress.cpp
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Peter KÃŒmmel
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include 
+
+#include "GuiProgress.h"
+
+#include "qt_helpers.h"
+
+#include "support/Systemcall.h"
+
+#include 
+#include 
+
+
+namespace lyx {
+namespace frontend {
+
+
+static void processEvents()
+{
+	// QEventLoop::ExcludeUserInputEvents: 
+	// don't allow user inputs while processing a document
+	// if we allow it, we open will Pandora's Box of multithreading
+	static bool busy = false;
+	if (!busy) {
+	  busy = true;
+	  QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+	  busy = false;
+	}
+}
+
+
+GuiProgress::GuiProgress(GuiView & parent, Qt::DockWidgetArea area, 
+	Qt::WindowFlags flags) : DockView(parent, "progress", "External tools output", area, flags)
+{
+	setWindowTitle(qt_("External process monitoring"));
+	setWidget(&text_edit);
+	text_edit.setReadOnly(true);
+}
+
+
+void GuiProgress::progessStarted()
+{
+	appendMessage("\n");
+}
+
+
+void GuiProgress::progessFinished()
+{
+	appendMessage("\n\n");
+}
+
+
+void GuiProgress::appendMessage(QString const & msg)
+{
+	text_edit.insertPlainText(msg);
+	text_edit.ensureCursorVisible();
+	processEvents();
+}
+
+
+void GuiProgress::appendError(QString const & msg)
+{
+	appendMessage(msg);
+}
+
+
+void GuiProgress::clearMessages()
+{
+	text_edit.clear();
+	processEvents();
+}
+
+
+void GuiProgress::showEvent(QShowEvent*)
+{
+	// don't show splash when progress window is visible
+	support::ProgressInterface::setInstance(this);
+}
+
+
+void GuiProgress::hideEvent(QHideEvent*)
+{
+	// show splash when no progress window is visible
+	support::ProgressInterface::setInstance(GuiProgressSplash::instance());
+}
+
+
+void GuiProgress::update()
+{
+	processEvents();
+}
+
+
+
+Dialog * createGuiProgress(GuiView & lv)
+{
+	GuiView & guiview = static_cast(lv);
+#ifdef Q_WS_MACX
+	// TODO where to show up on the Mac?
+	//return new GuiProgress(guiview, Qt::RightDockWidgetArea, Qt::Drawer);
+#else
+	return new GuiProgress(guiview, Qt::BottomDockWidgetArea);
+#endif
+}
+
+
+
+GuiProgressSplash::GuiProgressSplash() : 
+  QSplashScreen(QPixmap(":/images/lyx.png").scaled(400,200, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), 
+Qt::WindowStaysOnTopHint ),
+  show_counter(0)
+{
+	wait.setSingleShot(true);
+	// wait before show
+	wait.setInterval(2000);
+	connect(&wait, SIGNAL(timeout()), this, SLOT(showSplash()), Qt::DirectConnection);
+	connect(this, SIGNAL(triggerHide()), this, SLOT(hideSplash()), Qt::DirectConnection);
+}
+
+
+void GuiProgressSplash::showSplash()
+{
+	show();
+}
+
+
+
+void GuiProgressSplash::hideSplash()
+{
+	hide();
+}
+
+
+void GuiProgressSplash::progessStarted()
+{
+	show_counter++;
+	if (!wait.isActive()) {
+		// does not work if we block the gui thread
+		// therefore call call update()
+		wait.start();
+	}
+}
+
+
+void GuiProgressSplash::progessFinished()
+{
+	if (show_counter > 0)
+		show_counter--;
+	if (show_counter == 0) {
+		wait.stop();
+		triggerHide();
+		processEvents();
+	}
+}
+
+
+void GuiProgressSplash::mousePressEvent(QMouseEvent *)
+{
+//overwrite hide from QSplashScreen ?
+triggerHide();
+}
+
+
+
+void GuiProgressSplash::update()
+{
+	processEvents();
+}
+
+
+void GuiProgressSplash::appendMessage(QString const & msg)
+{
+//qDebug() << "void GuiProgressSplash::appendMessage";
+//qDebug() << msg;
+	QStringList lines = msg.split("\n");
+	while (lines.last().isEmpty() && !lines.isEmpty(

Re: GuiProgess

2009-06-07 Thread Andre Poenitz
On Sat, Jun 06, 2009 at 10:36:31PM +0200, Peter Kuemmel wrote:
> > > 1. QProcess::waitForFinished() sometimes crashes 
> > > 2. QProcess::waitForFinished() sometimes does not return (splash does
> > not disappear)
> > > 3. QProcess::started() is emitted twice (see disconnect in patch)
> > > 
> > > Until nobody proves me wrong I assume QProcess is not usable
> > > synchronously. Then I try it again with Qt 7.0.

Would be nice to have that reproducible with a minimal example.
QProcess (also the synchroneous version) seems to work well on the
supported platforms (yes, Enrico, Cygwin is none of them) for the rest
of the world, so all of the problems you mentioned would rank as the
equivalent of "must fix".

Andre'


Re: Broken reverse search

2009-06-07 Thread Uwe Stöhr

> Whatever you come to agree, could you please document that (e.g. on the wiki,
> like we have documented the release procedure)?

I've added a list of the maintainers:
http://wiki.lyx.org/LyX/DocumentationDevelopment#maintain

- When you are not the maintainer of a documentation file, use Change Tracking
- Only the maintainer of a document accepts changes

regards Uwe


Re: [christian.ridderst...@gmail.com: Hartmut has created updated screenshots for the LyX Graphical Tour]

2009-06-07 Thread Pavel Sanda
Hartmut Haase wrote:
> we have enough disk spacve), and someone can replace the english 1.3 
> screenshots by newer it he wants.

this was just to encouragement if you want to be that someone, while
you are this job... :)
pavel


Re: r29976 - lyx-devel/trunk/src/insets

2009-06-07 Thread Pavel Sanda
Abdelrazak Younes wrote:
>> Log:
>> Fix compilation on win
>
> You switched to Windows??!!!

for your calm sleep i'm still behind the black console on
the top of the penguin navel. once the frosty falklands
cover my body i may start eating the apples. Uwe screamed
ang gcc approved by warning, thats all ;) 
pavel


Re: r29981 - in lyx-devel/trunk: lib/layouts src src/insets

2009-06-07 Thread Abdelrazak Younes

On 06/06/2009 05:02, rgh...@lyx.org wrote:

Author: rgheck
Date: Sat Jun  6 05:02:43 2009
New Revision: 29981
URL: http://www.lyx.org/trac/changeset/29981



Modified: lyx-devel/trunk/src/insets/InsetText.h
==
--- lyx-devel/trunk/src/insets/InsetText.h  Sat Jun  6 03:56:46 2009
(r29980)
+++ lyx-devel/trunk/src/insets/InsetText.h  Sat Jun  6 05:02:43 2009
(r29981)
@@ -144,8 +144,8 @@
///
virtual bool allowMultiPar() const { return true; }

-   // Update the counters of this inset and of its contents
-   void updateLabels(ParIterator const&);
+   /// Update the counters of this inset and of its contents
+   virtual void updateLabels(ParIterator const&);


AFAIR this is already virtual in Inset.h so this is not useful here.

Impressive work by the way.

Abdel.



Re: r29976 - lyx-devel/trunk/src/insets

2009-06-07 Thread Abdelrazak Younes

On 06/06/2009 02:31, sa...@lyx.org wrote:

Author: sanda
Date: Sat Jun  6 02:31:58 2009
New Revision: 29976
URL: http://www.lyx.org/trac/changeset/29976

Log:
Fix compilation on win


You switched to Windows??!!!

Abdel.


Re: GuiProgess

2009-06-07 Thread Abdelrazak Younes

On 06/06/2009 22:09, Peter Kuemmel wrote:

what is your vision howto proceed with those 'other calls'?

 


I've found some errors in my code, but have also the impression
QProcess in buggy on Linux (Kubuntu Qt 4.5.1)

1. QProcess::waitForFinished() sometimes crashes
2. QProcess::waitForFinished() sometimes does not return (splash does not 
disappear)
3. QProcess::started() is emitted twice (see disconnect in patch)

Until nobody proves me wrong I assume QProcess is not usable
synchronously.


Well I've used these signals successfully both on windows and Linux so I 
am inclined to think that there might be some problems in your code.Your 
excessive use of processEvents might be the root of all the perceived 
problem. I don't really understand why you need that but I unfortunately 
don't have the time to do much today :-(


Abdel.



Re: [christian.ridderst...@gmail.com: Hartmut has created updated screenshots for the LyX Graphical Tour]

2009-06-07 Thread Hartmut Haase
Hi Pavel,
> PS. Hartmut, maybe you could briefly mention what the differences are in
> the pictures, 
I think there is a misunderstanding. I took german screenshots from LyX 1.6.2 
to use them in my translation. I also modified some file names. In the 
meantime I've seen that there are also spanish screenshots.
Therefore it is better to have national screenshots (Christian confirmed that 
we have enough disk spacve), and someone can replace the english 1.3 
screenshots by newer it he wants.
By the way, I can't see an ... images/LGT/En directory.

> and/or what made you think it was time for better screenshots?
Well there are a lot of changes between 1.3 and 1.6.2, aren't there?

Christian please copy my screenshots I've uploaded to 
http://wiki.lyx.org/ipfm/index.php?dir=/Site/LGT/WebDe to 
http://www.lyx.org/images/LGT/WebDe/.
-- 
Viele Grüße,
Hartmut Haase

Hungerhilfe: http://www.thehungersite.com

Ohne Zensur suchen:
http://suche.amnesty-bergedorf.de/

Das heutige Motto:
Too much of a good thing can be wonderful!


Re: Broken reverse search

2009-06-07 Thread Jürgen Spitzmüller
Uwe Stöhr wrote:
> >> This would make it impossible for me to keep the docs up to date.
> >> Imagine Georg adds something about label translation, 3 hours later
> >> Jürgen adds something about thesaurus. Result: When Jürgen would
> >> accept the changes, I will loose Georg's changes.
> >
> > No, you don't, because the whole history is there in svn. You run:
> >svn log --limit 10 doc/UserGuide.lyx
> > and see the last ten changes. Let's say they were at r15, r18, r25, etc.
> > Then you do:
> >svn up -r 15 doc/UserGuide.lyx...
>
> Oh please not, this is much too complicated, Why can't it be left as is?
> I'm very comfortable with the current situation.

Whatever you come to agree, could you please document that (e.g. on the wiki, 
like we have documented the release procedure)?

Uwe, you say you are comfortable with "how it is", but actually no one except 
you knows "how it is".

I also would welcome a page where the current maintainers of the respective 
manuals are listed.

Jürgen