mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 22:51:39 +00:00
Converted the prioritize dialog to objp. A bit hackish though. Refactorings required before going further.
--HG-- branch : objp
This commit is contained in:
@@ -1,31 +1,24 @@
|
||||
from cocoa.inter import PyGUIObject, PySelectableList
|
||||
from objp.util import pyref
|
||||
from cocoa.inter2 import PyGUIObject, GUIObjectView
|
||||
|
||||
from core.gui.prioritize_dialog import PrioritizeDialog
|
||||
from .prioritize_list import PyPrioritizeList
|
||||
class PrioritizeDialogView(GUIObjectView):
|
||||
pass
|
||||
|
||||
class PyPrioritizeDialog(PyGUIObject):
|
||||
py_class = PrioritizeDialog
|
||||
def categoryList(self) -> pyref:
|
||||
return self.model.category_list
|
||||
|
||||
def categoryList(self):
|
||||
if not hasattr(self, '_categoryList'):
|
||||
self._categoryList = PySelectableList.alloc().initWithPy_(self.py.category_list)
|
||||
return self._categoryList
|
||||
def criteriaList(self) -> pyref:
|
||||
return self.model.criteria_list
|
||||
|
||||
def criteriaList(self):
|
||||
if not hasattr(self, '_criteriaList'):
|
||||
self._criteriaList = PySelectableList.alloc().initWithPy_(self.py.criteria_list)
|
||||
return self._criteriaList
|
||||
|
||||
def prioritizationList(self):
|
||||
if not hasattr(self, '_prioritizationList'):
|
||||
self._prioritizationList = PyPrioritizeList.alloc().initWithPy_(self.py.prioritization_list)
|
||||
return self._prioritizationList
|
||||
def prioritizationList(self) -> pyref:
|
||||
return self.model.prioritization_list
|
||||
|
||||
def addSelected(self):
|
||||
self.py.add_selected()
|
||||
self.model.add_selected()
|
||||
|
||||
def removeSelected(self):
|
||||
self.py.remove_selected()
|
||||
self.model.remove_selected()
|
||||
|
||||
def performReprioritization(self):
|
||||
self.py.perform_reprioritization()
|
||||
self.model.perform_reprioritization()
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
from cocoa.inter import signature, PySelectableList
|
||||
from cocoa.inter2 import PySelectableList2, SelectableListView
|
||||
|
||||
class PyPrioritizeList(PySelectableList):
|
||||
@signature('v@:@i')
|
||||
def moveIndexes_toIndex_(self, indexes, dest_index):
|
||||
self.py.move_indexes(indexes, dest_index)
|
||||
|
||||
class PrioritizeListView(SelectableListView):
|
||||
pass
|
||||
|
||||
class PyPrioritizeList(PySelectableList2):
|
||||
FOLLOW_PROTOCOLS = ['PySelectableList2']
|
||||
|
||||
def moveIndexes_toIndex_(self, indexes: list, dest_index: int):
|
||||
self.model.move_indexes(indexes, dest_index)
|
||||
|
||||
Reference in New Issue
Block a user