Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Starting a GUI application out of an console application

Reply
Thread Tools

Starting a GUI application out of an console application

 
 
Fabian Steiner
Guest
Posts: n/a
 
      07-17-2006
Hello!

I am currently working on an alternative for the gnome-volume-manager
for multiseat systems based on HAL and DBus. Whenever the signal
'DeviceAdded' is received I would like to start a GUI-Interface where
the user can choose from different options. But now I am wondering how I
should start this interface since this GUI must be started by a console
daemon. What is the most common way to do that?

Usually, I start a PyQt application that way:

app = QApplication(sys.argv)
ui = Dialog()
app.setMainWidget(ui)
ui.show()
app.exec_loop()

If I start it that way, I am not quite sure whether this will work since
I have got two main loops then (the one of console daemon [implemented
by using gobject.MainLoop().run()] and the Qt one). Moreover, once the
Qt application is started, it should run independently of the console
daemon.

Unfortunately, I can't think of any possibility to achieve this aim. Do
you have any suggestions?
 
Reply With Quote
 
 
 
 
faulkner
Guest
Posts: n/a
 
      07-17-2006
put your gui application in another script and start it the same way
you'd start any other application whose exit status you didn't need:
os.popen* or subprocess.Popen.
or, use the threading module to give your qt application another
thread.


Fabian Steiner wrote:
> Hello!
>
> I am currently working on an alternative for the gnome-volume-manager
> for multiseat systems based on HAL and DBus. Whenever the signal
> 'DeviceAdded' is received I would like to start a GUI-Interface where
> the user can choose from different options. But now I am wondering how I
> should start this interface since this GUI must be started by a console
> daemon. What is the most common way to do that?
>
> Usually, I start a PyQt application that way:
>
> app = QApplication(sys.argv)
> ui = Dialog()
> app.setMainWidget(ui)
> ui.show()
> app.exec_loop()
>
> If I start it that way, I am not quite sure whether this will work since
> I have got two main loops then (the one of console daemon [implemented
> by using gobject.MainLoop().run()] and the Qt one). Moreover, once the
> Qt application is started, it should run independently of the console
> daemon.
>
> Unfortunately, I can't think of any possibility to achieve this aim. Do
> you have any suggestions?


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui C++ 0 04-27-2009 12:51 PM
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui C Programming 0 04-27-2009 12:51 PM
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui Python 0 04-27-2009 12:46 PM
Re: console mp3->wav decoder for $indows or GUI one which supports console Egor Bolonev Python 0 06-30-2003 10:43 AM
Re: console mp3->wav decoder for $indows or GUI one which supports console Ben Finney Python 2 06-30-2003 05:43 AM



Advertisments