Added uniform buttons on all dialogs and a website.
[jenirok] / src / gui / detailwindow.cpp
index 1fdbf7e..e916fcb 100644 (file)
  *
  */
 
-#include <QMaemo5ValueButton>
-#include <QMaemo5InformationBox>
-#include <QApplication>
 #include <QtDBus/QDBusConnection>
 #include <QtDBus/QDBusMessage>
 #include <QtGui/QMessageBox>
 #include <QtGui/QLabel>
 #include <QtGui/QClipboard>
+#include <QtGui/QDialogButtonBox>
+#include <QMaemo5ValueButton>
+#include <QMaemo5InformationBox>
+#include <QApplication>
 #include <QDebug>
 #include "detailwindow.h"
 #include "contactmanager.h"
@@ -108,10 +109,18 @@ void DetailWindow::showAddToContactsDialog()
         QHBoxLayout* layout = new QHBoxLayout();
         QLabel* name = new QLabel(tr("Name"));
         QPushButton* button = new QPushButton(tr("Add"));
+
+        QDialogButtonBox* buttons = new QDialogButtonBox;
+        buttons->setCenterButtons(false);
+        buttons->addButton(button, QDialogButtonBox::AcceptRole);
         connect(button, SIGNAL(pressed()), this, SLOT(addToContacts()));
-        layout->addWidget(name);
-        layout->addWidget(addContactInput_);
-        layout->addWidget(button);
+
+        QHBoxLayout* left = new QHBoxLayout();
+        left->addWidget(name);
+        left->addWidget(addContactInput_);
+
+        layout->addLayout(left, Qt::AlignLeft);
+        layout->addWidget(buttons);
         addDialog_->setLayout(layout);
     }