diff --git a/TODO b/TODO index 56d48b6c..578767ae 100644 --- a/TODO +++ b/TODO @@ -17,8 +17,6 @@ ToDos in Priority order: possiblity to forewart shortcut (or use them as shortcut) [pressing twice while timeout] cleanup inputManager split input driver out of the handler -- add screenManager - abstract screen driver - dictonary for special chars and string replacements - punctuation @@ -46,7 +44,6 @@ ToDos in Priority order: first item last item - improve performance -- pass environment instance in init and remove it from function calls - implement onScreenChange (new onScreenUpdate) commands read highlighted text mode @@ -214,3 +211,7 @@ ps a -o tty,comm | grep -e Xorg | grep -v "grep -e Xorg" promoted text clear_marks_on_screen_change leve_review_mode_on_screen_change + +- add screenManager + abstract screen driver +- pass environment instance in init and remove it from function calls diff --git a/src/fenrir-package/commands/onScreenChanged/80000-screen_change_announcement.py b/src/fenrir-package/commands/onScreenChanged/80000-screen_change_announcement.py index e09b1d58..69f56275 100644 --- a/src/fenrir-package/commands/onScreenChanged/80000-screen_change_announcement.py +++ b/src/fenrir-package/commands/onScreenChanged/80000-screen_change_announcement.py @@ -17,8 +17,6 @@ class command(): return 'No Description found' def run(self): - if self.env['screenData']['newTTY'] == self.env['screenData']['oldTTY']: - return self.env['runtime']['outputManager'].presentText("screen " + str(self.env['screenData']['newTTY']),soundIcon='ChangeTTY', interrupt=True) self.env['runtime']['outputManager'].presentText(self.env['screenData']['newDelta'], interrupt=False) diff --git a/src/fenrir-package/commands/onScreenChanged/85000-screen_chnage_reset_marks.py b/src/fenrir-package/commands/onScreenChanged/85000-screen_chnage_reset_marks.py index e514a2ab..ff7cab4b 100644 --- a/src/fenrir-package/commands/onScreenChanged/85000-screen_chnage_reset_marks.py +++ b/src/fenrir-package/commands/onScreenChanged/85000-screen_chnage_reset_marks.py @@ -17,8 +17,6 @@ class command(): return 'No Description found' def run(self): - if self.env['screenData']['newTTY'] == self.env['screenData']['oldTTY']: - return self.env['commandBuffer']['Marks']['1'] = None self.env['commandBuffer']['Marks']['2'] = None diff --git a/src/fenrir-package/commands/onScreenChanged/88000-screen_chnage_leve_review_mode.py b/src/fenrir-package/commands/onScreenChanged/88000-screen_chnage_leve_review_mode.py index e16643f6..e1d8bb51 100644 --- a/src/fenrir-package/commands/onScreenChanged/88000-screen_chnage_leve_review_mode.py +++ b/src/fenrir-package/commands/onScreenChanged/88000-screen_chnage_leve_review_mode.py @@ -17,8 +17,6 @@ class command(): return 'No Description found' def run(self): - if self.env['screenData']['newTTY'] == self.env['screenData']['oldTTY']: - return self.env['screenData']['oldCursorReview'] = None self.env['screenData']['newCursorReview'] = None diff --git a/src/fenrir-package/commands/onScreenChanged/50000-char_echo.py b/src/fenrir-package/commands/onScreenUpdate/50000-char_echo.py similarity index 100% rename from src/fenrir-package/commands/onScreenChanged/50000-char_echo.py rename to src/fenrir-package/commands/onScreenUpdate/50000-char_echo.py diff --git a/src/fenrir-package/commands/onScreenChanged/60000-word_echo.py b/src/fenrir-package/commands/onScreenUpdate/60000-word_echo.py similarity index 100% rename from src/fenrir-package/commands/onScreenChanged/60000-word_echo.py rename to src/fenrir-package/commands/onScreenUpdate/60000-word_echo.py diff --git a/src/fenrir-package/commands/onScreenChanged/62000-spell_check.py b/src/fenrir-package/commands/onScreenUpdate/62000-spell_check.py similarity index 100% rename from src/fenrir-package/commands/onScreenChanged/62000-spell_check.py rename to src/fenrir-package/commands/onScreenUpdate/62000-spell_check.py diff --git a/src/fenrir-package/commands/onScreenChanged/65000-char_delete_echo.py b/src/fenrir-package/commands/onScreenUpdate/65000-char_delete_echo.py similarity index 100% rename from src/fenrir-package/commands/onScreenChanged/65000-char_delete_echo.py rename to src/fenrir-package/commands/onScreenUpdate/65000-char_delete_echo.py diff --git a/src/fenrir-package/commands/onScreenChanged/70000-incomming.py b/src/fenrir-package/commands/onScreenUpdate/70000-incomming.py similarity index 100% rename from src/fenrir-package/commands/onScreenChanged/70000-incomming.py rename to src/fenrir-package/commands/onScreenUpdate/70000-incomming.py diff --git a/src/fenrir-package/commands/onScreenChanged/75000-incomming_promote.py b/src/fenrir-package/commands/onScreenUpdate/75000-incomming_promote.py similarity index 100% rename from src/fenrir-package/commands/onScreenChanged/75000-incomming_promote.py rename to src/fenrir-package/commands/onScreenUpdate/75000-incomming_promote.py diff --git a/src/fenrir-package/commands/onScreenChanged/__init__.py b/src/fenrir-package/commands/onScreenUpdate/__init__.py similarity index 100% rename from src/fenrir-package/commands/onScreenChanged/__init__.py rename to src/fenrir-package/commands/onScreenUpdate/__init__.py diff --git a/src/fenrir-package/core/commandManager.py b/src/fenrir-package/core/commandManager.py index bc78ec34..0a41bc9d 100644 --- a/src/fenrir-package/core/commandManager.py +++ b/src/fenrir-package/core/commandManager.py @@ -14,12 +14,14 @@ class commandManager(): def initialize(self, environment): self.env = environment self.env['runtime']['commandManager'].loadCommands('commands') - environment['runtime']['commandManager'].loadCommands('onInput') - environment['runtime']['commandManager'].loadCommands('onScreenChanged') + self.env['runtime']['commandManager'].loadCommands('onInput') + self.env['runtime']['commandManager'].loadCommands('onScreenUpdate') + self.env['runtime']['commandManager'].loadCommands('onScreenChanged') def shutdown(self): self.env['runtime']['commandManager'].shutdownCommands('commands') self.env['runtime']['commandManager'].shutdownCommands('onInput') + self.env['runtime']['commandManager'].shutdownCommands('onScreenUpdate') self.env['runtime']['commandManager'].shutdownCommands('onScreenChanged') def loadCommands(self, section='commands'): diff --git a/src/fenrir-package/core/commands.py b/src/fenrir-package/core/commands.py index 229913fc..ff1a3b6a 100644 --- a/src/fenrir-package/core/commands.py +++ b/src/fenrir-package/core/commands.py @@ -32,6 +32,8 @@ commands = { }, 'onScreenChanged':{ }, +'onScreenUpdate':{ + }, 'commands':{ } } diff --git a/src/fenrir-package/fenrir.py b/src/fenrir-package/fenrir.py index 1f86c230..9b925b3e 100755 --- a/src/fenrir-package/fenrir.py +++ b/src/fenrir-package/fenrir.py @@ -50,9 +50,11 @@ class fenrir(): print(e) self.environment['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR) - self.environment['runtime']['commandManager'].executeTriggerCommands('onInput') - self.environment['runtime']['commandManager'].executeTriggerCommands('onScreenChanged') - + self.environment['runtime']['commandManager'].executeTriggerCommands('onInput') + if self.environment['screenData']['newTTY'] == self.environment['screenData']['oldTTY']: + self.environment['runtime']['commandManager'].executeTriggerCommands('onScreenUpdate') + else: + self.environment['runtime']['commandManager'].executeTriggerCommands('onScreenChanged') self.handleCommands() def prepareCommand(self):