Skip to content

Commit

Permalink
Only show per-player args when "show more settings" is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Et0h committed Aug 27, 2015
1 parent 411808b commit 605c10b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions syncplay/ui/GuiConfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,29 @@ def automaticUpdatePromptCheck(self):
self.automaticupdatesCheckbox.setChecked(False)

def moreToggled(self):
self.setSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
if self.moreToggling == False:
self.moreToggling = True

if self.showmoreCheckbox.isChecked():
self.tabListFrame.show()
self.resetButton.show()
self.nostoreCheckbox.show()
self.playerargsTextbox.show()
self.playerargsLabel.show()
self.saveMoreState(True)
self.tabListWidget.setCurrentRow(0)
self.ensureTabListIsVisible()
self.stackedFrame.setFixedHeight(self.stackedFrame.minimumSizeHint().height())
else:
self.tabListFrame.hide()
self.resetButton.hide()
self.nostoreCheckbox.hide()
self.playerargsTextbox.hide()
self.playerargsLabel.hide()
self.saveMoreState(False)
self.stackedLayout.setCurrentIndex(0)

self.stackedFrame.setFixedHeight(self.connectionSettingsGroup.minimumSizeHint().height()+self.mediaplayerSettingsGroup.minimumSizeHint().height()+self.bottomButtonFrame.minimumSizeHint().height()+3)
self.adjustSize()
self.setFixedSize(self.sizeHint())
self.moreToggling = False
Expand All @@ -78,8 +84,6 @@ def runButtonTextUpdate(self):
def openHelp(self):
self.QtGui.QDesktopServices.openUrl(QUrl("http://syncplay.pl/guide/client/"))



def safenormcaseandpath(self, path):
if utils.isURL(path):
return path
Expand Down Expand Up @@ -510,9 +514,8 @@ def addBasicTab(self):
self.basicOptionsLayout.setAlignment(Qt.AlignTop)
self.basicOptionsLayout.addWidget(self.connectionSettingsGroup)
self.basicOptionsLayout.addSpacing(5)
self.mediaplayerSettingsGroup.setMaximumHeight(self.mediaplayerSettingsGroup.minimumSizeHint().height())
self.basicOptionsLayout.addWidget(self.mediaplayerSettingsGroup)

self.basicOptionsFrame.setSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
self.basicOptionsFrame.setLayout(self.basicOptionsLayout)
self.stackedLayout.addWidget(self.basicOptionsFrame)

Expand Down Expand Up @@ -934,14 +937,17 @@ def __init__(self, config, playerpaths, error, defaultConfig):
self.mainLayout.addWidget(self.stackedFrame, 0, 1)
self.addBottomLayout()


if self.getMoreState() == False:
self.tabListFrame.hide()
self.nostoreCheckbox.hide()
self.resetButton.hide()
self.playerargsTextbox.hide()
self.playerargsLabel.hide()
self.stackedFrame.setFixedHeight(self.connectionSettingsGroup.minimumSizeHint().height()+self.mediaplayerSettingsGroup.minimumSizeHint().height()+self.bottomButtonFrame.minimumSizeHint().height()+3)
else:
self.showmoreCheckbox.setChecked(True)
self.tabListWidget.setCurrentRow(0)
self.stackedFrame.setFixedHeight(self.stackedFrame.minimumSizeHint().height())

self.showmoreCheckbox.toggled.connect(self.moreToggled)

Expand Down

0 comments on commit 605c10b

Please sign in to comment.