aboutsummaryrefslogtreecommitdiff
path: root/gui/logindialog.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-09-06 22:00:19 +0200
committerPetr Mrázek <peterix@gmail.com>2013-09-06 22:00:19 +0200
commite6b8923b23693a10023b3cf4e5573390e5f22d7d (patch)
treeff55f4b0ecbbe497e5f99f756938cb60d07a7d47 /gui/logindialog.cpp
parent634e22298b14a8ad09f0d0489cb1c08c97d1f73a (diff)
parent2acfd00d76b79c49b61f651b5459f65803601a95 (diff)
downloadPrismLauncher-e6b8923b23693a10023b3cf4e5573390e5f22d7d.tar.gz
PrismLauncher-e6b8923b23693a10023b3cf4e5573390e5f22d7d.tar.bz2
PrismLauncher-e6b8923b23693a10023b3cf4e5573390e5f22d7d.zip
Merge https://github.com/Stiepen22/MultiMC5
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