<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 &amp; 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 &amp; Regards,<br />Sudheer<br /><br />P.S: Sometimes 2 cents is worth more than a million :)<br /><br />&gt; Date: Fri, 7 May 2010 10:54:15 -0400<br />&gt; Subject: Re: Noob question re Qt Application structure<br />&gt; From: <a href="#" onclick="parent.mailclient.util.HelperUtil.executeClientFunction('openNewMail','ianare@gmail.com');">ianare@gmail.com</a><br />&gt; To: <a href="#" onclick="parent.mailclient.util.HelperUtil.executeClientFunction('openNewMail','rkmaemo@gmx.com');">rkmaemo@gmx.com</a><br />&gt; 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 />&gt; <br />&gt; I second that opinion. Subclassing by functionality is definitely good<br />&gt; for a single app, but if you need to have the two parts running at<br />&gt; different times a daemon app and a GUI app is the way to go.<br />&gt; <br />&gt; Another option you could use to interact with your two apps is through<br />&gt; dbus itself, ince you will already be using that kind of code.<br />&gt; <br />&gt; - ianaré sévi<br />&gt; <br />&gt; <br />&gt; <br />&gt; 2010/5/7 Ram Kurvakat &lt;<a href="#" onclick="parent.mailclient.util.HelperUtil.executeClientFunction('openNewMail','rkmaemo@gmx.com');">rkmaemo@gmx.com</a>&gt;:<br />&gt; &gt; just my 2 pence worth.<br />&gt; &gt;<br />&gt; &gt; you should perhaps try to make 2 different apps for it.<br />&gt; &gt;<br />&gt; &gt; 1 which runs as a daemon and invoked on startup using an upstart script.<br />&gt; &gt;<br />&gt; &gt; and the other a GUI based app , that can interact with your daemon, via<br />&gt; &gt; files, sockets, any which way.<br />&gt; &gt;<br />&gt; &gt; cheers<br />&gt; &gt;<br />&gt; &gt; Ram<br />&gt; &gt;<br />&gt; &gt; ----- Original Message -----<br />&gt; &gt;<br />&gt; &gt; From: Scifi Guy<br />&gt; &gt;<br />&gt; &gt; Sent: 05/07/10 03:26 PM<br />&gt; &gt;<br />&gt; &gt; To: <a href="#" onclick="parent.mailclient.util.HelperUtil.executeClientFunction('openNewMail','maemo-developers@maemo.org');">maemo-developers@maemo.org</a><br />&gt; &gt;<br />&gt; &gt; Subject: Noob question re Qt Application structure<br />&gt; &gt;<br />&gt; &gt; Hi All,<br />&gt; &gt;<br />&gt; &gt; I am developing a Qt4.6 based application that monitors outgoing<br />&gt; &gt; international calls (by connecting to relevant DBUS signals) and routes<br />&gt; &gt; them via a calling card number. I have developed a configuration UI widget<br />&gt; &gt; (QWidget subclass) to enable/disable such routing.<br />&gt; &gt; The problem is that the UI widget code and DBUS slots code are all in the<br />&gt; &gt; same class. If I launch the application, the UI widget is shown.<br />&gt; &gt;<br />&gt; &gt; This is the code in my main.cpp.<br />&gt; &gt;<br />&gt; &gt;<br />&gt; &gt; #include &lt;QtGui/QApplication&gt;<br />&gt; &gt; #include &quot;eventmonitor.h&quot;<br />&gt; &gt; #include &lt;QDebug&gt;<br />&gt; &gt;<br />&gt; &gt; int main(int argc, char *argv[])<br />&gt; &gt; {<br />&gt; &gt;<br />&gt; &gt;     QApplication a(argc, argv);<br />&gt; &gt;     EventMonitor w;<br />&gt; &gt;     w.show();<br />&gt; &gt;     return a.exec();<br />&gt; &gt; }<br />&gt; &gt;<br />&gt; &gt;<br />&gt; &gt; EventMonitor is a QWidget subclass which also has functions to connect to<br />&gt; &gt; DBUS signals. My aim is to separate the functionality into two different<br />&gt; &gt; classes. The class with DBus slots should be running as a daemon which is<br />&gt; &gt; invoked on startup.<br />&gt; &gt; The class with QWidget (config screen) should be invoked when user launches<br />&gt; &gt; the app from the applications menu. Think on the lines of AutoDisconnect.<br />&gt; &gt;<br />&gt; &gt; What is the best way to achieve this? Let me know if you want me to post<br />&gt; &gt; more code.<br />&gt; &gt;<br />&gt; &gt;<br />&gt; &gt; Thanks &amp; Regards,<br />&gt; &gt; Sudheer<br />&gt; &gt; ________________________________<br />&gt; &gt; The New Busy is not the old busy. Search, chat and e-mail from your inbox.<br />&gt; &gt; Get started.<br />&gt; &gt;<br />&gt; &gt;<br />&gt; &gt;<br />&gt; &gt;<br />&gt; &gt;<br />&gt; &gt; _______________________________________________<br />&gt; &gt; maemo-developers mailing list<br />&gt; &gt; <a href="#" onclick="parent.mailclient.util.HelperUtil.executeClientFunction('openNewMail','maemo-developers@maemo.org');">maemo-developers@maemo.org</a><br />&gt; &gt; <a href="https://lists.maemo.org/mailman/listinfo/maemo-developers" target="_blank">https://lists.maemo.org/mailman/listinfo/maemo-developers</a><br />&gt; &gt;<br />&gt; &gt;<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>