Fixed an issue hiding the 'Open in Editor' context menu action for files not being SVG files. eric7

Sun, 09 Jan 2022 16:28:16 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 09 Jan 2022 16:28:16 +0100
branch
eric7
changeset 8911
a37761d36236
parent 8910
02d67de5ec1c
child 8912
1bd5e972252e

Fixed an issue hiding the 'Open in Editor' context menu action for files not being SVG files.

eric7/Project/ProjectOthersBrowser.py file | annotate | diff | comparison | revisions
--- a/eric7/Project/ProjectOthersBrowser.py	Sat Jan 08 20:12:37 2022 +0100
+++ b/eric7/Project/ProjectOthersBrowser.py	Sun Jan 09 16:28:16 2022 +0100
@@ -164,6 +164,7 @@
                     itm = self.model().item(index)
                     if isinstance(itm, ProjectBrowserFileItem):
                         self.editPixmapAct.setVisible(itm.isPixmapFile())
+                        self.openInEditorAct.setVisible(itm.isSvgFile())
                         self.mimeTypeAct.setVisible(True)
                         self.menu.popup(self.mapToGlobal(coord))
                     elif isinstance(itm, ProjectBrowserDirectoryItem):
@@ -208,11 +209,10 @@
         
         @param menu Reference to the popup menu (QPopupMenu)
         """
-        itm = self.model().item(self.currentIndex())
-        
         if self.project.vcs is None:
             for act in self.menuActions:
                 act.setEnabled(True)
+            itm = self.model().item(self.currentIndex())
             if isinstance(
                 itm,
                 (ProjectBrowserSimpleDirectoryItem,
@@ -221,8 +221,6 @@
                 self.renameFileAct.setEnabled(False)
         else:
             self.vcsHelper.showContextMenu(menu, self.menuActions)
-        
-        self.openInEditorAct.setVisible(itm.isSvgFile())
     
     def _editPixmap(self):
         """

eric ide

mercurial