20 lines
590 B
TypeScript
20 lines
590 B
TypeScript
import { dialog, OpenDialogOptions } from 'electron';
|
|
import { injectable } from 'inversify';
|
|
import { t } from '../../../shared/services/translation/t';
|
|
import type { DialogInterface } from './dialog-interface';
|
|
|
|
@injectable()
|
|
export class Dialog implements DialogInterface {
|
|
public selectFolder(options: OpenDialogOptions): ReturnType<typeof dialog.showOpenDialog> {
|
|
return dialog.showOpenDialog({
|
|
...{
|
|
title: t('imperatives.dialog.select_folder'),
|
|
},
|
|
...options,
|
|
...{
|
|
properties: ['openDirectory', 'showHiddenFiles'],
|
|
},
|
|
});
|
|
}
|
|
}
|