menuBar()->addAction(tr("&Buzz"), this, SLOT(mode_buzz()));
menuBar()->addAction(tr("&Config"), this, SLOT(config()));
+ demonio = new QAction(this);
+ if ( system("killall -0 GoogleLatitudeDaemon 2> /dev/null" ) ) {
+ demonio->setText(tr("&Start Daemon"));
+ } else {
+ demonio->setText(tr("&Stop Daemon"));
+ }
+ connect(demonio, SIGNAL(triggered()), this, SLOT(mode_demonio()));
+ menuBar()->addAction(demonio);
+
// updater
glatitude = new GoogleLatitude(this);
gps = new GpsMaemo5(this);
maps->page()->mainFrame()->evaluateJavaScript("document.getElementById('gaia_loginform').submit();");
}
}
+
+void LatitudeGUI::mode_demonio() {
+ if ( ! system("killall -0 GoogleLatitudeDaemon 2> /dev/null" ) ) {
+ system("killall GoogleLatitudeDaemon 2> /dev/null");
+ demonio->setText(tr("&Start Daemon"));
+ } else {
+ QProcess *cli = new QProcess(this);
+ cli->start(QCoreApplication::applicationDirPath()+"/GoogleLatitudeDaemon");
+ qDebug() << "LatitudeGUI: demonio" << QCoreApplication::applicationDirPath()+"/GoogleLatitudeDaemon";
+ if ( ! system("killall -0 GoogleLatitudeDaemon 2> /dev/null" ) ) {
+ demonio->setText(tr("&Stop Daemon"));
+ }
+ }
+}