Skip to content

Commit 35489cc

Browse files
committed
[pyqgis-console] changes and cleans up some icon
1 parent bdcc01e commit 35489cc

File tree

9 files changed

+12
-9
lines changed

9 files changed

+12
-9
lines changed

images/images.qrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,11 @@
6464
<file>themes/default/cap_round.png</file>
6565
<file>themes/default/cap_square.png</file>
6666
<file>themes/default/clearInput.png</file>
67-
<file>themes/default/console/iconAboutConsole.png</file>
6867
<file>themes/default/console/iconClassConsole.png</file>
6968
<file>themes/default/console/iconClearConsole.png</file>
7069
<file>themes/default/console/iconCodepadConsole.png</file>
7170
<file>themes/default/console/iconHelpConsole.png</file>
7271
<file>themes/default/console/iconHideToolConsole.png</file>
73-
<file>themes/default/console/iconIfaceConsole.png</file>
7472
<file>themes/default/console/iconOpenConsole.png</file>
7573
<file>themes/default/console/iconQtCoreConsole.png</file>
7674
<file>themes/default/console/iconQtGuiConsole.png</file>
@@ -84,7 +82,6 @@
8482
<file>themes/default/console/imgHelpMenu.png</file>
8583
<file>themes/default/console/iconTabEditorConsole.png</file>
8684
<file>themes/default/console/iconNewTabEditorConsole.png</file>
87-
<file>themes/default/console/iconCloseTabEditorConsole.png</file>
8885
<file>themes/default/console/iconRestoreTabsConsole.png</file>
8986
<file>themes/default/console/iconFileTabsMenuConsole.png</file>
9087
<file>themes/default/console/iconShowEditorConsole.png</file>
Binary file not shown.
Binary file not shown.
Loading
Binary file not shown.
Loading

python/console/console.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ def saveSettingsConsole(self):
708708
self.settings.setValue("pythonConsole/splitterObj", self.splitterObj.saveState())
709709
self.settings.setValue("pythonConsole/splitterEditor", self.splitterEditor.saveState())
710710

711-
self.shell.writeHistoryFile()
711+
self.shell.writeHistoryFile(True)
712712

713713
def restoreSettingsConsole(self):
714714
storedTabScripts = self.settings.value("pythonConsole/tabScripts")

python/console/console_editor.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ def contextMenuEvent(self, e):
271271
iconFind = QgsApplication.getThemeIcon("console/iconSearchEditorConsole.png")
272272
iconSyntaxCk = QgsApplication.getThemeIcon("console/iconSyntaxErrorConsole.png")
273273
iconObjInsp = QgsApplication.getThemeIcon("console/iconClassBrowserConsole.png")
274+
iconCut = QgsApplication.getThemeIcon("console/iconCutEditorConsole.png")
275+
iconCopy = QgsApplication.getThemeIcon("console/iconCopyEditorConsole.png")
276+
iconPaste = QgsApplication.getThemeIcon("console/iconPasteEditorConsole.png")
274277
hideEditorAction = menu.addAction(QCoreApplication.translate("PythonConsole", "Hide Editor"),
275278
self.hideEditor)
276279
menu.addSeparator()
@@ -300,15 +303,18 @@ def contextMenuEvent(self, e):
300303
"Find Text"),
301304
self.showFindWidget)
302305
menu.addSeparator()
303-
cutAction = menu.addAction(QCoreApplication.translate("PythonConsole",
306+
cutAction = menu.addAction(iconCut,
307+
QCoreApplication.translate("PythonConsole",
304308
"Cut"),
305309
self.cut,
306310
QKeySequence.Cut)
307-
copyAction = menu.addAction(QCoreApplication.translate("PythonConsole",
311+
copyAction = menu.addAction(iconCopy,
312+
QCoreApplication.translate("PythonConsole",
308313
"Copy"),
309314
self.copy,
310315
QKeySequence.Copy)
311-
pasteAction = menu.addAction(QCoreApplication.translate("PythonConsole",
316+
pasteAction = menu.addAction(iconPaste,
317+
QCoreApplication.translate("PythonConsole",
312318
"Paste"),
313319
self.paste, QKeySequence.Paste)
314320
menu.addSeparator()

python/console/console_sci.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def updateHistory(self, command):
271271
self.history.append(command)
272272
self.historyIndex = len(self.history)
273273

274-
def writeHistoryFile(self):
274+
def writeHistoryFile(self, fromCloseConsole=False):
275275
ok = False
276276
try:
277277
wH = open(_historyFile, 'w')
@@ -281,7 +281,7 @@ def writeHistoryFile(self):
281281
except:
282282
raise
283283
wH.close()
284-
if ok:
284+
if ok and not fromCloseConsole:
285285
msgText = QCoreApplication.translate('PythonConsole',
286286
'History saved successfully.')
287287
self.parent.callWidgetMessageBar(msgText)

0 commit comments

Comments
 (0)