Merge pull request #23 from Et0h/master

Give runButton default focus and add icons to GuiConfig
This commit is contained in:
Uriziel 2013-06-01 11:19:25 -07:00
commit c14b7a27b4
6 changed files with 15 additions and 7 deletions

View File

@ -523,17 +523,18 @@ info = dict(
options={'py2exe': { options={'py2exe': {
'dist_dir': OUT_DIR, 'dist_dir': OUT_DIR,
'packages': 'PySide.QtUiTools', 'packages': 'PySide.QtUiTools',
'includes': 'cairo, pango, pangocairo, atk, gobject, twisted, sys, encodings, datetime, os, time, math, PySide', 'includes': 'twisted, sys, encodings, datetime, os, time, math, PySide',
'excludes': 'venv, _ssl, doctest, pdb, unittest, win32clipboard, win32event, win32file, win32pdh, win32security, win32trace, win32ui, winxpgui, win32pipe, win32process', 'excludes': 'venv, _ssl, doctest, pdb, unittest, win32clipboard, win32event, win32file, win32pdh, win32security, win32trace, win32ui, winxpgui, win32pipe, win32process',
'dll_excludes': 'msvcr71.dll, MSVCP90.dll', 'dll_excludes': 'msvcr71.dll, MSVCP90.dll',
'optimize': 2, 'optimize': 2,
'compressed': 1 'compressed': 1
} }
}, },
data_files = [("resources", ["resources/icon.ico",])], data_files = [("resources", ["resources/icon.ico","resources/syncplay.png","resources/accept.png","resources/folder_explore.png","resources/help.png"])],
zipfile = "lib/libsync", zipfile = "lib/libsync",
cmdclass = {"py2exe": build_installer}, cmdclass = {"py2exe": build_installer},
) )
sys.argv.extend(['py2exe', '-p win32com ', '-i twisted.web.resource']) sys.argv.extend(['py2exe', '-p win32com ', '-i twisted.web.resource'])
setup(**info) setup(**info)

BIN
resources/accept.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 679 B

BIN
resources/help.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 B

BIN
resources/syncplay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -1,6 +1,6 @@
from PySide import QtCore, QtGui from PySide import QtCore, QtGui
from PySide.QtCore import QSettings, Qt from PySide.QtCore import QSettings, Qt
from PySide.QtGui import QApplication, QLineEdit, QCursor, QLabel, QCheckBox, QDesktopServices from PySide.QtGui import QApplication, QLineEdit, QCursor, QLabel, QCheckBox, QDesktopServices, QIcon
import os import os
import sys import sys
@ -142,12 +142,19 @@ class ConfigDialog(QtGui.QDialog):
def __init__(self, config, playerpaths): def __init__(self, config, playerpaths):
from syncplay import utils
self.config = config self.config = config
self.QtGui = QtGui self.QtGui = QtGui
if sys.platform.startswith('linux'):
resourcespath = utils.findWorkingDir() + "/resources/"
else:
resourcespath = utils.findWorkingDir() + "\\resources\\"
print resourcespath
super(ConfigDialog, self).__init__() super(ConfigDialog, self).__init__()
self.setWindowTitle(getMessage("en", "config-window-title")) self.setWindowTitle(getMessage("en", "config-window-title"))
self.setWindowIcon(QtGui.QIcon(resourcespath + "syncplay.png"))
if(config['host'] == None): if(config['host'] == None):
host = "" host = ""
@ -183,7 +190,7 @@ class ConfigDialog(QtGui.QDialog):
self.executablepathCombobox.setMinimumWidth(200) self.executablepathCombobox.setMinimumWidth(200)
self.executablepathCombobox.setMaximumWidth(200) self.executablepathCombobox.setMaximumWidth(200)
self.executablepathLabel = QLabel("Path to player executable:", self) self.executablepathLabel = QLabel("Path to player executable:", self)
self.executablebrowseButton = QtGui.QPushButton("Browse") self.executablebrowseButton = QtGui.QPushButton(QtGui.QIcon(resourcespath + 'folder_explore.png'),"Browse")
self.executablebrowseButton.clicked.connect(self.browsePlayerpath) self.executablebrowseButton.clicked.connect(self.browsePlayerpath)
self.slowdownCheckbox = QCheckBox("Slow down on desync") self.slowdownCheckbox = QCheckBox("Slow down on desync")
self.mediaplayerSettingsLayout = QtGui.QGridLayout() self.mediaplayerSettingsLayout = QtGui.QGridLayout()
@ -238,10 +245,10 @@ class ConfigDialog(QtGui.QDialog):
self.mainLayout.addWidget(self.malSettingsGroup) self.mainLayout.addWidget(self.malSettingsGroup)
self.topLayout = QtGui.QHBoxLayout() self.topLayout = QtGui.QHBoxLayout()
self.helpButton = QtGui.QPushButton("Help") self.helpButton = QtGui.QPushButton(QtGui.QIcon(resourcespath + 'help.png'),"Help")
self.helpButton.setMaximumSize(self.helpButton.sizeHint()) self.helpButton.setMaximumSize(self.helpButton.sizeHint())
self.helpButton.pressed.connect(self.openHelp) self.helpButton.pressed.connect(self.openHelp)
self.runButton = QtGui.QPushButton("Store configuration and run Syncplay") self.runButton = QtGui.QPushButton(QtGui.QIcon(resourcespath + 'accept.png'),"Store configuration and run Syncplay")
self.runButton.pressed.connect(self._saveDataAndLeave) self.runButton.pressed.connect(self._saveDataAndLeave)
self.runButtonTextUpdate self.runButtonTextUpdate
self.topLayout.addWidget(self.helpButton, Qt.AlignLeft) self.topLayout.addWidget(self.helpButton, Qt.AlignLeft)
@ -251,6 +258,6 @@ class ConfigDialog(QtGui.QDialog):
self.mainLayout.addLayout(self.topLayout) self.mainLayout.addLayout(self.topLayout)
self.mainLayout.addStretch(1) self.mainLayout.addStretch(1)
self.setLayout(self.mainLayout) self.setLayout(self.mainLayout)
self.runButton.setFocus()
self.setFixedSize(self.sizeHint()) self.setFixedSize(self.sizeHint())