|
18 | 18 | ***************************************************************************/
|
19 | 19 | Some portions of code were taken from https://code.google.com/p/pydee/
|
20 | 20 | """
|
21 |
| -from qgis.PyQt.QtCore import Qt, QObject, QEvent, QCoreApplication, QFileInfo, QSize |
| 21 | +from qgis.PyQt.QtCore import Qt, QObject, QEvent, QCoreApplication, QFileInfo, QSize, QDir |
22 | 22 | from qgis.PyQt.QtGui import QFont, QFontMetrics, QColor, QKeySequence, QCursor, QFontDatabase
|
23 | 23 | from qgis.PyQt.QtWidgets import QShortcut, QMenu, QApplication, QWidget, QGridLayout, QSpacerItem, QSizePolicy, QFileDialog, QTabWidget, QTreeWidgetItem, QFrame, QLabel, QToolButton, QMessageBox
|
24 | 24 | from qgis.PyQt.Qsci import QsciScintilla, QsciLexerPython, QsciAPIs, QsciStyle
|
@@ -831,9 +831,10 @@ def save(self, fileName=None):
|
831 | 831 | if self.path is None:
|
832 | 832 | saveTr = QCoreApplication.translate('PythonConsole',
|
833 | 833 | 'Python Console: Save file')
|
| 834 | + folder = self.pc.settings.value("pythonConsole/lastDirPath", QDir.homePath()) |
834 | 835 | self.path, filter = QFileDialog().getSaveFileName(self,
|
835 | 836 | saveTr,
|
836 |
| - self.tw.tabText(index) + '.py', |
| 837 | + os.path.join(folder, self.tw.tabText(index) + '.py'), |
837 | 838 | "Script file (*.py)")
|
838 | 839 | # If the user didn't select a file, abort the save operation
|
839 | 840 | if len(self.path) == 0:
|
|
0 commit comments