-
Notifications
You must be signed in to change notification settings - Fork 16
Allow to add directories #138
Allow to add directories #138
Conversation
import Settings from 'electron-settings' | ||
import { addFilesFromFSPath, unpinObject } from '../../api' | ||
import DetailsWindow from '../Details/window' | ||
|
||
const { app, dialog, shell } = remote |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remote
is undefined
when is called from the main process (which is happening now since I used this in the menu), but importing { app, dialog, shell }
directly seems to work.
app/menu.js
Outdated
properties: ['openDirectory', 'multiSelections'] | ||
} | ||
|
||
const paths = dialog.showOpenDialog(selectOptions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this doesn't have app.mainWindow and the other has?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ran before the StorageList is created. Maybe is worth considering moving this to StorageList and creating the menu afterwards? We disable the menu for any other window anyway...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, as we discussed maybe move the creation of the Menu into the Storage Window only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out we can only create the menu from the main process. Nonetheless, I added the missing app.mainWindow
to the dialog and it seems to work (StorageList is unusable while the dialog is open).
The warning I was getting: "Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged." seems to be unrelated to this.
What changed?
Added two new sub menus under
File
: Add File and Add Directory.