Fix Up/Down buttons in Edit Trackers Dialog
This fix properly reflects the movement of the tracker in the dialog table rather than by the tracker index.
This commit is contained in:
parent
5bfb98f9a9
commit
1f73476dc3
|
@ -113,16 +113,6 @@ class EditTrackersDialog:
|
|||
"""Returns the selected tracker"""
|
||||
return self.treeview.get_selection().get_selected()[1]
|
||||
|
||||
def on_button_up_clicked(self, widget):
|
||||
log.debug("on_button_up_clicked")
|
||||
selected = self.get_selected()
|
||||
num_rows = self.liststore.iter_n_children(None)
|
||||
if selected != None and num_rows > 1:
|
||||
tier = self.liststore.get_value(selected, 0)
|
||||
new_tier = tier + 1
|
||||
# Now change the tier for this tracker
|
||||
self.liststore.set_value(selected, 0, new_tier)
|
||||
|
||||
def on_button_add_clicked(self, widget):
|
||||
log.debug("on_button_add_clicked")
|
||||
# Show the add tracker dialog
|
||||
|
@ -156,8 +146,8 @@ class EditTrackersDialog:
|
|||
self.liststore.set_value(selected, 1, tracker)
|
||||
self.edit_tracker_entry.hide()
|
||||
|
||||
def on_button_down_clicked(self, widget):
|
||||
log.debug("on_button_down_clicked")
|
||||
def on_button_up_clicked(self, widget):
|
||||
log.debug("on_button_up_clicked")
|
||||
selected = self.get_selected()
|
||||
num_rows = self.liststore.iter_n_children(None)
|
||||
if selected != None and num_rows > 1:
|
||||
|
@ -168,6 +158,16 @@ class EditTrackersDialog:
|
|||
# Now change the tier for this tracker
|
||||
self.liststore.set_value(selected, 0, new_tier)
|
||||
|
||||
def on_button_down_clicked(self, widget):
|
||||
log.debug("on_button_down_clicked")
|
||||
selected = self.get_selected()
|
||||
num_rows = self.liststore.iter_n_children(None)
|
||||
if selected != None and num_rows > 1:
|
||||
tier = self.liststore.get_value(selected, 0)
|
||||
new_tier = tier + 1
|
||||
# Now change the tier for this tracker
|
||||
self.liststore.set_value(selected, 0, new_tier)
|
||||
|
||||
def on_button_ok_clicked(self, widget):
|
||||
log.debug("on_button_ok_clicked")
|
||||
self.trackers = []
|
||||
|
|
Loading…
Reference in New Issue