Skip to content

Commit

Permalink
Add help button to GuiConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
Et0h committed May 31, 2013
1 parent 6b7cdf6 commit 58b5e0c
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions syncplay/ui/GuiConfiguration.py
@@ -1,6 +1,6 @@
from PySide import QtCore, QtGui
from PySide.QtCore import QSettings, Qt
from PySide.QtGui import QApplication, QLineEdit, QCursor, QLabel, QCheckBox
from PySide.QtGui import QApplication, QLineEdit, QCursor, QLabel, QCheckBox, QDesktopServices

import os
import sys
Expand Down Expand Up @@ -62,6 +62,9 @@ def runButtonTextUpdate(self):
self.runButton.setText("Run Syncplay")
else:
self.runButton.setText("Store configuration and run Syncplay")

def openHelp(self):
self.QtGui.QDesktopServices.openUrl("http://syncplay.pl/guide/")

def _tryToFillPlayerPath(self, playerpath, playerpathlist):
foundpath = ""
Expand Down Expand Up @@ -140,6 +143,7 @@ def closeEvent(self, event):
def __init__(self, config, playerpaths):

self.config = config
self.QtGui = QtGui

super(ConfigDialog, self).__init__()

Expand Down Expand Up @@ -223,9 +227,6 @@ def __init__(self, config, playerpaths):
if config['noStore'] == True:
self.donotstoreCheckbox.setChecked(True)

self.runButton = QtGui.QPushButton("Store configuration and run Syncplay")
self.runButton.pressed.connect(self._saveDataAndLeave)
self.runButtonTextUpdate
self.donotstoreCheckbox.toggled.connect(self.runButtonTextUpdate)

self.mainLayout = QtGui.QVBoxLayout()
Expand All @@ -236,9 +237,18 @@ def __init__(self, config, playerpaths):
self.mainLayout.addWidget(self.malenabledCheckbox)
self.mainLayout.addWidget(self.malSettingsGroup)

self.topLayout = QtGui.QHBoxLayout()
self.helpButton = QtGui.QPushButton("Help")
self.helpButton.setMaximumSize(self.helpButton.sizeHint())
self.helpButton.pressed.connect(self.openHelp)
self.runButton = QtGui.QPushButton("Store configuration and run Syncplay")
self.runButton.pressed.connect(self._saveDataAndLeave)
self.runButtonTextUpdate
self.topLayout.addWidget(self.helpButton, Qt.AlignLeft)
self.topLayout.addWidget(self.runButton, Qt.AlignRight)
self.mainLayout.addWidget(self.alwaysshowCheckbox)
self.mainLayout.addWidget(self.donotstoreCheckbox)
self.mainLayout.addWidget(self.runButton)
self.mainLayout.addLayout(self.topLayout)

self.mainLayout.addStretch(1)

Expand Down

0 comments on commit 58b5e0c

Please sign in to comment.