Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1366523: Ensure that each quantity spinner has proper settings #1483

Merged
merged 1 commit into from Sep 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/subscription_manager/gui/widgets.py
Expand Up @@ -971,14 +971,19 @@ def _update_cell_based_on_data(self, column, cell_renderer, tree_model, tree_ite

if self.available_store_idx is not None:
available = tree_model.get_value(tree_iter, self.available_store_idx)
if available and available != -1:
if self.quantity_increment_idx is not None:
increment = tree_model.get_value(tree_iter, self.quantity_increment_idx)
else:
increment = 1

cell_renderer.set_property("adjustment",
ga_Gtk.Adjustment(lower=int(increment), upper=int(available), step_incr=int(increment)))
if self.quantity_increment_idx is not None:
increment = tree_model.get_value(tree_iter, self.quantity_increment_idx)
else:
increment = 1

if available:
if available != -1:
cell_renderer.set_property("adjustment",
ga_Gtk.Adjustment(lower=int(increment), upper=int(available), step_incr=int(increment)))
else:
cell_renderer.set_property("adjustment",
ga_Gtk.Adjustment(lower=int(increment), upper=100, step_incr=int(increment)))


class TextTreeViewColumn(ga_Gtk.TreeViewColumn):
Expand Down