[pyqgis-console] another updating to new SIP API

This commit is contained in:
Salvatore Larosa 2013-06-11 18:20:26 +02:00
parent bb6a4ee770
commit a415950d63
2 changed files with 12 additions and 12 deletions

View File

@ -185,7 +185,7 @@ class Editor(QsciScintilla):
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':
@ -198,8 +198,8 @@ class Editor(QsciScintilla):
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()
@ -240,7 +240,7 @@ class Editor(QsciScintilla):
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()
@ -372,7 +372,7 @@ class Editor(QsciScintilla):
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()))
@ -642,7 +642,7 @@ class Editor(QsciScintilla):
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:
@ -852,7 +852,7 @@ class EditorTabWidget(QTabWidget):
# 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:

View File

@ -117,7 +117,7 @@ class ShellScintilla(QsciScintilla, code.InteractiveInterpreter):
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)
@ -135,8 +135,8 @@ class ShellScintilla(QsciScintilla, code.InteractiveInterpreter):
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()
@ -192,7 +192,7 @@ class ShellScintilla(QsciScintilla, code.InteractiveInterpreter):
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()
@ -406,7 +406,7 @@ class ShellScintilla(QsciScintilla, code.InteractiveInterpreter):
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: