diff options
author | Florrie <towerofnix@gmail.com> | 2019-07-06 13:22:44 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2019-07-06 13:23:20 -0300 |
commit | 2487c806b3ca2f4a9ab25bc24f55efbfccc02bfb (patch) | |
tree | 087a7d6a6fbbe056c0448c37d9785ff450d6e01a | |
parent | bcc5120befd74ff583333f78a75729a87d13515c (diff) |
Disallow suspending on telnet clients
Suspending doesn't really mean anything unless you're an actual process!
-rw-r--r-- | telnet-server.js | 1 | ||||
-rw-r--r-- | 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() { |