diff --git a/aqt/__init__.py b/aqt/__init__.py index b1cfee56c..c72adea70 100644 --- a/aqt/__init__.py +++ b/aqt/__init__.py @@ -7,6 +7,7 @@ import locale, gettext import anki.lang from anki.consts import HELP_SITE from anki.lang import langDir +from anki.utils import isMac appVersion="2.0.8" appWebsite="http://ankisrs.net/" @@ -167,6 +168,10 @@ class AnkiApp(QApplication): def parseArgs(argv): "Returns (opts, args)." + # py2app fails to strip this in some instances, then anki dies + # as there's no such profile + if isMac and len(argv) > 1 and argv[1].startswith("-psn"): + argv = [argv[0]] parser = optparse.OptionParser(version="%prog " + appVersion) parser.usage = "%prog [OPTIONS] [file to import]" parser.add_option("-b", "--base", help="path to base folder") @@ -176,7 +181,6 @@ def parseArgs(argv): def run(): global mw - from anki.utils import isMac # parse args opts, args = parseArgs(sys.argv) diff --git a/aqt/editor.py b/aqt/editor.py index 372a6b2bc..8df6cb4a3 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -384,6 +384,9 @@ class Editor(object): self._buttons = {} # button styles for mac self.plastiqueStyle = QStyleFactory.create("plastique") + if not self.plastiqueStyle: + # plastique was removed in qt5 + self.plastiqueStyle = QStyleFactory.create("fusion") self.widget.setStyle(self.plastiqueStyle) # icons self.iconsBox = QHBoxLayout()