Skip to content

Commit 8cadce0

Browse files
dvbridgespeircej
authored andcommitted
BF: Disable Pavlovia Run when syncing.
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.
1 parent 80d11c6 commit 8cadce0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

psychopy/app/builder/builder.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,7 +2264,10 @@ def _getExportPref(self, pref):
22642264
def onPavloviaSync(self, evt=None):
22652265
if self._getExportPref('on sync'):
22662266
self.fileExport(htmlPath=self._getHtmlPath(self.filename))
2267+
2268+
self.togglePavloviaButton('pavloviaRun', 0)
22672269
pavlovia_ui.syncProject(parent=self, project=self.project)
2270+
self.togglePavloviaButton('pavloviaRun', 1)
22682271

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

2296+
def togglePavloviaButton(self, name, state):
2297+
self.toolbar.EnableTool(self.btnHandles[name].GetId(), state)
2298+
22932299
def setPavloviaUser(self, user):
22942300
# TODO: update user icon on button to user avatar
22952301
pass

0 commit comments

Comments
 (0)