+/*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ Henri Lampela - henri.lampela@ixonos.com
+
+ Situare is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ version 2 as published by the Free Software Foundation.
+
+ Situare is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Situare; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA.
+*/
+
+#include <QtGui>
+#include <QDebug>
+#include <QFormLayout>
+#include "logindialog.h"
+
+LoginDialog::LoginDialog(QWidget *parent)
+ : QDialog(parent)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ setWindowTitle(tr("Login to Situare with Facebook account"));
+
+ m_emailEdit = new QLineEdit();
+ m_passwordEdit = new QLineEdit();
+ m_passwordEdit->setEchoMode(QLineEdit::Password);
+
+ QGridLayout *gridLayout = new QGridLayout(this);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(Qt::Vertical);
+ QPushButton *connectButton = buttonBox->addButton(QDialogButtonBox::Ok);
+ QPushButton *cancelButton = buttonBox->addButton(QDialogButtonBox::Cancel);
+ connectButton->setText(tr("Connect"));
+
+ QFormLayout *form = new QFormLayout();
+ form->addRow(new QLabel(tr("E-mail:")), m_emailEdit);
+ form->addRow(new QLabel(tr("Password:")), m_passwordEdit);
+
+ gridLayout->addLayout(form, 0, 0, 2, 1);
+ gridLayout->addWidget(buttonBox, 0, 1, 1, 1);
+
+ connect(connectButton, SIGNAL(clicked()),
+ this, SLOT(connectPressed()));
+ connect(cancelButton, SIGNAL(clicked()),
+ this, SLOT(reject()));
+
+ setLayout(gridLayout);
+}
+
+void LoginDialog::connectPressed()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ emit loginDialogDone(m_emailEdit->text(), m_passwordEdit->text());
+
+ accept();
+}