# Path: lib/color_modes.py



from builtins import str
from builtins import range
from PyQt5 import QtCore, QtGui, QtWidgets
from ui.ui_dlg_settings import Ui_DlgSettings
from lib import color_modes
            client = {"host": host, "port": port, "enabled": enabled, "color-mode": color_mode,
                      "protocol": proto, "ignore-dimming": ignore_dimming}
            if client not in clients:
                clients.append(client)
        self.app.settings['networking']['clients'] = clients

    def accept_strands(self):
        strands = []
        for i in range(self.tbl_strands_list.rowCount()):
            idx = int(self.tbl_strands_list.item(i, 0).text())
            color_mode = self.tbl_strands_list.cellWidget(i, 1).currentText()
            enabled = (self.tbl_strands_list.cellWidget(i, 2).checkState() == QtCore.Qt.Checked)
            strand = {"id": idx, "enabled": enabled, "color-mode": color_mode}
            strands.append(strand)
        self.app.scene.set_strand_settings(strands)

    def save_settings(self):
        self.app.settings.save()
        self.app.scene.save()

    def populate_networking_clients_table(self):
        clients = self.app.settings['networking']['clients']
        self.tbl_networking_clients.setRowCount(len(clients))
        for i, client in enumerate(clients):
            item_host = QtWidgets.QTableWidgetItem(client["host"])
            item_port = QtWidgets.QTableWidgetItem(str(client["port"]))
            item_enabled = QtWidgets.QCheckBox()
            item_ignore_dimming = QtWidgets.QCheckBox()

            item_color_mode = QtWidgets.QComboBox()

# Path: lib/color_modes.py



# Path: ui/dlg_settings.py
from builtins import str
from builtins import range
from PyQt5 import QtCore, QtGui, QtWidgets
from ui.ui_dlg_settings import Ui_DlgSettings
from lib import color_modes

            client = {"host": host, "port": port, "enabled": enabled, "color-mode": color_mode,
                      "protocol": proto, "ignore-dimming": ignore_dimming}
            if client not in clients:
                clients.append(client)
        self.app.settings['networking']['clients'] = clients

    def accept_strands(self):
        strands = []
        for i in range(self.tbl_strands_list.rowCount()):
            idx = int(self.tbl_strands_list.item(i, 0).text())
            color_mode = self.tbl_strands_list.cellWidget(i, 1).currentText()
            enabled = (self.tbl_strands_list.cellWidget(i, 2).checkState() == QtCore.Qt.Checked)
            strand = {"id": idx, "enabled": enabled, "color-mode": color_mode}
            strands.append(strand)
        self.app.scene.set_strand_settings(strands)

    def save_settings(self):
        self.app.settings.save()
        self.app.scene.save()

    def populate_networking_clients_table(self):
        clients = self.app.settings['networking']['clients']
        self.tbl_networking_clients.setRowCount(len(clients))
        for i, client in enumerate(clients):
            item_host = QtWidgets.QTableWidgetItem(client["host"])
            item_port = QtWidgets.QTableWidgetItem(str(client["port"]))
            item_enabled = QtWidgets.QCheckBox()
            item_ignore_dimming = QtWidgets.QCheckBox()

            item_color_mode = QtWidgets.QComboBox()

            for mode in color_modes.modes: