mirror of https://github.com/bsnes-emu/bsnes.git
33 lines
1.1 KiB
C++
33 lines
1.1 KiB
C++
ServerSettings* serverSettings = nullptr;
|
|
|
|
ServerSettings::ServerSettings() {
|
|
title.setFont(program->titleFont);
|
|
title.setText("Server Settings");
|
|
hostLabel.setText("Hostname:");
|
|
userLabel.setText("Username:");
|
|
passLabel.setText("Password:");
|
|
|
|
unsigned width = min(
|
|
Font::size(program->normalFont, "Hostname:").width,
|
|
Font::size(program->normalFont, "Username:").width
|
|
);
|
|
|
|
append(title, {~0, 0}, 5);
|
|
append(hostLayout, {~0, 0}, 5);
|
|
hostLayout.append(hostLabel, {width, 0}, 5);
|
|
hostLayout.append(hostEdit, {~0, 0});
|
|
append(userLayout, {~0, 0});
|
|
userLayout.append(userLabel, {width, 0}, 5);
|
|
userLayout.append(userEdit, {~0, 0}, 5);
|
|
userLayout.append(passLabel, {0, 0}, 5);
|
|
userLayout.append(passEdit, {~0, 0});
|
|
|
|
hostEdit.setText(config->server.hostname);
|
|
userEdit.setText(config->server.username);
|
|
passEdit.setText(config->server.password);
|
|
|
|
hostEdit.onChange = [&] { config->server.hostname = hostEdit.text(); };
|
|
userEdit.onChange = [&] { config->server.username = userEdit.text(); };
|
|
passEdit.onChange = [&] { config->server.password = passEdit.text(); };
|
|
}
|