Fixed a little glitch in the project sources browser related to code formatting. eric7

Mon, 18 Jul 2022 15:04:21 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 18 Jul 2022 15:04:21 +0200
branch
eric7
changeset 9246
f3120bfe82fb
parent 9245
6ee1705a1cb9
child 9247
be188c302760

Fixed a little glitch in the project sources browser related to code formatting.

src/eric7/Project/ProjectSourcesBrowser.py file | annotate | diff | comparison | revisions
--- a/src/eric7/Project/ProjectSourcesBrowser.py	Mon Jul 18 14:46:23 2022 +0200
+++ b/src/eric7/Project/ProjectSourcesBrowser.py	Mon Jul 18 15:04:21 2022 +0200
@@ -1285,7 +1285,10 @@
                 if f.startswith(dirName)
             ]
 
-        if ericApp().getObject("ViewManager").checkAllDirty():
+        vm = ericApp().getObject("ViewManager")
+        files = [fn for fn in files if vm.checkFileDirty(fn)]
+
+        if files:
             dlg = BlackConfigurationDialog(withProject=True)
             if dlg.exec() == QDialog.DialogCode.Accepted:
                 config = dlg.getConfiguration()
@@ -1294,3 +1297,9 @@
                     config, files, project=self.project, action=action
                 )
                 formattingDialog.exec()
+        else:
+            EricMessageBox.information(
+                self,
+                self.tr("Code Formatting"),
+                self.tr("""There are no files left for reformatting."""),
+            )

eric ide

mercurial