Portable mode fix

The option should not be available if the directory with the executable
is not writable, such as when running from a dmg on OSX.
This commit is contained in:
mailchuck 2015-12-16 16:18:38 +01:00 committed by Peter Surda
parent 4dbd444053
commit ff207c1b56

View File

@ -4162,6 +4162,14 @@ class settingsDialog(QtGui.QDialog):
if shared.appdata == shared.lookupExeFolder():
self.ui.checkBoxPortableMode.setChecked(True)
else:
try:
import tempfile
file = tempfile.NamedTemporaryFile(dir=shared.lookupExeFolder(), delete=True)
file.close # should autodelete
except:
self.ui.checkBoxPortableMode.setDisabled(True)
if 'darwin' in sys.platform:
self.ui.checkBoxStartOnLogon.setDisabled(True)
self.ui.checkBoxStartOnLogon.setText(_translate(