mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
use show() over exec_() due to osx bugs
This commit is contained in:
parent
74e5122717
commit
ec8f7d3856
1 changed files with 4 additions and 1 deletions
|
@ -175,7 +175,8 @@ class Preferences(QDialog):
|
||||||
d.setFileMode(QFileDialog.Directory)
|
d.setFileMode(QFileDialog.Directory)
|
||||||
d.setOption(QFileDialog.ShowDirsOnly, True)
|
d.setOption(QFileDialog.ShowDirsOnly, True)
|
||||||
d.setDirectory(self.config['documentDir'])
|
d.setDirectory(self.config['documentDir'])
|
||||||
if d.exec_():
|
d.show()
|
||||||
|
def accept():
|
||||||
dir = unicode(list(d.selectedFiles())[0])
|
dir = unicode(list(d.selectedFiles())[0])
|
||||||
# make sure we can write into it
|
# make sure we can write into it
|
||||||
try:
|
try:
|
||||||
|
@ -183,5 +184,7 @@ class Preferences(QDialog):
|
||||||
open(f, "w").write("test")
|
open(f, "w").write("test")
|
||||||
os.unlink(f)
|
os.unlink(f)
|
||||||
except (OSError, IOError):
|
except (OSError, IOError):
|
||||||
|
showWarning(_("Can't write to folder."))
|
||||||
return
|
return
|
||||||
self.config['documentDir'] = dir
|
self.config['documentDir'] = dir
|
||||||
|
d.connect(d, SIGNAL("accepted()"), accept)
|
||||||
|
|
Loading…
Reference in a new issue