From ff207c1b56730773d8d38e23690872a8c3bb9e1a Mon Sep 17 00:00:00 2001 From: mailchuck Date: Wed, 16 Dec 2015 16:18:38 +0100 Subject: [PATCH] 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. --- src/bitmessageqt/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index f715a328..53093b4e 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -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(