mirror of https://github.com/Syncplay/syncplay
Pack Syncplay in a single .app file for macOS distribution
This commit is contained in:
parent
65e51c201d
commit
214fa45759
|
@ -0,0 +1,32 @@
|
|||
"""
|
||||
This is a setup.py script generated by py2applet
|
||||
|
||||
Usage:
|
||||
python setup.py py2app
|
||||
"""
|
||||
|
||||
from setuptools import setup
|
||||
from glob import glob
|
||||
import syncplay
|
||||
|
||||
APP = ['syncplayClient.py']
|
||||
DATA_FILES = [
|
||||
('resources', glob('resources/*.png')),
|
||||
]
|
||||
OPTIONS = {
|
||||
'iconfile':'resources/icon.icns',
|
||||
'plist': {
|
||||
'CFBundleName':'Syncplay',
|
||||
'CFBundleShortVersionString':syncplay.version,
|
||||
'CFBundleIdentifier':'pl.syncplay.Syncplay',
|
||||
'NSHumanReadableCopyright': '@ 2017 Syncplay All Rights Reserved'
|
||||
}
|
||||
}
|
||||
|
||||
setup(
|
||||
app=APP,
|
||||
name='Syncplay',
|
||||
data_files=DATA_FILES,
|
||||
options={'py2app': OPTIONS},
|
||||
setup_requires=['py2app'],
|
||||
)
|
Binary file not shown.
|
@ -1342,6 +1342,10 @@ class MainWindow(QtGui.QMainWindow):
|
|||
# Help menu
|
||||
|
||||
window.helpMenu = QtGui.QMenu(getMessage("help-menu-label"), self)
|
||||
if sys.platform.startswith('darwin'):
|
||||
window.about = window.helpMenu.addAction("&About")
|
||||
window.about.triggered.connect(self.openAbout)
|
||||
|
||||
window.userguideAction = window.helpMenu.addAction(QtGui.QIcon(self.resourcespath + 'help.png'),
|
||||
getMessage("userguide-menu-label"))
|
||||
window.userguideAction.triggered.connect(self.openUserGuide)
|
||||
|
@ -1353,6 +1357,15 @@ class MainWindow(QtGui.QMainWindow):
|
|||
if not sys.platform.startswith('darwin'):
|
||||
window.mainLayout.setMenuBar(window.menuBar)
|
||||
|
||||
def openAbout(self):
|
||||
AboutMsgBox = QtGui.QMessageBox.about(self,"Syncplay","Syncplay v" + version)
|
||||
# AboutMsgBox = QtGui.QMessageBox()
|
||||
# AboutMsgBox.setText("Test text")
|
||||
# AboutMsgBox.setStandardButtons(0)
|
||||
# AboutMsgBox.setModal(True)
|
||||
# AboutMsgBox.exec_()
|
||||
|
||||
|
||||
def addMainFrame(self, window):
|
||||
window.mainFrame = QtGui.QFrame()
|
||||
window.mainFrame.setLineWidth(0)
|
||||
|
@ -1618,7 +1631,10 @@ class MainWindow(QtGui.QMainWindow):
|
|||
self.resourcespath = utils.findWorkingDir() + u"\\resources\\"
|
||||
else:
|
||||
self.resourcespath = utils.findWorkingDir() + u"/resources/"
|
||||
self.setWindowFlags(self.windowFlags() & Qt.AA_DontUseNativeMenuBar)
|
||||
if sys.platform.startswith('darwin'):
|
||||
self.setWindowFlags(self.windowFlags())
|
||||
else:
|
||||
self.setWindowFlags(self.windowFlags() & Qt.AA_DontUseNativeMenuBar)
|
||||
self.setWindowTitle("Syncplay v" + version)
|
||||
self.mainLayout = QtGui.QVBoxLayout()
|
||||
self.addTopLayout(self)
|
||||
|
|
|
@ -124,6 +124,8 @@ def findWorkingDir():
|
|||
path = os.path.dirname(os.path.dirname(__file__))
|
||||
elif frozen in ('dll', 'console_exe', 'windows_exe'):
|
||||
path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
||||
elif frozen in ('macosx_app'):
|
||||
path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))))
|
||||
else:
|
||||
path = ""
|
||||
return path
|
||||
|
|
Loading…
Reference in New Issue