[meld] Handle setting merge action sensitivity when no pane is focussed
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Handle setting merge action sensitivity when no pane is focussed
- Date: Thu, 30 Aug 2012 20:50:51 +0000 (UTC)
commit cd6205bddba92faeabe8170d678bd6093981a149
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sat Jul 21 08:44:19 2012 +1000
Handle setting merge action sensitivity when no pane is focussed
meld/filediff.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 4643c67..1c2724d 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1049,8 +1049,12 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
def _set_merge_action_sensitivity(self):
pane = self._get_focused_pane()
- editable = self.textview[pane].get_editable()
- mergeable = self.linediffer.has_mergeable_changes(pane)
+ if pane != -1:
+ editable = self.textview[pane].get_editable()
+ mergeable = self.linediffer.has_mergeable_changes(pane)
+ else:
+ editable = False
+ mergeable = (False, False)
self.actiongroup.get_action("MergeFromLeft").set_sensitive(mergeable[0] and editable)
self.actiongroup.get_action("MergeFromRight").set_sensitive(mergeable[1] and editable)
if self.num_panes == 3 and self.textview[1].get_editable():
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]