summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKam Woods <kamwoods@gmail.com>2016-05-14 16:01:37 -0400
committerKam Woods <kamwoods@gmail.com>2016-05-14 16:01:37 -0400
commitc8328885776332b0c9211abce31880eecccf90aa (patch)
tree130ecaa5722a61a3ec8f6da07db960a37fe42a84
parent59247d2ce96135b149a5b1e6e6098a14c9c8bc7c (diff)
downloadDiskFormatID-c8328885776332b0c9211abce31880eecccf90aa.zip
DiskFormatID-c8328885776332b0c9211abce31880eecccf90aa.tar.gz
DiskFormatID-c8328885776332b0c9211abce31880eecccf90aa.tar.bz2
Updated diskIDMain to create settings in user home hidden dir
-rwxr-xr-xdiskIDMain17
1 files changed, 17 insertions, 0 deletions
diff --git a/diskIDMain b/diskIDMain
index 243c812..131c9b5 100755
--- a/diskIDMain
+++ b/diskIDMain
@@ -39,6 +39,23 @@ class kryoMain(QtGui.QMainWindow, diskIDMainGUI.Ui_kryoMain):
# set the dtc max concurrent isntances box to default to 1
self.DTCInstances.setText("1")
+ # Check for existence of settings file for local user. If it doesn't
+ # exist (e.g. on first use) warn and create)
+
+ spath = os.getenv("HOME") + '/.diskFormatID/settings.json'
+ if not os.path.exists(spath):
+
+ QtGui.QMessageBox.warning(self, "Cannot open file",
+ "The selected file could not be opened.",
+ QtGui.QMessageBox.Cancel, QtGui.QMessageBox.NoButton,
+ QtGui.QMessageBox.NoButton)
+
+ os.mkdir(os.getenv("HOME") + '/.diskFormatID')
+ sfile = open(spath, 'w+')
+ sfile.write('{"outputFormats": [{"Image type": "-i4"}, {"Image type": "-i10"}, {"Image type": "-i9"}], "mainSettings": [{"Output directory": "/home/euan/kryo/output/", "DTC directory": "/home/euan/kryo/kryoflux_2.6_linux/dtc/", "Input directory": "/home/euan/kryo/smallTest/", "Delete unmountable": "TRUE"}]}')
+ sfile.close()
+
+
#open the settings.json file for reading
if os.stat('settings.json').st_size != 0:
with open('settings.json') as settings_file: