From 2487c806b3ca2f4a9ab25bc24f55efbfccc02bfb Mon Sep 17 00:00:00 2001 From: Florrie Date: Sat, 6 Jul 2019 13:22:44 -0300 Subject: Disallow suspending on telnet clients Suspending doesn't really mean anything unless you're an actual process! --- telnet-server.js | 1 + ui.js | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/telnet-server.js b/telnet-server.js index d12e649..4e87499 100644 --- a/telnet-server.js +++ b/telnet-server.js @@ -27,6 +27,7 @@ class TelnetServer { writable: socket, interfacer, appConfig: { + canSuspend: false, showLeftPane: false, stopPlayingUponQuit: false, menubarColor: 2 diff --git a/ui.js b/ui.js index 21b5844..2ec13fa 100644 --- a/ui.js +++ b/ui.js @@ -143,8 +143,9 @@ class AppElement extends FocusElement { this.attachListeners() this.config = Object.assign({ - showLeftPane: true, + canSuspend: true, menubarColor: 4, // blue + showLeftPane: true, stopPlayingUponQuit: true }, config) @@ -241,7 +242,7 @@ class AppElement extends FocusElement { {label: 'mtui (perpetual development)'}, {divider: true}, {label: 'Quit', action: () => this.shutdown()}, - {label: 'Suspend', action: () => this.suspend()} + this.config.canSuspend && {label: 'Suspend', action: () => this.suspend()} ]}, {text: 'Playback', menuFn: () => { const { playingTrack } = this.backend @@ -631,7 +632,9 @@ class AppElement extends FocusElement { } suspend() { - this.emit('suspendRequested') + if (this.config.canSuspend) { + this.emit('suspendRequested') + } } fixLayout() { -- cgit 1.3.0-6-gf8a5