示例#1
0
    def __init__(self):
        QFrame.__init__(self)
        layout = QGridLayout()

        self.btnMonitor1 = OutputButton(ID=2)
        self.btnMonitor1.setText("Monitor 1")
        layout.addWidget(self.btnMonitor1, 0, 1)

        self.btnChurch = OutputButton(ID=4)
        self.btnChurch.setText("Church")
        layout.addWidget(self.btnChurch, 1, 0)
        self.btnSpecial = OutputButton(ID=7)
        self.btnSpecial.setText("Stage")
        layout.addWidget(self.btnSpecial, 1, 1)

        self.btnGallery = OutputButton(ID=6)
        self.btnGallery.setText("Gallery")
        layout.addWidget(self.btnGallery, 2, 0)
        self.btnWelcome = OutputButton(ID=5)
        self.btnWelcome.setText("Welcome")
        layout.addWidget(self.btnWelcome, 2, 1)

        self.btnFont = OutputButton(ID=3)
        self.btnFont.setText("Font")
        layout.addWidget(self.btnFont, 3, 0)
        self.btnRecord = OutputButton(ID=8)
        self.btnRecord.setText("Record")
        layout.addWidget(self.btnRecord, 3, 1)

        self.btnPCMix = OutputButton(ID=2)
        self.btnPCMix.setText("PC Mix")
        layout.addWidget(self.btnPCMix, 4, 0)
        self.btnAll = IDedButton(ID=0)
        self.btnAll.setText("All")
        layout.addWidget(self.btnAll, 4, 1)

        self.outputButtons = {
            2: self.btnMonitor1,
            3: self.btnFont,
            4: self.btnChurch,
            5: self.btnWelcome,
            6: self.btnGallery,
            7: self.btnSpecial,
            8: self.btnRecord,
        }

        layout.setColumnMinimumWidth(0, 100)
        layout.setColumnMinimumWidth(1, 100)
        layout.setColumnStretch(0, 1)
        layout.setColumnStretch(1, 1)

        self.setLayout(layout)
示例#2
0
    def makeContent(self):
        layout = QGridLayout()

        self.blinds = QButtonGroup()

        for i in range(1, 7):
            btn = IDedButton(i)
            btn.setText(str(i))
            layout.addWidget(btn, 0, i - 1)
            btn.setCheckable(True)
            self.blinds.addButton(btn, i)

        btnAll = IDedButton(0)
        btnAll.setText("All")
        layout.addWidget(btnAll, 0, 6)
        btnAll.setCheckable(True)
        btnAll.setChecked(True)
        self.blinds.addButton(btnAll, 0)

        btnRaise = SvgButton(":icons/go-up", 96, 96)
        btnRaise.setText("Raise")
        btnRaise.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonTextBesideIcon)
        layout.addWidget(btnRaise, 1, 1, 1, 3)
        btnRaise.clicked.connect(self.raiseUp)

        btnLower = SvgButton(":icons/go-down", 96, 96)
        btnLower.setText("Lower")
        btnLower.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonTextBesideIcon)
        layout.addWidget(btnLower, 2, 1, 1, 3)
        btnLower.clicked.connect(self.lowerDown)

        btnStop = SvgButton(":icons/process-stop", 96, 96)
        btnStop.setText("Stop")
        btnStop.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonTextUnderIcon)
        layout.addWidget(btnStop, 1, 4, 2, 2)
        btnStop.clicked.connect(self.stop)

        return layout
示例#3
0
    def makeContent(self):
        layout = QGridLayout()

        self.blinds = QButtonGroup()

        for i in range(1, 7):
            btn = IDedButton(i)
            btn.setText(str(i))
            layout.addWidget(btn, 0, i - 1)
            btn.setCheckable(True)
            self.blinds.addButton(btn, i)

        btnAll = IDedButton(0)
        btnAll.setText("All")
        layout.addWidget(btnAll, 0, 6)
        btnAll.setCheckable(True)
        btnAll.setChecked(True)
        self.blinds.addButton(btnAll, 0)

        btnRaise = SvgButton(":icons/go-up", 96, 96)
        btnRaise.setText("Raise")
        btnRaise.setToolButtonStyle(
            Qt.ToolButtonStyle.ToolButtonTextBesideIcon)
        layout.addWidget(btnRaise, 1, 1, 1, 3)
        btnRaise.clicked.connect(self.raiseUp)

        btnLower = SvgButton(":icons/go-down", 96, 96)
        btnLower.setText("Lower")
        btnLower.setToolButtonStyle(
            Qt.ToolButtonStyle.ToolButtonTextBesideIcon)
        layout.addWidget(btnLower, 2, 1, 1, 3)
        btnLower.clicked.connect(self.lowerDown)

        btnStop = SvgButton(":icons/process-stop", 96, 96)
        btnStop.setText("Stop")
        btnStop.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonTextUnderIcon)
        layout.addWidget(btnStop, 1, 4, 2, 2)
        btnStop.clicked.connect(self.stop)

        return layout
示例#4
0
    def makeContent(self):
        layout = QGridLayout()

        self.screens = QButtonGroup()

        btnLeft = IDedButton(1)
        btnLeft.setText("Left")
        layout.addWidget(btnLeft, 1, 0, 1, 2)
        btnLeft.setCheckable(True)
        self.screens.addButton(btnLeft, 1)

        btnAll = IDedButton(0)
        btnAll.setText("Both")
        layout.addWidget(btnAll, 1, 2, 1, 3)
        btnAll.setCheckable(True)
        btnAll.setChecked(True)
        self.screens.addButton(btnAll, 0)

        btnRight = IDedButton(2)
        btnRight.setText("Right")
        layout.addWidget(btnRight, 1, 5, 1, 2)
        btnRight.setCheckable(True)
        self.screens.addButton(btnRight, 2)

        btnRaise = SvgButton(":icons/go-up", 96, 96)
        btnRaise.setText("Raise")
        btnRaise.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonTextBesideIcon)
        layout.addWidget(btnRaise, 2, 1, 1, 3)
        btnRaise.clicked.connect(self.raiseUp)

        btnLower = SvgButton(":icons/go-down", 96, 96)
        btnLower.setText("Lower")
        btnLower.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonTextBesideIcon)
        layout.addWidget(btnLower, 3, 1, 1, 3)
        btnLower.clicked.connect(self.lowerDown)

        btnStop = SvgButton(":icons/process-stop", 96, 96)
        btnStop.setText("Stop")
        btnStop.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonTextUnderIcon)
        layout.addWidget(btnStop, 2, 4, 2, 2)
        btnStop.clicked.connect(self.stop)

        return layout
示例#5
0
class OutputsGrid(QFrame):
    """
    Grid of output buttons.
    """

    inputNames = {0: "Blank", 1: "Camera 1", 2: "Camera 2", 3: "Camera 3", 4: "DVD", 5: "Extras", 6: "Visuals PC"}

    def __init__(self):
        QFrame.__init__(self)
        layout = QGridLayout()

        self.btnMonitor1 = OutputButton(ID=2)
        self.btnMonitor1.setText("Monitor 1")
        layout.addWidget(self.btnMonitor1, 0, 1)

        self.btnChurch = OutputButton(ID=4)
        self.btnChurch.setText("Church")
        layout.addWidget(self.btnChurch, 1, 0)
        self.btnSpecial = OutputButton(ID=7)
        self.btnSpecial.setText("Stage")
        layout.addWidget(self.btnSpecial, 1, 1)

        self.btnGallery = OutputButton(ID=6)
        self.btnGallery.setText("Gallery")
        layout.addWidget(self.btnGallery, 2, 0)
        self.btnWelcome = OutputButton(ID=5)
        self.btnWelcome.setText("Welcome")
        layout.addWidget(self.btnWelcome, 2, 1)

        self.btnFont = OutputButton(ID=3)
        self.btnFont.setText("Font")
        layout.addWidget(self.btnFont, 3, 0)
        self.btnRecord = OutputButton(ID=8)
        self.btnRecord.setText("Record")
        layout.addWidget(self.btnRecord, 3, 1)

        self.btnPCMix = OutputButton(ID=2)
        self.btnPCMix.setText("PC Mix")
        layout.addWidget(self.btnPCMix, 4, 0)
        self.btnAll = IDedButton(ID=0)
        self.btnAll.setText("All")
        layout.addWidget(self.btnAll, 4, 1)

        self.outputButtons = {
            2: self.btnMonitor1,
            3: self.btnFont,
            4: self.btnChurch,
            5: self.btnWelcome,
            6: self.btnGallery,
            7: self.btnSpecial,
            8: self.btnRecord,
        }

        layout.setColumnMinimumWidth(0, 100)
        layout.setColumnMinimumWidth(1, 100)
        layout.setColumnStretch(0, 1)
        layout.setColumnStretch(1, 1)

        self.setLayout(layout)

    def connectMainOutputs(self, function):
        self.btnMonitor1.clicked.connect(function)
        self.btnChurch.clicked.connect(function)
        self.btnSpecial.clicked.connect(function)
        self.btnGallery.clicked.connect(function)
        self.btnWelcome.clicked.connect(function)
        self.btnFont.clicked.connect(function)
        self.btnRecord.clicked.connect(function)
        self.btnAll.clicked.connect(function)

    def connectPreviewOutputs(self, function):
        self.btnPCMix.clicked.connect(function)

    def updateOutputMappings(self, mapping):
        if "Main" in mapping:
            for outp, inp in mapping["Main"].iteritems():
                if outp in self.outputButtons.keys():
                    self.outputButtons[outp].setInputText(self.inputNames[inp])
                elif outp == 0:
                    for button in self.outputButtons.values():
                        button.setInputText(self.inputNames[inp])
        if "Preview" in mapping:
            if 2 in mapping["Preview"]:
                inp = mapping["Preview"][2]
                if inp == 6:  # HACK HACK HACK because of crossed wiring in church
                    inp = 5
                self.btnPCMix.setInputText(self.inputNames[inp])