diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-02-08 17:22:45 +0000 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-02-08 17:30:43 +0000 |
commit | b7e66fc4449b7eb5942c93e35eaf6f4f8dd31666 (patch) | |
tree | 360d5d584b035459fa26e3909f11b838e3e66a13 | |
parent | daf1a7fa428ccb16bd49e3ca5418278b0090fee9 (diff) |
make refocussing after envelope.edit configurrable
turned on by default and off when called from global.ComposeCommand.
-rw-r--r-- | alot/commands/envelope.py | 11 | ||||
-rw-r--r-- | alot/commands/globals.py | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py index f2788dc6..33cddfb8 100644 --- a/alot/commands/envelope.py +++ b/alot/commands/envelope.py @@ -151,19 +151,24 @@ class SendCommand(Command): @registerCommand(MODE, 'edit', arguments=[ (['--spawn'], {'action': 'store_true', - 'help':'force spawning of editor in a new terminal'})]) + 'help':'force spawning of editor in a new terminal'}), + (['--no-refocus'], {'action': 'store_false', 'dest':'refocus', + 'help':'don\'t refocus envelope after editing'}), + ]) class EditCommand(Command): """edit mail""" - def __init__(self, envelope=None, spawn=None, **kwargs): + def __init__(self, envelope=None, spawn=None, refocus=True, **kwargs): """ :param envelope: email to edit :type envelope: :class:`~alot.message.Envelope` :param spawn: force spawning of editor in a new terminal :type spawn: bool + :param refocus: m """ self.envelope = envelope self.openNew = (envelope != None) self.force_spawn = spawn + self.refocus = refocus Command.__init__(self, **kwargs) def apply(self, ui): @@ -240,7 +245,7 @@ class EditCommand(Command): tf.close() cmd = globals.EditCommand(tf.name, on_success=openEnvelopeFromTmpfile, spawn=self.force_spawn, thread=self.force_spawn, - refocus=True) + refocus=self.refocus) ui.apply_command(cmd) diff --git a/alot/commands/globals.py b/alot/commands/globals.py index 2c39f3dc..81385456 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -629,7 +629,7 @@ class ComposeCommand(Command): logging.debug('attaching: ' + a) cmd = commands.envelope.EditCommand(envelope=self.envelope, - spawn=self.force_spawn) + spawn=self.force_spawn, refocus=False) ui.apply_command(cmd) |