Skip to content

Commit

Permalink
Console options widget is not a dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 5, 2020
1 parent 33f5049 commit e7a34f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
13 changes: 4 additions & 9 deletions python/console/console_settings.py
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -156,7 +156,6 @@ def accept(self):
return
self.saveSettings()
self.listPath = []
QDialog.accept(self)

def addAPI(self, pathAPI):
count = self.tableWidget.rowCount()
Expand Down Expand Up @@ -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)
8 changes: 1 addition & 7 deletions python/console/console_settings.ui
@@ -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>
Expand All @@ -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>
Expand Down

0 comments on commit e7a34f3

Please sign in to comment.