Skip to content

Commit

Permalink
fix: file extensions in move notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
Illusion47586 committed Jun 21, 2022
1 parent 6722ee1 commit dff2363
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main/menu.ts
Expand Up @@ -10,6 +10,7 @@ import {
import { URL } from 'node:url';
import { PlutoExport } from '../../types/enums';
import { exportNotebook, openNotebook } from './pluto';
import { PLUTO_FILE_EXTENSIONS } from './util';

interface DarwinMenuItemConstructorOptions extends MenuItemConstructorOptions {
selector?: string;
Expand Down Expand Up @@ -233,6 +234,27 @@ export default class MenuBuilder {
await openNotebook();
},
},
{
label: 'Open in new window',
accelerator: 'Ctrl+Shift+O',
click: async () => {
const r = await dialog.showOpenDialog(this.mainWindow, {
message: 'Please select a Pluto Notebook.',
filters: [
{
name: 'Pluto Notebook',
extensions: PLUTO_FILE_EXTENSIONS.map((v) => v.slice(1)),
},
],
properties: ['openFile'],
});

if (r.canceled) return;

const [path] = r.filePaths;
await this._createWindow(undefined, undefined, path);
},
},
{
label: '&New',
accelerator: 'Ctrl+N',
Expand Down

0 comments on commit dff2363

Please sign in to comment.