Commit 4d223323 authored by Kai Willadsen's avatar Kai Willadsen

Partial fix for sensitivity setting (closes bgo#638629)

Sensitivity for MeldApp-mediated actions has to be handled on container
switch. FileDiff didn't handle this aggressively enough, and neither
DirDiff or VcView handled it at all. With this commit, FileDiff emits
the next-diff-changed signal correctly, and DirDiff and VcView emit
dummy values; this corrects the regression from previous behaviour.
parent 4a3fb2a8
......@@ -233,6 +233,8 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
label = misc.make_tool_button_widget(self.filter_menu_button.props.label)
# FIXME: Add real sensitivity handling
self.emit("next-diff-changed", True, True)
if self.treeview_focussed:
......@@ -286,6 +286,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
def on_container_switch_in_event(self, ui):
melddoc.MeldDoc.on_container_switch_in_event(self, ui)
# FIXME: If no focussed textview, action sensitivity will be unset
if self.textview_focussed:
......@@ -338,10 +339,10 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
if line != self.cursor.line or force:
chunk, prev, next = self.linediffer.locate_chunk(pane, line)
if chunk != self.cursor.chunk:
if chunk != self.cursor.chunk or force:
self.cursor.chunk = chunk
if prev != self.cursor.prev or next !=
if prev != self.cursor.prev or next != or force:
self.emit("next-diff-changed", prev is not None,
next is not None)
......@@ -353,7 +354,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
next_conflict = conflict
if prev_conflict != self.cursor.prev_conflict or \
next_conflict != self.cursor.next_conflict:
next_conflict != self.cursor.next_conflict or force:
self.emit("next-conflict-changed", prev_conflict is not None,
next_conflict is not None)
......@@ -314,9 +314,9 @@ class MeldApp(gnomeglade.Component):
nbl = self.notebook.get_tab_label( newdoc.widget )
self.widget.set_title(nbl.get_label_text() + " - Meld")
self.diff_handler = newdoc.connect("next-diff-changed",
self.scheduler.add_task( newdoc.scheduler )
def on_notebook_label_changed(self, component, text, tooltip):
......@@ -209,6 +209,11 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
self.combobox_vcs.connect("changed", self.on_vc_change)
def on_container_switch_in_event(self, ui):
melddoc.MeldDoc.on_container_switch_in_event(self, ui)
# FIXME: Add real sensitivity handling
self.emit("next-diff-changed", True, True)
def update_actions_sensitivity(self):
"""Disable actions that use not implemented VC plugin methods
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment