MCPcopy Create free account
hub / github.com/Syncplay/syncplay / populateMenubar

Method populateMenubar

syncplay/ui/gui.py:1717–1832  ·  view source on GitHub ↗
(self, window)

Source from the content-addressed store, hash-verified

1715 window.editMenu = None
1716
1717 def populateMenubar(self, window):
1718 # File menu
1719
1720 window.fileMenu = QtWidgets.QMenu(getMessage("file-menu-label"), self)
1721 window.openAction = window.fileMenu.addAction(QtGui.QPixmap(resourcespath + 'folder_explore.png'),
1722 getMessage("openmedia-menu-label"))
1723 window.openAction.triggered.connect(self.browseMediapath)
1724 window.openAction = window.fileMenu.addAction(QtGui.QPixmap(resourcespath + 'world_explore.png'),
1725 getMessage("openstreamurl-menu-label"))
1726 window.openAction.triggered.connect(self.promptForStreamURL)
1727 window.openAction = window.fileMenu.addAction(QtGui.QPixmap(resourcespath + 'film_folder_edit.png'),
1728 getMessage("setmediadirectories-menu-label"))
1729 window.openAction.triggered.connect(self.openSetMediaDirectoriesDialog)
1730
1731 window.reconnectAction = window.fileMenu.addAction(QtGui.QPixmap(resourcespath + "reconnect.png"), getMessage("reconnect-menu-label"))
1732 window.reconnectAction.triggered.connect(self.reconnectToServer)
1733
1734 window.exitAction = window.fileMenu.addAction(getMessage("exit-menu-label"))
1735 if isMacOS():
1736 window.exitAction.setMenuRole(QtWidgets.QAction.QuitRole)
1737 else:
1738 window.exitAction.setIcon(QtGui.QPixmap(resourcespath + 'cross.png'))
1739 window.exitAction.triggered.connect(self.exitSyncplay)
1740
1741 if(window.editMenu is not None):
1742 window.menuBar.insertMenu(window.editMenu.menuAction(), window.fileMenu)
1743 else:
1744 window.menuBar.addMenu(window.fileMenu)
1745
1746 # Playback menu
1747
1748 window.playbackMenu = QtWidgets.QMenu(getMessage("playback-menu-label"), self)
1749 window.playAction = window.playbackMenu.addAction(
1750 QtGui.QPixmap(resourcespath + 'control_play_blue.png'),
1751 getMessage("play-menu-label"))
1752 window.playAction.triggered.connect(self.play)
1753 window.pauseAction = window.playbackMenu.addAction(
1754 QtGui.QPixmap(resourcespath + 'control_pause_blue.png'),
1755 getMessage("pause-menu-label"))
1756 window.pauseAction.triggered.connect(self.pause)
1757 window.seekAction = window.playbackMenu.addAction(
1758 QtGui.QPixmap(resourcespath + 'clock_go.png'),
1759 getMessage("seektime-menu-label"))
1760 window.seekAction.triggered.connect(self.seekPositionDialog)
1761 window.unseekAction = window.playbackMenu.addAction(
1762 QtGui.QPixmap(resourcespath + 'arrow_undo.png'),
1763 getMessage("undoseek-menu-label"))
1764 window.unseekAction.triggered.connect(self.undoSeek)
1765
1766 window.menuBar.addMenu(window.playbackMenu)
1767
1768 # Advanced menu
1769
1770 window.advancedMenu = QtWidgets.QMenu(getMessage("advanced-menu-label"), self)
1771 window.setoffsetAction = window.advancedMenu.addAction(
1772 QtGui.QPixmap(resourcespath + 'timeline_marker.png'),
1773 getMessage("setoffset-menu-label"))
1774 window.setoffsetAction.triggered.connect(self.setOffset)

Callers 1

__init__Method · 0.95

Calls 3

getMessageFunction · 0.90
isMacOSFunction · 0.90
connectMethod · 0.45

Tested by

no test coverage detected