15
15
import h5py
16
16
import lmfit
17
17
import nanite
18
+ import nanite .read
18
19
import numpy
19
20
import scipy
20
21
import sklearn
@@ -67,6 +68,11 @@ def __init__(self, *args, **kwargs):
67
68
self .action_open_bulk .triggered .connect (self .on_open_bulk )
68
69
self .action_open_single .triggered .connect (self .on_open_single )
69
70
self .action_open_multiple .triggered .connect (self .on_open_multiple )
71
+ # Edit menu
72
+ is_dev_mode = bool (int (self .settings .value ("developer mode" , "0" )))
73
+ self .action_developer_mode .setChecked (is_dev_mode )
74
+ self .on_developer_mode (is_dev_mode )
75
+ self .action_developer_mode .triggered .connect (self .on_developer_mode )
70
76
# Tool menu
71
77
self .actionConvert_AFM_data .triggered .connect (self .on_tool_convert )
72
78
# Help menu
@@ -146,6 +152,7 @@ def rem_subwindow(self, title):
146
152
self .menuExport .removeAction (action )
147
153
break
148
154
155
+ @QtCore .pyqtSlot ()
149
156
def on_about (self ):
150
157
about_text = "PyJibe is a user interface for data analysis in " \
151
158
+ "atomic force microscopy with an emphasis on biological " \
@@ -157,10 +164,22 @@ def on_about(self):
157
164
"PyJibe {}" .format (__version__ ),
158
165
about_text )
159
166
167
+ @QtCore .pyqtSlot (bool )
168
+ def on_developer_mode (self , checked ):
169
+ # remember in settings
170
+ self .settings .setValue ("developer mode" , str (int (checked )))
171
+ # set nanite
172
+ if checked :
173
+ nanite .read .DEFAULT_MODALITY = None
174
+ else :
175
+ nanite .read .DEFAULT_MODALITY = "force-distance"
176
+
177
+ @QtCore .pyqtSlot ()
160
178
def on_documentation (self ):
161
179
webbrowser .open ("https://pyjibe.readthedocs.io" )
162
180
163
- def on_open_bulk (self , evt = None ):
181
+ @QtCore .pyqtSlot ()
182
+ def on_open_bulk (self ):
164
183
dlg = custom_widgets .DirectoryDialogMultiSelect (self )
165
184
search_dir = self .settings .value ("paths/load data" , "" )
166
185
dlg .setDirectory (search_dir )
@@ -172,7 +191,8 @@ def on_open_bulk(self, evt=None):
172
191
self .settings .setValue ("paths/load data" ,
173
192
str (dlg .getDirectory ()))
174
193
175
- def on_open_multiple (self , evt = None ):
194
+ @QtCore .pyqtSlot ()
195
+ def on_open_multiple (self ):
176
196
dlg = custom_widgets .DirectoryDialogMultiSelect (self )
177
197
search_dir = self .settings .value ("paths/load data" , "" )
178
198
dlg .setDirectory (search_dir )
@@ -185,7 +205,8 @@ def on_open_multiple(self, evt=None):
185
205
self .settings .setValue ("paths/load data" ,
186
206
str (dlg .getDirectory ()))
187
207
188
- def on_open_single (self , evt = None ):
208
+ @QtCore .pyqtSlot ()
209
+ def on_open_single (self ):
189
210
ext_opts = []
190
211
# all
191
212
exts = ["*" + e for e in registry .known_suffixes ]
@@ -206,6 +227,7 @@ def on_open_single(self, evt=None):
206
227
self .settings .setValue ("paths/load data" ,
207
228
str (pathlib .Path (n [0 ]).parent ))
208
229
230
+ @QtCore .pyqtSlot ()
209
231
def on_software (self ):
210
232
libs = [afmformats ,
211
233
h5py ,
@@ -228,6 +250,7 @@ def on_software(self):
228
250
"Software" ,
229
251
sw_text )
230
252
253
+ @QtCore .pyqtSlot ()
231
254
def on_tool_convert (self ):
232
255
dlg = ConvertDialog (self )
233
256
dlg .show ()
0 commit comments