2012-01-13 16:49:34 +00:00
|
|
|
from objp.util import dontwrap
|
2012-01-13 20:25:34 +00:00
|
|
|
from cocoa.inter import PyTable, TableView
|
2011-09-21 20:02:13 +00:00
|
|
|
|
2012-01-13 16:49:34 +00:00
|
|
|
class ResultTableView(TableView):
|
|
|
|
def invalidateMarkings(self): pass
|
|
|
|
|
2012-01-13 19:43:43 +00:00
|
|
|
class PyResultTable(PyTable):
|
2012-01-13 16:49:34 +00:00
|
|
|
def powerMarkerMode(self) -> bool:
|
|
|
|
return self.model.power_marker
|
2011-09-21 20:02:13 +00:00
|
|
|
|
2012-01-13 16:49:34 +00:00
|
|
|
def setPowerMarkerMode_(self, value: bool):
|
|
|
|
self.model.power_marker = value
|
2011-09-21 20:02:13 +00:00
|
|
|
|
2012-01-13 16:49:34 +00:00
|
|
|
def deltaValuesMode(self) -> bool:
|
|
|
|
return self.model.delta_values
|
2011-09-21 20:02:13 +00:00
|
|
|
|
2012-01-13 16:49:34 +00:00
|
|
|
def setDeltaValuesMode_(self, value: bool):
|
|
|
|
self.model.delta_values = value
|
2011-09-21 20:02:13 +00:00
|
|
|
|
2012-01-13 16:49:34 +00:00
|
|
|
def valueForRow_column_(self, row_index: int, column: str) -> object:
|
|
|
|
return self.model.get_row_value(row_index, column)
|
2011-09-21 20:02:13 +00:00
|
|
|
|
2013-07-28 21:45:23 +00:00
|
|
|
def isDeltaAtRow_column_(self, row_index: int, column: str) -> bool:
|
|
|
|
row = self.model[row_index]
|
|
|
|
return row.is_cell_delta(column)
|
|
|
|
|
2012-01-13 16:49:34 +00:00
|
|
|
def renameSelected_(self, newname: str) -> bool:
|
|
|
|
return self.model.rename_selected(newname)
|
2011-09-21 20:02:13 +00:00
|
|
|
|
2012-01-13 16:49:34 +00:00
|
|
|
def sortBy_ascending_(self, key: str, asc: bool):
|
|
|
|
self.model.sort(key, asc)
|
2011-09-21 20:02:13 +00:00
|
|
|
|
|
|
|
def markSelected(self):
|
2012-01-13 16:49:34 +00:00
|
|
|
self.model.app.toggle_selected_mark_state()
|
2011-09-21 20:02:13 +00:00
|
|
|
|
|
|
|
def removeSelected(self):
|
2012-01-13 16:49:34 +00:00
|
|
|
self.model.app.remove_selected()
|
2011-09-21 20:02:13 +00:00
|
|
|
|
2012-01-13 16:49:34 +00:00
|
|
|
def selectedDupeCount(self) -> int:
|
|
|
|
return self.model.selected_dupe_count
|
2011-09-21 20:02:13 +00:00
|
|
|
|
2012-01-13 16:49:34 +00:00
|
|
|
def pathAtIndex_(self, index: int) -> str:
|
|
|
|
row = self.model[index]
|
2011-09-22 19:59:11 +00:00
|
|
|
return str(row._dupe.path)
|
|
|
|
|
2011-09-21 20:02:13 +00:00
|
|
|
# python --> cocoa
|
2012-01-13 16:49:34 +00:00
|
|
|
@dontwrap
|
2011-09-21 20:02:13 +00:00
|
|
|
def invalidate_markings(self):
|
2012-01-13 16:49:34 +00:00
|
|
|
self.callback.invalidateMarkings()
|
2011-09-21 20:02:13 +00:00
|
|
|
|