Now updates the DimListConroller when a CategoryDataset is drag'n'dropped into
SelectionListController.
This commit is contained in:
parent
c5c4f13a19
commit
a5955f9b59
|
@ -158,6 +158,7 @@ class FluentApp:
|
||||||
self.idlist_crt)
|
self.idlist_crt)
|
||||||
self.dimlist_crt = selections.DimListController(self['dim_list'],
|
self.dimlist_crt = selections.DimListController(self['dim_list'],
|
||||||
self.sellist_crt)
|
self.sellist_crt)
|
||||||
|
self.sellist_crt.set_dimlist_controller(self.dimlist_crt)
|
||||||
|
|
||||||
def init_gui(self):
|
def init_gui(self):
|
||||||
self['appwindow'].set_size_request(800, 600)
|
self['appwindow'].set_size_request(800, 600)
|
||||||
|
|
|
@ -182,9 +182,10 @@ class SelectionListController:
|
||||||
##
|
##
|
||||||
## Public interface
|
## Public interface
|
||||||
##
|
##
|
||||||
|
def set_dimlist_controller(self, dimlist_controller):
|
||||||
|
self._dimlist_controller = dimlist_controller
|
||||||
|
|
||||||
def set_dimension(self, dim):
|
def set_dimension(self, dim):
|
||||||
print "SelTreeController.set_dimension(%s)" % dim
|
|
||||||
|
|
||||||
self._ensure_selection_store(dim)
|
self._ensure_selection_store(dim)
|
||||||
self._seltree.set_model(self._sel_stores[dim])
|
self._seltree.set_model(self._sel_stores[dim])
|
||||||
self._idlist_controller.set_dimension(dim)
|
self._idlist_controller.set_dimension(dim)
|
||||||
|
@ -192,14 +193,11 @@ class SelectionListController:
|
||||||
|
|
||||||
def selection_changed(self, dimname, selection):
|
def selection_changed(self, dimname, selection):
|
||||||
"""Callback function from Project."""
|
"""Callback function from Project."""
|
||||||
print "selection_changed"
|
|
||||||
|
|
||||||
for dim in selection.dims():
|
for dim in selection.dims():
|
||||||
self._ensure_selection_store(dim)
|
self._ensure_selection_store(dim)
|
||||||
store = self._sel_stores[dim]
|
store = self._sel_stores[dim]
|
||||||
|
|
||||||
if not self._get_current_selection_iter(selection, dim):
|
if not self._get_current_selection_iter(selection, dim):
|
||||||
print " inserting into store"
|
|
||||||
values = (selection.title, selection, dim)
|
values = (selection.title, selection, dim)
|
||||||
store.insert_after(None, None, values)
|
store.insert_after(None, None, values)
|
||||||
|
|
||||||
|
@ -276,7 +274,7 @@ class SelectionListController:
|
||||||
obj = treestore.get_value(i, 2)
|
obj = treestore.get_value(i, 2)
|
||||||
if isinstance(obj, dataset.CategoryDataset):
|
if isinstance(obj, dataset.CategoryDataset):
|
||||||
self.add_dataset(obj)
|
self.add_dataset(obj)
|
||||||
self.set_dimension(obj.get_dim_name(0))
|
self._dimlist_controller.set_dimension(obj.get_dim_name(0))
|
||||||
widget.emit_stop_by_name('drag-data-received')
|
widget.emit_stop_by_name('drag-data-received')
|
||||||
|
|
||||||
def _on_cursor_changed(self, widget):
|
def _on_cursor_changed(self, widget):
|
||||||
|
@ -361,7 +359,6 @@ class DimListController:
|
||||||
self.dimlist.set_cursor(self.dimstore.get_path(dim))
|
self.dimlist.set_cursor(self.dimstore.get_path(dim))
|
||||||
|
|
||||||
self._seltree_controller.set_dimension(dimname)
|
self._seltree_controller.set_dimension(dimname)
|
||||||
print "DimListController.set_dimension()"
|
|
||||||
|
|
||||||
def dataset_changed(self):
|
def dataset_changed(self):
|
||||||
"""Callback function from Project."""
|
"""Callback function from Project."""
|
||||||
|
|
Reference in New Issue