Allow to set login buttons

This commit is contained in:
Klaus Basan
2015-01-18 21:21:35 +01:00
parent f8cc656692
commit c6c7b71a83
2 changed files with 20 additions and 1 deletions

View File

@@ -25,7 +25,6 @@ namespace BlackGui
CLoginModeButtons::~CLoginModeButtons()
{ }
BlackCore::INetwork::LoginMode BlackGui::CLoginModeButtons::getLoginMode() const
{
INetwork::LoginMode mode = INetwork::LoginNormal;
@@ -39,4 +38,21 @@ namespace BlackGui
}
return mode;
}
void CLoginModeButtons::setLoginMode(INetwork::LoginMode mode)
{
switch (mode)
{
case INetwork::LoginAsObserver:
this->ui->rb_LoginObserver->setChecked(true);
break;
case INetwork::LoginStealth:
this->ui->rb_LoginStealth->setChecked(true);
break;
default:
case INetwork::LoginNormal:
this->ui->rb_LoginNormal->setChecked(true);
break;
}
}
}

View File

@@ -36,6 +36,9 @@ namespace BlackGui
//! Get login mode, \sa BlackCore::INetwork::LoginMode
BlackCore::INetwork::LoginMode getLoginMode() const;
//! Set login mode
void setLoginMode(BlackCore::INetwork::LoginMode mode);
private:
QScopedPointer<Ui::CLoginModeButtons> ui;
};