Commit dac69143 authored by Robert Loehning's avatar Robert Loehning Committed by Robert Löhning
Browse files

Squish: Added helper function for opening files



Change-Id: I756822299e591010eb926ee46600f4b5231d9318
Reviewed-by: default avatarBill King <bill.king@nokia.com>
Reviewed-by: default avatarChristian Stenger <christian.stenger@nokia.com>
parent b82475b0
......@@ -11,38 +11,14 @@ def __handleProcessExited__(object, exitCode):
def openQmakeProject(projectPath):
invokeMenuItem("File", "Open File or Project...")
if platform.system()=="Darwin":
snooze(1)
nativeType("<Command+Shift+g>")
snooze(1)
nativeType(projectPath)
snooze(1)
nativeType("<Return>")
snooze(2)
nativeType("<Return>")
else:
waitForObject("{name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}")
type(findObject("{name='fileNameEdit' type='QLineEdit'}"), projectPath)
clickButton(findObject("{text='Open' type='QPushButton'}"))
selectFromFileDialog(projectPath)
waitForObject("{type='Qt4ProjectManager::Internal::ProjectLoadWizard' visible='1' windowTitle='Project Setup'}")
selectFromCombo(":scrollArea.Create Build Configurations:_QComboBox", "For Each Qt Version One Debug And One Release")
clickButton(waitForObject("{text~='(Finish|Done)' type='QPushButton'}"))
def openCmakeProject(projectPath):
invokeMenuItem("File", "Open File or Project...")
if platform.system()=="Darwin":
snooze(1)
nativeType("<Command+Shift+g>")
snooze(1)
nativeType(projectPath)
snooze(1)
nativeType("<Return>")
snooze(2)
nativeType("<Return>")
else:
waitForObject("{name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}")
type(findObject("{name='fileNameEdit' type='QLineEdit'}"), projectPath)
clickButton(findObject("{text='Open' type='QPushButton'}"))
selectFromFileDialog(projectPath)
clickButton(waitForObject(":CMake Wizard.Next_QPushButton", 20000))
generatorCombo = waitForObject(":Generator:_QComboBox")
index = generatorCombo.findText("MinGW Generator (MinGW from SDK)")
......
......@@ -184,10 +184,25 @@ def getOutputFromCmdline(cmdline):
versCall.stdout.close()
return result
def selectFromFileDialog(fileName):
if platform.system() == "Darwin":
snooze(1)
nativeType("<Command+Shift+g>")
snooze(1)
nativeType(fileName)
snooze(1)
nativeType("<Return>")
snooze(2)
nativeType("<Return>")
else:
waitForObject("{name='QFileDialog' type='QFileDialog' visible='1'}")
pathLine = waitForObject("{name='fileNameEdit' type='QLineEdit' visible='1'}")
replaceEditorContent(pathLine, os.path.abspath(fileName))
clickButton(findObject("{text='Open' type='QPushButton'}"))
# add qt.qch from SDK path
def addHelpDocumentationFromSDK():
global sdkPath
doc = "%s/Documentation/qt.qch" % sdkPath
invokeMenuItem("Tools", "Options...")
waitForObjectItem(":Options_QListView", "Help")
clickItem(":Options_QListView", "Help", 14, 15, 0, Qt.LeftButton)
......@@ -200,17 +215,5 @@ def addHelpDocumentationFromSDK():
mouseClick(listWidget, rect.x+5, rect.y+5, 0, Qt.LeftButton)
mouseClick(waitForObject("{type='QPushButton' name='removeButton' visible='1'}"), 5, 5, 0, Qt.LeftButton)
clickButton(waitForObject("{type='QPushButton' name='addButton' visible='1' text='Add...'}"))
if platform.system() == "Darwin":
snooze(1)
nativeType("<Command+Shift+g>")
snooze(1)
nativeType(doc)
snooze(1)
nativeType("<Return>")
snooze(2)
nativeType("<Return>")
else:
pathLine = waitForObject("{name='fileNameEdit' type='QLineEdit' visible='1'}")
replaceEditorContent(pathLine, os.path.abspath(doc))
type(pathLine, "<Return>")
selectFromFileDialog("%s/Documentation/qt.qch" % sdkPath)
clickButton(waitForObject(":Options.OK_QPushButton"))
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