# Created On: 2011/09/16 # Copyright 2014 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license from hscommon.trans import trget from core.prioritize import ( KindCategory, FolderCategory, FilenameCategory, NumericalCategory, SizeCategory, MtimeCategory ) coltr = trget('columns') class DimensionsCategory(NumericalCategory): NAME = coltr("Dimensions") def extract_value(self, dupe): return dupe.dimensions def invert_numerical_value(self, value): width, height = value return (-width, -height) def all_categories(): return [ KindCategory, FolderCategory, FilenameCategory, SizeCategory, DimensionsCategory, MtimeCategory ]
# which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from PyQt5.QtCore import Qt from PyQt5.QtWidgets import (QVBoxLayout, QHBoxLayout, QFormLayout, QLabel, QCheckBox, QLineEdit, QComboBox, QDialogButtonBox) from hscommon.trans import trget from qtlib.selectable_list import ComboboxModel from qtlib.text_field import TextField from ..support.date_edit import DateEdit from ..support.completable_edit import PayeeEdit, AccountEdit, DescriptionEdit from .panel import Panel tr = trget('ui') class MassEditionPanel(Panel): FIELDS = [ ('dateCheckBox', 'date_enabled'), ('descriptionCheckBox', 'description_enabled'), ('payeeCheckBox', 'payee_enabled'), ('checknoCheckBox', 'checkno_enabled'), ('fromCheckBox', 'from_enabled'), ('toCheckBox', 'to_enabled'), ('amountCheckBox', 'amount_enabled'), ('currencyCheckBox', 'currency_enabled'), ] PERSISTENT_NAME = 'massEditionPanel'
from PyQt5.QtCore import Qt, QCoreApplication from PyQt5.QtGui import QPixmap, QFont from PyQt5.QtWidgets import ( QDialog, QDialogButtonBox, QSizePolicy, QHBoxLayout, QVBoxLayout, QLabel, QApplication, ) from hscommon.trans import trget tr = trget("qtlib") class AboutBox(QDialog): def __init__(self, parent, app, **kwargs): flags = (Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.MSWindowsFixedSizeDialogHint) super().__init__(parent, flags, **kwargs) self.app = app self._setupUi() self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject)
# which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license from PyQt5.QtCore import Qt, QRect from PyQt5.QtWidgets import (QMainWindow, QMenu, QLabel, QFileDialog, QMenuBar, QWidget, QVBoxLayout, QAbstractItemView, QStatusBar, QDialog, QPushButton, QCheckBox) from hscommon.trans import trget from qtlib.util import moveToScreenCenter, horizontalWrap, createActions from qtlib.search_edit import SearchEdit from .results_model import ResultsView from .stats_label import StatsLabel from .prioritize_dialog import PrioritizeDialog tr = trget('ui') class ResultWindow(QMainWindow): def __init__(self, parent, app, **kwargs): super().__init__(parent, **kwargs) self.app = app self._setupUi() self.resultsModel = app.RESULT_MODEL_CLASS(self.app, self.resultsView) self.stats = StatsLabel(app.model.stats_label, self.statusLabel) self._update_column_actions_status() self.menuColumns.triggered.connect(self.columnToggled) self.resultsView.doubleClicked.connect(self.resultsDoubleClicked) self.resultsView.spacePressed.connect(self.resultsSpacePressed) self.detailsButton.clicked.connect(self.actionDetails.triggered) self.dupesOnlyCheckBox.stateChanged.connect(self.powerMarkerTriggered)
# Created By: Virgil Dupras # Created On: 2009-05-09 # Copyright 2015 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from PyQt4.QtCore import Qt, QCoreApplication from PyQt4.QtGui import (QDialog, QDialogButtonBox, QPixmap, QSizePolicy, QHBoxLayout, QVBoxLayout, QLabel, QFont, QApplication) from hscommon.trans import trget tr = trget('qtlib') class AboutBox(QDialog): def __init__(self, parent, app): flags = Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.MSWindowsFixedSizeDialogHint QDialog.__init__(self, parent, flags) self.app = app self._setupUi() self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) def _setupUi(self): self.setWindowTitle(tr("About {}").format(QCoreApplication.instance().applicationName())) self.resize(400, 190) sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0)
from PyQt5.QtWidgets import ( QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy, QSpacerItem, QWidget, ) from hscommon.trans import trget from core.app import AppMode from core.scanner import ScanType from ..preferences_dialog import PreferencesDialogBase tr = trget("ui") class PreferencesDialog(PreferencesDialogBase): def _setupPreferenceWidgets(self): self._setupFilterHardnessBox() self.widgetsVLayout.addLayout(self.filterHardnessHLayout) self.widget = QWidget(self) self.widget.setMinimumSize(QSize(0, 40)) self.verticalLayout_4 = QVBoxLayout(self.widget) self.verticalLayout_4.setSpacing(0) self.verticalLayout_4.setContentsMargins(0, 0, 0, 0) self.label_6 = QLabel(self.widget) self.label_6.setText(tr("Tags to scan:")) self.verticalLayout_4.addWidget(self.label_6) self.horizontalLayout_2 = QHBoxLayout()
# Created By: Virgil Dupras # Created On: 2009-12-10 # Copyright 2013 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license from PyQt4.QtCore import pyqtSignal, Qt from PyQt4.QtGui import (QToolButton, QLineEdit, QIcon, QPixmap, QStyle, QStyleOptionFrameV2, QPainter, QPalette) from hscommon.trans import trget tr = trget('qtlib') # IMPORTANT: For this widget to work propertly, you have to add "search_clear_13" from the # "images" folder in your resources. class LineEditButton(QToolButton): def __init__(self, parent): QToolButton.__init__(self, parent) pixmap = QPixmap(':/search_clear_13') self.setIcon(QIcon(pixmap)) self.setIconSize(pixmap.size()) self.setCursor(Qt.ArrowCursor) self.setPopupMode(QToolButton.InstantPopup) stylesheet = "QToolButton { border: none; padding: 0px; }" self.setStyleSheet(stylesheet)
# Created On: 2011/09/16 # Copyright 2013 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license from hscommon.trans import trget from core.prioritize import (KindCategory, FolderCategory, FilenameCategory, NumericalCategory, SizeCategory, MtimeCategory) coltr = trget('columns') class DurationCategory(NumericalCategory): NAME = coltr("Duration") def extract_value(self, dupe): return dupe.duration class BitrateCategory(NumericalCategory): NAME = coltr("Bitrate") def extract_value(self, dupe): return dupe.bitrate class SamplerateCategory(NumericalCategory): NAME = coltr("Samplerate")
from hscommon import io from hscommon.util import remove_invalid_xml, first from hscommon.path import Path from hscommon.trans import trget from cocoa import proxy from core.scanner import ScanType from core import directories from core.app import JobType from core_pe import _block_osx from core_pe.photo import Photo as PhotoBase from core_pe.app import DupeGuru as DupeGuruBase from .app import PyDupeGuruBase tr = trget("ui") IPHOTO_PATH = Path("iPhoto Library") APERTURE_PATH = Path("Aperture Library") class Photo(PhotoBase): HANDLED_EXTS = PhotoBase.HANDLED_EXTS.copy() HANDLED_EXTS.update({"psd", "nef", "cr2", "orf"}) def _plat_get_dimensions(self): return _block_osx.get_image_size(str(self.path)) def _plat_get_blocks(self, block_count_per_side, orientation): try: blocks = _block_osx.getblocks(str(self.path), block_count_per_side, orientation)
# Created By: Virgil Dupras # Created On: 2008-08-08 # Copyright 2015 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from hscommon.trans import trget from hscommon.gui.column import Column from .table import GUITable, Row from .transaction_table_base import TransactionSelectionMixin trcol = trget('columns') class ImportTable(GUITable, TransactionSelectionMixin): SAVENAME = 'ImportTable' COLUMNS = [ Column('will_import', display=''), Column('date', display=trcol("Date")), Column('description', display=trcol("Description")), Column('amount', display=trcol("Amount")), Column('bound', display=''), Column('date_import', display=trcol("Date")), Column('description_import', display=trcol("Description")), Column('payee_import', display=trcol("Payee")), Column('checkno_import', display=trcol("Check #")), Column('transfer_import', display=trcol("Transfer")), Column('amount_import', display=trcol("Amount")), ]
# Copyright 2016 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from hscommon.trans import trget from hscommon.gui.column import Column from .table import GUITable, Row trcol = trget("columns") class PluginListTable(GUITable): SAVENAME = "PluginListTable" COLUMNS = [ Column("enabled", display=trcol("Enabled")), Column("name", display=trcol("Name")), Column("type", display=trcol("Type")), Column("author", display=trcol("Author")), ] # --- Override def _fill(self): for plugin in self.document.app.plugins: self.append(PluginListRow(self, plugin)) class PluginListRow(Row): def __init__(self, table, plugin):
# Created By: Virgil Dupras # Created On: 2009-08-22 # Copyright 2015 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html import datetime from hscommon.trans import trget from hscommon.gui.column import Column from .table import GUITable, Row, rowattr, TableWithAmountMixin trcol = trget('columns') class BudgetTable(GUITable, TableWithAmountMixin): SAVENAME = 'BudgetTable' COLUMNS = [ Column('start_date', display=trcol("Start Date")), Column('stop_date', display=trcol("Stop Date")), Column('repeat_type', display=trcol("Repeat Type")), Column('interval', display=trcol("Interval")), Column('account', display=trcol("Account")), Column('target', display=trcol("Target")), Column('amount', display=trcol("Amount")), ] def __init__(self, budget_view): GUITable.__init__(self, document=budget_view.document)
# Created By: Virgil Dupras # Created On: 2009-12-10 # Copyright 2013 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license from PyQt4.QtCore import pyqtSignal, Qt from PyQt4.QtGui import QToolButton, QLineEdit, QIcon, QPixmap, QStyle, QStyleOptionFrameV2, QPainter, QPalette from hscommon.trans import trget tr = trget("qtlib") # IMPORTANT: For this widget to work propertly, you have to add "search_clear_13" from the # "images" folder in your resources. class LineEditButton(QToolButton): def __init__(self, parent): QToolButton.__init__(self, parent) pixmap = QPixmap(":/search_clear_13") self.setIcon(QIcon(pixmap)) self.setIconSize(pixmap.size()) self.setCursor(Qt.ArrowCursor) self.setPopupMode(QToolButton.InstantPopup) stylesheet = "QToolButton { border: none; padding: 0px; }" self.setStyleSheet(stylesheet)
# Created On: 2011-11-27 # Copyright 2015 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from hscommon.gui.column import Column from hscommon.trans import trget from core.gui.result_table import ResultTable as ResultTableBase coltr = trget("columns") class ResultTable(ResultTableBase): COLUMNS = [ Column("marked", ""), Column("name", coltr("Filename")), Column("folder_path", coltr("Folder"), visible=False, optional=True), Column("size", coltr("Size (MB)"), optional=True), Column("duration", coltr("Time"), optional=True), Column("bitrate", coltr("Bitrate"), optional=True), Column("samplerate", coltr("Sample Rate"), visible=False, optional=True), Column("extension", coltr("Kind"), optional=True), Column("mtime", coltr("Modification"), visible=False, optional=True), Column("title", coltr("Title"), visible=False, optional=True), Column("artist", coltr("Artist"), visible=False, optional=True),
# Created By: Virgil Dupras # Created On: 2012-03-13 # Copyright 2015 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from hscommon.gui.table import GUITable, Row from hscommon.gui.column import Column, Columns from hscommon.trans import trget coltr = trget("columns") class IgnoreListTable(GUITable): COLUMNS = [ # the str concat below saves us needless localization. Column("path1", coltr("File Path") + " 1"), Column("path2", coltr("File Path") + " 2"), ] def __init__(self, ignore_list_dialog): GUITable.__init__(self) self.columns = Columns(self) self.view = None self.dialog = ignore_list_dialog # --- Override def _fill(self): for path1, path2 in self.dialog.ignore_list: