<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title></title><meta http-equiv="Content-type" content="text/html; charset=UTF-8" /><style type="text/css">p { margin:0px; padding:0px; }</style></head><body style='background-color:rgb(255, 255, 255);background-image:none;background-repeat:repeat;background-position:0% 0%;font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:12px;margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;padding-top:5px;padding-bottom:5px;padding-left:5px;padding-right:5px;'><p><span style="font-family:Verdana;"><font id="mc_first" size="2">assuming you have the communication between the GUI and daemon in place.</font></span></p><p><span style="font-family:Verdana;"><font id="mc_first" size="2"><br /></font></span></p><p><span style="font-family:Verdana;"><font id="mc_first" size="2">you could always launch a daemon ( this is not running ) using <a href="http://doc.trolltech.com/4.6/qprocess.html" target="_blank" title="http://doc.trolltech.com/4.6/qprocess.html">QProcess</a> and shutdown by listening to a custom DBUS message or similar </font></span></p><p><span style="font-family:Verdana;"><font id="mc_first" size="2">communication.</font></span></p><p><span style="font-family:Verdana;"><font id="mc_first" size="2"><br /></font></span></p><p><span style="font-family:Verdana;"><font id="mc_first" size="2">-Ram</font></span></p><p><span style="font-family:Verdana;"><font id="mc_first" size="2"><br /></font></span></p><p><span style="font-family:Verdana;"><font id="mc_first" size="2"><br /></font></span></p><font id="mc_first" size="2"><p></p><blockquote class="quote" face="Verdana" type="cite" style="font-size:12px;"><p>----- Original Message -----</p><p>From: Scifi Guy</p><p>Sent: 05/07/10 04:24 PM</p><p>To: ianare@gmail.com, rkmaemo@gmx.com</p><p>Subject: RE: Noob question re Qt Application structure</p><br /><div> Hi Ram & ianaré,<br /><br />Thank you for the response. Creating two apps makes sense. I was trying to avoid user having to install two apps for one feature. But it is not a big deal i guess (If i set the dependencies properly).<br /><br />Here is another question though. How I do launch/kill the daemon app from the GUI app? This is required when user chooses enable/disable application from GUI app. I can exit the daemon by receiving a custom DBUS signal but how do I launch it?<br /><br />Thanks & Regards,<br />Sudheer<br /><br />P.S: Sometimes 2 cents is worth more than a million :)<br /><br />> Date: Fri, 7 May 2010 10:54:15 -0400<br />> Subject: Re: Noob question re Qt Application structure<br />> From: <a href="#" onclick="parent.mailclient.util.HelperUtil.executeClientFunction('openNewMail','ianare@gmail.com');">ianare@gmail.com</a><br />> To: <a href="#" onclick="parent.mailclient.util.HelperUtil.executeClientFunction('openNewMail','rkmaemo@gmx.com');">rkmaemo@gmx.com</a><br />> CC: <a href="#" onclick="parent.mailclient.util.HelperUtil.executeClientFunction('openNewMail','scifi.guy@hotmail.com');">scifi.guy@hotmail.com</a>; <a href="#" onclick="parent.mailclient.util.HelperUtil.executeClientFunction('openNewMail','maemo-developers@maemo.org');">maemo-developers@maemo.org</a><br />> <br />> I second that opinion. Subclassing by functionality is definitely good<br />> for a single app, but if you need to have the two parts running at<br />> different times a daemon app and a GUI app is the way to go.<br />> <br />> Another option you could use to interact with your two apps is through<br />> dbus itself, ince you will already be using that kind of code.<br />> <br />> - ianaré sévi<br />> <br />> <br />> <br />> 2010/5/7 Ram Kurvakat <<a href="#" onclick="parent.mailclient.util.HelperUtil.executeClientFunction('openNewMail','rkmaemo@gmx.com');">rkmaemo@gmx.com</a>>:<br />> > just my 2 pence worth.<br />> ><br />> > you should perhaps try to make 2 different apps for it.<br />> ><br />> > 1 which runs as a daemon and invoked on startup using an upstart script.<br />> ><br />> > and the other a GUI based app , that can interact with your daemon, via<br />> > files, sockets, any which way.<br />> ><br />> > cheers<br />> ><br />> > Ram<br />> ><br />> > ----- Original Message -----<br />> ><br />> > From: Scifi Guy<br />> ><br />> > Sent: 05/07/10 03:26 PM<br />> ><br />> > To: <a href="#" onclick="parent.mailclient.util.HelperUtil.executeClientFunction('openNewMail','maemo-developers@maemo.org');">maemo-developers@maemo.org</a><br />> ><br />> > Subject: Noob question re Qt Application structure<br />> ><br />> > Hi All,<br />> ><br />> > I am developing a Qt4.6 based application that monitors outgoing<br />> > international calls (by connecting to relevant DBUS signals) and routes<br />> > them via a calling card number. I have developed a configuration UI widget<br />> > (QWidget subclass) to enable/disable such routing.<br />> > The problem is that the UI widget code and DBUS slots code are all in the<br />> > same class. If I launch the application, the UI widget is shown.<br />> ><br />> > This is the code in my main.cpp.<br />> ><br />> ><br />> > #include <QtGui/QApplication><br />> > #include "eventmonitor.h"<br />> > #include <QDebug><br />> ><br />> > int main(int argc, char *argv[])<br />> > {<br />> ><br />> > QApplication a(argc, argv);<br />> > EventMonitor w;<br />> > w.show();<br />> > return a.exec();<br />> > }<br />> ><br />> ><br />> > EventMonitor is a QWidget subclass which also has functions to connect to<br />> > DBUS signals. My aim is to separate the functionality into two different<br />> > classes. The class with DBus slots should be running as a daemon which is<br />> > invoked on startup.<br />> > The class with QWidget (config screen) should be invoked when user launches<br />> > the app from the applications menu. Think on the lines of AutoDisconnect.<br />> ><br />> > What is the best way to achieve this? Let me know if you want me to post<br />> > more code.<br />> ><br />> ><br />> > Thanks & Regards,<br />> > Sudheer<br />> > ________________________________<br />> > The New Busy is not the old busy. Search, chat and e-mail from your inbox.<br />> > Get started.<br />> ><br />> ><br />> ><br />> ><br />> ><br />> > _______________________________________________<br />> > maemo-developers mailing list<br />> > <a href="#" onclick="parent.mailclient.util.HelperUtil.executeClientFunction('openNewMail','maemo-developers@maemo.org');">maemo-developers@maemo.org</a><br />> > <a href="https://lists.maemo.org/mailman/listinfo/maemo-developers" target="_blank">https://lists.maemo.org/mailman/listinfo/maemo-developers</a><br />> ><br />> ><br /><br /><hr />Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. <a href="http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2" target="_blank">See how.</a> </div></blockquote><p></p><br /></font><p></p><p> </p><div id="editor_signature"><p size="2" style="font-family:Verdana;"> </p></div></body></html>