def show_help_browser(self, path=None): """ Displays the help browser somewhere on screen. Can set a special page if needed. """ # we sometimes wire signals that send parameters for url (mouse events for example) which we do not like if isinstance(path, str): url = qt.local_url(path) # self.help_browser_widget.load(url) QtGui.QDesktopServices.openUrl(url) else: QtGui.QDesktopServices.openUrl(qt.local_url(constants.DOCUMENTATION_INDEX_FILE))
def show_help_browser(self, path=None): """ Displays the help browser somewhere on screen. Can set a special page if needed. """ # we sometimes wire signals that send parameters for url (mouse events for example) which we do not like if isinstance(path, str): url = qt.local_url(path) # self.help_browser_widget.load(url) QtGui.QDesktopServices.openUrl(url) else: QtGui.QDesktopServices.openUrl( qt.local_url(constants.DOCUMENTATION_INDEX_FILE))
def load_soundtrack_playlist(): """ Loads the play list of the soundtracks and replaces the file name with the full path. A playlist is a list where each entry is a list of two strings: file path, title """ global soundtrack_playlist # create playlist soundtrack_playlist = QtMultimedia.QMediaPlaylist() soundtrack_playlist.setPlaybackMode(QtMultimedia.QMediaPlaylist.Loop) # read information file data = utils.read_as_yaml(constants.SOUNDTRACK_INFO_FILE) # add the soundtrack folder to each file name for entry in data: file = constants.extend(constants.SOUNDTRACK_FOLDER, entry[0]) url = qt.local_url(file) media = QtMultimedia.QMediaContent(url) soundtrack_playlist.addMedia(media)