mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
[pyqgis-console] again more upadte for sip api v2
This commit is contained in:
parent
9db7ab96a5
commit
b1843de774
@ -385,7 +385,7 @@ class Editor(QsciScintilla):
|
||||
cs = self.parent.pc.caseSensitive.isChecked()
|
||||
wo = self.parent.pc.wholeWord.isChecked()
|
||||
notFound = False
|
||||
if not text:
|
||||
if text:
|
||||
if not forward:
|
||||
line = lineFrom
|
||||
index = indexFrom
|
||||
@ -462,7 +462,7 @@ class Editor(QsciScintilla):
|
||||
if commentCheck:
|
||||
self.insertAt('#', line, 0)
|
||||
else:
|
||||
if not self.text(line).trimmed().startsWith('#'):
|
||||
if not self.text(line).strip().startswith('#'):
|
||||
continue
|
||||
self.setSelection(line, self.indentation(line),
|
||||
line, self.indentation(line) + 1)
|
||||
@ -472,7 +472,7 @@ class Editor(QsciScintilla):
|
||||
if commentCheck:
|
||||
self.insertAt('#', line, 0)
|
||||
else:
|
||||
if not self.text(line).trimmed().startsWith('#'):
|
||||
if not self.text(line).strip().startswith('#'):
|
||||
return
|
||||
self.setSelection(line, self.indentation(line),
|
||||
line, self.indentation(line) + 1)
|
||||
@ -908,7 +908,7 @@ class EditorTabWidget(QTabWidget):
|
||||
|
||||
def _currentWidgetChanged(self, tab):
|
||||
if self.settings.value("pythonConsole/enableObjectInsp",
|
||||
False):
|
||||
False, type=bool):
|
||||
self.listObject(tab)
|
||||
self.changeLastDirPath(tab)
|
||||
self.enableSaveIfModified(tab)
|
||||
@ -1091,11 +1091,11 @@ class EditorTabWidget(QTabWidget):
|
||||
self.fileTabMenu.clear()
|
||||
for index in range(self.count()):
|
||||
action = self.fileTabMenu.addAction(self.tabIcon(index), self.tabText(index))
|
||||
action.setData(QVariant(index))
|
||||
action.setData(index)
|
||||
|
||||
def showFileTabMenuTriggered(self, action):
|
||||
index, ok = action.data().toInt()
|
||||
if ok:
|
||||
index = action.data()
|
||||
if index is not None:
|
||||
self.setCurrentIndex(index)
|
||||
|
||||
def listObject(self, tab):
|
||||
@ -1186,7 +1186,7 @@ class EditorTabWidget(QTabWidget):
|
||||
self.widget(i).newEditor.settingsEditor()
|
||||
|
||||
objInspectorEnabled = self.settings.value("pythonConsole/enableObjectInsp",
|
||||
False)
|
||||
False, type=bool)
|
||||
listObj = self.parent.objectListButton
|
||||
if self.parent.listClassMethod.isVisible():
|
||||
listObj.setChecked(objInspectorEnabled)
|
||||
|
@ -194,7 +194,7 @@ class ShellScintilla(QsciScintilla, code.InteractiveInterpreter):
|
||||
else:
|
||||
apiPath = self.settings.value("pythonConsole/userAPI")
|
||||
for i in range(0, len(apiPath)):
|
||||
self.api.load(QString(unicode(apiPath[i])))
|
||||
self.api.load(unicode(apiPath[i]))
|
||||
self.api.prepare()
|
||||
self.lexer.setAPIs(self.api)
|
||||
|
||||
|
@ -98,13 +98,13 @@ class optionsDialog(QDialog, Ui_SettingsDialogPythonConsole):
|
||||
|
||||
def saveSettings(self):
|
||||
settings = QSettings()
|
||||
settings.setValue("pythonConsole/preloadAPI", QVariant(self.preloadAPI.isChecked()))
|
||||
settings.setValue("pythonConsole/autoSaveScript", QVariant(self.autoSaveScript.isChecked()))
|
||||
settings.setValue("pythonConsole/preloadAPI", self.preloadAPI.isChecked())
|
||||
settings.setValue("pythonConsole/autoSaveScript", self.autoSaveScript.isChecked())
|
||||
|
||||
fontFamilyText = self.fontComboBox.currentText()
|
||||
settings.setValue("pythonConsole/fontfamilytext", QVariant(fontFamilyText))
|
||||
settings.setValue("pythonConsole/fontfamilytext", fontFamilyText)
|
||||
fontFamilyTextEditor = self.fontComboBoxEditor.currentText()
|
||||
settings.setValue("pythonConsole/fontfamilytextEditor", QVariant(fontFamilyTextEditor))
|
||||
settings.setValue("pythonConsole/fontfamilytextEditor", fontFamilyTextEditor)
|
||||
|
||||
fontSize = self.spinBox.value()
|
||||
fontSizeEditor = self.spinBoxEditor.value()
|
||||
@ -112,33 +112,33 @@ class optionsDialog(QDialog, Ui_SettingsDialogPythonConsole):
|
||||
for i in range(0, self.tableWidget.rowCount()):
|
||||
text = self.tableWidget.item(i, 1).text()
|
||||
self.listPath.append(text)
|
||||
settings.setValue("pythonConsole/fontsize", QVariant(fontSize))
|
||||
settings.setValue("pythonConsole/fontsizeEditor", QVariant(fontSizeEditor))
|
||||
settings.setValue("pythonConsole/userAPI", QVariant(self.listPath))
|
||||
settings.setValue("pythonConsole/fontsize", fontSize)
|
||||
settings.setValue("pythonConsole/fontsizeEditor", fontSizeEditor)
|
||||
settings.setValue("pythonConsole/userAPI", self.listPath)
|
||||
|
||||
settings.setValue("pythonConsole/autoCompThreshold", QVariant(self.autoCompThreshold.value()))
|
||||
settings.setValue("pythonConsole/autoCompThresholdEditor", QVariant(self.autoCompThresholdEditor.value()))
|
||||
settings.setValue("pythonConsole/autoCompThreshold", self.autoCompThreshold.value())
|
||||
settings.setValue("pythonConsole/autoCompThresholdEditor", self.autoCompThresholdEditor.value())
|
||||
|
||||
settings.setValue("pythonConsole/autoCompleteEnabledEditor", QVariant(self.groupBoxAutoCompletionEditor.isChecked()))
|
||||
settings.setValue("pythonConsole/autoCompleteEnabled", QVariant(self.groupBoxAutoCompletion.isChecked()))
|
||||
settings.setValue("pythonConsole/autoCompleteEnabledEditor", self.groupBoxAutoCompletionEditor.isChecked())
|
||||
settings.setValue("pythonConsole/autoCompleteEnabled", self.groupBoxAutoCompletion.isChecked())
|
||||
|
||||
if self.autoCompFromAPIEditor.isChecked():
|
||||
settings.setValue("pythonConsole/autoCompleteSourceEditor", QVariant('fromAPI'))
|
||||
settings.setValue("pythonConsole/autoCompleteSourceEditor", 'fromAPI')
|
||||
elif self.autoCompFromDocEditor.isChecked():
|
||||
settings.setValue("pythonConsole/autoCompleteSourceEditor", QVariant('fromDoc'))
|
||||
settings.setValue("pythonConsole/autoCompleteSourceEditor", 'fromDoc')
|
||||
elif self.autoCompFromDocAPIEditor.isChecked():
|
||||
settings.setValue("pythonConsole/autoCompleteSourceEditor", QVariant('fromDocAPI'))
|
||||
settings.setValue("pythonConsole/autoCompleteSourceEditor", 'fromDocAPI')
|
||||
|
||||
if self.autoCompFromAPI.isChecked():
|
||||
settings.setValue("pythonConsole/autoCompleteSource", QVariant('fromAPI'))
|
||||
settings.setValue("pythonConsole/autoCompleteSource", 'fromAPI')
|
||||
elif self.autoCompFromDoc.isChecked():
|
||||
settings.setValue("pythonConsole/autoCompleteSource", QVariant('fromDoc'))
|
||||
settings.setValue("pythonConsole/autoCompleteSource", 'fromDoc')
|
||||
elif self.autoCompFromDocAPI.isChecked():
|
||||
settings.setValue("pythonConsole/autoCompleteSource", QVariant('fromDocAPI'))
|
||||
settings.setValue("pythonConsole/autoCompleteSource", 'fromDocAPI')
|
||||
|
||||
settings.setValue("pythonConsole/enableObjectInsp", QVariant(self.enableObjectInspector.isChecked()))
|
||||
settings.setValue("pythonConsole/autoCloseBracket", QVariant(self.autoCloseBracket.isChecked()))
|
||||
settings.setValue("pythonConsole/autoCloseBracketEditor", QVariant(self.autoCloseBracketEditor.isChecked()))
|
||||
settings.setValue("pythonConsole/enableObjectInsp", self.enableObjectInspector.isChecked())
|
||||
settings.setValue("pythonConsole/autoCloseBracket", self.autoCloseBracket.isChecked())
|
||||
settings.setValue("pythonConsole/autoCloseBracketEditor", self.autoCloseBracketEditor.isChecked())
|
||||
|
||||
def restoreSettings(self):
|
||||
settings = QSettings()
|
||||
|
Loading…
x
Reference in New Issue
Block a user