Squish: Simplify __createProjectHandleQtQuickSelection__()

Change-Id: I02f76a90aa6a464f36d84dcc70698639a74d7f86
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
Robert Loehning
2014-05-15 13:43:57 +02:00
parent 79ed722724
commit 20c0dcfe1d
3 changed files with 16 additions and 23 deletions
+10 -20
View File
@@ -133,25 +133,15 @@ def __createProjectSetNameAndPath__(path, projectName = None, checks = True, lib
clickButton(waitForObject(":Next_QPushButton"))
return str(projectName)
def __createProjectHandleQtQuickSelection__(qtQuickVersion, controlsVersion):
def __createProjectHandleQtQuickSelection__(qtQuickOrControlsVersion):
comboBox = waitForObject("{type='QComboBox' unnamed='1' visible='1' "
"leftWidget={text='Qt Quick component set:' type='QLabel' unnamed='1' "
"visible='1'}}")
if qtQuickVersion == "1.1":
selectFromCombo(comboBox, "Qt Quick 1.1")
if controlsVersion:
test.warning("Controls are not available for Quick 1.")
elif qtQuickVersion[:2] == "2.":
if controlsVersion:
if controlsVersion in ("1.0", "1.1"):
selectFromCombo(comboBox, "Qt Quick Controls %s" % controlsVersion)
else:
test.fatal("Got unknown Qt Quick Controls version: %s - trying to continue."
% str(controlsVersion))
else:
selectFromCombo(comboBox, "Qt Quick %s" % qtQuickVersion)
else:
test.fatal("Got unknown Qt Quick version: %s - trying to continue." % str(qtQuickVersion))
try:
selectFromCombo(comboBox, "Qt Quick %s" % qtQuickOrControlsVersion)
except:
t,v = sys.exc_info()[:2]
test.fatal("Exception while trying to select Qt Quick version", "%s (%s)" % (str(t), str(v)))
label = waitForObject("{type='QLabel' unnamed='1' visible='1' text?='Creates a *' }")
requires = re.match(".*Requires Qt (\d\.\d).*", str(label.text))
if requires:
@@ -285,10 +275,10 @@ def createProject_Qt_Console(path, projectName, checks = True):
def createNewQtQuickApplication(workingDir, projectName = None,
targets=Targets.desktopTargetClasses(), qtQuickVersion="1.1",
fromWelcome=False, controlsVersion=None):
fromWelcome=False):
available = __createProjectOrFileSelectType__(" Applications", "Qt Quick Application", fromWelcome)
projectName = __createProjectSetNameAndPath__(workingDir, projectName)
requiredQt = __createProjectHandleQtQuickSelection__(qtQuickVersion, controlsVersion)
requiredQt = __createProjectHandleQtQuickSelection__(qtQuickVersion)
__modifyAvailableTargets__(available, requiredQt)
checkedTargets = __chooseTargets__(targets, available)
snooze(1)
@@ -298,12 +288,12 @@ def createNewQtQuickApplication(workingDir, projectName = None,
progressBarWait(10000)
return checkedTargets, projectName
def createNewQtQuickUI(workingDir, qtQuickVersion="1.1", controlsVersion=None):
def createNewQtQuickUI(workingDir, qtQuickVersion="1.1"):
__createProjectOrFileSelectType__(" Applications", "Qt Quick UI")
if workingDir == None:
workingDir = tempDir()
projectName = __createProjectSetNameAndPath__(workingDir)
__createProjectHandleQtQuickSelection__(qtQuickVersion, controlsVersion)
__createProjectHandleQtQuickSelection__(qtQuickVersion)
__createProjectHandleLastPage__()
return projectName