-QFormLayout *LatitudeGUI::do_login() {
- login_user = new QLineEdit(setting->value("user","my_username").toString());
- login_pass = new QLineEdit(setting->value("pass","my_password").toString());
- login_pass->setEchoMode(QLineEdit::Password);
- QPushButton *login_up = new QPushButton(tr("Update Location"));
-
- QFormLayout *layout = new QFormLayout();
- layout->addRow(tr("&Username"), login_user);
- layout->addRow(tr("&Password"), login_pass);
- layout->addRow(login_up);
-
- connect(login_user, SIGNAL(editingFinished()), this, SLOT(save()));
- connect(login_pass, SIGNAL(editingFinished()), this, SLOT(save()));
- connect(login_user, SIGNAL(returnPressed()), login_pass, SLOT(setFocus()));
- connect(login_pass, SIGNAL(returnPressed()), this, SLOT(set()));
- connect(login_up, SIGNAL(clicked()), this, SLOT(set()));
-
- return layout;
-}
-
-QFormLayout *LatitudeGUI::do_location() {
- location_lat = new QLineEdit(QString::number(0));
- location_lon = new QLineEdit(QString::number(0));
- location_acc = new QLineEdit(QString::number(0));
-
- QFormLayout *layout = new QFormLayout();
- layout->addRow(tr("lat :"), location_lat);
- layout->addRow(tr("lon :"), location_lon);
- layout->addRow(tr("acc :"), location_acc);
-
- return layout;
+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()+QDir::separator()+"GoogleLatitudeDaemon");
+ qDebug() << "LatitudeGUI: demonio" << QCoreApplication::applicationDirPath()+"/GoogleLatitudeDaemon";
+ if ( ! system("killall -0 GoogleLatitudeDaemon 2> /dev/null" ) ) {
+ demonio->setText(tr("&Stop Daemon"));
+ }
+ }