changes for qt5 on mac

- setShown() -> setVisible()
- qt_mac_set_menubar_icons() no longer exported, use alternative method
This commit is contained in:
Damien Elmes 2013-04-15 13:46:07 +09:00
parent 0994bd332c
commit ce9e09d4c5
7 changed files with 14 additions and 11 deletions

View file

@ -195,6 +195,10 @@ def run():
# we've signaled the primary instance, so we should close # we've signaled the primary instance, so we should close
return 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 # we must have a usable temp dir
try: try:
tempfile.gettempdir() tempfile.gettempdir()

View file

@ -562,7 +562,7 @@ class Browser(QMainWindow):
"Update current note and hide/show editor." "Update current note and hide/show editor."
update = self.updateTitle() update = self.updateTitle()
show = self.model.cards and update == 1 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: if not show:
self.editor.setNote(None) self.editor.setNote(None)
else: else:

View file

@ -79,9 +79,9 @@ class CustomStudy(QDialog):
sval = 100 sval = 100
spShow = False spShow = False
pre = post = "" pre = post = ""
sp.setShown(spShow) sp.setVisible(spShow)
f.title.setText(tit) f.title.setText(tit)
f.title.setShown(not not tit) f.title.setVisible(not not tit)
f.spin.setMinimum(smin) f.spin.setMinimum(smin)
f.spin.setMaximum(smax) f.spin.setMaximum(smax)
f.spin.setValue(sval) f.spin.setValue(sval)

View file

@ -35,9 +35,9 @@ class ExportDialog(QDialog):
self.exporter = exporters()[idx][1](self.col) self.exporter = exporters()[idx][1](self.col)
self.isApkg = hasattr(self.exporter, "includeSched") self.isApkg = hasattr(self.exporter, "includeSched")
self.hideTags = hasattr(self.exporter, "hideTags") self.hideTags = hasattr(self.exporter, "hideTags")
self.frm.includeSched.setShown(self.isApkg) self.frm.includeSched.setVisible(self.isApkg)
self.frm.includeMedia.setShown(self.isApkg) self.frm.includeMedia.setVisible(self.isApkg)
self.frm.includeTags.setShown( self.frm.includeTags.setVisible(
not self.isApkg and not self.hideTags) not self.isApkg and not self.hideTags)
def accept(self): def accept(self):

View file

@ -64,7 +64,7 @@ class ImportDialog(QDialog):
self.setupMappingFrame() self.setupMappingFrame()
self.setupOptions() self.setupOptions()
self.modelChanged() self.modelChanged()
self.frm.autoDetect.setShown(self.importer.needDelimiter) self.frm.autoDetect.setVisible(self.importer.needDelimiter)
addHook("currentModelChanged", self.modelChanged) addHook("currentModelChanged", self.modelChanged)
self.connect(self.frm.autoDetect, SIGNAL("clicked()"), self.connect(self.frm.autoDetect, SIGNAL("clicked()"),
self.onDelimiter) self.onDelimiter)

View file

@ -134,8 +134,8 @@ class AnkiQt(QMainWindow):
name = self.pm.profiles()[n] name = self.pm.profiles()[n]
f = self.profileForm f = self.profileForm
passwd = not self.pm.load(name) passwd = not self.pm.load(name)
f.passEdit.setShown(passwd) f.passEdit.setVisible(passwd)
f.passLabel.setShown(passwd) f.passLabel.setVisible(passwd)
def openProfile(self): def openProfile(self):
name = self.pm.profiles()[self.profileForm.profiles.currentRow()] name = self.pm.profiles()[self.profileForm.profiles.currentRow()]
@ -1007,7 +1007,6 @@ will be lost. Continue?"""))
def setupSystemSpecific(self): def setupSystemSpecific(self):
self.hideMenuAccels = False self.hideMenuAccels = False
if isMac: if isMac:
qt_mac_set_menubar_icons(False)
# mac users expect a minimize option # mac users expect a minimize option
self.minimizeShortcut = QShortcut("Ctrl+M", self) self.minimizeShortcut = QShortcut("Ctrl+M", self)
self.connect(self.minimizeShortcut, SIGNAL("activated()"), self.connect(self.minimizeShortcut, SIGNAL("activated()"),

View file

@ -87,7 +87,7 @@ class Preferences(QDialog):
self.onSyncDeauth) self.onSyncDeauth)
def _hideAuth(self): def _hideAuth(self):
self.form.syncDeauth.setShown(False) self.form.syncDeauth.setVisible(False)
self.form.syncLabel.setText(_("""\ self.form.syncLabel.setText(_("""\
<b>Synchronization</b><br> <b>Synchronization</b><br>
Not currently enabled; click the sync button in the main window to enable.""")) Not currently enabled; click the sync button in the main window to enable."""))