mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
more qt5 mac fixes
- workaround for -psn_0 being passed in - use fusion if plastique missing
This commit is contained in:
parent
ce9e09d4c5
commit
fc2c772115
2 changed files with 8 additions and 1 deletions
|
@ -7,6 +7,7 @@ import locale, gettext
|
||||||
import anki.lang
|
import anki.lang
|
||||||
from anki.consts import HELP_SITE
|
from anki.consts import HELP_SITE
|
||||||
from anki.lang import langDir
|
from anki.lang import langDir
|
||||||
|
from anki.utils import isMac
|
||||||
|
|
||||||
appVersion="2.0.8"
|
appVersion="2.0.8"
|
||||||
appWebsite="http://ankisrs.net/"
|
appWebsite="http://ankisrs.net/"
|
||||||
|
@ -167,6 +168,10 @@ class AnkiApp(QApplication):
|
||||||
|
|
||||||
def parseArgs(argv):
|
def parseArgs(argv):
|
||||||
"Returns (opts, args)."
|
"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 = optparse.OptionParser(version="%prog " + appVersion)
|
||||||
parser.usage = "%prog [OPTIONS] [file to import]"
|
parser.usage = "%prog [OPTIONS] [file to import]"
|
||||||
parser.add_option("-b", "--base", help="path to base folder")
|
parser.add_option("-b", "--base", help="path to base folder")
|
||||||
|
@ -176,7 +181,6 @@ def parseArgs(argv):
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
global mw
|
global mw
|
||||||
from anki.utils import isMac
|
|
||||||
|
|
||||||
# parse args
|
# parse args
|
||||||
opts, args = parseArgs(sys.argv)
|
opts, args = parseArgs(sys.argv)
|
||||||
|
|
|
@ -384,6 +384,9 @@ class Editor(object):
|
||||||
self._buttons = {}
|
self._buttons = {}
|
||||||
# button styles for mac
|
# button styles for mac
|
||||||
self.plastiqueStyle = QStyleFactory.create("plastique")
|
self.plastiqueStyle = QStyleFactory.create("plastique")
|
||||||
|
if not self.plastiqueStyle:
|
||||||
|
# plastique was removed in qt5
|
||||||
|
self.plastiqueStyle = QStyleFactory.create("fusion")
|
||||||
self.widget.setStyle(self.plastiqueStyle)
|
self.widget.setStyle(self.plastiqueStyle)
|
||||||
# icons
|
# icons
|
||||||
self.iconsBox = QHBoxLayout()
|
self.iconsBox = QHBoxLayout()
|
||||||
|
|
Loading…
Reference in a new issue