Exemplo n.º 1
0
class TopTap1Filter(GroupBox):

    key = 'TopTab1Info'

    def __init__(self):
        super(TopTap1Filter, self).__init__()

        self.setTitle('Fillter')
        self.layout = GridLayout(self)
        self.setLayout(self.layout)

        self.overduedCB = CheckBox()
        self.urgentCB = CheckBox()
        self.safetyCB = CheckBox()
        self.allTabCheckBox = CheckBox()
        self.allTabCheckBox.stateChanged.connect(self.allTabCheckBoxStateChanged)

        odl = 0
        ugl = odl + 1
        stl = ugl + 1
        al = stl + 1

        self.layout.addWidget(Label({'txt': 'Overdued', 'sss': 'color: red'}), odl, 0, 1, 2)
        self.layout.addWidget(self.overduedCB, odl, 2, 1, 1)
        self.layout.addWidget(Label({'txt': 'Urgent', 'sss': 'color: orange'}), ugl, 0, 1, 2)
        self.layout.addWidget(self.urgentCB, ugl, 2, 1, 1)
        self.layout.addWidget(Label({'txt': 'Others', 'sss': 'color: green'}), stl, 0, 1, 2)
        self.layout.addWidget(self.safetyCB, stl, 2, 1, 1)
        self.layout.addWidget(Label({'txt': 'All'}), al, 0, 1, 2)
        self.layout.addWidget(self.allTabCheckBox, al, 2, 1, 1)

    def allTabCheckBoxStateChanged(self, bool):
        self.overduedCB.setChecked(bool)
        self.urgentCB.setChecked(bool)
        self.safetyCB.setChecked(bool)
Exemplo n.º 2
0
class TaskDetails(GridLayout):

    key = 'TaskDetails'
    _taskMode = None
    _taskType = None

    def __init__(self, parent=None):
        super(TaskDetails, self).__init__(parent)

        self.parent = parent
        self.addWidget(Label({'txt': 'Task Mode: '}), 0, 0, 1, 1)
        self.addWidget(Label({'txt': 'Task Type'}), 1, 0, 1, 1)

        self.individualMode = CheckBox('Individual')
        self.groupMode = CheckBox('Group')
        self.departmentMode = CheckBox('Department')

        self.individualMode.stateChanged.connect(self.individual)
        self.groupMode.stateChanged.connect(self.group)
        self.departmentMode.stateChanged.connect(self.department)

        self.researchType = CheckBox('Research')
        self.readingType = CheckBox('Reading')
        self.vfxType = CheckBox('VFX')
        self.researchType.stateChanged.connect(self.research)
        self.readingType.stateChanged.connect(self.reading)
        self.vfxType.stateChanged.connect(self.vfx)

        self.addWidget(self.individualMode, 0, 1, 1, 1)
        self.addWidget(self.groupMode, 0, 2, 1, 1)
        self.addWidget(self.departmentMode, 0, 3, 1, 1)
        self.addWidget(self.researchType, 1, 1, 1, 1)
        self.addWidget(self.readingType, 1, 2, 1, 1)
        self.addWidget(self.vfxType, 1, 3, 1, 1)

        self.taskDetails = PlainTextEdit()
        self.addWidget(self.taskDetails, 2, 0, 8, 8)

    def individual(self, bool):
        if str2bool(bool):
            self.groupMode.setChecked(False)
            self.departmentMode.setChecked(False)
            self._taskMode = 'individual'

    def group(self, bool):
        if str2bool(bool):
            self.individualMode.setChecked(False)
            self.departmentMode.setChecked(False)
            self._taskMode = 'group'

    def department(self, bool):
        if str2bool(bool):
            self.individualMode.setChecked(False)
            self.groupMode.setChecked(False)
            self._taskMode = 'department'

    def research(self, bool):
        if str2bool(bool):
            self.readingType.setChecked(False)
            self.vfxType.setChecked(False)
            self._taskType = 'research'

    def reading(self, bool):
        if str2bool(bool):
            self.researchType.setChecked(False)
            self.vfxType.setChecked(False)
            self._taskType = 'reading'

    def vfx(self, bool):
        if str2bool(bool):
            self.researchType.setChecked(False)
            self.readingType.setChecked(False)
            self._taskType = 'vfx'

    @property
    def taskType(self):
        return self._taskType

    @taskType.setter
    def taskType(self, val):
        self._taskType = val

    @property
    def taskMode(self):
        return self._taskMode

    @taskMode.setter
    def taskMode(self, val):
        self._taskMode = val
Exemplo n.º 3
0
class HeaderCheckBoxes(GridLayout):

    key = 'HeaderCheckBoxes'
    toolBarCBs = DAMGLIST()
    menuCBs = DAMGLIST()
    connectCBs = DAMGLIST()
    checkboxes = DAMGDICT()
    def __init__(self, parent=None):
        super(HeaderCheckBoxes, self).__init__(parent)
        self.parent = parent
        self.la = 0
        self.buildHeaderCheckBoxes()

        cbs = [self.toolBarCBs, self.menuCBs, self.connectCBs, [self.headerCB]]

        for i in range(len(cbs)):
            if i == 0:
                prefix = 'ToolBar'
            elif i == 1:
                prefix = 'Menu'
            elif i == 2:
                prefix = 'Network'
            else:
                prefix = 'Header'

            for cb in cbs[i]:
                cb.key = '{0}_{1}_CheckBox_{2}'.format(self.parent.key, prefix, cb.text())
                cb._name = '{0} {1} Check Box: {2}'.format(self.parent.key, prefix, cb.text())

                cb.settings._settingEnable = True
                state = cb.getValue('checkState')
                if state is None:
                    state = True
                cb.setValue('checkState', state)
                cb.setChecked(str2bool(state))
                self.checkboxes.add(cb.key, cb)

    def buildHeaderCheckBoxes(self):
        self.buildToolBarCheckBoxes()
        self.buildMenuCheckBoxes()
        self.buildServerStatusCheckBoxes()
        self.headerCB = CheckBox('Header')
        self.headerCB.stateChanged.connect(self.headerStateChanged)

        mnl = self.la
        csl = mnl + 1
        tbl = csl + 1
        hdl = tbl + 1

        self.addWidget(Label({'txt': 'Menus'}), mnl, 0, 1, 1)
        self.addWidget(self.allMenuCB, mnl, 1, 1, 1)
        self.addWidget(self.mnAppCB, mnl, 2, 1, 1)
        self.addWidget(self.mnGoCB, mnl, 3, 1, 1)
        self.addWidget(self.mnOfficeCB, mnl, 4, 1, 1)
        self.addWidget(self.mnToolsCB, mnl, 5, 1, 1)
        self.addWidget(self.mnDevCB, mnl, 6, 1, 1)
        self.addWidget(self.mnLibCB, mnl, 7, 1, 1)
        self.addWidget(self.mnHelpCB, mnl, 8, 1, 1)

        self.addWidget(Label({'txt': 'Tool Bar: '}), tbl, 0, 1, 1)
        self.addWidget(self.allToolBarCB, tbl, 1, 1, 1)
        self.addWidget(self.tbTDCB, tbl, 2, 1, 1)
        self.addWidget(self.tbVfxCB, tbl, 3, 1, 1)
        self.addWidget(self.tbArtCB, tbl, 4, 1, 1)
        self.addWidget(self.tbTexCB, tbl, 5, 1, 1)
        self.addWidget(self.tbPostCB, tbl, 6, 1, 1)

        self.addWidget(Label({'txt': 'Connect Status'}), csl, 0, 1, 1)
        self.addWidget(self.allConnectCB, csl, 1, 1, 1)
        self.addWidget(self.serverCB, csl, 2, 1, 1)
        self.addWidget(self.onlineCB, csl, 3, 1, 1)
        self.addWidget(self.modeCB, csl, 4, 1, 1)

        self.addWidget(Label({'txt': 'Header'}), hdl, 0, 1, 1)
        self.addWidget(self.headerCB, hdl, 1, 1, 1)

    def buildServerStatusCheckBoxes(self):
        self.serverCB = CheckBox('Server')
        self.onlineCB = CheckBox('Internet')
        self.modeCB = CheckBox('Mode')
        self.allConnectCB = CheckBox("All: ")
        self.allConnectCB.stateChanged.connect(self.allConnectStateChanged)
        for cb in [self.serverCB, self.onlineCB, self.modeCB, self.allConnectCB]:
            self.connectCBs.append(cb)

    def buildMenuCheckBoxes(self):
        self.mnAppCB = CheckBox('&App')
        self.mnGoCB = CheckBox('&Go')
        self.mnOfficeCB = CheckBox('&Office')
        self.mnToolsCB = CheckBox('&Tools')
        self.mnDevCB = CheckBox('&Dev')
        self.mnLibCB = CheckBox('&Lib')
        self.mnHelpCB = CheckBox('&Help')
        self.allMenuCB = CheckBox('All: ')
        self.allMenuCB.stateChanged.connect(self.allMenuStateChanged)
        for cb in [self.mnAppCB, self.mnGoCB, self.mnOfficeCB, self.mnToolsCB, self.mnDevCB, self.mnLibCB,
                   self.mnHelpCB, self.allMenuCB]:
            self.menuCBs.append(cb)

    def buildToolBarCheckBoxes(self):
        self.tbTDCB = CheckBox("TD")
        self.tbVfxCB = CheckBox("VFX")
        self.tbArtCB = CheckBox("Art")
        self.tbTexCB = CheckBox("Tex")
        self.tbPostCB = CheckBox('Post')
        self.allToolBarCB = CheckBox("All: ")
        self.allToolBarCB.stateChanged.connect(self.allToolBarStateChanged)
        for cb in [self.tbTDCB, self.tbVfxCB, self.tbArtCB, self.tbTexCB, self.tbPostCB, self.allToolBarCB]:
            self.toolBarCBs.append(cb)

    def allToolBarStateChanged(self, bool):
        for cb in self.toolBarCBs:
            cb.setChecked(bool)

    def allMenuStateChanged(self, bool):
        for cb in self.menuCBs:
            cb.setChecked(bool)

    def allConnectStateChanged(self, bool):
        for cb in self.connectCBs:
            cb.setChecked(bool)

    def headerStateChanged(self, bool):
        self.allToolBarCB.setChecked(bool)
        self.allMenuCB.setChecked(bool)
        self.allConnectCB.setChecked(bool)