more qt5 mac fixes

- workaround for -psn_0 being passed in
- use fusion if plastique missing
This commit is contained in:
Damien Elmes 2013-04-16 19:54:23 +09:00
parent ce9e09d4c5
commit fc2c772115
2 changed files with 8 additions and 1 deletions

View File

@ -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)

View File

@ -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()