2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Katri Kaikkonen - katri.kaikkonen@ixonos.com
6 Henri Lampela - henri.lampela@ixonos.com
8 Situare is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 version 2 as published by the Free Software Foundation.
12 Situare is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Situare; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
24 #include "updatelocationdialog.h"
26 UpdateLocationDialog::UpdateLocationDialog(QWidget *parent)
29 setWindowTitle(tr("Update Location"));
31 QScrollArea *scrollArea = new QScrollArea(this);
32 QGridLayout *gridLayout = new QGridLayout(this);
33 QGroupBox *groupBox = new QGroupBox(scrollArea);
35 m_textEdit = new QTextEdit;
36 m_locationLabel = new QLabel;
37 m_checkBox = new QCheckBox(tr("Publish on Facebook"));
39 QDialogButtonBox *buttonBox = new QDialogButtonBox(Qt::Vertical);
40 QPushButton *sendButton = buttonBox->addButton(QDialogButtonBox::Ok);
41 QPushButton *cancelButton = buttonBox->addButton(QDialogButtonBox::Cancel);
42 sendButton->setText(tr("Send"));
44 QFormLayout *form = new QFormLayout();
45 form->addRow(new QLabel(tr("Location:")), m_locationLabel);
46 form->addRow(new QLabel(tr("Message:")), m_textEdit);
47 form->addWidget(m_checkBox);
49 new TextEditAutoResizer(m_textEdit);
51 groupBox->setLayout(form);
52 scrollArea->setWidget(groupBox);
53 scrollArea->setWidgetResizable(true);
54 gridLayout->addWidget(scrollArea, 0, 0, 2, 1);
55 gridLayout->addWidget(buttonBox, 0, 1, 1, 1);
56 setLayout(gridLayout);
58 connect(sendButton, SIGNAL(clicked()), this, SLOT(sendUpdate()));
59 connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
64 void UpdateLocationDialog::setAddress(const QString &address)
66 qDebug() << __PRETTY_FUNCTION__;
67 m_locationLabel->setText(address);
70 void UpdateLocationDialog::sendUpdate()
72 qDebug() << __PRETTY_FUNCTION__;
74 // coordinates for this call will be get from somewhere, map etc...
75 emit statusUpdate(m_textEdit->toPlainText(), m_checkBox->isChecked());