Fix account adding and account removing.

This needs to be fully tested before I'm comfortable closing #9

The "advanced" tab also needs testing

We might also want to move the login website to chatterino.com and make
it look nicer
This commit is contained in:
Rasmus Karlsson
2017-12-19 15:12:33 +01:00
parent 1e3aca1b7a
commit 324dfc9ee9
5 changed files with 170 additions and 38 deletions
+10 -4
View File
@@ -120,10 +120,6 @@ QVBoxLayout *SettingsDialog::createAccountsTab()
loginWidget->show();
});
connect(removeButton, &QPushButton::clicked, []() {
qDebug() << "TODO: Implement"; //
});
buttonBox->addButton(addButton, QDialogButtonBox::YesRole);
buttonBox->addButton(removeButton, QDialogButtonBox::NoRole);
@@ -131,6 +127,16 @@ QVBoxLayout *SettingsDialog::createAccountsTab()
this->ui.accountSwitchWidget = new AccountSwitchWidget(this);
connect(removeButton, &QPushButton::clicked, [this]() {
qDebug() << "TODO: Implement"; //
auto selectedUser = this->ui.accountSwitchWidget->currentItem()->text();
if (selectedUser == " - anonymous - ") {
// Do nothing
return;
}
AccountManager::getInstance().Twitch.removeUser(selectedUser);
});
layout->addWidget(this->ui.accountSwitchWidget);
return layout;