Refactored class updatelocationdialog
authorlampehe-local <henri.lampela@ixonos.com>
Tue, 27 Apr 2010 09:39:25 +0000 (12:39 +0300)
committerlampehe-local <henri.lampela@ixonos.com>
Tue, 27 Apr 2010 09:39:25 +0000 (12:39 +0300)
src/ui/updatelocation/updatelocationdialog.cpp
src/ui/updatelocation/updatelocationdialog.h

index e4613d9..42363a2 100755 (executable)
@@ -34,11 +34,12 @@ UpdateLocationDialog::UpdateLocationDialog(QWidget *parent)
 
     m_textEdit = new QTextEdit;
     m_locationLabel = new QLabel;
-    m_checkBox = new QCheckBox(tr("Publish in Facebook"));
+    m_checkBox = new QCheckBox(tr("Publish on Facebook"));
 
-    m_okButton = new QPushButton(tr("Send"));
-    m_buttonBox = new QDialogButtonBox(Qt::Vertical);
-    m_buttonBox->addButton(m_okButton, QDialogButtonBox::ActionRole);
+    QDialogButtonBox *buttonBox = new QDialogButtonBox(Qt::Vertical);
+    QPushButton *sendButton = buttonBox->addButton(QDialogButtonBox::Ok);
+    QPushButton *cancelButton = buttonBox->addButton(QDialogButtonBox::Cancel);
+    sendButton->setText(tr("Send"));
 
     QFormLayout *form = new QFormLayout();
     form->addRow(new QLabel(tr("Location:")), m_locationLabel);
@@ -51,10 +52,11 @@ UpdateLocationDialog::UpdateLocationDialog(QWidget *parent)
     scrollArea->setWidget(groupBox);
     scrollArea->setWidgetResizable(true);
     gridLayout->addWidget(scrollArea, 0, 0, 2, 1);
-    gridLayout->addWidget(m_buttonBox, 0, 1, 1, 1);
+    gridLayout->addWidget(buttonBox, 0, 1, 1, 1);
     setLayout(gridLayout);
 
-    connect(m_okButton, SIGNAL(clicked()), this, SLOT(sendUpdate()));
+    connect(sendButton, SIGNAL(clicked()), this, SLOT(sendUpdate()));
+    connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
 
     scrollArea->show();
 }
index 7196f3e..9ebbd29 100755 (executable)
@@ -96,10 +96,8 @@ signals:
 
 private:
 
-    QDialogButtonBox *m_buttonBox; ///< Pointer to DialogButtonBox
     QCheckBox *m_checkBox; ///< Pointer to CheckBox
     QLabel *m_locationLabel; ///< Pointer to locationLabel
-    QPushButton *m_okButton; ///< Pointer to PushButton
     QTextEdit *m_textEdit; ///< Pointer to TextEdit
 };