summaryrefslogtreecommitdiffstats
path: root/gui/logindialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/logindialog.cpp')
-rw-r--r--gui/logindialog.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/gui/logindialog.cpp b/gui/logindialog.cpp
index 3b44c440..a4dad1c1 100644
--- a/gui/logindialog.cpp
+++ b/gui/logindialog.cpp
@@ -24,12 +24,21 @@ LoginDialog::LoginDialog(QWidget *parent, const QString& loginErrMsg) :
{
ui->setupUi(this);
+ //TODO: make translateable
+ offlineButton = new QPushButton("Offline Once");
+
+ ui->loginButtonBox->addButton(offlineButton, QDialogButtonBox::ActionRole);
+
blockToggles = false;
+ isOnline_ = true;
+ onlineForced = false;
+
//FIXME: translateable?
ui->usernameTextBox->lineEdit()->setPlaceholderText(QApplication::translate("LoginDialog", "Name", 0));
connect(ui->usernameTextBox, SIGNAL(currentTextChanged(QString)), this, SLOT(userTextChanged(QString)));
connect(ui->forgetButton, SIGNAL(clicked(bool)), this, SLOT(forgetCurrentUser()));
+ connect(offlineButton, SIGNAL(clicked(bool)), this, SLOT(launchOffline()));
if (loginErrMsg.isEmpty())
ui->loginErrorLabel->setVisible(false);
@@ -60,6 +69,7 @@ LoginDialog::LoginDialog(QWidget *parent, const QString& loginErrMsg) :
LoginDialog::~LoginDialog()
{
+ delete offlineButton;
delete ui;
}
@@ -173,3 +183,15 @@ void LoginDialog::accept()
}
QDialog::accept();
}
+
+void LoginDialog::launchOffline()
+{
+ isOnline_ = false;
+ QDialog::accept();
+}
+
+void LoginDialog::forceOnline()
+{
+ onlineForced = true;
+ offlineButton->setEnabled(false);
+} \ No newline at end of file