mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
Перемещение dirUpdates
This commit is contained in:
parent
1eb4066250
commit
1e54e661f5
3 changed files with 13 additions and 3 deletions
|
@ -70,8 +70,9 @@ var settingsOverlay = {
|
|||
// Set new result
|
||||
var newDir = chooser.showDialog(stage);
|
||||
if (newDir !== null) {
|
||||
settingsOverlay.transferCatalogDialog();
|
||||
settingsOverlay.transferCatalogDialog(newDir.toPath());
|
||||
settings.updatesDir = newDir.toPath();
|
||||
DirBridge.dirUpdates = settings.updatesDir;
|
||||
settingsOverlay.updateDirLabel();
|
||||
}
|
||||
});
|
||||
|
@ -137,11 +138,12 @@ var settingsOverlay = {
|
|||
holder.lookup("#apply").setOnAction(function(event) overlay.hide(0, null));
|
||||
},
|
||||
|
||||
transferCatalogDialog: function() {
|
||||
transferCatalogDialog: function(newDir) {
|
||||
settingsOverlay.transferDialog.setVisible(true);
|
||||
settingsOverlay.transferDialog.lookup("#cancelTransfer").setOnAction(function(event) settingsOverlay.transferDialog.setVisible(false));
|
||||
settingsOverlay.transferDialog.lookup("#applyTransfer").setOnAction(function(event) {
|
||||
//Здесь могла быть ваша реклама, либо DirBridge.move();
|
||||
DirBridge.move(newDir);
|
||||
settingsOverlay.transferDialog.setVisible(false);
|
||||
});
|
||||
},
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package ru.gravit.launcher.client;
|
||||
|
||||
import ru.gravit.launcher.LauncherAPI;
|
||||
import ru.gravit.utils.helper.IOHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
|
||||
public class DirBridge {
|
||||
|
@ -11,5 +13,10 @@ public class DirBridge {
|
|||
public static Path dirUpdates;
|
||||
@LauncherAPI
|
||||
public static Path defaultUpdatesDir;
|
||||
|
||||
@LauncherAPI
|
||||
public static void move(Path newDir) throws IOException
|
||||
{
|
||||
IOHelper.move(dirUpdates,newDir);
|
||||
dirUpdates = newDir;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,6 +97,7 @@ public void read(HInput input) throws IOException, SignatureException {
|
|||
|
||||
// Client settings
|
||||
updatesDir = IOHelper.toPath(input.readString(0));
|
||||
DirBridge.dirUpdates = updatesDir;
|
||||
autoEnter = input.readBoolean();
|
||||
fullScreen = input.readBoolean();
|
||||
setRAM(input.readLength(JVMHelper.RAM));
|
||||
|
|
Loading…
Reference in a new issue