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 qDebug() << __PRETTY_FUNCTION__;
30 setWindowTitle(tr("Update Location"));
32 QScrollArea *scrollArea = new QScrollArea(this);
33 QGridLayout *gridLayout = new QGridLayout(this);
34 QGroupBox *groupBox = new QGroupBox(scrollArea);
36 m_textEdit = new QTextEdit;
37 m_locationLabel = new QLabel;
38 m_locationLabel->setWordWrap(true);
39 m_checkBox = new QCheckBox(tr("Publish on Facebook"));
41 QDialogButtonBox *buttonBox = new QDialogButtonBox(Qt::Vertical);
42 QPushButton *sendButton = buttonBox->addButton(QDialogButtonBox::Ok);
43 QPushButton *cancelButton = buttonBox->addButton(QDialogButtonBox::Cancel);
44 sendButton->setText(tr("Send"));
46 QFormLayout *form = new QFormLayout();
47 form->addRow(new QLabel(tr("Location:")), m_locationLabel);
48 form->addRow(new QLabel(tr("Message:")), m_textEdit);
49 form->addWidget(m_checkBox);
51 new TextEditAutoResizer(m_textEdit);
53 groupBox->setLayout(form);
54 scrollArea->setWidget(groupBox);
55 scrollArea->setWidgetResizable(true);
56 gridLayout->addWidget(scrollArea, 0, 0, 2, 1);
57 gridLayout->addWidget(buttonBox, 0, 1, 1, 1);
58 setLayout(gridLayout);
60 connect(sendButton, SIGNAL(clicked()), this, SLOT(sendUpdate()));
61 connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
66 UpdateLocationDialog::~UpdateLocationDialog()
68 qDebug() << __PRETTY_FUNCTION__;
70 // emit m_textEdit sisältö userInfo luokalle talteen
73 void UpdateLocationDialog::setAddress(const QString &address)
75 qDebug() << __PRETTY_FUNCTION__;
76 m_locationLabel->setText(address);
79 void UpdateLocationDialog::sendUpdate()
81 qDebug() << __PRETTY_FUNCTION__;
83 // coordinates for this call will be get from somewhere, map etc...
84 emit statusUpdate(m_textEdit->toPlainText(), m_checkBox->isChecked());