# 이슈처리
192 다른 이름으로 저장 취소시 팝업 문의건
This commit is contained in:
parent
81c8a2b790
commit
4e6332dccf
|
@ -603,7 +603,10 @@ ipcMain.on(
|
||||||
dialog
|
dialog
|
||||||
.showSaveDialog({ defaultPath: args[0] })
|
.showSaveDialog({ defaultPath: args[0] })
|
||||||
.then(obj => {
|
.then(obj => {
|
||||||
event.returnValue = obj.filePath;
|
event.returnValue = {
|
||||||
|
canceled: obj.canceled,
|
||||||
|
filePath: obj.filePath
|
||||||
|
};
|
||||||
})
|
})
|
||||||
.catch(obj => {
|
.catch(obj => {
|
||||||
event.returnValue = undefined;
|
event.returnValue = undefined;
|
||||||
|
|
|
@ -918,15 +918,19 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
this.nativeService
|
this.nativeService
|
||||||
.selectSaveFilePath(value.fileInfo.fileName)
|
.selectSaveFilePath(value.fileInfo.fileName)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
if (!!result && result.length > 0) {
|
if (!!result && result.filePath.length > 0) {
|
||||||
this.saveFile(value, result);
|
this.saveFile(value, result.filePath);
|
||||||
} else {
|
} else {
|
||||||
this.snackBarService.open(
|
if (!!result && result.canceled) {
|
||||||
this.translateService.instant(
|
// ignore..
|
||||||
'common.file.errors.failToSpecifyPath'
|
} else {
|
||||||
),
|
this.snackBarService.open(
|
||||||
this.translateService.instant('common.file.errors.label')
|
this.translateService.instant(
|
||||||
);
|
'common.file.errors.failToSpecifyPath'
|
||||||
|
),
|
||||||
|
this.translateService.instant('common.file.errors.label')
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(reason => {
|
.catch(reason => {
|
||||||
|
|
|
@ -187,9 +187,18 @@ export class BrowserNativeService extends NativeService {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
selectSaveFilePath(defaultPath?: string): Promise<string> {
|
selectSaveFilePath(defaultPath?: string): Promise<{
|
||||||
return new Promise<string>((resolve, reject) => {
|
canceled: boolean,
|
||||||
resolve('');
|
filePath: string
|
||||||
|
}> {
|
||||||
|
return new Promise<{
|
||||||
|
canceled: boolean,
|
||||||
|
filePath: string
|
||||||
|
}>((resolve, reject) => {
|
||||||
|
resolve({
|
||||||
|
canceled: false,
|
||||||
|
filePath: ''
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -309,8 +309,14 @@ export class ElectronNativeService implements NativeService {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
selectSaveFilePath(defaultPath?: string): Promise<string> {
|
selectSaveFilePath(defaultPath?: string): Promise<{
|
||||||
return new Promise<string>((resolve, reject) => {
|
canceled: boolean,
|
||||||
|
filePath: string
|
||||||
|
}> {
|
||||||
|
return new Promise<{
|
||||||
|
canceled: boolean,
|
||||||
|
filePath: string
|
||||||
|
}>((resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
resolve(
|
resolve(
|
||||||
this.ipcRenderer.sendSync(FileChannel.SelectSaveFilePath, defaultPath)
|
this.ipcRenderer.sendSync(FileChannel.SelectSaveFilePath, defaultPath)
|
||||||
|
|
|
@ -59,7 +59,10 @@ export abstract class NativeService {
|
||||||
abstract openTargetItem(filePath?: string): Promise<boolean>;
|
abstract openTargetItem(filePath?: string): Promise<boolean>;
|
||||||
abstract getPath(name: NativePathName): Promise<string>;
|
abstract getPath(name: NativePathName): Promise<string>;
|
||||||
abstract selectDirectory(): Promise<string>;
|
abstract selectDirectory(): Promise<string>;
|
||||||
abstract selectSaveFilePath(defaultPath?: string): Promise<string>;
|
abstract selectSaveFilePath(defaultPath?: string): Promise<{
|
||||||
|
canceled: boolean,
|
||||||
|
filePath: string
|
||||||
|
}>;
|
||||||
|
|
||||||
abstract executeProcess(executableName: string): Promise<number>;
|
abstract executeProcess(executableName: string): Promise<number>;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user