Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 401 → Rev 402

/branches/BR-0.4/basico/widgets/wdg_visor_sapnotes.py
69,7 → 69,8
 
 
def sort_by_timestamp(self):
self.sorted_model.set_sort_column_id(11, Gtk.SortType.DESCENDING)
sorted_model = self.srvgui.get_widget('visor_sapnotes_sorted_model')
sorted_model.set_sort_column_id(11, Gtk.SortType.DESCENDING)
 
 
def setup_panel(self):
233,8 → 234,8
self.renderer_icon = Gtk.CellRendererPixbuf()
self.renderer_icon.set_alignment(0.0, 0.5)
self.column_icon = Gtk.TreeViewColumn('', self.renderer_icon, pixbuf=1)
widget = get_column_header_widget('', 'basico-sapnote')
self.column_icon.set_widget(widget)
# ~ widget = get_column_header_widget('', '')
# ~ self.column_icon.set_widget(widget)
self.column_icon.set_sizing(Gtk.TreeViewColumnSizing.AUTOSIZE)
self.column_icon.set_visible(True)
self.column_icon.set_expand(False)
244,8 → 245,10
 
# SAP Note Checkbox
self.renderer_checkbox = Gtk.CellRendererToggle()
self.renderer_checkbox.connect("toggled", self.toggle_checkbox)
self.renderer_checkbox.connect("toggled", self.__clb_row_toggled)
self.column_checkbox = Gtk.TreeViewColumn('', self.renderer_checkbox, active=2)
widget = get_column_header_widget('', 'basico-check-accept')
self.column_checkbox.set_widget(widget)
self.column_checkbox.set_sizing(Gtk.TreeViewColumnSizing.AUTOSIZE)
self.column_checkbox.set_visible(True)
self.column_checkbox.set_expand(False)
260,8 → 263,8
self.renderer_sid.set_property('height', 36)
self.renderer_sid.set_property('background', '#F0E3E3')
self.column_sid = Gtk.TreeViewColumn('SAP Note', self.renderer_sid, markup=3)
widget = get_column_header_widget('SAP Note', 'basico-sapnote')
self.column_sid.set_widget(widget)
# ~ widget = get_column_header_widget('SAP Note', 'basico-sapnote')
# ~ self.column_sid.set_widget(widget)
self.column_sid.set_visible(True)
self.column_sid.set_sizing(Gtk.TreeViewColumnSizing.AUTOSIZE)
self.column_sid.set_expand(False)
396,8 → 399,9
# https://stackoverflow.com/questions/23355866/user-search-collapsed-rows-in-a-gtk-treeview
 
# TreeView sorting
self.sorted_model = Gtk.TreeModelSort(model=self.visible_filter)
self.sorted_model.set_sort_func(0, self.sort_function, None)
sorted_model = Gtk.TreeModelSort(model=self.visible_filter)
self.srvgui.add_widget('visor_sapnotes_sorted_model', sorted_model)
sorted_model.set_sort_func(0, self.sort_function, None)
 
# Selection
self.selection = self.treeview.get_selection()
405,7 → 409,7
self.selection.connect('changed', self.row_changed)
 
# Set model (filtered and sorted)
self.treeview.set_model(self.sorted_model)
self.treeview.set_model(sorted_model)
 
self.show_all()
return visor
471,9 → 475,11
self.log.debug(error)
 
 
def toggle_checkbox(self, cell, path):
path = self.sorted_model.convert_path_to_child_path(Gtk.TreePath(path))
self.model[path][2] = not self.model[path][2]
def __clb_row_toggled(self, cell, path):
sorted_model = self.srvgui.get_widget('visor_sapnotes_sorted_model')
model = sorted_model.get_model()
rpath = sorted_model.convert_path_to_child_path(Gtk.TreePath(path))
model[rpath][2] = not model[rpath][2]
 
 
def get_node(self, key, icon, checkbox, sid, title, component, category='', sntype='', priority='', updated='', aid='', timestamp=''):
516,6 → 522,7
 
 
def populate(self, bag=None, cid=None):
sorted_model = self.srvgui.get_widget('visor_sapnotes_sorted_model')
icon_sapnote = self.srvicm.get_pixbuf_icon('basico-sapnote', 32, 32)
# ~ icon_sap_note = self.srvicm.get_pixbuf_icon('basico-sap-note', 32, 32)
# ~ icon_sap_note_standard = self.srvicm.get_pixbuf_icon('basico-sap-note', 32, 32)
523,9 → 530,9
for atype in ATYPES:
self.icons['type'][atype.lower()] = self.srvicm.get_pixbuf_icon('basico-annotation-type-%s' % atype.lower())
self.column_sid.set_visible(True)
self.column_checkbox.set_visible(False)
self.column_category.set_visible(False)
self.column_component.set_visible(True)
# ~ self.column_checkbox.set_visible(False)
# ~ self.column_category.set_visible(False)
# ~ self.column_component.set_visible(True)
completion = self.srvgui.get_widget('gtk_entrycompletion_visor')
completion_model = completion.get_model()
completion_model.clear()
634,7 → 641,7
# ~ )
# ~ self.model.append(pid, node)
 
self.treeview.set_model(self.sorted_model)
self.treeview.set_model(sorted_model)
self.update_total_sapnotes_count()
self.show_widgets()
self.srvclb.gui_show_dashboard()
790,8 → 797,8
 
 
def get_filtered_bag(self):
sorted_model = self.srvgui.get_widget('visor_sapnotes_sorted_model')
visor_sapnotes = self.srvgui.get_widget('visor_sapnotes')
model = visor_sapnotes.get_sorted_model()
selected = []
 
def get_selected_sapnotes(model, path, itr):
800,5 → 807,5
if len(aid) == 0:
selected.append(str(sid))
 
model.foreach(get_selected_sapnotes)
sorted_model.foreach(get_selected_sapnotes)
return selected