use of com.faforever.client.preferences.LoginPrefs in project downlords-faf-client by FAForever.
the class ServerAccessorImplTest method setUp.
@Before
public void setUp() throws Exception {
serverToClientReadyLatch = new CountDownLatch(1);
messagesReceivedByFafServer = new ArrayBlockingQueue<>(10);
startFakeFafLobbyServer();
ClientProperties clientProperties = new ClientProperties();
clientProperties.getServer().setHost(LOOPBACK_ADDRESS.getHostAddress()).setPort(fafLobbyServerSocket.getLocalPort());
instance = new FafServerAccessorImpl(preferencesService, uidService, notificationService, i18n, clientProperties, reportingService);
LoginPrefs loginPrefs = new LoginPrefs();
loginPrefs.setUsername("junit");
loginPrefs.setPassword("password");
when(preferencesService.getFafDataDirectory()).thenReturn(faDirectory.getRoot().toPath());
when(uidService.generate(any(), any())).thenReturn("encrypteduidstring");
}
use of com.faforever.client.preferences.LoginPrefs in project downlords-faf-client by FAForever.
the class LoginController method display.
public void display() {
setShowLoginProgress(false);
LoginPrefs loginPrefs = preferencesService.getPreferences().getLogin();
String username = loginPrefs.getUsername();
String password = loginPrefs.getPassword();
boolean isAutoLogin = loginPrefs.getAutoLogin();
// Fill the form even if autoLogin is true, since user may cancel the login
usernameInput.setText(Strings.nullToEmpty(username));
autoLoginCheckBox.setSelected(isAutoLogin);
if (loginPrefs.getAutoLogin() && !isNullOrEmpty(username) && !isNullOrEmpty(password)) {
login(username, password, true);
} else if (isNullOrEmpty(username)) {
usernameInput.requestFocus();
} else {
passwordInput.requestFocus();
}
}
Aggregations