# Path: subdownloader/client/gui/views/imdb.py
# class ImdbListView(QTableView):
#     def __init__(self, parent=None):
#         QTableView.__init__(self, parent)
#         self._imdb_model = ImdbSearchModel()
#         self.setup_ui()
# 
#     def setup_ui(self):
#         self.setModel(self._imdb_model)
# 
#         self.setSelectionMode(QTableView.SingleSelection)
#         self.setSelectionBehavior(QTableView.SelectRows)
#         self.setGridStyle(Qt.DotLine)
# 
#         self.horizontalHeader().setSectionResizeMode(0, QHeaderView.ResizeToContents)
#         self.horizontalHeader().setSectionResizeMode(1, QHeaderView.Stretch)
#         self.horizontalHeader().sectionClicked.connect(self.on_header_clicked)
#         self.verticalHeader().hide()
# 
#         self.selectionModel().selectionChanged.connect(self.imdb_selection_changed)
# 
#         self.retranslate()
# 
#     def retranslate(self):
#         self._imdb_model.headerDataChanged.emit(Qt.Horizontal, 0, ImdbSearchModel.NB_COLS - 1)
# 
#     def set_imdb_data(self, imdb_data: Sequence[ImdbMovieMatch]):
#         self._imdb_model.set_imdb_data(imdb_data)
# 
#     @pyqtSlot(int)
#     def on_header_clicked(self, section: int) -> None:
#         self._imdb_model.sort(section)
# 
#     imdb_selection_changed = pyqtSignal()
# 
#     def get_selected_imdb(self) -> Optional[ImdbMovieMatch]:
#         selection = self.selectionModel().selection()
# 
#         if not selection.count():
#             return None
# 
#         selection_range = selection.first()
#         return self._imdb_model.get_imdb_at_row(selection_range.top())
# 
# 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.imdb import ImdbListView
from subdownloader.client.gui.views.provider import ProviderComboBox
# Form implementation generated from reading ui file '/home/maarten/programming/subdownloader_old/scripts/gui/ui/imdbSearch.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!




class Ui_IMDBSearchDialog(object):
    def setupUi(self, IMDBSearchDialog):
        IMDBSearchDialog.setObjectName("IMDBSearchDialog")
        IMDBSearchDialog.setWindowModality(QtCore.Qt.ApplicationModal)
        IMDBSearchDialog.setModal(True)
        self._2 = QtWidgets.QVBoxLayout(IMDBSearchDialog)
        self._2.setObjectName("_2")
        self.label = QtWidgets.QLabel(IMDBSearchDialog)
        self.label.setObjectName("label")
        self._2.addWidget(self.label)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.movieSearch = QtWidgets.QLineEdit(IMDBSearchDialog)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.movieSearch.sizePolicy().hasHeightForWidth())
        self.movieSearch.setSizePolicy(sizePolicy)
        self.movieSearch.setText("")
        self.movieSearch.setObjectName("movieSearch")
        self.horizontalLayout_2.addWidget(self.movieSearch)

# Path: subdownloader/client/gui/views/imdb.py
# class ImdbListView(QTableView):
#     def __init__(self, parent=None):
#         QTableView.__init__(self, parent)
#         self._imdb_model = ImdbSearchModel()
#         self.setup_ui()
# 
#     def setup_ui(self):
#         self.setModel(self._imdb_model)
# 
#         self.setSelectionMode(QTableView.SingleSelection)
#         self.setSelectionBehavior(QTableView.SelectRows)
#         self.setGridStyle(Qt.DotLine)
# 
#         self.horizontalHeader().setSectionResizeMode(0, QHeaderView.ResizeToContents)
#         self.horizontalHeader().setSectionResizeMode(1, QHeaderView.Stretch)
#         self.horizontalHeader().sectionClicked.connect(self.on_header_clicked)
#         self.verticalHeader().hide()
# 
#         self.selectionModel().selectionChanged.connect(self.imdb_selection_changed)
# 
#         self.retranslate()
# 
#     def retranslate(self):
#         self._imdb_model.headerDataChanged.emit(Qt.Horizontal, 0, ImdbSearchModel.NB_COLS - 1)
# 
#     def set_imdb_data(self, imdb_data: Sequence[ImdbMovieMatch]):
#         self._imdb_model.set_imdb_data(imdb_data)
# 
#     @pyqtSlot(int)
#     def on_header_clicked(self, section: int) -> None:
#         self._imdb_model.sort(section)
# 
#     imdb_selection_changed = pyqtSignal()
# 
#     def get_selected_imdb(self) -> Optional[ImdbMovieMatch]:
#         selection = self.selectionModel().selection()
# 
#         if not selection.count():
#             return None
# 
#         selection_range = selection.first()
#         return self._imdb_model.get_imdb_at_row(selection_range.top())
# 
# 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/imdbSearch_ui.py
from PyQt5 import QtCore, QtGui, QtWidgets
from subdownloader.client.gui.views.imdb import ImdbListView
from subdownloader.client.gui.views.provider import ProviderComboBox

# Form implementation generated from reading ui file '/home/maarten/programming/subdownloader_old/scripts/gui/ui/imdbSearch.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!




class Ui_IMDBSearchDialog(object):
    def setupUi(self, IMDBSearchDialog):
        IMDBSearchDialog.setObjectName("IMDBSearchDialog")
        IMDBSearchDialog.setWindowModality(QtCore.Qt.ApplicationModal)
        IMDBSearchDialog.setModal(True)
        self._2 = QtWidgets.QVBoxLayout(IMDBSearchDialog)
        self._2.setObjectName("_2")
        self.label = QtWidgets.QLabel(IMDBSearchDialog)
        self.label.setObjectName("label")
        self._2.addWidget(self.label)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.movieSearch = QtWidgets.QLineEdit(IMDBSearchDialog)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.movieSearch.sizePolicy().hasHeightForWidth())
        self.movieSearch.setSizePolicy(sizePolicy)
        self.movieSearch.setText("")
        self.movieSearch.setObjectName("movieSearch")
        self.horizontalLayout_2.addWidget(self.movieSearch)

        self.providerSearch = ProviderComboBox(IMDBSearchDialog)