switching to the open view on request

This commit is contained in:
antelle 2021-04-26 13:40:37 +02:00
parent 1a8aff0594
commit e0d47a474d
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
2 changed files with 8 additions and 0 deletions

View File

@ -1434,6 +1434,7 @@ class AppModel {
unlockAnyFile(unlockRes, timeout) {
this.rejectPendingFileUnlockPromise('Replaced with a new operation');
Events.emit('show-open-view');
return new Promise((resolve, reject) => {
this.fileUnlockPromise = { resolve, reject, unlockRes };
if (timeout) {

View File

@ -82,6 +82,7 @@ class AppView extends View {
this.listenTo(Events, 'toggle-settings', this.toggleSettings);
this.listenTo(Events, 'toggle-menu', this.toggleMenu);
this.listenTo(Events, 'toggle-details', this.toggleDetails);
this.listenTo(Events, 'show-open-view', this.showOpenIfNotThere);
this.listenTo(Events, 'edit-group', this.editGroup);
this.listenTo(Events, 'edit-tag', this.editTag);
this.listenTo(Events, 'edit-generator-presets', this.editGeneratorPresets);
@ -724,6 +725,12 @@ class AppView extends View {
this.views.menu.switchVisibility(false);
}
showOpenIfNotThere() {
if (!this.views.open) {
this.showLastOpenFile();
}
}
editGroup(group) {
if (group && !(this.views.panel instanceof GrpView)) {
this.showEditGroup(group);