Skip to content
Permalink
Browse files

[pyqgis-console] reject changes in settings if they are not applied

  • Loading branch information
slarosa committed Sep 16, 2013
1 parent 959862c commit 2d728d7f4c33bc58289df5fe2b704d2645df9a21
Showing with 5 additions and 2 deletions.
  1. +0 −1 python/console/console.py
  2. +5 −1 python/console/console_settings.py
@@ -684,7 +684,6 @@ def openHelp(self):
QgsContextHelp.run( "PythonConsole" )

def openSettings(self):
self.options.restoreSettings()
self.options.exec_()

def prefChanged(self):
@@ -35,7 +35,7 @@ def __init__(self, parent):
self.listPath = []
self.lineEdit.setReadOnly(True)

#self.restoreSettings()
self.restoreSettings()
self.initialCheck()

self.addAPIpath.setIcon(QIcon(":/images/themes/default/symbologyAdd.png"))
@@ -210,6 +210,7 @@ def restoreSettings(self):
self.lineEdit.setText(settings.value("pythonConsole/preparedAPIFile", "", type=str))
itemTable = settings.value("pythonConsole/userAPI", [])
if itemTable:
self.tableWidget.setRowCount(0)
for i in range(len(itemTable)):
self.tableWidget.insertRow(i)
self.tableWidget.setColumnCount(2)
@@ -221,6 +222,8 @@ def restoreSettings(self):

self.autoCompThreshold.setValue(settings.value("pythonConsole/autoCompThreshold", 2, type=int))
self.autoCompThresholdEditor.setValue(settings.value("pythonConsole/autoCompThresholdEditor", 2, type=int))
self.groupBoxAutoCompletionEditor.setChecked(settings.value("pythonConsole/autoCompleteEnabledEditor", True, type=bool))
self.groupBoxAutoCompletion.setChecked(settings.value("pythonConsole/autoCompleteEnabled", True, type=bool))

self.enableObjectInspector.setChecked(settings.value("pythonConsole/enableObjectInsp", False, type=bool))
self.autoCloseBracketEditor.setChecked(settings.value("pythonConsole/autoCloseBracketEditor", False, type=bool))
@@ -285,4 +288,5 @@ def _resetFontColorEditor(self):
# return obj.setButtonBackground()

def reject(self):
self.restoreSettings()
QDialog.reject(self)

0 comments on commit 2d728d7

Please sign in to comment.
You can’t perform that action at this time.