Exemplo n.º 1
0
 def __init__(self, mw: aqt.main.AnkiQt):
     QDialog.__init__(self, mw, Qt.Window)
     mw.setupDialogGC(self)
     self.mw = mw
     self.name = "deckStats"
     self.period = 0
     self.form = aqt.forms.stats.Ui_Dialog()
     self.oldPos = None
     self.wholeCollection = False
     self.setMinimumWidth(700)
     f = self.form
     f.setupUi(self)
     f.groupBox.setVisible(False)
     f.groupBox_2.setVisible(False)
     restoreGeom(self, self.name)
     b = f.buttonBox.addButton(
         tr(TR.STATISTICS_SAVE_PDF), QDialogButtonBox.ActionRole
     )
     qconnect(b.clicked, self.saveImage)
     b.setAutoDefault(False)
     maybeHideClose(self.form.buttonBox)
     addCloseShortcut(self)
     gui_hooks.stats_dialog_will_show(self)
     self.show()
     self.refresh()
     self.activateWindow()
Exemplo n.º 2
0
Arquivo: stats.py Projeto: RumovZ/anki
 def __init__(self, mw: aqt.main.AnkiQt) -> None:
     QDialog.__init__(self, mw, Qt.WindowType.Window)
     mw.garbage_collect_on_dialog_finish(self)
     self.mw = mw
     self.name = "deckStats"
     self.period = 0
     self.form = aqt.forms.stats.Ui_Dialog()
     self.oldPos = None
     self.wholeCollection = False
     self.setMinimumWidth(700)
     disable_help_button(self)
     f = self.form
     f.setupUi(self)
     f.groupBox.setVisible(False)
     f.groupBox_2.setVisible(False)
     restoreGeom(self, self.name)
     b = f.buttonBox.addButton(
         tr.statistics_save_pdf(), QDialogButtonBox.ButtonRole.ActionRole
     )
     qconnect(b.clicked, self.saveImage)
     b.setAutoDefault(False)
     maybeHideClose(self.form.buttonBox)
     addCloseShortcut(self)
     gui_hooks.stats_dialog_will_show(self)
     self.show()
     self.refresh()
     self.form.web.set_bridge_command(self._on_bridge_cmd, self)
     self.activateWindow()