# 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
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.optionSubFnSame = QtWidgets.QRadioButton(self.groupBoxSubFn)
        self.optionSubFnSame.setChecked(True)
        self.optionSubFnSame.setObjectName("optionSubFnSame")
        self.verticalLayout_2.addWidget(self.optionSubFnSame)
        self.optionSubFnSameLang = QtWidgets.QRadioButton(self.groupBoxSubFn)
        self.optionSubFnSameLang.setChecked(False)
        self.optionSubFnSameLang.setObjectName("optionSubFnSameLang")
        self.verticalLayout_2.addWidget(self.optionSubFnSameLang)
        self.optionSubFnSameLangUploader = QtWidgets.QRadioButton(self.groupBoxSubFn)
        self.optionSubFnSameLangUploader.setChecked(False)
        self.optionSubFnSameLangUploader.setObjectName("optionSubFnSameLangUploader")
        self.verticalLayout_2.addWidget(self.optionSubFnSameLangUploader)
        self.optionSubFnOnline = QtWidgets.QRadioButton(self.groupBoxSubFn)
        self.optionSubFnOnline.setObjectName("optionSubFnOnline")
        self.verticalLayout_2.addWidget(self.optionSubFnOnline)
        self.verticalLayout.addWidget(self.groupBoxSubFn)
        self.tabsPreferences.addTab(self.tabDownload, "")
        self.tabUpload = QtWidgets.QWidget()
        self.tabUpload.setObjectName("tabUpload")
        self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.tabUpload)
        self.verticalLayout_7.setObjectName("verticalLayout_7")
        self.uploadFrame = QtWidgets.QFrame(self.tabUpload)
        self.uploadFrame.setObjectName("uploadFrame")
        self.formLayout_2 = QtWidgets.QFormLayout(self.uploadFrame)
        self.formLayout_2.setObjectName("formLayout_2")
        self.textUlDefaultLanguage = QtWidgets.QLabel(self.uploadFrame)
        self.textUlDefaultLanguage.setMinimumSize(QtCore.QSize(339, 0))
        self.textUlDefaultLanguage.setObjectName("textUlDefaultLanguage")
        self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.textUlDefaultLanguage)

# 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

        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.optionSubFnSame = QtWidgets.QRadioButton(self.groupBoxSubFn)
        self.optionSubFnSame.setChecked(True)
        self.optionSubFnSame.setObjectName("optionSubFnSame")
        self.verticalLayout_2.addWidget(self.optionSubFnSame)
        self.optionSubFnSameLang = QtWidgets.QRadioButton(self.groupBoxSubFn)
        self.optionSubFnSameLang.setChecked(False)
        self.optionSubFnSameLang.setObjectName("optionSubFnSameLang")
        self.verticalLayout_2.addWidget(self.optionSubFnSameLang)
        self.optionSubFnSameLangUploader = QtWidgets.QRadioButton(self.groupBoxSubFn)
        self.optionSubFnSameLangUploader.setChecked(False)
        self.optionSubFnSameLangUploader.setObjectName("optionSubFnSameLangUploader")
        self.verticalLayout_2.addWidget(self.optionSubFnSameLangUploader)
        self.optionSubFnOnline = QtWidgets.QRadioButton(self.groupBoxSubFn)
        self.optionSubFnOnline.setObjectName("optionSubFnOnline")
        self.verticalLayout_2.addWidget(self.optionSubFnOnline)
        self.verticalLayout.addWidget(self.groupBoxSubFn)
        self.tabsPreferences.addTab(self.tabDownload, "")
        self.tabUpload = QtWidgets.QWidget()
        self.tabUpload.setObjectName("tabUpload")
        self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.tabUpload)
        self.verticalLayout_7.setObjectName("verticalLayout_7")
        self.uploadFrame = QtWidgets.QFrame(self.tabUpload)
        self.uploadFrame.setObjectName("uploadFrame")
        self.formLayout_2 = QtWidgets.QFormLayout(self.uploadFrame)
        self.formLayout_2.setObjectName("formLayout_2")
        self.textUlDefaultLanguage = QtWidgets.QLabel(self.uploadFrame)
        self.textUlDefaultLanguage.setMinimumSize(QtCore.QSize(339, 0))
        self.textUlDefaultLanguage.setObjectName("textUlDefaultLanguage")
        self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.textUlDefaultLanguage)

        self.optionUlDefaultLanguage = LanguageComboBox(self.uploadFrame)