mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 13:44:37 +00:00
Deduplicated scan type combobox creation code between SE and ME (soon to be shared by PE) (Qt).
This commit is contained in:
parent
9d5f3029d0
commit
de23ce90d8
@ -25,6 +25,19 @@ class PreferencesDialogBase(QDialog):
|
|||||||
self.buttonBox.accepted.connect(self.accept)
|
self.buttonBox.accepted.connect(self.accept)
|
||||||
self.buttonBox.rejected.connect(self.reject)
|
self.buttonBox.rejected.connect(self.reject)
|
||||||
|
|
||||||
|
def _setupScanTypeBox(self, labels):
|
||||||
|
self.scanTypeHLayout = QHBoxLayout()
|
||||||
|
self.scanTypeLabel = QLabel(self)
|
||||||
|
self.scanTypeLabel.setText(tr("Scan Type:"))
|
||||||
|
self.scanTypeLabel.setMinimumSize(QSize(100, 0))
|
||||||
|
self.scanTypeLabel.setMaximumSize(QSize(100, 16777215))
|
||||||
|
self.scanTypeHLayout.addWidget(self.scanTypeLabel)
|
||||||
|
self.scanTypeComboBox = QComboBox(self)
|
||||||
|
for label in labels:
|
||||||
|
self.scanTypeComboBox.addItem(label)
|
||||||
|
self.scanTypeHLayout.addWidget(self.scanTypeComboBox)
|
||||||
|
self.widgetsVLayout.addLayout(self.scanTypeHLayout)
|
||||||
|
|
||||||
def _setupFilterHardnessBox(self):
|
def _setupFilterHardnessBox(self):
|
||||||
self.filterHardnessHLayout = QHBoxLayout()
|
self.filterHardnessHLayout = QHBoxLayout()
|
||||||
self.filterHardnessLabel = QLabel(self)
|
self.filterHardnessLabel = QLabel(self)
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
# http://www.hardcoded.net/licenses/bsd_license
|
# http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from PyQt4.QtCore import SIGNAL, QSize
|
from PyQt4.QtCore import QSize
|
||||||
from PyQt4.QtGui import (QVBoxLayout, QHBoxLayout, QLabel, QComboBox, QSizePolicy, QSpacerItem,
|
from PyQt4.QtGui import (QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy, QSpacerItem, QWidget,
|
||||||
QWidget, QApplication)
|
QApplication)
|
||||||
|
|
||||||
from hscommon.trans import tr
|
from hscommon.trans import tr
|
||||||
from core.scanner import ScanType
|
from core.scanner import ScanType
|
||||||
@ -30,24 +30,12 @@ class PreferencesDialog(PreferencesDialogBase):
|
|||||||
def __init__(self, parent, app):
|
def __init__(self, parent, app):
|
||||||
PreferencesDialogBase.__init__(self, parent, app)
|
PreferencesDialogBase.__init__(self, parent, app)
|
||||||
|
|
||||||
self.connect(self.scanTypeComboBox, SIGNAL('currentIndexChanged(int)'), self.scanTypeChanged)
|
self.scanTypeComboBox.currentIndexChanged[int].connect(self.scanTypeChanged)
|
||||||
|
|
||||||
def _setupPreferenceWidgets(self):
|
def _setupPreferenceWidgets(self):
|
||||||
self.horizontalLayout = QHBoxLayout()
|
scanTypeLabels = [tr(s) for s in ["Filename", "Filename - Fields",
|
||||||
self.label_2 = QLabel(self)
|
"Filename - Fields (No Order)", "Tags", "Contents", "Audio Contents"]]
|
||||||
self.label_2.setText(tr("Scan Type:"))
|
self._setupScanTypeBox(scanTypeLabels)
|
||||||
self.label_2.setMinimumSize(QSize(100, 0))
|
|
||||||
self.label_2.setMaximumSize(QSize(100, 16777215))
|
|
||||||
self.horizontalLayout.addWidget(self.label_2)
|
|
||||||
self.scanTypeComboBox = QComboBox(self)
|
|
||||||
self.scanTypeComboBox.addItem(tr("Filename"))
|
|
||||||
self.scanTypeComboBox.addItem(tr("Filename - Fields"))
|
|
||||||
self.scanTypeComboBox.addItem(tr("Filename - Fields (No Order)"))
|
|
||||||
self.scanTypeComboBox.addItem(tr("Tags"))
|
|
||||||
self.scanTypeComboBox.addItem(tr("Contents"))
|
|
||||||
self.scanTypeComboBox.addItem(tr("Audio Contents"))
|
|
||||||
self.horizontalLayout.addWidget(self.scanTypeComboBox)
|
|
||||||
self.widgetsVLayout.addLayout(self.horizontalLayout)
|
|
||||||
self._setupFilterHardnessBox()
|
self._setupFilterHardnessBox()
|
||||||
self.widgetsVLayout.addLayout(self.filterHardnessHLayout)
|
self.widgetsVLayout.addLayout(self.filterHardnessHLayout)
|
||||||
self.widget = QWidget(self)
|
self.widget = QWidget(self)
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
from PyQt4.QtCore import QSize
|
from PyQt4.QtCore import QSize
|
||||||
from PyQt4.QtGui import (QVBoxLayout, QHBoxLayout, QLabel, QComboBox, QSizePolicy, QSpacerItem,
|
from PyQt4.QtGui import (QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy, QSpacerItem, QWidget,
|
||||||
QWidget, QLineEdit, QApplication)
|
QLineEdit, QApplication)
|
||||||
|
|
||||||
from hscommon.trans import tr
|
from hscommon.trans import tr
|
||||||
from hscommon.util import tryint
|
from hscommon.util import tryint
|
||||||
@ -32,17 +32,8 @@ class PreferencesDialog(PreferencesDialogBase):
|
|||||||
self.scanTypeComboBox.currentIndexChanged[int].connect(self.scanTypeChanged)
|
self.scanTypeComboBox.currentIndexChanged[int].connect(self.scanTypeChanged)
|
||||||
|
|
||||||
def _setupPreferenceWidgets(self):
|
def _setupPreferenceWidgets(self):
|
||||||
self.horizontalLayout = QHBoxLayout()
|
scanTypeLabels = [tr(s) for s in ["Filename", "Contents", "Folders"]]
|
||||||
self.label_2 = QLabel(self)
|
self._setupScanTypeBox(scanTypeLabels)
|
||||||
self.label_2.setText(tr("Scan Type:"))
|
|
||||||
self.label_2.setMinimumSize(QSize(100, 0))
|
|
||||||
self.label_2.setMaximumSize(QSize(100, 16777215))
|
|
||||||
self.horizontalLayout.addWidget(self.label_2)
|
|
||||||
self.scanTypeComboBox = QComboBox(self)
|
|
||||||
for label in [tr("Filename"), tr("Contents"), tr("Folders")]:
|
|
||||||
self.scanTypeComboBox.addItem(label)
|
|
||||||
self.horizontalLayout.addWidget(self.scanTypeComboBox)
|
|
||||||
self.widgetsVLayout.addLayout(self.horizontalLayout)
|
|
||||||
self._setupFilterHardnessBox()
|
self._setupFilterHardnessBox()
|
||||||
self.widgetsVLayout.addLayout(self.filterHardnessHLayout)
|
self.widgetsVLayout.addLayout(self.filterHardnessHLayout)
|
||||||
self.widget = QWidget(self)
|
self.widget = QWidget(self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user