Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.
/ Orion Public archive

Allow to add directories #138

Merged
merged 2 commits into from
Jun 15, 2018

Conversation

kernelwhisperer
Copy link
Contributor

What changed?

Added two new sub menus under File: Add File and Add Directory.

import Settings from 'electron-settings'
import { addFilesFromFSPath, unpinObject } from '../../api'
import DetailsWindow from '../Details/window'

const { app, dialog, shell } = remote
Copy link
Contributor Author

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)
Copy link
Member

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?

Copy link
Contributor Author

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...

Copy link
Member

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.

Copy link
Contributor Author

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.

@kernelwhisperer kernelwhisperer merged commit 2fcc88b into master Jun 15, 2018
@kernelwhisperer kernelwhisperer deleted the bugfix/156-allow-to-upload-directories-on-win branch June 19, 2018 08:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants