How to use the toast.PesterToastMachine function in toast

To help you get started, we’ve selected a few toast examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github illuminatedwax / pesterchum / pesterchum.py View on Github external
self.randhandler = RandomHandler(self)

        try:
            themeChecker(self.theme)
        except ThemeException as xxx_todo_changeme:
            (inst) = xxx_todo_changeme
            print("Caught: "+inst.parameter)
            themeWarning = QtWidgets.QMessageBox(self)
            themeWarning.setText("Theme Error: %s" % (inst))
            themeWarning.exec_()
            self.theme = pesterTheme("pesterchum")

        extraToasts = {'default': PesterToast}
        if pytwmn.confExists():
            extraToasts['twmn'] = pytwmn.Notification
        self.tm = PesterToastMachine(self, lambda: self.theme["main/windowtitle"], on=self.config.notify(),
                                     type=self.config.notifyType(), extras=extraToasts)
        self.tm.run()

        self.chatlog = PesterLog(self.profile().handle, self)

        self.move(100, 100)

        talk = QtWidgets.QAction(self.theme["main/menus/client/talk"], self, triggered=self.openChat)
        self.talk = talk
        logv = QtWidgets.QAction(self.theme["main/menus/client/logviewer"], self, triggered=self.openLogv)
        self.logv = logv
        grps = QtWidgets.QAction(self.theme["main/menus/client/addgroup"], self, triggered=self.addGroupWindow)
        self.grps = grps
        self.rand = QtWidgets.QAction(self.theme["main/menus/client/randen"], self, triggered=self.randhandler.getEncounter)
        opts = QtWidgets.QAction(self.theme["main/menus/client/options"], self, triggered=self.openOpts)
        self.opts = opts