diff -r 2c14c7a09032 -r 982fb074be98 eric7/UI/UserInterface.py --- a/eric7/UI/UserInterface.py Wed Dec 08 19:52:51 2021 +0100 +++ b/eric7/UI/UserInterface.py Thu Dec 09 20:07:08 2021 +0100 @@ -2840,6 +2840,34 @@ self.prefImportAct.triggered.connect(self.__importPreferences) self.actions.append(self.prefImportAct) + self.themeExportAct = EricAction( + self.tr('Export Theme'), +## UI.PixmapCache.getIcon("configureExport"), + self.tr('Export Theme...'), + 0, 0, self, 'export_theme') + self.themeExportAct.setStatusTip(self.tr( + 'Export the current theme')) + self.themeExportAct.setWhatsThis(self.tr( + """<b>Export Theme</b>""" + """<p>Export the current theme to a file.</p>""" + )) + self.themeExportAct.triggered.connect(self.__exportTheme) + self.actions.append(self.themeExportAct) + + self.themeImportAct = EricAction( + self.tr('Import Theme'), +## UI.PixmapCache.getIcon("configureImport"), + self.tr('Import Theme...'), + 0, 0, self, 'import_theme') + self.themeImportAct.setStatusTip(self.tr( + 'Import a previously exported theme')) + self.themeImportAct.setWhatsThis(self.tr( + """<b>Import Theme</b>""" + """<p>Import a previously exported theme.</p>""" + )) + self.themeImportAct.triggered.connect(self.__importTheme) + self.actions.append(self.themeImportAct) + self.reloadAPIsAct = EricAction( self.tr('Reload APIs'), self.tr('Reload &APIs'), @@ -3426,6 +3454,9 @@ self.__menus["settings"].addAction(self.prefExportAct) self.__menus["settings"].addAction(self.prefImportAct) self.__menus["settings"].addSeparator() + self.__menus["settings"].addAction(self.themeExportAct) + self.__menus["settings"].addAction(self.themeImportAct) + self.__menus["settings"].addSeparator() self.__menus["settings"].addAction(self.reloadAPIsAct) self.__menus["settings"].addSeparator() self.__menus["settings"].addAction(self.configViewProfilesAct) @@ -3667,6 +3698,8 @@ self.importShortcutsAct, self.prefExportAct, self.prefImportAct, + self.themeExportAct, + self.themeImportAct, self.showExternalToolsAct, self.editMessageFilterAct, self.clearPrivateDataAct, @@ -6420,20 +6453,40 @@ self.__configurationDialog.deleteLater() self.__configurationDialog = None - + + @pyqtSlot() def __exportPreferences(self): """ Private slot to export the current preferences. """ Preferences.exportPreferences() - + + @pyqtSlot() def __importPreferences(self): """ Private slot to import preferences. """ Preferences.importPreferences() self.__preferencesChanged() - + + @pyqtSlot() + def __exportTheme(self): + """ + Private slot to export the current theme to a file. + """ + from Preferences.ThemeManager import ThemeManager + ThemeManager().exportTheme() + + @pyqtSlot() + def __importTheme(self): + """ + Private slot to import a previously exported theme. + """ + from Preferences.ThemeManager import ThemeManager + ThemeManager().importTheme() + self.__preferencesChanged() + + @pyqtSlot() def __preferencesChanged(self): """ Private slot to handle a change of the preferences.