mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-21 04:08:01 +02:00
Recent documents menu (#1582)
* Adds recent documents menu. * Removes erroneous import. * Open collection from recent document menu.
This commit is contained in:
parent
d05a86252b
commit
8287126deb
@ -12,6 +12,16 @@ const template = [
|
|||||||
ipcMain.emit('main:open-collection');
|
ipcMain.emit('main:open-collection');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'Open Recent',
|
||||||
|
role: 'recentdocuments',
|
||||||
|
submenu: [
|
||||||
|
{
|
||||||
|
label: 'Clear Recent',
|
||||||
|
role: 'clearrecentdocuments'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Preferences',
|
label: 'Preferences',
|
||||||
accelerator: 'CommandOrControl+,',
|
accelerator: 'CommandOrControl+,',
|
||||||
|
@ -122,3 +122,7 @@ app.on('ready', async () => {
|
|||||||
|
|
||||||
// Quit the app once all windows are closed
|
// Quit the app once all windows are closed
|
||||||
app.on('window-all-closed', app.quit);
|
app.on('window-all-closed', app.quit);
|
||||||
|
|
||||||
|
app.on('open-file', (event, path) => {
|
||||||
|
openCollection(mainWindow, watcher, path);
|
||||||
|
})
|
@ -617,6 +617,7 @@ const registerMainEventHandlers = (mainWindow, watcher, lastOpenedCollections) =
|
|||||||
ipcMain.on('main:collection-opened', (win, pathname, uid, brunoConfig) => {
|
ipcMain.on('main:collection-opened', (win, pathname, uid, brunoConfig) => {
|
||||||
watcher.addWatcher(win, pathname, uid, brunoConfig);
|
watcher.addWatcher(win, pathname, uid, brunoConfig);
|
||||||
lastOpenedCollections.add(pathname);
|
lastOpenedCollections.add(pathname);
|
||||||
|
app.addRecentDocument(pathname);
|
||||||
});
|
});
|
||||||
|
|
||||||
// The app listen for this event and allows the user to save unsaved requests before closing the app
|
// The app listen for this event and allows the user to save unsaved requests before closing the app
|
||||||
|
Loading…
x
Reference in New Issue
Block a user