示例#1
0
 def delete_obsolete_statistics(self, *w):
     if gu.dialog_delete(_("Delete obsolete statistics?"), self,
             _(u"This will delete the directory «%s».") % os.path.join(filesystem.app_data(), u"statistics")):
         try:
             shutil.rmtree(os.path.join(filesystem.app_data(), u"statistics"))
         except OSError, e:
             gu.display_exception_message(e)
         self.update_old_statistics_info()
示例#2
0
 def delete_obsolete_statistics(self, *w):
     if gu.dialog_delete(
             _("Delete obsolete statistics?"), self,
             _(u"This will delete the directory «%s».") %
             os.path.join(filesystem.app_data(), u"statistics")):
         try:
             shutil.rmtree(
                 os.path.join(filesystem.app_data(), u"statistics"))
         except OSError, e:
             gu.display_exception_message(e)
         self.update_old_statistics_info()
示例#3
0
 def delete_statistics(self, *w):
     if gu.dialog_delete(_("Delete statistics and test results?"), self,
             _(u"This will delete and recreate the file «%s».") % solfege.db.get_statistics_filename()):
         restart = False
         # We need to test for this, because get_view() can also return the front page
         if isinstance(solfege.win.get_view(), abstract.Gui):
             solfege.win.get_view().on_end_practise()
             restart = True
         solfege.db.reset_database()
         if restart:
             solfege.win.get_view().on_start_practise()
             if solfege.win.get_view().m_t.m_P and solfege.win.get_view().m_t.m_statistics:
                 solfege.db.validate_stored_statistics(solfege.win.get_view().m_t.m_P.m_filename)
     self.update_statistics_info()
示例#4
0
 def delete_statistics(self, *w):
     if gu.dialog_delete(
             _("Delete statistics and test results?"), self,
             _(u"This will delete and recreate the file «%s».") %
             solfege.db.get_statistics_filename()):
         restart = False
         # We need to test for this, because get_view() can also return the front page
         if isinstance(solfege.win.get_view(), abstract.Gui):
             solfege.win.get_view().on_end_practise()
             restart = True
         solfege.db.reset_database()
         if restart:
             solfege.win.get_view().on_start_practise()
             if solfege.win.get_view().m_t.m_P and solfege.win.get_view(
             ).m_t.m_statistics:
                 solfege.db.validate_stored_statistics(
                     solfege.win.get_view().m_t.m_P.m_filename)
     self.update_statistics_info()