Skip to content
Permalink
Browse files

Console options widget is not a dialog

  • Loading branch information
nyalldawson committed Oct 5, 2020
1 parent 33f5049 commit e7a34f33cb0f0e4b43f2c526bfd402f0dff585e0
Showing with 5 additions and 16 deletions.
  1. +4 −9 python/console/console_settings.py
  2. +1 −7 python/console/console_settings.ui
@@ -20,7 +20,7 @@
"""

from qgis.PyQt.QtCore import QCoreApplication, QUrl
from qgis.PyQt.QtWidgets import QDialog, QFileDialog, QMessageBox, QTableWidgetItem, QHBoxLayout
from qgis.PyQt.QtWidgets import QWidget, QFileDialog, QMessageBox, QTableWidgetItem, QHBoxLayout
from qgis.PyQt.QtGui import QIcon, QDesktopServices

from qgis.core import QgsSettings, QgsApplication
@@ -46,7 +46,7 @@ class ConsoleOptionsPage(QgsOptionsPageWidget):

def __init__(self, parent):
super(ConsoleOptionsPage, self).__init__(parent)
self.options_widget = optionsDialog(parent)
self.options_widget = ConsoleOptionsWidget(parent)
layout = QHBoxLayout()
layout.setContentsMargins(0, 0, 0, 0)
layout.setMargin(0)
@@ -61,10 +61,10 @@ def helpKey(self):
return 'plugins/python_console.html'


class optionsDialog(QDialog, Ui_SettingsDialogPythonConsole):
class ConsoleOptionsWidget(QWidget, Ui_SettingsDialogPythonConsole):

def __init__(self, parent):
QDialog.__init__(self, parent)
super().__init__(parent)
self.setWindowTitle(QCoreApplication.translate(
"SettingsDialogPythonConsole", "Python Console Settings"))
self.parent = parent
@@ -156,7 +156,6 @@ def accept(self):
return
self.saveSettings()
self.listPath = []
QDialog.accept(self)

def addAPI(self, pathAPI):
count = self.tableWidget.rowCount()
@@ -233,7 +232,3 @@ def restoreSettings(self):
self.autoCompFromAPI.setChecked(True)
elif settings.value("pythonConsole/autoCompleteSource") == 'fromDocAPI':
self.autoCompFromDocAPI.setChecked(True)

def reject(self):
self.restoreSettings()
QDialog.reject(self)
@@ -1,10 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SettingsDialogPythonConsole</class>
<widget class="QDialog" name="SettingsDialogPythonConsole">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
<widget class="QWidget" name="SettingsDialogPythonConsole">
<property name="geometry">
<rect>
<x>0</x>
@@ -31,9 +28,6 @@
<bold>false</bold>
</font>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_16">
<property name="leftMargin">
<number>0</number>

0 comments on commit e7a34f3

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