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

Removed data modules and moved their functionalities to core_*.app.

This commit is contained in:
Virgil Dupras
2011-09-21 10:26:58 -04:00
parent 60462698ac
commit 70689ce057
18 changed files with 417 additions and 447 deletions

View File

@@ -140,7 +140,7 @@ class ResultWindow(QMainWindow):
# Columns menu
menu = self.menuColumns
self._column_actions = []
for index, column in enumerate(self.app.model.data.COLUMNS):
for index, column in enumerate(self.app.model.COLUMNS):
action = menu.addAction(column.display)
action.setCheckable(True)
action.column_index = index
@@ -272,7 +272,7 @@ class ResultWindow(QMainWindow):
def exportTriggered(self):
h = self.resultsView.horizontalHeader()
column_ids = []
for i in range(len(self.app.model.data.COLUMNS)):
for i in range(len(self.app.model.COLUMNS)):
if not h.isSectionHidden(i):
column_ids.append(str(i))
exported_path = self.app.model.export_to_xhtml(column_ids)
@@ -355,7 +355,7 @@ class ResultWindow(QMainWindow):
h = self.resultsView.horizontalHeader()
widths = []
visible = []
for i in range(len(self.app.model.data.COLUMNS)):
for i in range(len(self.app.model.COLUMNS)):
widths.append(h.sectionSize(i))
visible.append(not h.isSectionHidden(i))
prefs.columns_width = widths

View File

@@ -7,7 +7,7 @@
# http://www.hardcoded.net/licenses/bsd_license
from PyQt4.QtCore import SIGNAL, Qt
from PyQt4.QtGui import QBrush, QFont, QTableView, QColor, QItemSelectionModel, QItemSelection
from PyQt4.QtGui import QBrush, QFont, QTableView, QColor
from qtlib.table import Table
@@ -16,14 +16,13 @@ from core.gui.result_table import ResultTable as ResultTableModel
class ResultsModel(Table):
def __init__(self, app, view):
model = ResultTableModel(self, app.model)
self._app = app
self._data = app.model.data
self._delta_columns = app.model.data.DELTA_COLUMNS
self._app = app.model
self._delta_columns = app.model.DELTA_COLUMNS
Table.__init__(self, model, view)
self.model.connect()
def columnCount(self, parent):
return len(self._data.COLUMNS)
return len(self._app.COLUMNS)
def data(self, index, role):
if not index.isValid():
@@ -62,8 +61,8 @@ class ResultsModel(Table):
return flags
def headerData(self, section, orientation, role):
if orientation == Qt.Horizontal and role == Qt.DisplayRole and section < len(self._data.COLUMNS):
return self._data.COLUMNS[section].display
if orientation == Qt.Horizontal and role == Qt.DisplayRole and section < len(self._app.COLUMNS):
return self._app.COLUMNS[section].display
return None
def setData(self, index, value, role):