Clean up account switcher stuff

Update settings library version

Fixes #9
This commit is contained in:
Rasmus Karlsson
2017-12-20 00:39:33 +01:00
parent be3c85d72d
commit 86a9f194f9
3 changed files with 53 additions and 37 deletions
+5 -3
View File
@@ -113,11 +113,13 @@ QVBoxLayout *SettingsDialog::createAccountsTab()
auto buttonBox = new QDialogButtonBox(this);
auto addButton = new QPushButton("Add", this);
addButton->setToolTip("Log in with a new account");
auto removeButton = new QPushButton("Remove", this);
removeButton->setToolTip("Remove selected account");
connect(addButton, &QPushButton::clicked, []() {
// TODO: fix memory leak :bbaper:
auto loginWidget = new LoginWidget();
static auto loginWidget = new LoginWidget();
loginWidget->show();
});
@@ -129,12 +131,12 @@ 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_USERNAME_LABEL) {
// Do nothing
return;
}
AccountManager::getInstance().Twitch.removeUser(selectedUser);
});