mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-12 00:06:43 -04:00
[pyqgis-console] converts all newlines to "\n" in order to fix the "Enter selected command" from the editor
- fixes background color for toolbar editor on Windows - minor fixes
This commit is contained in:
parent
956e18d28f
commit
269a419b25
@ -354,9 +354,16 @@ class PythonConsoleWidget(QWidget):
|
||||
self.toolBar.addAction(self.optionsButton)
|
||||
self.toolBar.addAction(self.helpButton)
|
||||
|
||||
if sys.platform.startswith('win'):
|
||||
bkgrcolor = ['170', '170', '170']
|
||||
bordercl = ['125', '125', '125']
|
||||
else:
|
||||
bkgrcolor = ['200', '200', '200']
|
||||
bordercl = ['155', '155', '155']
|
||||
|
||||
self.toolBarEditor = QToolBar()
|
||||
self.toolBarEditor.setStyleSheet('QToolBar{background-color: rgb(200, 200, 200);\
|
||||
border-right: 1px solid rgb(155, 155, 155);}')
|
||||
self.toolBarEditor.setStyleSheet('QToolBar{background-color: rgb(%s, %s, %s' % tuple(bkgrcolor) + ');\
|
||||
border-right: 1px solid rgb(%s, %s, %s' % tuple(bordercl) + ');}')
|
||||
self.toolBarEditor.setEnabled(False)
|
||||
self.toolBarEditor.setFocusPolicy(Qt.NoFocus)
|
||||
self.toolBarEditor.setContextMenuPolicy(Qt.DefaultContextMenu)
|
||||
@ -604,16 +611,17 @@ class PythonConsoleWidget(QWidget):
|
||||
self.tabEditorWidget.widgetMessageBar(iface, text)
|
||||
|
||||
def updateTabListScript(self, script, action=None):
|
||||
settings = QSettings()
|
||||
if script == 'empty':
|
||||
self.tabListScript = []
|
||||
if script is not None and not action and script != 'empty':
|
||||
self.tabListScript.remove(script)
|
||||
if action:
|
||||
if script not in self.tabListScript:
|
||||
self.tabListScript.append(script)
|
||||
settings.setValue("pythonConsole/tabScripts",
|
||||
QVariant(self.tabListScript))
|
||||
if script != '':
|
||||
settings = QSettings()
|
||||
if script == 'empty':
|
||||
self.tabListScript = []
|
||||
if script is not None and not action and script != 'empty':
|
||||
self.tabListScript.remove(script)
|
||||
if action:
|
||||
if script not in self.tabListScript:
|
||||
self.tabListScript.append(script)
|
||||
settings.setValue("pythonConsole/tabScripts",
|
||||
QVariant(self.tabListScript))
|
||||
|
||||
def saveSettingsConsole(self):
|
||||
settings = QSettings()
|
||||
|
@ -477,7 +477,7 @@ class EditorTab(QWidget):
|
||||
self.newEditor.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
|
||||
self.newEditor.modificationChanged.connect(self.modified)
|
||||
if filename:
|
||||
self.newEditor.setText(open(filename, "r").read())
|
||||
self.newEditor.setText(open(filename, "rt").read())
|
||||
self.newEditor.setModified(False)
|
||||
self.path = filename
|
||||
|
||||
@ -763,7 +763,6 @@ class EditorTabWidget(QTabWidget):
|
||||
#print sys.modules[module]
|
||||
if pathFile not in sys.path:
|
||||
sys.path.append(pathFile)
|
||||
|
||||
try:
|
||||
reload(pyclbr)
|
||||
dictObject = {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user