# Path: subdownloader/client/gui/views/language.py
# class InterfaceLanguageComboBox(AbstractLanguageComboBox):
#     def legal_languages(self):
#         return [Language.from_locale(locale) for locale in i18n_get_supported_locales()]
# 
# class LanguageComboBox(AbstractLanguageComboBox):
#     def legal_languages(self):
#         return [l for l in legal_languages()]
# 
# Path: subdownloader/client/gui/views/provider.py
# class ProviderComboBox(QComboBox):
#     selected_provider_state_changed = pyqtSignal(_Optional)
# 
#     def __init__(self, parent):
#         QComboBox.__init__(self, parent)
#         self._model = ProviderModel()
#         self._current_provider_state = None
# 
#         self.setup_ui()
# 
#     def set_general_text(self, general_text):
#         self._model.set_general_text(general_text)
# 
#     def set_general_visible(self, general_visible):
#         self._model.set_general_visible(general_visible)
# 
#     def set_filter_enable(self, filter_enable):
#         self._model.set_filter_enable(filter_enable)
# 
#     def set_state(self, state):
#         current_index = self.currentIndex()
#         self._model.set_state(state)
#         if current_index >= self._model.rowCount():
#             current_index = self._model.rowCount() - 1
#         self.setCurrentIndex(current_index)
# 
#     def set_selected_provider(self, provider):
#         index = self._model.index_of_provider(provider)
#         if index is not None:
#             self.setCurrentIndex(index)
# 
#     def get_selected_provider_state(self):
#         return self._current_provider_state
# 
#     def setup_ui(self):
#         self.setModel(self._model)
# 
#         self.setIconSize(QSize(16, 16))
# 
#         self.setCurrentIndex(0)
#         self._current_provider_state = self._model.provider_state_at_index(self.currentIndex())
# 
#         self.currentIndexChanged.connect(self.onCurrentIndexChanged)
# 
#     @pyqtSlot(int)
#     def onCurrentIndexChanged(self, index):
#         self._current_provider_state = self._model.provider_state_at_index(index)
#         self.selected_provider_state_changed.emit(_Optional(self._current_provider_state))


from PyQt5 import QtCore, QtGui, QtWidgets
from subdownloader.client.gui.views.language import InterfaceLanguageComboBox, LanguageComboBox
from subdownloader.client.gui.views.provider import ProviderComboBox
        sizePolicy.setHeightForWidth(self.optionUlDefaultLanguage.sizePolicy().hasHeightForWidth())
        self.optionUlDefaultLanguage.setSizePolicy(sizePolicy)
        self.optionUlDefaultLanguage.setFrame(True)
        self.optionUlDefaultLanguage.setObjectName("optionUlDefaultLanguage")
        self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.optionUlDefaultLanguage)
        self.verticalLayout_7.addWidget(self.uploadFrame)
        self.tabsPreferences.addTab(self.tabUpload, "")
        self.tabProviders = QtWidgets.QWidget()
        self.tabProviders.setObjectName("tabProviders")
        self.verticalLayout_9 = QtWidgets.QVBoxLayout(self.tabProviders)
        self.verticalLayout_9.setObjectName("verticalLayout_9")
        self.providerComboBox = ProviderComboBox(self.tabProviders)
        self.providerComboBox.setObjectName("providerComboBox")
        self.verticalLayout_9.addWidget(self.providerComboBox)
        self.providerStack = QtWidgets.QStackedWidget(self.tabProviders)
        self.providerStack.setObjectName("providerStack")
        self.verticalLayout_9.addWidget(self.providerStack)
        self.tabsPreferences.addTab(self.tabProviders, "")
        self.tabOthers = QtWidgets.QWidget()
        self.tabOthers.setObjectName("tabOthers")
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.tabOthers)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.groupInterface = QtWidgets.QGroupBox(self.tabOthers)
        self.groupInterface.setObjectName("groupInterface")
        self.gridLayout = QtWidgets.QGridLayout(self.groupInterface)
        self.gridLayout.setObjectName("gridLayout")
        self.textInterfaceLanguage = QtWidgets.QLabel(self.groupInterface)
        self.textInterfaceLanguage.setMinimumSize(QtCore.QSize(224, 0))
        self.textInterfaceLanguage.setObjectName("textInterfaceLanguage")
        self.gridLayout.addWidget(self.textInterfaceLanguage, 0, 0, 1, 1)

# Path: subdownloader/client/gui/views/language.py
# class InterfaceLanguageComboBox(AbstractLanguageComboBox):
#     def legal_languages(self):
#         return [Language.from_locale(locale) for locale in i18n_get_supported_locales()]
# 
# class LanguageComboBox(AbstractLanguageComboBox):
#     def legal_languages(self):
#         return [l for l in legal_languages()]
# 
# Path: subdownloader/client/gui/views/provider.py
# class ProviderComboBox(QComboBox):
#     selected_provider_state_changed = pyqtSignal(_Optional)
# 
#     def __init__(self, parent):
#         QComboBox.__init__(self, parent)
#         self._model = ProviderModel()
#         self._current_provider_state = None
# 
#         self.setup_ui()
# 
#     def set_general_text(self, general_text):
#         self._model.set_general_text(general_text)
# 
#     def set_general_visible(self, general_visible):
#         self._model.set_general_visible(general_visible)
# 
#     def set_filter_enable(self, filter_enable):
#         self._model.set_filter_enable(filter_enable)
# 
#     def set_state(self, state):
#         current_index = self.currentIndex()
#         self._model.set_state(state)
#         if current_index >= self._model.rowCount():
#             current_index = self._model.rowCount() - 1
#         self.setCurrentIndex(current_index)
# 
#     def set_selected_provider(self, provider):
#         index = self._model.index_of_provider(provider)
#         if index is not None:
#             self.setCurrentIndex(index)
# 
#     def get_selected_provider_state(self):
#         return self._current_provider_state
# 
#     def setup_ui(self):
#         self.setModel(self._model)
# 
#         self.setIconSize(QSize(16, 16))
# 
#         self.setCurrentIndex(0)
#         self._current_provider_state = self._model.provider_state_at_index(self.currentIndex())
# 
#         self.currentIndexChanged.connect(self.onCurrentIndexChanged)
# 
#     @pyqtSlot(int)
#     def onCurrentIndexChanged(self, index):
#         self._current_provider_state = self._model.provider_state_at_index(index)
#         self.selected_provider_state_changed.emit(_Optional(self._current_provider_state))


# Path: subdownloader/client/gui/generated/preferences_ui.py
from PyQt5 import QtCore, QtGui, QtWidgets
from subdownloader.client.gui.views.language import InterfaceLanguageComboBox, LanguageComboBox
from subdownloader.client.gui.views.provider import ProviderComboBox

        sizePolicy.setHeightForWidth(self.optionUlDefaultLanguage.sizePolicy().hasHeightForWidth())
        self.optionUlDefaultLanguage.setSizePolicy(sizePolicy)
        self.optionUlDefaultLanguage.setFrame(True)
        self.optionUlDefaultLanguage.setObjectName("optionUlDefaultLanguage")
        self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.optionUlDefaultLanguage)
        self.verticalLayout_7.addWidget(self.uploadFrame)
        self.tabsPreferences.addTab(self.tabUpload, "")
        self.tabProviders = QtWidgets.QWidget()
        self.tabProviders.setObjectName("tabProviders")
        self.verticalLayout_9 = QtWidgets.QVBoxLayout(self.tabProviders)
        self.verticalLayout_9.setObjectName("verticalLayout_9")
        self.providerComboBox = ProviderComboBox(self.tabProviders)
        self.providerComboBox.setObjectName("providerComboBox")
        self.verticalLayout_9.addWidget(self.providerComboBox)
        self.providerStack = QtWidgets.QStackedWidget(self.tabProviders)
        self.providerStack.setObjectName("providerStack")
        self.verticalLayout_9.addWidget(self.providerStack)
        self.tabsPreferences.addTab(self.tabProviders, "")
        self.tabOthers = QtWidgets.QWidget()
        self.tabOthers.setObjectName("tabOthers")
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.tabOthers)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.groupInterface = QtWidgets.QGroupBox(self.tabOthers)
        self.groupInterface.setObjectName("groupInterface")
        self.gridLayout = QtWidgets.QGridLayout(self.groupInterface)
        self.gridLayout.setObjectName("gridLayout")
        self.textInterfaceLanguage = QtWidgets.QLabel(self.groupInterface)
        self.textInterfaceLanguage.setMinimumSize(QtCore.QSize(224, 0))
        self.textInterfaceLanguage.setObjectName("textInterfaceLanguage")
        self.gridLayout.addWidget(self.textInterfaceLanguage, 0, 0, 1, 1)

        self.optionInterfaceLanguage = InterfaceLanguageComboBox(self.groupInterface)