Skip to content

Commit

Permalink
Merge remote-tracking branch 'specing/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
abma committed Jan 15, 2020
2 parents ba1a988 + 0d10a04 commit a0b8ede
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/gui/options/lobbyoptionstab.cpp
Expand Up @@ -191,7 +191,11 @@ LobbyOptionsTab::LobbyOptionsTab(wxWindow* parent)
int user_level_choices_len = sizeof(user_level_choices) / sizeof(wxString);
m_user_level_choice = new wxChoice(m_user_level_sizer->GetStaticBox(), wxID_ANY,
wxDefaultPosition, wxDefaultSize, user_level_choices_len, user_level_choices);
m_user_level_choice->SetSelection(0);
Settings::UserLevel userLevel = sett().GetUserLevel();
// Round up
m_user_level_choice->SetSelection(
userLevel <= Settings::UserLevel::NewUser ? 0 :
1);
m_user_level_sizer->Add(m_user_level_choice, 0, wxALL | wxEXPAND, 5);


Expand Down
4 changes: 2 additions & 2 deletions src/settings.cpp
Expand Up @@ -1390,9 +1390,9 @@ void Settings::SetSplitBRoomHorizontally(const bool vertical)
cfg().Write(_T( "/GUI/SplitBRoomHorizontally" ), vertical);
}

int Settings::GetUserLevel()
Settings::UserLevel Settings::GetUserLevel()
{
return cfg().Read(_T("/General/UserLevel"), NewUser);
return static_cast<UserLevel> (cfg().Read(_T("/General/UserLevel"), NewUser));
}

void Settings::SetUserLevel(int level)
Expand Down
2 changes: 1 addition & 1 deletion src/settings.h
Expand Up @@ -288,7 +288,7 @@ class Settings : public SL::NonCopyable
Developer = 1000
};

int GetUserLevel();
UserLevel GetUserLevel();
void SetUserLevel(int value);

/*@}*/
Expand Down

0 comments on commit a0b8ede

Please sign in to comment.