[Gambas-user] A issue with gbDesktop.open

Benoît Minisini gambas at ...1...
Sat Apr 25 23:06:25 CEST 2015


Le 21/04/2015 13:24, Jorge Carrión a écrit :
> I have a project thas uses gbDesktop in order to open .odt documents and
> let users to modify them.
> In order to control if a document has changed after been closed the second
> parameter of desktop.open is setted to True.
>
> gbDesktop.Open(myfile,True)
>
> It seems work fine..but (allways there's a but) yesterday I find that in my
> Office development mahcine, executing the project from the IDE, that second
> parameter was ignored and the project does'nt wait for the end of launched
> Desktop application (LibreOffice).
>
> It drive me nut all the morning and I wrote a workaround... but (again)
> this morning the second parameter works fine.
>
>   The same machine, the same project, the same gambas. Yesterday doesn't
> work, today works.
>
> There is some explanation? This point is very important to my project, if
> program doesn't wait all the sistem fails...
>
> The system info:
> [System]
> Gambas=3.7.0
> OperatingSystem=Linux
> Kernel=3.13.0-37-generic
> Architecture=x86_64
> Distribution=Linux Mint 17.1 Rebecca
> Desktop=GNOME
> Theme=QCleanlooks
> Language=es_ES.UTF-8
> Memory=5934M
> [Libraries]
> Cairo=libcairo.so.2.11301.0
> Curl=libcurl.so.4.3.0
> DBus=libdbus-1.so.3.7.6
> GStreamer=libgstreamer-0.10.so.0.30.0
> GStreamer=libgstreamer-1.0.so.0.204.0
> GTK+3=libgtk-3.so.0.1000.8
> GTK+=libgtk-x11-2.0.so.0.2400.23
> OpenGL=libGL.so.1.2.0
> Poppler=libpoppler.so.44.0.0
> Qt4=libQtCore.so.4.8.6
> SDL=libSDL-1.2.so.0.11.4
>
> The project uses qt4 and the Desktop Qt4 theme is cleanlooks
>
> I can't send a proyect reproducing the error: *Today* it works fine!
>
> Regards.

Desktop.Open() relies on an xdg-util shell script to open the file.

When the Wait argument is True, Desktop.Open() just waits for the end of 
the xdg-util script. It does not know how to wait for the end of the 
program that will open the file for you.

The Wait argument is mainly useful to catch a possible error when 
running a script. It is not reliable for doing what you want.

Regards,

-- 
Benoît Minisini




More information about the User mailing list