mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
changes for qt5 on mac
- setShown() -> setVisible() - qt_mac_set_menubar_icons() no longer exported, use alternative method
This commit is contained in:
parent
0994bd332c
commit
ce9e09d4c5
7 changed files with 14 additions and 11 deletions
|
@ -195,6 +195,10 @@ def run():
|
|||
# we've signaled the primary instance, so we should close
|
||||
return
|
||||
|
||||
# disable icons on mac; this must be done before window created
|
||||
if isMac:
|
||||
app.setAttribute(Qt.AA_DontShowIconsInMenus)
|
||||
|
||||
# we must have a usable temp dir
|
||||
try:
|
||||
tempfile.gettempdir()
|
||||
|
|
|
@ -562,7 +562,7 @@ class Browser(QMainWindow):
|
|||
"Update current note and hide/show editor."
|
||||
update = self.updateTitle()
|
||||
show = self.model.cards and update == 1
|
||||
self.form.splitter.widget(1).setShown(not not show)
|
||||
self.form.splitter.widget(1).setVisible(not not show)
|
||||
if not show:
|
||||
self.editor.setNote(None)
|
||||
else:
|
||||
|
|
|
@ -79,9 +79,9 @@ class CustomStudy(QDialog):
|
|||
sval = 100
|
||||
spShow = False
|
||||
pre = post = ""
|
||||
sp.setShown(spShow)
|
||||
sp.setVisible(spShow)
|
||||
f.title.setText(tit)
|
||||
f.title.setShown(not not tit)
|
||||
f.title.setVisible(not not tit)
|
||||
f.spin.setMinimum(smin)
|
||||
f.spin.setMaximum(smax)
|
||||
f.spin.setValue(sval)
|
||||
|
|
|
@ -35,9 +35,9 @@ class ExportDialog(QDialog):
|
|||
self.exporter = exporters()[idx][1](self.col)
|
||||
self.isApkg = hasattr(self.exporter, "includeSched")
|
||||
self.hideTags = hasattr(self.exporter, "hideTags")
|
||||
self.frm.includeSched.setShown(self.isApkg)
|
||||
self.frm.includeMedia.setShown(self.isApkg)
|
||||
self.frm.includeTags.setShown(
|
||||
self.frm.includeSched.setVisible(self.isApkg)
|
||||
self.frm.includeMedia.setVisible(self.isApkg)
|
||||
self.frm.includeTags.setVisible(
|
||||
not self.isApkg and not self.hideTags)
|
||||
|
||||
def accept(self):
|
||||
|
|
|
@ -64,7 +64,7 @@ class ImportDialog(QDialog):
|
|||
self.setupMappingFrame()
|
||||
self.setupOptions()
|
||||
self.modelChanged()
|
||||
self.frm.autoDetect.setShown(self.importer.needDelimiter)
|
||||
self.frm.autoDetect.setVisible(self.importer.needDelimiter)
|
||||
addHook("currentModelChanged", self.modelChanged)
|
||||
self.connect(self.frm.autoDetect, SIGNAL("clicked()"),
|
||||
self.onDelimiter)
|
||||
|
|
|
@ -134,8 +134,8 @@ class AnkiQt(QMainWindow):
|
|||
name = self.pm.profiles()[n]
|
||||
f = self.profileForm
|
||||
passwd = not self.pm.load(name)
|
||||
f.passEdit.setShown(passwd)
|
||||
f.passLabel.setShown(passwd)
|
||||
f.passEdit.setVisible(passwd)
|
||||
f.passLabel.setVisible(passwd)
|
||||
|
||||
def openProfile(self):
|
||||
name = self.pm.profiles()[self.profileForm.profiles.currentRow()]
|
||||
|
@ -1007,7 +1007,6 @@ will be lost. Continue?"""))
|
|||
def setupSystemSpecific(self):
|
||||
self.hideMenuAccels = False
|
||||
if isMac:
|
||||
qt_mac_set_menubar_icons(False)
|
||||
# mac users expect a minimize option
|
||||
self.minimizeShortcut = QShortcut("Ctrl+M", self)
|
||||
self.connect(self.minimizeShortcut, SIGNAL("activated()"),
|
||||
|
|
|
@ -87,7 +87,7 @@ class Preferences(QDialog):
|
|||
self.onSyncDeauth)
|
||||
|
||||
def _hideAuth(self):
|
||||
self.form.syncDeauth.setShown(False)
|
||||
self.form.syncDeauth.setVisible(False)
|
||||
self.form.syncLabel.setText(_("""\
|
||||
<b>Synchronization</b><br>
|
||||
Not currently enabled; click the sync button in the main window to enable."""))
|
||||
|
|
Loading…
Reference in a new issue