Skip to content

Commit

Permalink
[pyqgis-console] another updating to new SIP API
Browse files Browse the repository at this point in the history
  • Loading branch information
slarosa committed Jun 11, 2013
1 parent bb6a4ee commit a415950
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions python/console/console_editor.py
Expand Up @@ -185,7 +185,7 @@ def settingsEditor(self):
self.setLexers()
threshold = self.settings.value("pythonConsole/autoCompThresholdEditor", 2, type=int)
radioButtonSource = self.settings.value("pythonConsole/autoCompleteSourceEditor", 'fromAPI')
autoCompEnabled = self.settings.value("pythonConsole/autoCompleteEnabledEditor", True)
autoCompEnabled = self.settings.value("pythonConsole/autoCompleteEnabledEditor", True, type=bool)
self.setAutoCompletionThreshold(threshold)
if autoCompEnabled:
if radioButtonSource == 'fromDoc':
Expand All @@ -198,8 +198,8 @@ def settingsEditor(self):
self.setAutoCompletionSource(self.AcsNone)

def autoCompleteKeyBinding(self):
radioButtonSource = self.settings.value("pythonConsole/autoCompleteSourceEditor")
autoCompEnabled = self.settings.value("pythonConsole/autoCompleteEnabledEditor")
radioButtonSource = self.settings.value("pythonConsole/autoCompleteSourceEditor", 'fromAPI')
autoCompEnabled = self.settings.value("pythonConsole/autoCompleteEnabledEditor", True, type=bool)
if autoCompEnabled:
if radioButtonSource == 'fromDoc':
self.autoCompleteFromDocument()
Expand Down Expand Up @@ -240,7 +240,7 @@ def setLexers(self):
if chekBoxAPI:
self.api.loadPrepared( QgsApplication.pkgDataPath() + "/python/qsci_apis/pyqgis_master.pap" )
else:
apiPath = self.settings.value("pythonConsole/userAPI")
apiPath = self.settings.value("pythonConsole/userAPI", [])
for i in range(0, len(apiPath)):
self.api.load(unicode(apiPath[i]))
self.api.prepare()
Expand Down Expand Up @@ -372,7 +372,7 @@ def contextMenuEvent(self, e):
if QApplication.clipboard().text():
pasteAction.setEnabled(True)
if self.settings.value("pythonConsole/enableObjectInsp",
False):
False, type=bool):
showCodeInspection.setEnabled(True)
action = menu.exec_(self.mapToGlobal(e.pos()))

Expand Down Expand Up @@ -642,7 +642,7 @@ def syntaxCheck(self, filename=None, fromContextMenu=True):
return True

def keyPressEvent(self, e):
if self.settings.value("pythonConsole/autoCloseBracketEditor", True):
if self.settings.value("pythonConsole/autoCloseBracketEditor", True, type=bool):
t = unicode(e.text())
## Close bracket automatically
if t in self.opening:
Expand Down Expand Up @@ -852,7 +852,7 @@ def __init__(self, parent):

# Restore script of the previuos session
self.settings = QSettings()
tabScripts = self.settings.value("pythonConsole/tabScripts")
tabScripts = self.settings.value("pythonConsole/tabScripts", [])
self.restoreTabList = tabScripts

if self.restoreTabList:
Expand Down
10 changes: 5 additions & 5 deletions python/console/console_sci.py
Expand Up @@ -117,7 +117,7 @@ def settingsShell(self):
threshold = self.settings.value("pythonConsole/autoCompThreshold", 2, type=int)
self.setAutoCompletionThreshold(threshold)
radioButtonSource = self.settings.value("pythonConsole/autoCompleteSource", 'fromAPI')
autoCompEnabled = self.settings.value("pythonConsole/autoCompleteEnabled", True)
autoCompEnabled = self.settings.value("pythonConsole/autoCompleteEnabled", True, type=bool)
if autoCompEnabled:
if radioButtonSource == 'fromDoc':
self.setAutoCompletionSource(self.AcsDocument)
Expand All @@ -135,8 +135,8 @@ def showHistory(self):
self.historyDlg.activateWindow()

def autoCompleteKeyBinding(self):
radioButtonSource = self.settings.value("pythonConsole/autoCompleteSource")
autoCompEnabled = self.settings.value("pythonConsole/autoCompleteEnabled")
radioButtonSource = self.settings.value("pythonConsole/autoCompleteSource", 'fromAPI')
autoCompEnabled = self.settings.value("pythonConsole/autoCompleteEnabled", True, type=bool)
if autoCompEnabled:
if radioButtonSource == 'fromDoc':
self.autoCompleteFromDocument()
Expand Down Expand Up @@ -192,7 +192,7 @@ def setLexers(self):
if chekBoxAPI:
self.api.loadPrepared( QgsApplication.pkgDataPath() + "/python/qsci_apis/pyqgis_master.pap" )
else:
apiPath = self.settings.value("pythonConsole/userAPI")
apiPath = self.settings.value("pythonConsole/userAPI", [])
for i in range(0, len(apiPath)):
self.api.load(unicode(apiPath[i]))
self.api.prepare()
Expand Down Expand Up @@ -406,7 +406,7 @@ def keyPressEvent(self, e):
self.showNext()
## TODO: press event for auto-completion file directory
else:
if self.settings.value("pythonConsole/autoCloseBracket", True):
if self.settings.value("pythonConsole/autoCloseBracket", True, type=bool):
t = unicode(e.text())
## Close bracket automatically
if t in self.opening:
Expand Down

0 comments on commit a415950

Please sign in to comment.