Commit 20c0dcfe authored by Robert Loehning's avatar Robert Loehning

Squish: Simplify __createProjectHandleQtQuickSelection__()

Change-Id: I02f76a90aa6a464f36d84dcc70698639a74d7f86
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 79ed7227
......@@ -144,7 +144,10 @@ class SubprocessType:
if subprocessType == SubprocessType.QT_WIDGET:
return "QMainWindow"
if subprocessType == SubprocessType.QT_QUICK_APPLICATION:
return "QtQuick%sApplicationViewer" % qtQuickVersion[0]
qqv = "2"
if qtQuickVersion[0] == "1":
qqv = "1"
return "QtQuick%sApplicationViewer" % qqv
if subprocessType == SubprocessType.QT_QUICK_UI:
if qtQuickVersion == "1.1":
return "QDeclarativeViewer"
......
......@@ -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
......
......@@ -33,7 +33,7 @@ import re
def main():
global tmpSettingsDir
quickCombinations = [["1.1",None], ["2.1",None], ["2.2",None], ["2.1","1.0"], ["2.2","1.1"]]
quickCombinations = ["1.1", "2.1", "2.2", "Controls 1.0", "Controls 1.1"]
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
......@@ -73,7 +73,7 @@ def main():
displayedPlatforms = __createProject__(category, template)
if template == "Qt Quick Application":
for counter, qComb in enumerate(quickCombinations):
requiredQtVersion = __createProjectHandleQtQuickSelection__(qComb[0], qComb[1])
requiredQtVersion = __createProjectHandleQtQuickSelection__(qComb)
__modifyAvailableTargets__(displayedPlatforms, requiredQtVersion, True)
verifyKitCheckboxes(kits, displayedPlatforms)
# FIXME: if QTBUG-35203 is fixed replace by triggering the shortcut for Back
......
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