Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[pyqgis-console] reject changes in settings if they are not applied
  • Loading branch information
slarosa committed Sep 16, 2013
1 parent 959862c commit 2d728d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion python/console/console.py
Expand Up @@ -684,7 +684,6 @@ def openHelp(self):
QgsContextHelp.run( "PythonConsole" )

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

def prefChanged(self):
Expand Down
6 changes: 5 additions & 1 deletion python/console/console_settings.py
Expand Up @@ -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"))
Expand Down Expand Up @@ -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)
Expand All @@ -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))
Expand Down Expand Up @@ -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.