@@ -612,21 +612,22 @@ def uncommentCode(self):
612
612
def openScriptFile (self ):
613
613
lastDirPath = self .settings .value ("pythonConsole/lastDirPath" ).toString ()
614
614
openFileTr = QCoreApplication .translate ("PythonConsole" , "Open File" )
615
- filename = QFileDialog .getOpenFileName (
615
+ fileList = QFileDialog .getOpenFileNames (
616
616
self , openFileTr , lastDirPath , "Script file (*.py)" )
617
- if not filename .isEmpty ():
618
- for i in range (self .tabEditorWidget .count ()):
619
- tabWidget = self .tabEditorWidget .widget (i )
620
- if tabWidget .path == filename :
621
- self .tabEditorWidget .setCurrentWidget (tabWidget )
622
- break
623
- else :
624
- tabName = filename .split ('/' )[- 1 ]
625
- self .tabEditorWidget .newTabEditor (tabName , filename )
626
-
627
- lastDirPath = QFileInfo (filename ).path ()
628
- self .settings .setValue ("pythonConsole/lastDirPath" , QVariant (filename ))
629
- self .updateTabListScript (filename , action = 'append' )
617
+ if not fileList .isEmpty ():
618
+ for pyFile in fileList :
619
+ for i in range (self .tabEditorWidget .count ()):
620
+ tabWidget = self .tabEditorWidget .widget (i )
621
+ if tabWidget .path == pyFile :
622
+ self .tabEditorWidget .setCurrentWidget (tabWidget )
623
+ break
624
+ else :
625
+ tabName = QFileInfo (pyFile ).fileName ()
626
+ self .tabEditorWidget .newTabEditor (tabName , pyFile )
627
+
628
+ lastDirPath = QFileInfo (pyFile ).path ()
629
+ self .settings .setValue ("pythonConsole/lastDirPath" , QVariant (pyFile ))
630
+ self .updateTabListScript (pyFile , action = 'append' )
630
631
631
632
def saveScriptFile (self ):
632
633
tabWidget = self .tabEditorWidget .currentWidget ()
0 commit comments