Skip to content

Commit 569b958

Browse files
committed
New: Added support for import / export in main menu.
1 parent 428ecb1 commit 569b958

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

app/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class Arc {
6868
case 'show-settings':
6969
case 'about':
7070
case 'open-license':
71+
case 'import-data':
72+
case 'export-data':
7173
win.webContents.send(windowCommand, action);
7274
break;
7375
case 'new-window':

app/menus/darwin.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
"label": "File",
1818
"submenu": [
1919
{"label": "Save", "command": "request:save", "accelerator": "CommandOrControl+s"},
20-
{"label": "Save as...", "command": "request:save-as", "accelerator": "CommandOrControl+Shift+s"}
20+
{"label": "Save as...", "command": "request:save-as", "accelerator": "CommandOrControl+Shift+s"},
21+
{"type": "separator"},
22+
{"label": "Import data", "command": "application:import-data"},
23+
{"label": "Export data", "command": "application:export-data"}
2124
]
2225
}, {
2326
"label": "View",

app/menus/win.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
{"label": "Save", "command": "request:save", "accelerator": "CommandOrControl+s"},
1010
{"label": "Save as...", "command": "request:save-as", "accelerator": "CommandOrControl+Shift+s"},
1111
{"type": "separator"},
12+
{"label": "Import data", "command": "application:import-data"},
13+
{"label": "Export data", "command": "application:export-data"}
14+
{"type": "separator"},
1215
{"label": "Quit", "command": "application:quit"}
1316
]
1417
}, {

app/src/arc-electron.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,24 @@
519519
ipc.send('toggle-devtools');
520520
},
521521

522+
openImport: function() {
523+
this.fire('navigate', {
524+
base: 'dataimport'
525+
});
526+
var panel = this.$$('data-import-export-panel');
527+
panel.hideExport = true;
528+
panel.hideImport = false;
529+
},
530+
531+
openExport: function() {
532+
this.fire('navigate', {
533+
base: 'dataimport'
534+
});
535+
var panel = this.$$('data-import-export-panel');
536+
panel.hideExport = false;
537+
panel.hideImport = true;
538+
},
539+
522540
_copyContentHandler: function(e) {
523541
const {
524542
clipboard
@@ -564,6 +582,8 @@
564582
case 'show-settings': this.openSettings(); break;
565583
case 'about': this.openAbout(); break;
566584
case 'open-license': this.openLicense(); break;
585+
case 'import-data': this.openImport(); break;
586+
case 'export-data': this.openExport(); break;
567587
}
568588
}
569589
});

0 commit comments

Comments
 (0)