@@ -295,7 +295,7 @@ def export_plugins(self):
295
295
rows = table .rowCount ()
296
296
cols = table .columnCount ()
297
297
298
- if self .dlg .chk_core_plugins .isChecked ():
298
+ if self .dlg .chk_ext_repos .isChecked ():
299
299
repos = repositories .allEnabled ()
300
300
else :
301
301
repos = None
@@ -329,6 +329,12 @@ def export_plugins(self):
329
329
self .iface .messageBar ().pushSuccess ("Success" , "Selected plugins were exported successfully." )
330
330
elif file_format == '.json' :
331
331
with open (output_file , 'w' ) as file :
332
+ if repos :
333
+ for key , value in repos .items ():
334
+ if key == 'QGIS Official Plugin Repository' :
335
+ pass
336
+ else :
337
+ plugin_list .insert (0 , {'id' : '-' , 'name' : key , 'zip_repository' : value ['url' ]})
332
338
json .dump (plugin_list , file )
333
339
self .iface .messageBar ().pushSuccess ("Success" , "Selected plugins were exported successfully." )
334
340
except IsADirectoryError :
@@ -394,7 +400,6 @@ def import_plugins(self):
394
400
try :
395
401
if plugin ['id' ] == '-' : # It's a third party repository
396
402
self .add_repository (plugin )
397
- self .iface .messageBar ().pushSuccess ("Success" , plugin ['name' ] + " was added to the repositories." )
398
403
else :
399
404
self .pyplugin .installPlugin (plugin ['id' ])
400
405
self .iface .messageBar ().pushSuccess ("Success" , plugin ['name' ] + " was installed successfully." )
@@ -411,28 +416,31 @@ def add_repository(self, repo_info):
411
416
repo_name = repo_info ['name' ]
412
417
repo_url = repo_info ['zip_repository' ]
413
418
if repo_name in repositories .all ():
414
- repo_name = repo_name + "(2)"
415
419
self .iface .messageBar ().pushInfo ("Info" ,
416
- "Found a repository with the same names. Please check your repository "
417
- "settings for duplicate entries, the one imported ends with (2)." )
418
- # add to settings
419
- settings .setValue (repo_name + "/url" , repo_url )
420
- settings .setValue (repo_name + "/authcfg" , "" )
421
- settings .setValue (repo_name + "/enabled" , "True" )
422
- self .pyplugin .reloadAndExportData ()
420
+ "Found a repository with the same name. Skipping repository " + repo_name +
421
+ ". This could prevent a plugin from being installed." )
422
+ else :
423
+ # Adds the repo inside the settings
424
+ settings .setValue (repo_name + "/url" , repo_url )
425
+ settings .setValue (repo_name + "/authcfg" , "" )
426
+ settings .setValue (repo_name + "/enabled" , "True" )
427
+ self .pyplugin .reloadAndExportData ()
428
+ self .iface .messageBar ().pushSuccess ("Success" , repo_name + " was added to the repositories." )
423
429
424
430
# Disables and enables widgets
425
431
def toggle_widget (self ):
426
432
if self .dlg .rd_import .isChecked ():
427
433
self .dlg .file_output_export .setEnabled (False )
428
434
self .dlg .combo_file_format .setEnabled (False )
435
+ self .dlg .chk_ext_repos .setEnabled (False )
429
436
self .dlg .chk_skip_installed .setEnabled (True )
430
437
self .dlg .file_input_import .setEnabled (True )
431
438
else :
432
439
self .dlg .file_input_import .setEnabled (False )
433
440
self .dlg .chk_skip_installed .setEnabled (False )
434
441
self .dlg .file_output_export .setEnabled (True )
435
442
self .dlg .combo_file_format .setEnabled (True )
443
+ self .dlg .chk_ext_repos .setEnabled (True )
436
444
437
445
# Sets the file extension filter for the QgsFileWidget
438
446
def set_filter (self ):
0 commit comments