Skip to content

Commit

Permalink
Updated iconview application launcher and context menu (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
andersevenrud committed Jun 17, 2019
1 parent e56519c commit 38cfd2b
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/adapters/ui/iconview.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,16 @@ export class DesktopIconView extends EventEmitter {
}
},

openEntry: ({entry}) => {
openEntry: ({entry, forceDialog}) => {
if (entry.isDirectory) {
this.core.run('FileManager', {
path: entry
});
} else {
this.core.open(entry, {useDefault: false});
this.core.open(entry, {
useDefault: true,
forceDialog
});
}

return {selected: -1};
Expand Down Expand Up @@ -209,13 +212,18 @@ export class DesktopIconView extends EventEmitter {
}

createFileContextMenu(ev, entry) {
const _ = this.core.make('osjs/locale').translate;

this.core.make('osjs/contextmenu', {
position: ev,
menu: [{
label: 'Open',
onclick: () => this.iconview.openEntry(({entry}))
label: _('LBL_OPEN'),
onclick: () => this.iconview.openEntry({entry, forceDialog: false})
}, {
label: _('LBL_OPEN_WITH'),
onclick: () => this.iconview.openEntry({entry, forceDialog: true})
}, {
label: 'Remove',
label: _('LBL_DELETE'),
onclick: () => this.iconview.removeEntry(entry)
}]
});
Expand Down

0 comments on commit 38cfd2b

Please sign in to comment.