diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-09-06 22:00:19 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-09-06 22:00:19 +0200 |
commit | e6b8923b23693a10023b3cf4e5573390e5f22d7d (patch) | |
tree | ff55f4b0ecbbe497e5f99f756938cb60d07a7d47 /gui/logindialog.cpp | |
parent | 634e22298b14a8ad09f0d0489cb1c08c97d1f73a (diff) | |
parent | 2acfd00d76b79c49b61f651b5459f65803601a95 (diff) | |
download | PrismLauncher-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.cpp | 22 |
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 |