-
Notifications
You must be signed in to change notification settings - Fork 1
Feature options in project menu #9
base: master
Are you sure you want to change the base?
Feature options in project menu #9
Conversation
It will close this issue: #10 |
@@ -11,12 +11,12 @@ | |||
<span>{{t "projects.actions.remove"}}</span> | |||
{{/content.menu-item}} | |||
|
|||
{{#content.menu-item onClick="openSomething" disabled=true}} | |||
{{#content.menu-item onClick="openInDirectory"}} |
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.
always use closure actions (action "openInDirectory")
:)
|
||
openInDirectory() { | ||
let projectPath = this.get('project.path') | ||
return this.get('terminal').execute(`nautilus ${projectPath}`) |
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.
nautilus?
Rather than using 3rd parties try to use official electron API:
https://github.com/electron/electron/blob/master/docs/api/shell.md
@@ -3,12 +3,25 @@ const { Component, inject } = Ember; | |||
|
|||
export default Component.extend({ | |||
notify: inject.service(), | |||
terminal: inject.service(), | |||
ideName: 'code', |
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.
Hmm, hardcoded :/ I will push my changes related with settings but is still need to be tested. If you would like to practice, go ahead.
|
||
actions: { | ||
remove() { | ||
this.get('project').destroyRecord().then(() => { | ||
this.get('notify').success('notify.projects.remove.success'); | ||
}); | ||
}, | ||
|
||
openInEditor() { |
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.
You can move these methods to terminal
service and just pass them the path :)
WIP, but almost done. I think we let user define his OS and IDE, and later pass this information to component
When I come back. I will work on this feature: https://www.youtube.com/watch?v=lYGIaAkyu6M