fixes #125 now hitting return will make the folder for you
This commit is contained in:
@@ -30,7 +30,7 @@ export class AdbClientService {
|
||||
lastConnectionCheck: number;
|
||||
deviceStatus: ConnectionStatus = ConnectionStatus.UNAUTHORIZED;
|
||||
deviceStatusMessage: string = 'Connecting...';
|
||||
pollInterval: number = 1000 * 5;
|
||||
pollInterval: number = 1000 * 2;
|
||||
savePath: string;
|
||||
isTransferring: boolean;
|
||||
adbResolves: any;
|
||||
|
||||
@@ -197,31 +197,31 @@ export class AppService {
|
||||
openFolder(folder: FolderType, packageName?: string) {
|
||||
switch (folder) {
|
||||
case FolderType.MAIN:
|
||||
this.electron.shell.openPath(this.appData);
|
||||
this.electron.shell.openItem(this.appData);
|
||||
break;
|
||||
case FolderType.BSABER:
|
||||
this.electron.shell.openPath(this.path.join(this.appData, 'bsaber'));
|
||||
this.electron.shell.openItem(this.path.join(this.appData, 'bsaber'));
|
||||
break;
|
||||
case FolderType.BSABER_BACKUPS:
|
||||
this.electron.shell.openPath(this.path.join(this.appData, 'bsaber-backups'));
|
||||
this.electron.shell.openItem(this.path.join(this.appData, 'bsaber-backups'));
|
||||
break;
|
||||
case FolderType.ADB:
|
||||
this.electron.shell.openPath(this.path.join(this.appData, 'platform-tools'));
|
||||
this.electron.shell.openItem(this.path.join(this.appData, 'platform-tools'));
|
||||
break;
|
||||
case FolderType.APK_BACKUPS:
|
||||
this.electron.shell.openPath(this.path.join(this.appData, 'backups'));
|
||||
this.electron.shell.openItem(this.path.join(this.appData, 'backups'));
|
||||
break;
|
||||
case FolderType.DATA_BACKUPS:
|
||||
this.electron.shell.openPath(this.path.join(this.appData, 'bsaber-data-backups'));
|
||||
this.electron.shell.openItem(this.path.join(this.appData, 'bsaber-data-backups'));
|
||||
break;
|
||||
case FolderType.QUEST_SABER_PATCH:
|
||||
this.electron.shell.openPath(this.path.join(this.appData, 'saber-quest-patch', 'questsaberpatch'));
|
||||
this.electron.shell.openItem(this.path.join(this.appData, 'saber-quest-patch', 'questsaberpatch'));
|
||||
break;
|
||||
case FolderType.APP_BACKUP:
|
||||
this.electron.shell.openPath(this.path.join(this.backupPath, packageName));
|
||||
this.electron.shell.openItem(this.path.join(this.backupPath, packageName));
|
||||
break;
|
||||
case FolderType.SONG_FOLDER:
|
||||
this.electron.shell.openPath(this.path.join(this.appData, 'bsaber', packageName));
|
||||
this.electron.shell.openItem(this.path.join(this.appData, 'bsaber', packageName));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div *ngIf="!isConnected()">
|
||||
<h4
|
||||
[ngClass]="{'text-dark-theme':appService.currentTheme === 'dark','text-light-theme':appService.currentTheme === 'light'}">
|
||||
No device connected...</h4>
|
||||
No device connected yet...</h4>
|
||||
|
||||
</div>
|
||||
<div *ngIf="isConnected()">
|
||||
@@ -20,6 +20,7 @@
|
||||
<h4
|
||||
[ngClass]="{'text-dark-theme':appService.currentTheme === 'dark','text-light-theme':appService.currentTheme === 'light'}">
|
||||
No files here...</h4>
|
||||
<div class="grey-text">{{this.currentPath}}</div>
|
||||
|
||||
</div>
|
||||
<div *ngFor="let file of files" class="vertical-align cursor"
|
||||
@@ -74,7 +75,7 @@
|
||||
<mz-modal-content>
|
||||
Please enter a folder name.
|
||||
<div class="input-field ">
|
||||
<input id="devicePaste" type="text" [(ngModel)]="folderName" autofocus />
|
||||
<input id="devicePaste" type="text" [(ngModel)]="folderName" autofocus (keyup)="autoReturn($event, makeFolder.bind(this))"/>
|
||||
<label for="devicePaste">Folder Name</label>
|
||||
</div>
|
||||
</mz-modal-content>
|
||||
|
||||
@@ -25,6 +25,7 @@ export class FilesComponent implements OnInit {
|
||||
@ViewChild('filesModal', { static: false }) filesModal;
|
||||
@ViewChild('fixedAction', { static: false }) fixedAction;
|
||||
@ViewChild('downloadMediaModal', { static: false }) downloadMediaModal;
|
||||
@ViewChild('mkDirModal', { static: true }) mkDirModal;
|
||||
files: FileFolderListing[] = [];
|
||||
selectedFiles: FileFolderListing[] = [];
|
||||
filesToBeSaved: FileFolderListing[];
|
||||
@@ -64,8 +65,8 @@ export class FilesComponent implements OnInit {
|
||||
return this.statusService.showStatus('A folder already exists with that name!!', true);
|
||||
} else {
|
||||
await this.adbService.makeDirectory(this.appService.path.posix.join(this.currentPath, this.folderName)).then(r => {
|
||||
this.open(this.appService.path.posix.join(this.currentPath, this.folderName));
|
||||
this.folderName = '';
|
||||
this.open(this.currentPath);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -298,6 +299,12 @@ export class FilesComponent implements OnInit {
|
||||
}
|
||||
this.breadcrumbs.push({ path, name });
|
||||
}
|
||||
autoReturn(event, callback) {
|
||||
if (event.keyCode === 13) {
|
||||
callback();
|
||||
this.mkDirModal.closeModal();
|
||||
}
|
||||
}
|
||||
open(path: string) {
|
||||
this.currentPath = path;
|
||||
this.breadcrumbs = [];
|
||||
@@ -323,7 +330,7 @@ export class FilesComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
openSaveLocation() {
|
||||
this.appService.electron.remote.shell.openPath(this.adbService.savePath);
|
||||
this.appService.electron.remote.shell.openItem(this.adbService.savePath);
|
||||
}
|
||||
async readdir(path: string) {
|
||||
let dirContents: FileFolderListing[];
|
||||
|
||||
Reference in New Issue
Block a user