def unserialize(self, data): data = apply_defaults(data, { 'header_visible': True, 'header_autoresize': True, 'header_sizes': [100] * 3, }) for column, size in enumerate(data.header_sizes): size = size or 100 self.setColumnWidth(column, size) self.action_hide_columns.setChecked(data.header_visible) self.action_auto_resize.setChecked(data.header_autoresize) FileWidgetBase.unserialize(self, data)
def unserialize(self, data): data = apply_defaults(data, { 'tab_width': 150, } ) self.shorten_tabnames = data.shorten_tabnames self.tab_width = data.tab_width #print "UNSERIALIZE", self, data for dirpanel_data in data.dirs: dirpanel = self.new_tab(data=dirpanel_data) self.action_hide_tabbar.setChecked(data.tabbar_visible) self.tabBar().setVisible(data.tabbar_visible) self.setCurrentIndex(data.active_tab)
def unserialize(self, data): #print "UNSERIALIZE", self, data data = apply_defaults(data, { 'view_data': {} }) self.path_history = data.path_history self.directory.sort_settings = data.sort_settings #self.listwidget.action_hide_columns.setChecked(data.header_visible) #self.listwidget.header().setVisible(data.header_visible) sort_by, descending = data.sort_settings.get( data.path, ('name', False) ) for index, column_visible in data.columns_visible: self.listwidget.setColumnHidden(index, not column_visible) self.listwidget.column_actions[index].setChecked(column_visible) self._view_data = data.view_data self.listwidget.unserialize(data.view_data['list']) #self.set_path(data.path) self.show_widget(data.current_widget_name) self.currentWidget().model().sort(sort_by, descending) self.currentWidget().show() #{ #'list': self.show_list_action, #'thumbs': self.show_thumbs_action, #'thumb_list': self.show_thumb_list_action, #'large_thumbs': self.show_large_thumbs_action, #}[data.current_widget_name].setChecked(True) self.view_actions[data.current_widget_name].setChecked(True)
def unserialize(self, data): data = apply_defaults(data, { 'vscrollbar': 0, }) self.verticalScrollBar().setValue(data.vscrollbar)