Re: Notifying users during long tasks.

2007-09-12 Thread Abdelrazak Younes

Tommaso Cucinotta wrote:

Abdelrazak Younes ha scritto:
Yes, and this doesn't have to change to do what you envision. I had 
once a patch that used the forkedcall mechanism that is used for 
graphics conversion (and for instant preview). As you probably know, 
graphics are converted asynchronously before they are shown on screen. 
I had once a patch that did exactly that but I can't seem to find it :-(
Ok, infact the mechanism needs to be similar. Where are the points in 
the code where the

graphics displaying activities are started and terminated/joined ?


Look at PreviewLoader and ForkedcallsController. Basically, the process 
is detached and LyX periodically checks if it is completed or not. The 
checking occurs in WorkArea::toggleCursor().


Abdel.



Re: Notifying users during long tasks.

2007-09-12 Thread Abdelrazak Younes

Tommaso Cucinotta wrote:

Abdelrazak Younes ha scritto:
Yes, and this doesn't have to change to do what you envision. I had 
once a patch that used the forkedcall mechanism that is used for 
graphics conversion (and for instant preview). As you probably know, 
graphics are converted asynchronously before they are shown on screen. 
I had once a patch that did exactly that but I can't seem to find it :-(
Ok, infact the mechanism needs to be similar. Where are the points in 
the code where the

graphics displaying activities are started and terminated/joined ?


Look at PreviewLoader and ForkedcallsController. Basically, the process 
is detached and LyX periodically checks if it is completed or not. The 
checking occurs in WorkArea::toggleCursor().


Abdel.



Re: Notifying users during long tasks.

2007-09-11 Thread Helge Hafting

Tommaso Cucinotta wrote:

Hi all,

I'd like to know what is the most suitable way to notify users of
the progress made during possibly long tasks, in LyX.

The standard way would be to create a new thread, so to exit
the Qt callback that started the long task, adding a progress bar or
similar and updating it periodically, and a Cancel button that allows
to stop the batch activity. Is there any reusable LyX component/code
snippet for managing such situations ?

If you di this - please make that a progress bar (or similiar) inside
the main window - _not_ a popup thing. :-)

Helge Hafting


Re: Notifying users during long tasks.

2007-09-11 Thread Tommaso Cucinotta

Helge Hafting ha scritto:

If you di this - please make that a progress bar (or similiar) inside
the main window - _not_ a popup thing. :-)

Ok, guess smth. besides (or embedded into) the status bar. Despite
the appearence, I guess the main problem is that LyX has a single
thread design. So, if you have a long activity to be run externally to
the current doc (let's say compiling a LaTeX/PS/PDF), it is safe to
let the user keep modifying the doc. On the other hand, if the activity
needs access to the doc, user activities should be inhibited (this
is perfectly done by a very long Gui callback, even though it is not good
to see), but at least there should be a way to cancel it if the user
wants so (and this is not doable from within a long Gui callback).
The best support for external (potentially long) activities I've ever seen
within applications is the one of Eclipse, where user may even start or
enqueue multiple activities, the system keeps track of dependencies
among them, if any, and a progress dockable window may always be
popped up by the user so to see what is not done yet and the state
of advance of each activity. At last, if the user makes an operation
that requires one of the activities to complete, then the user interaction
is blocked until completition of that activity.

But probably, I don't want to use a cannon to shoot to a fly.

   T.

--
Tommaso Cucinotta, Computer Engineering PhD, Researcher
ReTiS Lab, Scuola Superiore Sant'Anna, Pisa, Italy
Tel +39 050 882 024, Fax +39 050 882 003
http://feanor.sssup.it/~tommaso



Re: Notifying users during long tasks.

2007-09-11 Thread Abdelrazak Younes

Tommaso Cucinotta wrote:

Helge Hafting ha scritto:

If you di this - please make that a progress bar (or similiar) inside
the main window - _not_ a popup thing. :-)

Ok, guess smth. besides (or embedded into) the status bar. Despite
the appearence, I guess the main problem is that LyX has a single
thread design.


Yes, and this doesn't have to change to do what you envision. I had once 
a patch that used the forkedcall mechanism that is used for graphics 
conversion (and for instant preview). As you probably know, graphics are 
converted asynchronously before they are shown on screen. I had once a 
patch that did exactly that but I can't seem to find it :-(



So, if you have a long activity to be run externally to
the current doc (let's say compiling a LaTeX/PS/PDF), it is safe to
let the user keep modifying the doc. On the other hand, if the activity
needs access to the doc, user activities should be inhibited (this
is perfectly done by a very long Gui callback, even though it is not good
to see),


No, only the export to latex needs be synchronous because this is done 
by LyX itself; all other conversion can be asynchronous.


Abdel.



Re: Notifying users during long tasks.

2007-09-11 Thread Tommaso Cucinotta

Abdelrazak Younes ha scritto:
Yes, and this doesn't have to change to do what you envision. I had 
once a patch that used the forkedcall mechanism that is used for 
graphics conversion (and for instant preview). As you probably know, 
graphics are converted asynchronously before they are shown on screen. 
I had once a patch that did exactly that but I can't seem to find it :-(
Ok, infact the mechanism needs to be similar. Where are the points in 
the code where the

graphics displaying activities are started and terminated/joined ?

   T.

--
Tommaso Cucinotta, Computer Engineering PhD, Researcher
ReTiS Lab, Scuola Superiore Sant'Anna, Pisa, Italy
Tel +39 050 882 024, Fax +39 050 882 003
http://feanor.sssup.it/~tommaso



Re: Notifying users during long tasks.

2007-09-11 Thread Helge Hafting

Tommaso Cucinotta wrote:

Hi all,

I'd like to know what is the most suitable way to notify users of
the progress made during possibly long tasks, in LyX.

The standard way would be to create a new thread, so to exit
the Qt callback that started the long task, adding a progress bar or
similar and updating it periodically, and a Cancel button that allows
to stop the batch activity. Is there any reusable LyX component/code
snippet for managing such situations ?

If you di this - please make that a progress bar (or similiar) inside
the main window - _not_ a popup thing. :-)

Helge Hafting


Re: Notifying users during long tasks.

2007-09-11 Thread Tommaso Cucinotta

Helge Hafting ha scritto:

If you di this - please make that a progress bar (or similiar) inside
the main window - _not_ a popup thing. :-)

Ok, guess smth. besides (or embedded into) the status bar. Despite
the appearence, I guess the main problem is that LyX has a single
thread design. So, if you have a long activity to be run externally to
the current doc (let's say compiling a LaTeX/PS/PDF), it is safe to
let the user keep modifying the doc. On the other hand, if the activity
needs access to the doc, user activities should be inhibited (this
is perfectly done by a very long Gui callback, even though it is not good
to see), but at least there should be a way to cancel it if the user
wants so (and this is not doable from within a long Gui callback).
The best support for external (potentially long) activities I've ever seen
within applications is the one of Eclipse, where user may even start or
enqueue multiple activities, the system keeps track of dependencies
among them, if any, and a progress dockable window may always be
popped up by the user so to see what is not done yet and the state
of advance of each activity. At last, if the user makes an operation
that requires one of the activities to complete, then the user interaction
is blocked until completition of that activity.

But probably, I don't want to "use a cannon to shoot to a fly".

   T.

--
Tommaso Cucinotta, Computer Engineering PhD, Researcher
ReTiS Lab, Scuola Superiore Sant'Anna, Pisa, Italy
Tel +39 050 882 024, Fax +39 050 882 003
http://feanor.sssup.it/~tommaso



Re: Notifying users during long tasks.

2007-09-11 Thread Abdelrazak Younes

Tommaso Cucinotta wrote:

Helge Hafting ha scritto:

If you di this - please make that a progress bar (or similiar) inside
the main window - _not_ a popup thing. :-)

Ok, guess smth. besides (or embedded into) the status bar. Despite
the appearence, I guess the main problem is that LyX has a single
thread design.


Yes, and this doesn't have to change to do what you envision. I had once 
a patch that used the forkedcall mechanism that is used for graphics 
conversion (and for instant preview). As you probably know, graphics are 
converted asynchronously before they are shown on screen. I had once a 
patch that did exactly that but I can't seem to find it :-(



So, if you have a long activity to be run externally to
the current doc (let's say compiling a LaTeX/PS/PDF), it is safe to
let the user keep modifying the doc. On the other hand, if the activity
needs access to the doc, user activities should be inhibited (this
is perfectly done by a very long Gui callback, even though it is not good
to see),


No, only the export to latex needs be synchronous because this is done 
by LyX itself; all other conversion can be asynchronous.


Abdel.



Re: Notifying users during long tasks.

2007-09-11 Thread Tommaso Cucinotta

Abdelrazak Younes ha scritto:
Yes, and this doesn't have to change to do what you envision. I had 
once a patch that used the forkedcall mechanism that is used for 
graphics conversion (and for instant preview). As you probably know, 
graphics are converted asynchronously before they are shown on screen. 
I had once a patch that did exactly that but I can't seem to find it :-(
Ok, infact the mechanism needs to be similar. Where are the points in 
the code where the

graphics displaying activities are started and terminated/joined ?

   T.

--
Tommaso Cucinotta, Computer Engineering PhD, Researcher
ReTiS Lab, Scuola Superiore Sant'Anna, Pisa, Italy
Tel +39 050 882 024, Fax +39 050 882 003
http://feanor.sssup.it/~tommaso



Notifying users during long tasks.

2007-09-10 Thread Tommaso Cucinotta

Hi all,

I'd like to know what is the most suitable way to notify users of
the progress made during possibly long tasks, in LyX.

The standard way would be to create a new thread, so to exit
the Qt callback that started the long task, adding a progress bar or
similar and updating it periodically, and a Cancel button that allows
to stop the batch activity. Is there any reusable LyX component/code
snippet for managing such situations ?

Thanks, bye,

   T.



Re: Notifying users during long tasks.

2007-09-10 Thread Andre Poenitz
On Mon, Sep 10, 2007 at 04:04:51PM +0200, Tommaso Cucinotta wrote:
 Hi all,
 
 I'd like to know what is the most suitable way to notify users of
 the progress made during possibly long tasks, in LyX.
 
 The standard way would be to create a new thread, so to exit
 the Qt callback that started the long task, adding a progress bar or
 similar and updating it periodically, and a Cancel button that allows
 to stop the batch activity. Is there any reusable LyX component/code
 snippet for managing such situations ?

No(t yet).

Andre'


Notifying users during long tasks.

2007-09-10 Thread Tommaso Cucinotta

Hi all,

I'd like to know what is the most suitable way to notify users of
the progress made during possibly long tasks, in LyX.

The standard way would be to create a new thread, so to exit
the Qt callback that started the long task, adding a progress bar or
similar and updating it periodically, and a Cancel button that allows
to stop the batch activity. Is there any reusable LyX component/code
snippet for managing such situations ?

Thanks, bye,

   T.



Re: Notifying users during long tasks.

2007-09-10 Thread Andre Poenitz
On Mon, Sep 10, 2007 at 04:04:51PM +0200, Tommaso Cucinotta wrote:
> Hi all,
> 
> I'd like to know what is the most suitable way to notify users of
> the progress made during possibly long tasks, in LyX.
> 
> The standard way would be to create a new thread, so to exit
> the Qt callback that started the long task, adding a progress bar or
> similar and updating it periodically, and a Cancel button that allows
> to stop the batch activity. Is there any reusable LyX component/code
> snippet for managing such situations ?

No(t yet).

Andre'