@@ -32,7 +32,8 @@ def __init__(self, *args, **kwargs):
3232
3333 self .setWindowTitle ("DCOR-Aid Preferences" )
3434 # general
35- self .checkBox_check_updates .toggled .connect (self .on_check_for_updates )
35+ self .checkBox_check_updates .toggled .connect (
36+ self .on_general_check_for_updates )
3637 # server
3738 self .show_server .connect (self .on_show_server )
3839 self .show_user .connect (self .on_show_user )
@@ -46,7 +47,10 @@ def __init__(self, *args, **kwargs):
4647 # uploads
4748 self .toolButton_uploads_cache_browse .clicked .connect (
4849 self .on_uploads_browse )
49- self .toolButton_uploads_apply .clicked .connect (self .on_uploads_apply )
50+ self .toolButton_uploads_path_apply .clicked .connect (
51+ self .on_uploads_path_apply )
52+ self .checkBox_upload_write_task_id .toggled .connect (
53+ self .on_uploads_write_task_id )
5054 # downloads
5155 self .toolButton_downloads_browse .clicked .connect (
5256 self .on_downloads_browse )
@@ -114,7 +118,7 @@ def init_uploads(self):
114118 self .checkBox_upload_write_task_id .blockSignals (False )
115119
116120 @QtCore .pyqtSlot (bool )
117- def on_check_for_updates (self , check_for_updates ):
121+ def on_general_check_for_updates (self , check_for_updates ):
118122 self .settings .setValue ("check for updates" ,
119123 int (bool (check_for_updates )))
120124
@@ -203,11 +207,17 @@ def on_downloads_browse(self):
203207 if path and pathlib .Path (path ).exists ():
204208 self .lineEdit_downloads_path .setText (path )
205209
206- @QtCore .pyqtSlot ()
207- def on_uploads_apply (self ):
208- utwdid = int (self .checkBox_upload_write_task_id .isChecked ())
209- self .settings .setValue ("uploads/update task with dataset id" , utwdid )
210+ def on_uploads_browse (self ):
211+ default = self .settings .value ("uploads/cache path" , "." )
212+ path = QtWidgets .QFileDialog .getExistingDirectory (
213+ self ,
214+ "Choose upload cache location" ,
215+ default ,
216+ )
217+ self .lineEdit_uploads_cache .setText (path )
210218
219+ @QtCore .pyqtSlot ()
220+ def on_uploads_path_apply (self ):
211221 current = self .settings .value ("uploads/cache path" , "." )
212222 path_cache = self .lineEdit_uploads_cache .text ()
213223 self .settings .setValue ("uploads/cache path" , path_cache )
@@ -219,14 +229,10 @@ def on_uploads_apply(self):
219229 msg .setWindowTitle ("Please restart DCOR-Aid" )
220230 msg .exec ()
221231
222- def on_uploads_browse (self ):
223- default = self .settings .value ("uploads/cache path" , "." )
224- path = QtWidgets .QFileDialog .getExistingDirectory (
225- self ,
226- "Choose upload cache location" ,
227- default ,
228- )
229- self .lineEdit_uploads_cache .setText (path )
232+ @QtCore .pyqtSlot (bool )
233+ def on_uploads_write_task_id (self , check_for_updates ):
234+ self .settings .setValue ("uploads/update task with dataset id" ,
235+ int (bool (check_for_updates )))
230236
231237 @QtCore .pyqtSlot ()
232238 def on_show_server (self ):
0 commit comments