~facundo/encuentro/trunk

« back to all changes in this revision

Viewing changes to encuentro/main.py

  • Committer: Facundo Batista
  • Date: 2011-12-02 14:38:42 UTC
  • Revision ID: facundo@taniquetil.com.ar-20111202143842-yb2m40n9lk076dwe
Support not having some variables to store in the config.

Show diffs side-by-side

added added

removed removed

Lines of Context:
526
526
        self.config['mainwin_position'] = self.main_window.get_position()
527
527
        treeview_columns = self.programs_treeview.get_columns()
528
528
        self.config['cols_width'] = [c.get_width() for c in treeview_columns]
529
 
        self.config['cols_order'] = self.programs_store.get_sort_column_id()
 
529
 
 
530
        cols_order = self.programs_store.get_sort_column_id()
 
531
        if cols_order != (None, None):
 
532
            self.config['cols_order'] = cols_order
 
533
 
530
534
        tree_selection = self.programs_treeview.get_selection()
531
535
        _, pathlist = tree_selection.get_selected_rows()
532
 
        self.config['selected_row'] = pathlist[0]
 
536
        if len(pathlist) > 0:
 
537
            self.config['selected_row'] = pathlist[0]
533
538
 
534
539
        with open(self._config_file, 'w') as fh:
535
540
            pickle.dump(self.config, fh)