mirror of
https://github.com/Syncplay/syncplay
synced 2025-02-03 12:41:44 +00:00
commit
98fac4ac0f
@ -31,6 +31,7 @@ class ConfigurationGetter(object):
|
||||
"file": None,
|
||||
"playerArgs": [],
|
||||
"playerClass": None,
|
||||
"slowOnDesync": True
|
||||
}
|
||||
|
||||
#
|
||||
|
@ -20,9 +20,13 @@ class GuiConfiguration:
|
||||
self.window.add(vbox)
|
||||
vbox.show()
|
||||
self._addLabeledEntries(self.config, vbox)
|
||||
self._addCheckboxEntries(self.config, vbox)
|
||||
self.hostEntry.select_region(0, len(self.hostEntry.get_text()))
|
||||
button = gtk.Button(stock=gtk.STOCK_SAVE)
|
||||
button.connect("clicked", lambda w: self._saveDataAndLeave())
|
||||
guideLink = gtk.LinkButton("http://syncplay.pl/guide/", "Configuration Guide")
|
||||
guideLink.show()
|
||||
vbox.add(guideLink)
|
||||
vbox.pack_start(button, True, True, 0)
|
||||
button.set_flags(gtk.CAN_DEFAULT)
|
||||
button.grab_default()
|
||||
@ -66,6 +70,18 @@ class GuiConfiguration:
|
||||
self.config['room'] = self.roomEntry.get_text()
|
||||
self.config['password'] = self.passEntry.get_text()
|
||||
self.config['playerPath'] = self.mpcEntry.get_text()
|
||||
if self.alwaysShowCheck.get_active() == True:
|
||||
self.config['noGui'] = True
|
||||
else:
|
||||
self.config['noGui'] = False
|
||||
if self.storeConfigCheck.get_active() == True:
|
||||
self.config['noStore'] = True
|
||||
else:
|
||||
self.config['noStore'] = False
|
||||
if self.slowOnDesyncCheck.get_active() == True:
|
||||
self.config['slowOnDesync'] = True
|
||||
else:
|
||||
self.config['slowOnDesync'] = False
|
||||
self.window.destroy()
|
||||
gtk.main_quit()
|
||||
|
||||
@ -87,17 +103,30 @@ class GuiConfiguration:
|
||||
hbox.pack_end(entry, False, False, 0)
|
||||
entry.set_usize(200, -1)
|
||||
entry.show()
|
||||
hbox = gtk.HBox(False, 0)
|
||||
vbox.add(hbox)
|
||||
hbox.show()
|
||||
return entry
|
||||
|
||||
def _addCheckboxEntries(self, config, vbox):
|
||||
CheckVbox = gtk.VBox(False, 0)
|
||||
vbox.pack_start(CheckVbox, False, False, 0)
|
||||
self.alwaysShowCheck = gtk.CheckButton("Always Show This Dialog")
|
||||
if self.config['noGui'] == True:
|
||||
self.alwaysShowCheck.set_active(True)
|
||||
self.alwaysShowCheck.show()
|
||||
self.storeConfigCheck = gtk.CheckButton("Do Not Store This Configuration")
|
||||
if self.config['noStore'] == True:
|
||||
self.storeConfigCheck.set_active(True)
|
||||
self.storeConfigCheck.show()
|
||||
self.slowOnDesyncCheck = gtk.CheckButton("Slow Down On Desync")
|
||||
if self.config['slowOnDesync'] == True:
|
||||
self.slowOnDesyncCheck.set_active(True)
|
||||
self.slowOnDesyncCheck.show()
|
||||
CheckVbox.pack_start(self.alwaysShowCheck, False, False, 0)
|
||||
CheckVbox.add(self.storeConfigCheck)
|
||||
CheckVbox.add(self.slowOnDesyncCheck)
|
||||
CheckVbox.show()
|
||||
|
||||
def setAvailablePaths(self, paths):
|
||||
self._availablePlayerPaths = paths
|
||||
|
||||
class WindowClosed(Exception):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user