from standarditem import StandardItem

__all__ = ['ImageItems']

class ImageItems:
    '''Pridani prvku retezce do listu
    '''
    def __init__(self, id, model, data, file, executor):
        self.executor = executor

        premod = 'global'
        stamod = 'global'
        segmod = 'global'
        self.itemx = StandardItem(id, 'orig', executor, data, file)
        self.newItem(StandardItem(id, 'pre', executor, None, 'Preprocess   (' + premod + ')'))
        self.newItem(StandardItem(id, 'staff', executor, None, 'Staffremoval (' + stamod + ')'))
        #self.newItem(StandardItem(id, 'horlines', executor, None, 'Seg - hor lines (' + segmod + ')'))
        self.newItem(StandardItem(id, 'head', executor, None, 'Seg - note heads (' + segmod + ')'))
        self.newItem(StandardItem(id, 'imgfhv1', executor, None, 'Filterhead (' + segmod + ')'))
        #self.newItem(StandardItem(id, 'imgfl2', executor, None, 'Filterline (' + segmod + ')'))
        self.newItem(StandardItem(id, 'drawtemp', executor, None, 'Drawbeams (' + segmod + ')'))

        model.appendRow(self.itemx)

    def newItem(self, item):
        '''Pridani noveho prvku
        '''
        item.setEditable(0)
        self.itemx.appendRow(item)

    def runAll(self):
        '''Spusteni vsech prvku
        '''
        for i in range(self.itemx.rowCount()):
            self.itemx.child(i,0).run()