Skip to content

Commit f9d4a64

Browse files
committed
removes first-run copy of pre-v2.0 settings
1 parent a8bd816 commit f9d4a64

1 file changed

Lines changed: 0 additions & 55 deletions

File tree

src/artisanlib/main.py

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -562,49 +562,6 @@ def permissionUpdated(permission:'QPermission') -> None:
562562
os.environ['QT_SCALE_FACTOR'] = f"{float(qsettings.value('scale_factor')):.2f}"
563563

564564
app = Artisan(app_args)
565-
566-
567-
568-
# On the first run if there are legacy settings under "YourQuest" but no new settings under "artisan-scope" then the legacy settings
569-
# will be copied to the new settings location. Once settings exist under "artisan-scope" the legacy settings under "YourQuest" will
570-
# no longer be read or saved. At start-up, versions of Artisan before to v2.0 will no longer share settings with versions v2.0 and after.
571-
# Settings can be shared among all versions of Artisan by explicitly saving and loading them using Help>Save/Load Settings.
572-
573-
settingsRelocated:bool = False
574-
try:
575-
app.setApplicationName(application_name) #needed by QSettings() to store windows geometry in operating system
576-
577-
app.setOrganizationName('YourQuest') #needed by QSettings() to store windows geometry in operating system
578-
app.setOrganizationDomain('p.code.google.com') #needed by QSettings() to store windows geometry in operating system
579-
legacysettings = QSettings()
580-
app.setOrganizationName(application_organization_name) #needed by QSettings() to store windows geometry in operating system
581-
app.setOrganizationDomain(application_organization_domain) #needed by QSettings() to store windows geometry in operating system
582-
newsettings = QSettings()
583-
584-
# copy settings from legacy to new if newsettings do not exist, legacysettings do exist, and were not previously copied
585-
if not newsettings.contains('Mode') and legacysettings.contains('Mode') and legacysettings.contains('_settingsCopied') and legacysettings.value('_settingsCopied') != 1:
586-
settingsRelocated = True
587-
# copy Artisan settings
588-
for key in legacysettings.allKeys():
589-
newsettings.setValue(key,legacysettings.value(key))
590-
legacysettings.setValue('_settingsCopied', 1) # prevents copying again in the future, this key not cleared by a Factory Reset
591-
592-
# copy ArtisanViewer settings
593-
app.setApplicationName(application_viewer_name) #needed by QSettings() to store windows geometry in operating system
594-
595-
app.setOrganizationName('YourQuest') #needed by QSettings() to store windows geometry in operating system
596-
app.setOrganizationDomain('p.code.google.com') #needed by QSettings() to store windows geometry in operating system
597-
legacysettings = QSettings()
598-
app.setOrganizationName(application_organization_name) #needed by QSettings() to store windows geometry in operating system
599-
app.setOrganizationDomain(application_organization_domain) #needed by QSettings() to store windows geometry in operating system
600-
newsettings = QSettings()
601-
for key in legacysettings.allKeys():
602-
newsettings.setValue(key,legacysettings.value(key))
603-
del legacysettings #free up memory?
604-
del newsettings #free up memory?
605-
except Exception: # pylint: disable=broad-except
606-
pass
607-
608565
app.setApplicationName(application_name) #needed by QSettings() to store windows geometry in operating system
609566
app.setOrganizationName(application_organization_name) #needed by QSettings() to store windows geometry in operating system
610567
app.setOrganizationDomain(application_organization_domain) #needed by QSettings() to store windows geometry in operating system
@@ -4141,18 +4098,6 @@ def makeButtonbar() -> QFrame:
41414098

41424099
self.editgraphdialog:editGraphDlg|bool|None = None
41434100

4144-
# # provide information message to user about sharing settings at start-up
4145-
if settingsRelocated:
4146-
string = QApplication.translate('Message','Welcome to version {0} of artisan!').format(__version__) + '\n\n'
4147-
string += QApplication.translate('Message','This is a one time message to inform you about a change in artisan.') + '\n\n'
4148-
string += QApplication.translate('Message','If you never run older versions of artisan you can skip this message, the change does not affect you.') + ' '
4149-
string += QApplication.translate('Message','artisan preserves all your configuration settings when you exit so they will automatically be available the next time you start artisan.') + ' '
4150-
string += QApplication.translate('Message','Beginning with release v2.0, settings will no longer be automatically shared at start-up with versions before v2.0.') + '\n\n'
4151-
string += QApplication.translate('Message','Do not worry. Since this is the first time you opened this new version artisan has already loaded your last used settings.') + '\n\n'
4152-
string += QApplication.translate('Message',"To share settings between this version and artisan versions before v2.0 use 'Help>Save Settings' and 'Help>Load Settings'.") + '\n\n'
4153-
string += QApplication.translate('Message','Enjoy using artisan, The artisan team')
4154-
QMessageBox.information(self, QApplication.translate('Message','One time message about loading settings at start-up'),string)
4155-
41564101
# provide information message to user about artisanViewer the first time it is started
41574102
if self.artisanviewerFirstStart:
41584103
string = QApplication.translate('Message','Welcome to the artisanViewer!').format(__version__) + '\n\n'

0 commit comments

Comments
 (0)