mirror of
				https://github.com/arsenetar/dupeguru.git
				synced 2025-09-11 17:58:17 +00:00 
			
		
		
		
	Fix Issue #504
- Update qt/preferences_dialog.py to resize based on layout with fixed sizing constraints - Remove _setupUi from qt/se/preferences_dialog.py and just use the parent class's function - Remove unused imports from qt/se/preferences_dialog.py
This commit is contained in:
		
							parent
							
								
									f7e20c8aa6
								
							
						
					
					
						commit
						dde2c9bf8f
					
				| @ -7,7 +7,7 @@ | |||||||
| from PyQt5.QtCore import Qt, QSize | from PyQt5.QtCore import Qt, QSize | ||||||
| from PyQt5.QtWidgets import ( | from PyQt5.QtWidgets import ( | ||||||
|     QDialog, QDialogButtonBox, QVBoxLayout, QHBoxLayout, QLabel, QComboBox, |     QDialog, QDialogButtonBox, QVBoxLayout, QHBoxLayout, QLabel, QComboBox, | ||||||
|     QSlider, QSizePolicy, QSpacerItem, QCheckBox, QLineEdit, QMessageBox, QSpinBox |     QSlider, QSizePolicy, QSpacerItem, QCheckBox, QLineEdit, QMessageBox, QSpinBox, QLayout | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| from hscommon.trans import trget | from hscommon.trans import trget | ||||||
| @ -114,7 +114,6 @@ class PreferencesDialogBase(QDialog): | |||||||
| 
 | 
 | ||||||
|     def _setupUi(self): |     def _setupUi(self): | ||||||
|         self.setWindowTitle(tr("Options")) |         self.setWindowTitle(tr("Options")) | ||||||
|         self.resize(304, 263) |  | ||||||
|         self.setSizeGripEnabled(False) |         self.setSizeGripEnabled(False) | ||||||
|         self.setModal(True) |         self.setModal(True) | ||||||
|         self.mainVLayout = QVBoxLayout(self) |         self.mainVLayout = QVBoxLayout(self) | ||||||
| @ -124,6 +123,7 @@ class PreferencesDialogBase(QDialog): | |||||||
|         self.buttonBox = QDialogButtonBox(self) |         self.buttonBox = QDialogButtonBox(self) | ||||||
|         self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Ok|QDialogButtonBox.RestoreDefaults) |         self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Ok|QDialogButtonBox.RestoreDefaults) | ||||||
|         self.mainVLayout.addWidget(self.buttonBox) |         self.mainVLayout.addWidget(self.buttonBox) | ||||||
|  |         self.layout().setSizeConstraint(QLayout.SetFixedSize) | ||||||
| 
 | 
 | ||||||
|     def _load(self, prefs, setchecked): |     def _load(self, prefs, setchecked): | ||||||
|         # Edition-specific |         # Edition-specific | ||||||
|  | |||||||
| @ -9,7 +9,6 @@ from PyQt5.QtWidgets import ( | |||||||
|     QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy, QSpacerItem, QWidget, QLineEdit |     QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy, QSpacerItem, QWidget, QLineEdit | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| from hscommon.plat import ISWINDOWS, ISLINUX |  | ||||||
| from hscommon.trans import trget | from hscommon.trans import trget | ||||||
| from hscommon.util import tryint | from hscommon.util import tryint | ||||||
| 
 | 
 | ||||||
| @ -64,16 +63,6 @@ class PreferencesDialog(PreferencesDialogBase): | |||||||
|         self.widgetsVLayout.addWidget(self.widget) |         self.widgetsVLayout.addWidget(self.widget) | ||||||
|         self._setupBottomPart() |         self._setupBottomPart() | ||||||
| 
 | 
 | ||||||
|     def _setupUi(self): |  | ||||||
|         PreferencesDialogBase._setupUi(self) |  | ||||||
| 
 |  | ||||||
|         if ISLINUX: |  | ||||||
|             # Under linux, whether it's a Qt layout bug or something else, the size threshold text edit |  | ||||||
|             # doesn't have enough space, so we make the pref pane higher to compensate. |  | ||||||
|             self.resize(self.width(), 530) |  | ||||||
|         elif ISWINDOWS: |  | ||||||
|             self.resize(self.width(), 440) |  | ||||||
| 
 |  | ||||||
|     def _load(self, prefs, setchecked): |     def _load(self, prefs, setchecked): | ||||||
|         setchecked(self.matchSimilarBox, prefs.match_similar) |         setchecked(self.matchSimilarBox, prefs.match_similar) | ||||||
|         setchecked(self.wordWeightingBox, prefs.word_weighting) |         setchecked(self.wordWeightingBox, prefs.word_weighting) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user