1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 06:37:17 +00:00

qt: move qt.base units into qt root package

This commit is contained in:
Virgil Dupras
2016-05-31 21:59:31 -04:00
parent 773f6651e6
commit d4919054f9
36 changed files with 67 additions and 90 deletions

View File

@@ -1,9 +1,7 @@
# Created By: Virgil Dupras
# Created On: 2009-04-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
# Copyright 2016 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 PyQt5.QtCore import Qt, QSize
@@ -11,8 +9,8 @@ from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QVBoxLayout, QAbstractItemView, QHBoxLayout, QLabel, QSizePolicy
from hscommon.trans import trget
from ..base.details_dialog import DetailsDialog as DetailsDialogBase
from ..base.details_table import DetailsTable
from ..details_dialog import DetailsDialog as DetailsDialogBase
from ..details_table import DetailsTable
tr = trget('ui')
@@ -21,7 +19,7 @@ class DetailsDialog(DetailsDialogBase):
DetailsDialogBase.__init__(self, parent, app)
self.selectedPixmap = None
self.referencePixmap = None
def _setupUi(self):
self.setWindowTitle(tr("Details"))
self.resize(502, 295)
@@ -61,21 +59,21 @@ class DetailsDialog(DetailsDialogBase):
self.tableView.setSelectionBehavior(QAbstractItemView.SelectRows)
self.tableView.setShowGrid(False)
self.verticalLayout.addWidget(self.tableView)
def _update(self):
if not self.app.model.selected_dupes:
return
dupe = self.app.model.selected_dupes[0]
group = self.app.model.results.get_group_of_duplicate(dupe)
ref = group.ref
self.selectedPixmap = QPixmap(str(dupe.path))
if ref is dupe:
self.referencePixmap = None
else:
self.referencePixmap = QPixmap(str(ref.path))
self._updateImages()
def _updateImages(self):
if self.selectedPixmap is not None:
target_size = self.selectedImage.size()
@@ -89,18 +87,18 @@ class DetailsDialog(DetailsDialogBase):
self.referenceImage.setPixmap(scaledPixmap)
else:
self.referenceImage.setPixmap(QPixmap())
#--- Override
def resizeEvent(self, event):
self._updateImages()
def show(self):
DetailsDialogBase.show(self)
self._update()
# model --> view
def refresh(self):
DetailsDialogBase.refresh(self)
if self.isVisible():
self._update()

View File

@@ -8,7 +8,7 @@ from hscommon.trans import trget
from core.scanner import ScanType
from core.app import AppMode
from ..base.preferences_dialog import PreferencesDialogBase
from ..preferences_dialog import PreferencesDialogBase
tr = trget('ui')

View File

@@ -1,12 +1,11 @@
# Created On: 2011-11-27
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
# Copyright 2016 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 qtlib.column import Column
from ..base.results_model import ResultsModel as ResultsModelBase
from ..results_model import ResultsModel as ResultsModelBase
class ResultsModel(ResultsModelBase):
COLUMNS = [