def file_save(self):
     stopwatch.pause()
     path = config()["path"]
     try:
         database().save(path)
     except MnemosyneError, e:
         self.widget.error_box(e)
Exemple #2
0
 def cleanDuplicates(self):
     stopwatch.pause()
     self.statusbar.message(_("Please wait..."))
     clean_duplicates(self)
     rebuild_revision_queue()
     if not in_revision_queue(self.card):
         self.newQuestion()
     self.updateDialog()
     stopwatch.unpause()
 def add_cards(self):
     stopwatch.pause()
     self.widget.run_add_cards_dialog()
     review_controller = ui_controller_review()
     if review_controller.card == None:
         review_controller.new_question()
     else:
         self.widget.update_status_bar()
     stopwatch.unpause()
Exemple #4
0
 def Import(self):
     stopwatch.pause()
     from xml.sax import saxutils, make_parser
     from xml.sax.handler import feature_namespaces
     dlg = ImportDlg(self)
     dlg.exec_loop()
     if self.card == None:
         self.newQuestion()
     self.updateDialog()
     stopwatch.unpause()
Exemple #5
0
 def configuration(self):
     stopwatch.pause()
     dlg = ConfigurationDlg(self)
     dlg.exec_loop()
     rebuild_revision_queue()
     if not in_revision_queue(self.card):
         self.newQuestion()
     else:
         remove_from_revision_queue(self.card) # It's already being asked.
     self.updateDialog()
     stopwatch.unpause()
Exemple #6
0
 def activateCategories(self):
     stopwatch.pause()
     dlg = ActivateCategoriesDlg(self)
     dlg.exec_()
     rebuild_revision_queue()
     if not in_revision_queue(self.card):
         self.newQuestion()
     else:
         remove_from_revision_queue(self.card) # It's already being asked.
     self.updateDialog()
     stopwatch.unpause()
Exemple #7
0
 def editCards(self):
     stopwatch.pause()
     dlg = EditCardsDlg(self)
     dlg.exec_()
     rebuild_revision_queue()
     if not in_revision_queue(self.card):
         self.newQuestion()
     else:
         remove_from_revision_queue(self.card) # It's already being asked.
     ui_controller_review().update_dialog(redraw_all=True)
     self.updateDialog()
     stopwatch.unpause()
 def file_open(self):
     stopwatch.pause()
     old_path = expand_path(config()["path"])
     out = self.widget.open_file_dialog(path=old_path,
                         filter=_("Mnemosyne databases (*.mem)"))
     if not out:
         stopwatch.unpause()
         return
     try:
         database().unload()
     except MnemosyneError, e:
         self.widget.error_box(e)
         stopwatch.unpause()
         return            
Exemple #9
0
 def deleteCurrentCard(self):
     # TODO: ask user if he wants to delete all related cards, or only
     # deactivate this cardview?
     stopwatch.pause()
     status = QMessageBox.warning(None,
                                  _("Mnemosyne"),
                                  _("Delete current card?"),
                                  _("&Yes"), _("&No"),
                                  QString(), 1, -1)
     if status == 0:
         delete_card(self.card)
         self.newQuestion()
     ui_controller_review().update_dialog(redraw_all=True)
     stopwatch.unpause()
 def file_save_as(self):
     stopwatch.pause()
     old_path = expand_path(config()["path"])
     out = self.widget.save_file_dialog(path=old_path,
                         filter=_("Mnemosyne databases (*.mem)"))
     if not out:
         stopwatch.unpause()
         return
     if not out.endswith(".mem"):
         out += ".mem"
     try:
         database().save(out)
     except MnemosyneError, e:
         self.widget.error_box(e)
         stopwatch.unpause()
         return
 def file_new(self):
     stopwatch.pause()
     out = self.widget.save_file_dialog(path=config().basedir,
                         filter=_("Mnemosyne databases (*.mem)"),
                         caption=_("New"))
     if not out:
         stopwatch.unpause()
         return
     if not out.endswith(".mem"):
         out += ".mem"
     db = database()
     db.unload()
     db.new(out)
     db.load(config()["path"])
     ui_controller_review().clear()
     ui_controller_review().update_dialog()
     stopwatch.unpause()
Exemple #12
0
 def helpAbout(self):
     stopwatch.pause()
     dlg = AboutDlg(self)
     dlg.exec_()
     stopwatch.unpause()
Exemple #13
0
 def Tip(self):
     return
     stopwatch.pause()
     dlg = TipDlg(self)
     dlg.exec_()
     stopwatch.unpause()
Exemple #14
0
 def export(self):
     stopwatch.pause()
     dlg = ExportDlg(self)
     dlg.exec_loop()
     stopwatch.unpause()
Exemple #15
0
 def showStatistics(self):
     stopwatch.pause()
     dlg = StatisticsDlg(self)
     dlg.exec_()
     stopwatch.unpause()
 def edit_current_card(self):
     stopwatch.pause()
     review_controller = ui_controller_review()
     self.widget.run_edit_fact_dialog(review_controller.card.fact)
     review_controller.update_dialog(redraw_all=True)
     stopwatch.unpause()
Exemple #17
0
 def productTour(self):
     return
     stopwatch.pause()
     dlg = ProductTourDlg(self)
     dlg.exec_()
     stopwatch.unpause()