Example #1
0
 def _setupUi(self):
     self.resize(400, 300)
     self.verticalLayout = QVBoxLayout(self)
     self.verticalLayout.setSpacing(0)
     self.verticalLayout.setContentsMargins(0, 0, 0, 0)
     self.filterBar = RadioBox(self)
     sizePolicy = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Preferred)
     sizePolicy.setHorizontalStretch(0)
     sizePolicy.setVerticalStretch(0)
     sizePolicy.setHeightForWidth(
         self.filterBar.sizePolicy().hasHeightForWidth())
     self.filterBar.setSizePolicy(sizePolicy)
     self.filterBar.setMinimumSize(QtCore.QSize(0, 20))
     self.verticalLayout.addWidget(self.filterBar)
     self.tableView = TableView(self)
     self.tableView.setAcceptDrops(True)
     self.tableView.setEditTriggers(QAbstractItemView.DoubleClicked
                                    | QAbstractItemView.EditKeyPressed)
     self.tableView.setDragEnabled(True)
     self.tableView.setDragDropMode(QAbstractItemView.InternalMove)
     self.tableView.setSelectionBehavior(QAbstractItemView.SelectRows)
     self.tableView.setSortingEnabled(True)
     self.tableView.setCornerButtonEnabled(False)
     self.tableView.horizontalHeader().setHighlightSections(False)
     self.tableView.horizontalHeader().setMinimumSectionSize(18)
     self.tableView.verticalHeader().setVisible(False)
     self.tableView.verticalHeader().setDefaultSectionSize(18)
     self.verticalLayout.addWidget(self.tableView)
Example #2
0
 def _setupUi(self):
     self.setWindowTitle(tr("Deletion Options"))
     self.resize(400, 270)
     self.verticalLayout = QVBoxLayout(self)
     self.msgLabel = QLabel()
     self.verticalLayout.addWidget(self.msgLabel)
     self.linkCheckbox = QCheckBox(tr("Link deleted files"))
     self.verticalLayout.addWidget(self.linkCheckbox)
     text = tr(
         "After having deleted a duplicate, place a link targeting the reference file "
         "to replace the deleted file.")
     self.linkMessageLabel = QLabel(text)
     self.linkMessageLabel.setWordWrap(True)
     self.verticalLayout.addWidget(self.linkMessageLabel)
     self.linkTypeRadio = RadioBox(items=[tr("Symlink"),
                                          tr("Hardlink")],
                                   spread=False)
     self.verticalLayout.addWidget(self.linkTypeRadio)
     if not self.model.supports_links():
         self.linkCheckbox.setEnabled(False)
         self.linkCheckbox.setText(self.linkCheckbox.text() +
                                   tr(" (unsupported)"))
     self.directCheckbox = QCheckBox(tr("Directly delete files"))
     self.verticalLayout.addWidget(self.directCheckbox)
     text = tr(
         "Instead of sending files to trash, delete them directly. This option is usually "
         "used as a workaround when the normal deletion method doesn't work."
     )
     self.directMessageLabel = QLabel(text)
     self.directMessageLabel.setWordWrap(True)
     self.verticalLayout.addWidget(self.directMessageLabel)
     self.buttonBox = QDialogButtonBox()
     self.buttonBox.addButton(tr("Proceed"), QDialogButtonBox.AcceptRole)
     self.buttonBox.addButton(tr("Cancel"), QDialogButtonBox.RejectRole)
     self.verticalLayout.addWidget(self.buttonBox)
Example #3
0
    def _setupPreferenceWidgets(self):
        self._setupFilterHardnessBox()
        self.widgetsVLayout.addLayout(self.filterHardnessHLayout)
        self._setupAddCheckbox("matchScaledBox",
                               tr("Match pictures of different dimensions"))
        self.widgetsVLayout.addWidget(self.matchScaledBox)
        self._setupAddCheckbox("mixFileKindBox", tr("Can mix file kind"))
        self.widgetsVLayout.addWidget(self.mixFileKindBox)
        self._setupAddCheckbox("useRegexpBox",
                               tr("Use regular expressions when filtering"))
        self.widgetsVLayout.addWidget(self.useRegexpBox)
        self._setupAddCheckbox("removeEmptyFoldersBox",
                               tr("Remove empty folders on delete or move"))
        self.widgetsVLayout.addWidget(self.removeEmptyFoldersBox)
        self._setupAddCheckbox(
            "ignoreHardlinkMatches",
            tr("Ignore duplicates hardlinking to the same file"),
        )
        self.widgetsVLayout.addWidget(self.ignoreHardlinkMatches)
        self._setupAddCheckbox("debugModeBox",
                               tr("Debug mode (restart required)"))
        self.widgetsVLayout.addWidget(self.debugModeBox)

        self.cacheTypeRadio = RadioBox(self,
                                       items=["Sqlite", "Shelve"],
                                       spread=False)
        cache_form = QFormLayout()
        cache_form.setLabelAlignment(Qt.AlignLeft)
        cache_form.addRow(tr("Picture cache mode:"), self.cacheTypeRadio)
        self.widgetsVLayout.addLayout(cache_form)
        self._setupBottomPart()
Example #4
0
 def _setupUi(self):
     self.resize(483, 423)
     self.verticalLayout = QVBoxLayout(self)
     self.verticalLayout.setSpacing(0)
     self.verticalLayout.setContentsMargins(0, 0, 0, 0)
     self.horizontalLayout = QHBoxLayout()
     self.horizontalLayout.setSpacing(0)
     self.filterBar = RadioBox(self)
     sizePolicy = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Preferred)
     sizePolicy.setHorizontalStretch(0)
     sizePolicy.setVerticalStretch(0)
     sizePolicy.setHeightForWidth(
         self.filterBar.sizePolicy().hasHeightForWidth())
     self.filterBar.setSizePolicy(sizePolicy)
     self.horizontalLayout.addWidget(self.filterBar)
     self.horizontalLayout.addItem(horizontalSpacer())
     self.reconciliationButton = QPushButton(tr("Reconciliation"))
     self.reconciliationButton.setCheckable(True)
     self.horizontalLayout.addWidget(self.reconciliationButton)
     self.verticalLayout.addLayout(self.horizontalLayout)
     self.splitterView = QSplitter()
     self.splitterView.setOrientation(Qt.Vertical)
     self.splitterView.setChildrenCollapsible(False)
     self.tableView = TableView(self)
     self.tableView.setAcceptDrops(True)
     self.tableView.setEditTriggers(QAbstractItemView.DoubleClicked
                                    | QAbstractItemView.EditKeyPressed)
     self.tableView.setDragEnabled(True)
     self.tableView.setDragDropMode(QAbstractItemView.InternalMove)
     self.tableView.setSelectionBehavior(QAbstractItemView.SelectRows)
     self.tableView.setSortingEnabled(True)
     self.tableView.horizontalHeader().setHighlightSections(False)
     self.tableView.horizontalHeader().setMinimumSectionSize(18)
     self.tableView.verticalHeader().setVisible(False)
     self.tableView.verticalHeader().setDefaultSectionSize(18)
     self.splitterView.addWidget(self.tableView)
     self.graphView = QStackedWidget(self)
     sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed)
     sizePolicy.setHorizontalStretch(0)
     sizePolicy.setVerticalStretch(0)
     sizePolicy.setHeightForWidth(
         self.graphView.sizePolicy().hasHeightForWidth())
     self.graphView.setSizePolicy(sizePolicy)
     self.graphView.setMinimumSize(0, 200)
     self.lineGraphView = LineGraphView()
     self.graphView.addWidget(self.lineGraphView)
     self.barGraphView = BarGraphView()
     self.graphView.addWidget(self.barGraphView)
     self.splitterView.addWidget(self.graphView)
     self.graphView.setCurrentIndex(1)
     self.splitterView.setStretchFactor(0, 1)
     self.splitterView.setStretchFactor(1, 0)
     self.verticalLayout.addWidget(self.splitterView)
    def _setupUi(self):
        self.setWindowTitle(self.app.NAME)
        self.resize(420, 338)
        self.centralwidget = QWidget(self)
        self.verticalLayout = QVBoxLayout(self.centralwidget)
        self.verticalLayout.setContentsMargins(4, 0, 4, 0)
        self.verticalLayout.setSpacing(0)
        hl = QHBoxLayout()
        label = QLabel(tr("Application Mode:"), self)
        label.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        hl.addWidget(label)
        self.appModeRadioBox = RadioBox(
            self,
            items=[tr("Standard"), tr("Music"),
                   tr("Picture")],
            spread=False)
        hl.addWidget(self.appModeRadioBox)
        self.verticalLayout.addLayout(hl)
        hl = QHBoxLayout()
        hl.setAlignment(Qt.AlignLeft)
        label = QLabel(tr("Scan Type:"), self)
        label.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        hl.addWidget(label)
        self.scanTypeComboBox = QComboBox(self)
        self.scanTypeComboBox.setSizePolicy(
            QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed))
        self.scanTypeComboBox.setMaximumWidth(400)
        hl.addWidget(self.scanTypeComboBox)
        self.showPreferencesButton = QPushButton(tr("More Options"),
                                                 self.centralwidget)
        self.showPreferencesButton.setSizePolicy(QSizePolicy.Fixed,
                                                 QSizePolicy.Fixed)
        hl.addWidget(self.showPreferencesButton)
        self.verticalLayout.addLayout(hl)
        self.promptLabel = QLabel(
            tr('Select folders to scan and press "Scan".'), self.centralwidget)
        self.verticalLayout.addWidget(self.promptLabel)
        self.treeView = QTreeView(self.centralwidget)
        self.treeView.setSelectionMode(QAbstractItemView.ExtendedSelection)
        self.treeView.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.treeView.setAcceptDrops(True)
        triggers = (QAbstractItemView.DoubleClicked
                    | QAbstractItemView.EditKeyPressed
                    | QAbstractItemView.SelectedClicked)
        self.treeView.setEditTriggers(triggers)
        self.treeView.setDragDropOverwriteMode(True)
        self.treeView.setDragDropMode(QAbstractItemView.DropOnly)
        self.treeView.setUniformRowHeights(True)
        self.verticalLayout.addWidget(self.treeView)
        self.horizontalLayout = QHBoxLayout()
        self.removeFolderButton = QPushButton(self.centralwidget)
        self.removeFolderButton.setIcon(QIcon(QPixmap(":/minus")))
        self.removeFolderButton.setShortcut("Del")
        self.horizontalLayout.addWidget(self.removeFolderButton)
        self.addFolderButton = QPushButton(self.centralwidget)
        self.addFolderButton.setIcon(QIcon(QPixmap(":/plus")))
        self.horizontalLayout.addWidget(self.addFolderButton)
        spacerItem1 = QSpacerItem(40, 20, QSizePolicy.Expanding,
                                  QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem1)
        self.loadResultsButton = QPushButton(self.centralwidget)
        self.loadResultsButton.setText(tr("Load Results"))
        self.horizontalLayout.addWidget(self.loadResultsButton)
        self.scanButton = QPushButton(self.centralwidget)
        self.scanButton.setText(tr("Scan"))
        self.scanButton.setDefault(True)
        self.horizontalLayout.addWidget(self.scanButton)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.setCentralWidget(self.centralwidget)

        self._setupActions()
        self._setupMenu()

        if self.app.prefs.directoriesWindowRect is not None:
            self.setGeometry(self.app.prefs.directoriesWindowRect)
        else:
            moveToScreenCenter(self)