From 23d5bfc501816cccfd65fcd73db2d863ac7b042d Mon Sep 17 00:00:00 2001 From: Etoh Date: Sat, 18 May 2013 21:29:53 +0200 Subject: [PATCH] Recall playerPath in GuiConfiguration --- syncplay/ui/GuiConfiguration.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index 453b1ff..64fe2cc 100644 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -51,9 +51,13 @@ class GuiConfiguration: self.userEntry = self._addLabeledEntryToVbox(getMessage("en", "username-label"), config['name'], vbox, lambda __, _: self._saveDataAndLeave()) self.roomEntry = self._addLabeledEntryToVbox(getMessage("en", "room-label"), config['room'], vbox, lambda __, _: self._saveDataAndLeave()) self.passEntry = self._addLabeledEntryToVbox(getMessage("en", "password-label"), config['password'], vbox, lambda __, _: self._saveDataAndLeave()) - self.mpcEntry = self._addLabeledEntryToVbox(getMessage("en", "path-label"), self._tryToFillPlayerPath(), vbox, lambda __, _: self._saveDataAndLeave()) + self.mpcEntry = self._addLabeledEntryToVbox(getMessage("en", "path-label"), self._tryToFillPlayerPath(config['playerPath']), vbox, lambda __, _: self._saveDataAndLeave()) + + + def _tryToFillPlayerPath(self, playerpath): + if os.path.isfile(playerpath): + return playerpath - def _tryToFillPlayerPath(self): for path in self._availablePlayerPaths: if(os.path.isfile(path)): return path