Сохранение текущего выбранного профиля

This commit is contained in:
Gravit 2018-11-20 01:12:58 +07:00
parent 7c58959e24
commit 3b29043dca
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -276,19 +276,24 @@ function updateProfilesList(profiles) {
profilesList = [];
// Set profiles items
serverList.getChildren().clear();
var index = 0;
profiles.forEach(function (profile, i, arr) {
pingers[profile.object] = new ServerPinger(profile.object.getServerSocketAddress(), profile.object.getVersion());
var serverBtn = new javafx.scene.control.ToggleButton(profile);
(function () {
profilesList[serverBtn] = profile;
var hold = serverBtn;
var hIndex = index;
serverBtn.setOnAction(function (event) {
serverHolder.set(hold);
settings.profile = hIndex;
});
})();
serverList.getChildren().add(serverBtn);
index++;
});
serverHolder.set(serverList.getChildren().get(0));
LogHelper.debug("Load selected %d profile",settings.profile);
serverHolder.set(serverList.getChildren().get(settings.profile));
}
function pingServer(btn) {