--- a/eric6/UI/UserInterface.py Sat May 01 14:27:38 2021 +0200 +++ b/eric6/UI/UserInterface.py Thu Jun 03 11:39:23 2021 +0200 @@ -130,6 +130,7 @@ self.__nWrite(self.__bufferedWrite()) +# TODO: add support for QSessionManager to save changed files class UserInterface(E5MainWindow): """ Class implementing the main user interface. @@ -403,6 +404,7 @@ self.projectBrowser.poBrowser.pixmapEditFile.connect(self.__editPixmap) self.projectBrowser.poBrowser.pixmapFile.connect(self.__showPixmap) self.projectBrowser.poBrowser.svgFile.connect(self.__showSvg) + self.projectBrowser.poBrowser.umlFile.connect(self.__showUml) self.projectBrowser.poBrowser.binaryFile.connect(self.__openHexEditor) self.project.sourceFile.connect(self.viewmanager.openSourceFile) @@ -504,6 +506,7 @@ self.browser.pixmapEditFile.connect(self.__editPixmap) self.browser.pixmapFile.connect(self.__showPixmap) self.browser.svgFile.connect(self.__showSvg) + self.browser.umlFile.connect(self.__showUml) self.browser.binaryFile.connect(self.__openHexEditor) self.browser.unittestOpen.connect(self.__unittestScript) self.browser.trpreview.connect(self.__TRPreviewer) @@ -5431,6 +5434,19 @@ dlg = SvgDiagram(fn, self) dlg.show() + @pyqtSlot(str) + def __showUml(self, fn): + """ + Private slot to show an eric graphics file in a dialog. + + @param fn name of the file to be shown + @type str + """ + from Graphics.UMLDialog import UMLDialog, UMLDialogType + dlg = UMLDialog(UMLDialogType.NO_DIAGRAM, self.project, parent=self) + if dlg.load(fn): + dlg.show(fromFile=True) + def __snapshot(self): """ Private slot to start the snapshot tool. @@ -6801,12 +6817,23 @@ installation list of strings """ from PluginManager.PluginInstallDialog import PluginInstallDialog - dlg = PluginInstallDialog( + self.__pluginInstallDialog = PluginInstallDialog( self.pluginManager, [] if pluginFileNames is None else pluginFileNames[:], self) - dlg.exec() - if dlg.restartNeeded(): + self.__pluginInstallDialog.setModal(False) + self.__pluginInstallDialog.finished.connect( + self.__pluginInstallFinished) + self.__pluginInstallDialog.show() + + @pyqtSlot() + def __pluginInstallFinished(self): + """ + Private slot to handle the finishing of the plugin install dialog. + """ + if self.__pluginInstallDialog.restartNeeded(): + self.__pluginInstallDialog.deleteLater() + del self.__pluginInstallDialog self.__restart(ask=True) def __deinstallPlugin(self):