|
19 | 19 | Some portions of code were taken from https://code.google.com/p/pydee/
|
20 | 20 | """
|
21 | 21 |
|
22 |
| -from PyQt4.QtCore import Qt, QObject, QEvent, QSettings, QCoreApplication, QFileInfo, QSize, SIGNAL |
| 22 | +from PyQt4.QtCore import Qt, QObject, QEvent, QSettings, QCoreApplication, QFileInfo, QSize, QDir, SIGNAL |
23 | 23 | from PyQt4.QtGui import QFont, QFontMetrics, QColor, QShortcut, QKeySequence, QMenu, QApplication, QCursor, QWidget, QGridLayout, QSpacerItem, QSizePolicy, QFileDialog, QTabWidget, QTreeWidgetItem, QFrame, QLabel, QToolButton, QMessageBox
|
24 | 24 | from PyQt4.Qsci import (QsciScintilla,
|
25 | 25 | QsciLexerPython,
|
@@ -828,6 +828,8 @@ def save(self, fileName=None):
|
828 | 828 | self.newEditor.lastModified = QFileInfo(path).lastModified()
|
829 | 829 | self.pc.updateTabListScript(path, action='append')
|
830 | 830 | self.tw.listObject(self)
|
| 831 | + lastDirPath = QFileInfo(path).path() |
| 832 | + self.pc.settings.setValue("pythonConsole/lastDirPath", lastDirPath) |
831 | 833 |
|
832 | 834 | def modified(self, modified):
|
833 | 835 | self.tw.tabModified(self, modified)
|
@@ -1250,7 +1252,7 @@ def refreshSettingsEditor(self):
|
1250 | 1252 |
|
1251 | 1253 | def changeLastDirPath(self, tab):
|
1252 | 1254 | tabWidget = self.widget(tab)
|
1253 |
| - if tabWidget: |
| 1255 | + if tabWidget and tabWidget.path: |
1254 | 1256 | self.settings.setValue("pythonConsole/lastDirPath", tabWidget.path)
|
1255 | 1257 |
|
1256 | 1258 | def widgetMessageBar(self, iface, text, level, timed=True):
|
|
0 commit comments