Skip to content

Commit

Permalink
BF: Disable Pavlovia Run when syncing.
Browse files Browse the repository at this point in the history
This fix disables Pavlovia Run when syncing because running too early caused a wx error. The choice to use 0 or 1 for toggle state was more intuitive than False or True. Happy to change if bool is preferred.
  • Loading branch information
dvbridges authored and peircej committed Feb 12, 2019
1 parent 80d11c6 commit 8cadce0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions psychopy/app/builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2264,7 +2264,10 @@ def _getExportPref(self, pref):
def onPavloviaSync(self, evt=None):
if self._getExportPref('on sync'):
self.fileExport(htmlPath=self._getHtmlPath(self.filename))

self.togglePavloviaButton('pavloviaRun', 0)
pavlovia_ui.syncProject(parent=self, project=self.project)
self.togglePavloviaButton('pavloviaRun', 1)

def onPavloviaRun(self, evt=None):
if self._getExportPref('on save'):
Expand All @@ -2290,6 +2293,9 @@ def onPavloviaRun(self, evt=None):
url = "https://pavlovia.org/run/{}/html".format(self.project.id)
wx.LaunchDefaultBrowser(url)

def togglePavloviaButton(self, name, state):
self.toolbar.EnableTool(self.btnHandles[name].GetId(), state)

def setPavloviaUser(self, user):
# TODO: update user icon on button to user avatar
pass
Expand Down

0 comments on commit 8cadce0

Please sign in to comment.