Esempio n. 1
0
    def getSelected(self):
        """
        Return the iteration of the selected comboBox series, or None if none is
        selected.
        """

        iteration = self.comboBox.get_active_iter()
        return getChildModelSelection(self.comboBoxModel, iteration)
Esempio n. 2
0
    def getMovieOrSeriesFromSelection(self, contextId, context):
        """
        Obtain a movie or series from the currently-selected treeView row.
        """

        # get the current movie selection
        parentModel, parentIter = self.movieTreeSelection.get_selected()

        treeModel = self.movieTreeStore
        treeIndex = getChildModelSelection(parentModel, parentIter)
        if treeIndex is None:
            self.displaySelectMovieErrorMessage(contextId, context)
            return None, None
        if treeModel[treeIndex][-1]:
            childIter = treeModel.iter_children(treeIndex)
            seriesList = self.movieListIO.extractMovieTreeAsList(childIter)
            return treeIndex, MovieSeries.fromList(treeModel[treeIndex],
                                                   seriesList)
        else:
            return treeIndex, Movie.fromList(treeModel[treeIndex])