Ejemplo n.º 1
0
    def __restore_perspective(self):
        perspective = self.settings.get('view', 'perspective')
        for viewer_type in viewer.viewerTypes():
            if self.__perspective_and_settings_viewer_count_differ(
                    viewer_type):
                # Different viewer counts may happen when the name of a viewer
                # is changed between versions
                perspective = ''
                break

        try:
            self.manager.LoadPerspective(perspective)
        except ValueError, reason:
            # This has been reported to happen. Don't know why. Keep going
            # if it does.
            if self.__splash:
                self.__splash.Destroy()
            wx.MessageBox(_(
                '''Couldn't restore the pane layout from TaskCoach.ini:
%s

The default pane layout will be used.

If this happens again, please make a copy of your TaskCoach.ini file '''
                '''before closing the program, open a bug report, and attach the '''
                '''copied TaskCoach.ini file to the bug report.''') % reason,
                          _('%s settings error') % meta.name,
                          style=wx.OK | wx.ICON_ERROR)
            self.manager.LoadPerspective('')
Ejemplo n.º 2
0
    def __restore_perspective(self):
        perspective = self.settings.get('view', 'perspective')
        for viewer_type in viewer.viewerTypes():
            if self.__perspective_and_settings_viewer_count_differ(viewer_type):
                # Different viewer counts may happen when the name of a viewer 
                # is changed between versions
                perspective = ''
                break

        try:
            self.manager.LoadPerspective(perspective)
        except ValueError, reason:
            # This has been reported to happen. Don't know why. Keep going
            # if it does.
            if self.__splash:
                self.__splash.Destroy()
            wx.MessageBox(_('''Couldn't restore the pane layout from TaskCoach.ini:
%s

The default pane layout will be used.

If this happens again, please make a copy of your TaskCoach.ini file '''
'''before closing the program, open a bug report, and attach the '''
'''copied TaskCoach.ini file to the bug report.''') % reason,
            _('%s settings error') % meta.name, style=wx.OK | wx.ICON_ERROR)
            self.manager.LoadPerspective('')
Ejemplo n.º 3
0
 def __save_viewer_counts(self):
     ''' Save the number of viewers for each viewer type. '''
     for viewer_type in viewer.viewerTypes():
         count = len([
             v for v in self.viewer
             if v.__class__.__name__.lower() == viewer_type
         ])
         self.settings.set('view', viewer_type + 'count', str(count))
Ejemplo n.º 4
0
 def __save_viewer_counts(self):
     ''' Save the number of viewers for each viewer type. '''
     for viewer_type in viewer.viewerTypes():
         count = len([v for v in self.viewer if v.__class__.__name__.lower() == viewer_type])
         self.settings.set('view', viewer_type + 'count', str(count))