From 31266c7ee27fdc289216cfeee77fdea6214323fd Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Wed, 7 Apr 2010 03:26:59 -0700 Subject: [PATCH] commands: Use prompt_user() instead of signalling information This reads closer to what is going on -- we're prompting the user. Other signals don't have an interactive component and thus use the regular notification->command map. Signed-off-by: David Aguilar --- cola/commands.py | 6 +++--- cola/guicmds.py | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cola/commands.py b/cola/commands.py index 7e069e19..c1e19c5c 100644 --- a/cola/commands.py +++ b/cola/commands.py @@ -127,7 +127,7 @@ class AmendMode(Command): if os.path.exists(self.model.git.git_path('MERGE_HEAD')): self.skip = True _notifier.broadcast(signals.amend, False) - _notifier.broadcast(signals.information, + _factory.prompt_user(signals.information, 'Oops! Unmerged', 'You are in the middle of a merge.\n' 'You cannot amend while merging.') @@ -212,7 +212,7 @@ class ApplyPatches(Command): # Display a diffstat self.model.set_diff_text(diff_text) - _notifier.broadcast(signals.information, + _factory.prompt_user(signals.information, 'Patch(es) Applied', '%d patch(es) applied:\n\n%s' % (len(self.patches), @@ -317,7 +317,7 @@ class Delete(Command): os.remove(filename) rescan=True except: - _notifier.broadcast(signals.information, + _factory.prompt_user(signals.information, 'Error' 'Deleting "%s" failed.' % filename) if rescan: diff --git a/cola/guicmds.py b/cola/guicmds.py index 2115728b..c58557ea 100644 --- a/cola/guicmds.py +++ b/cola/guicmds.py @@ -3,6 +3,7 @@ from PyQt4 import QtGui import cola import cola.app +from cola import i18n from cola import core from cola import gitcmd from cola import gitcmds @@ -29,7 +30,11 @@ class CommandWrapper(object): return qtutils.question(self.parent, title, msg) def _information(self, title, msg): - return qtutils.information(self.parent, title, msg) + if msg is None: + msg = title + title = i18n.gettext(title) + msg = i18n.gettext(msg) + QtGui.QMessageBox.information(self.parent, title, msg) def choose_from_combo(title, items): -- 2.11.4.GIT