Commit 646dcf0e authored by Robert Loehning's avatar Robert Loehning

Squish: Hack when "Open File" dialog can't be found

Happens to me with binary packages for Linux.

Change-Id: I688103ba2df26056468e89271e815b5717effeee
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 2b02c006
...@@ -252,15 +252,21 @@ def selectFromFileDialog(fileName, waitForFile=False): ...@@ -252,15 +252,21 @@ def selectFromFileDialog(fileName, waitForFile=False):
else: else:
fName = os.path.basename(os.path.abspath(fileName)) fName = os.path.basename(os.path.abspath(fileName))
pName = os.path.dirname(os.path.abspath(fileName)) + os.sep pName = os.path.dirname(os.path.abspath(fileName)) + os.sep
waitForObject("{name='QFileDialog' type='QFileDialog' visible='1'}") try:
pathLine = waitForObject("{name='fileNameEdit' type='QLineEdit' visible='1'}") waitForObject("{name='QFileDialog' type='QFileDialog' visible='1'}", 5000)
snooze(1) pathLine = waitForObject("{name='fileNameEdit' type='QLineEdit' visible='1'}")
replaceEditorContent(pathLine, pName) snooze(1)
clickButton(waitForObject("{text='Open' type='QPushButton'}")) replaceEditorContent(pathLine, pName)
waitFor("str(pathLine.text)==''") clickButton(waitForObject("{text='Open' type='QPushButton'}"))
snooze(1) waitFor("str(pathLine.text)==''")
replaceEditorContent(pathLine, fName) snooze(1)
clickButton(waitForObject("{text='Open' type='QPushButton'}")) replaceEditorContent(pathLine, fName)
clickButton(waitForObject("{text='Open' type='QPushButton'}"))
except:
nativeType(pName + fName)
snooze(1)
nativeType("<Return>")
snooze(3)
if waitForFile: if waitForFile:
fileCombo = waitForObject(":Qt Creator_FilenameQComboBox") fileCombo = waitForObject(":Qt Creator_FilenameQComboBox")
if not waitFor("str(fileCombo.currentText) in fileName", 5000): if not waitFor("str(fileCombo.currentText) in fileName", 5000):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment