fixed uploading files and setting backup locations

This commit is contained in:
Shane Harris
2020-10-19 08:55:44 +01:00
parent ffcc256a14
commit 2ed693d245
4 changed files with 34 additions and 48 deletions
+16 -22
View File
@@ -56,7 +56,7 @@ export class FilesComponent implements OnInit {
}
async makeFolder() {
if (
~this.files
!!~this.files
.filter(f => f.icon === 'folder')
.map(f => f.name)
.indexOf(this.folderName)
@@ -173,14 +173,12 @@ export class FilesComponent implements OnInit {
});
}
}
uploadFiles() {
this.appService.electron.remote.dialog.showOpenDialog(
{
properties: ['openFile', 'multiSelections'],
defaultPath: this.adbService.savePath,
},
files => this.uploadFilesFromList(files)
);
async uploadFiles() {
let res = await this.appService.electron.remote.dialog.showOpenDialog({
properties: ['openFile', 'multiSelections'],
defaultPath: this.adbService.savePath,
});
this.uploadFilesFromList(res.filePaths);
}
quickSaveSupported() {
return this.quickSaveModels.includes(this.adbService.deviceModel);
@@ -268,19 +266,15 @@ export class FilesComponent implements OnInit {
.then(() => this.statusService.showStatus('Folder Saved OK!'));
});
}
pickLocation() {
this.appService.electron.remote.dialog.showOpenDialog(
{
properties: ['openDirectory'],
defaultPath: this.adbService.savePath,
},
files => {
if (files !== undefined && files.length === 1) {
this.adbService.savePath = files[0];
this.adbService.setSavePath();
}
}
);
async pickLocation() {
let res = await this.appService.electron.remote.dialog.showOpenDialog({
properties: ['openDirectory'],
defaultPath: this.adbService.savePath,
});
if (res && res.filePaths && res.filePaths.length === 1) {
this.adbService.savePath = res.filePaths[0];
this.adbService.setSavePath();
}
}
isConnected() {
const isConnected = this.adbService.deviceStatus === ConnectionStatus.CONNECTED;
+8 -12
View File
@@ -209,18 +209,14 @@ export class HeaderComponent implements OnInit {
cancelLogcatOutput() {
this.saveLogcatPath = null;
}
selectLogcatOutput() {
this.appService.electron.remote.dialog.showOpenDialog(
{
properties: ['openDirectory'],
defaultPath: this.adbService.savePath,
},
files => {
files.forEach(filepath => {
this.saveLogcatPath = filepath;
});
}
);
async selectLogcatOutput() {
const res = await this.appService.electron.remote.dialog.showOpenDialog({
properties: ['openDirectory'],
defaultPath: this.adbService.savePath,
});
res.filePaths.forEach(filepath => {
this.saveLogcatPath = filepath;
});
}
clearLogcatFile() {
if (this.saveLogcatPath) {
@@ -79,19 +79,15 @@ export class PackagesComponent implements OnInit {
this.adbService.setPermission(this.currentPackage.package.packageName, perm.permission, !perm.enabled);
}
pickBackupLocation() {
this.appService.electron.remote.dialog.showOpenDialog(
{
properties: ['openDirectory'],
defaultPath: this.appService.backupPath,
},
files => {
if (files !== undefined && files.length === 1) {
this.appService.backupPath = files[0];
localStorage.setItem('backup-path', this.appService.backupPath);
}
}
);
async pickBackupLocation() {
const res = await this.appService.electron.remote.dialog.showOpenDialog({
properties: ['openDirectory'],
defaultPath: this.appService.backupPath,
});
if (res && res.filePaths && res.filePaths.length === 1) {
this.appService.backupPath = res.filePaths[0];
localStorage.setItem('backup-path', this.appService.backupPath);
}
}
backupAll() {