summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtLoginWindow.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp
index e84e316..4daa658 100644
--- a/Swift/QtUI/QtLoginWindow.cpp
+++ b/Swift/QtUI/QtLoginWindow.cpp
@@ -1,96 +1,105 @@
#include "QtLoginWindow.h"
#include "QtAboutWidget.h"
#include "QtSwiftUtil.h"
#include "QtMainWindow.h"
#include <algorithm>
#include <QApplication>
#include <QBoxLayout>
#include <QComboBox>
#include <QDesktopWidget>
#include <QFileDialog>
#include <QStatusBar>
#include <QToolButton>
#include <QLabel>
#include <QMenuBar>
#include <cassert>
namespace Swift{
QtLoginWindow::QtLoginWindow() : QMainWindow() {
setWindowTitle("Swift");
resize(200, 500);
setContentsMargins(0,0,0,0);
QWidget *centralWidget = new QWidget(this);
setCentralWidget(centralWidget);
QBoxLayout *topLayout = new QBoxLayout(QBoxLayout::TopToBottom, centralWidget);
stack_ = new QStackedWidget(centralWidget);
topLayout->addWidget(stack_);
topLayout->setMargin(0);
QWidget *wrapperWidget = new QWidget(this);
wrapperWidget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom, wrapperWidget);
layout->addStretch();
QLabel* logo = new QLabel(this);
logo->setPixmap(QPixmap(":/logo-shaded-text.256.png"));
logo->setScaledContents(true);
logo->setFixedSize(192,192);
layout->addWidget(logo);
layout->addStretch();
+ QLabel* jidLabel = new QLabel(this);
+ jidLabel->setText("<font size='-1'>User address</font>");
+ layout->addWidget(jidLabel);
+
username_ = new QComboBox(this);
username_->setEditable(true);
layout->addWidget(username_);
+ QLabel* passwordLabel = new QLabel();
+ passwordLabel->setText("<font size='-1'>Password</font>");
+ layout->addWidget(passwordLabel);
+
+
QWidget* w = new QWidget(this);
w->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
layout->addWidget(w);
QHBoxLayout* credentialsLayout = new QHBoxLayout(w);
credentialsLayout->setMargin(0);
credentialsLayout->setSpacing(3);
password_ = new QLineEdit(this);
password_->setEchoMode(QLineEdit::Password);
connect(password_, SIGNAL(returnPressed()), this, SLOT(loginClicked()));
connect(username_->lineEdit(), SIGNAL(returnPressed()), password_, SLOT(setFocus()));
connect(username_, SIGNAL(editTextChanged(const QString&)), this, SLOT(handleUsernameTextChanged()));
credentialsLayout->addWidget(password_);
certificateButton_ = new QToolButton(this);
certificateButton_->setCheckable(true);
certificateButton_->setIcon(QIcon(":/icons/certificate.png"));
credentialsLayout->addWidget(certificateButton_);
connect(certificateButton_, SIGNAL(clicked(bool)), SLOT(handleCertficateChecked(bool)));
loginButton_ = new QPushButton(this);
loginButton_->setText(tr("Connect"));
loginButton_->setAutoDefault(true);
loginButton_->setDefault(true);
layout->addWidget(loginButton_);
message_ = new QLabel(this);
message_->setTextFormat(Qt::RichText);
message_->setWordWrap(true);
layout->addWidget(message_);
layout->addStretch();
remember_ = new QCheckBox(tr("Remember Password?"), this);
layout->addWidget(remember_);
connect(loginButton_, SIGNAL(clicked()), SLOT(loginClicked()));
stack_->addWidget(wrapperWidget);
#ifdef SWIFTEN_PLATFORM_MACOSX
menuBar_ = new QMenuBar(NULL);
#else
menuBar_ = menuBar();
#endif
QApplication::setQuitOnLastWindowClosed(false);
swiftMenu_ = new QMenu(tr("Swift"), this);
QAction* aboutAction = new QAction("About Swift", this);
connect(aboutAction, SIGNAL(activated()), SLOT(handleAbout()));