On 5/9/13 8:48 PM, Sabarish Sridhar wrote:
>               When I query data from my database it takes some while to get
> the data back and I would like to show some progress dialog to alert the
> user of the ongoing operation. But I dont think that DABO has some natively
> built tools to achieve these. So I realize that this has to be done with
> wxPython for which I have a tutorial here
> http://www.blog.pythonlibrary.org/2010/07/10/the-dialogs-of-wxpython-part-2-of-2/.
> But how exactly do I tie this into DABO when I click a button ? Do I simply
> copy paste the same code? Is that the way to do it? Or is there some other
> preferred way to do it.

This is a problem I've wanted to solve ever since Dabo's beginnings. It is a 
hard,
partly because of Dabo's design, and partly because of wxPython's design.

Basically:

* All wxPython calls need to happen in the main thread
* Dabo's db layer operates in the main thread

So, while Dabo is fetching the records, the main thread is blocked. This keeps 
us
from being able to update a progress bar until the database fetch is done, 
which is
too late. It also keeps your UI from being responsive during that time.

But updating a progress bar by a timer isn't really the best way anyway. It 
should
really be updated based on having fetched one or ten records out of a thousand 
total.
This can theoretically be done. Instead of doing fetching all matching records 
from
the backend like we do know, we'd do something like:

while cursor.fetchone():
  update_progress()
  store_record()

However, I've been cautioned that not all database backends support sending one
record at a time like they are supposed to.

Anyway, I'd love to get this figured out but have nothing to offer at the 
moment.

>                Also I do find it really frustrating that the undo function
> doesn't work on the editor(I am running Windows 7). Could someone please
> check this issue out?

I just checked and it definitely works in Linux. Can someone with Windows check 
this out?

Paul


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to