1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

Deduplicated scan type combobox creation code between SE and ME (soon to be shared by PE) (Qt).

This commit is contained in:
Virgil Dupras
2011-04-20 15:18:21 +02:00
parent 9d5f3029d0
commit de23ce90d8
3 changed files with 24 additions and 32 deletions

View File

@@ -7,9 +7,9 @@
# http://www.hardcoded.net/licenses/bsd_license
import sys
from PyQt4.QtCore import SIGNAL, QSize
from PyQt4.QtGui import (QVBoxLayout, QHBoxLayout, QLabel, QComboBox, QSizePolicy, QSpacerItem,
QWidget, QApplication)
from PyQt4.QtCore import QSize
from PyQt4.QtGui import (QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy, QSpacerItem, QWidget,
QApplication)
from hscommon.trans import tr
from core.scanner import ScanType
@@ -30,24 +30,12 @@ class PreferencesDialog(PreferencesDialogBase):
def __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):
self.horizontalLayout = QHBoxLayout()
self.label_2 = QLabel(self)
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)
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)
scanTypeLabels = [tr(s) for s in ["Filename", "Filename - Fields",
"Filename - Fields (No Order)", "Tags", "Contents", "Audio Contents"]]
self._setupScanTypeBox(scanTypeLabels)
self._setupFilterHardnessBox()
self.widgetsVLayout.addLayout(self.filterHardnessHLayout)
self.widget = QWidget(self)