~bzoltan/kubuntu-packaging/decouple_cmake_plugin

« back to all changes in this revision

Viewing changes to tests/system/shared/project.py

  • Committer: Timo Jyrinki
  • Date: 2013-12-02 09:16:15 UTC
  • mfrom: (1.1.29)
  • Revision ID: timo.jyrinki@canonical.com-20131202091615-xbj1os1f604ber1m
New upstream release candidate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
    clickButton(waitForObject(":Next_QPushButton"))
140
140
    return str(projectName)
141
141
 
 
142
def __createProjectHandleQtQuickSelection__(qtQuickVersion, withControls):
 
143
    comboBox = waitForObject("{type='QComboBox' unnamed='1' visible='1' "
 
144
                             "leftWidget={text='Qt Quick component set:' type='QLabel' unnamed='1' "
 
145
                             "visible='1'}}")
 
146
    if qtQuickVersion == 1:
 
147
        selectFromCombo(comboBox, "Qt Quick 1.1")
 
148
        if withControls:
 
149
            test.warning("Controls are not available for Quick 1.")
 
150
    elif qtQuickVersion == 2:
 
151
        if withControls:
 
152
            selectFromCombo(comboBox, "Qt Quick Controls 1.0")
 
153
        else:
 
154
            selectFromCombo(comboBox, "Qt Quick 2.0")
 
155
    else:
 
156
        test.fatal("Got unknown Qt Quick version: %s - trying to continue." % str(qtQuickVersion))
 
157
    clickButton(waitForObject(":Next_QPushButton"))
 
158
 
142
159
# Selects the Qt versions for a project
143
160
# param checks turns tests in the function on if set to True
144
161
# param available a list holding the available targets
175
192
# param projectName is the name for the new project
176
193
# param checks turns tests in the function on if set to True
177
194
def createProject_Qt_GUI(path, projectName, checks = True):
178
 
    template = "Qt Gui Application"
 
195
    template = "Qt Widgets Application"
179
196
    available = __createProjectOrFileSelectType__("  Applications", template)
180
197
    __createProjectSetNameAndPath__(path, projectName, checks)
181
198
    checkedTargets = __selectQtVersionDesktop__(checks, available)
234
251
    __verifyFileCreation__(path, expectedFiles)
235
252
    return checkedTargets
236
253
 
237
 
def createNewQtQuickApplication(workingDir, projectName = None, templateFile = None,
 
254
def createNewQtQuickApplication(workingDir, projectName = None,
238
255
                                targets=Targets.desktopTargetClasses(), qtQuickVersion=1,
239
 
                                fromWelcome=False):
240
 
    if templateFile:
241
 
        available = __createProjectOrFileSelectType__("  Applications", "Qt Quick %d Application (from Existing QML File)"
242
 
                                                      % qtQuickVersion, fromWelcome)
243
 
    else:
244
 
        available = __createProjectOrFileSelectType__("  Applications", "Qt Quick %d Application (Built-in Types)"
245
 
                                                % qtQuickVersion, fromWelcome)
 
256
                                fromWelcome=False, withControls=False):
 
257
    available = __createProjectOrFileSelectType__("  Applications", "Qt Quick Application", fromWelcome)
246
258
    projectName = __createProjectSetNameAndPath__(workingDir, projectName)
247
 
    if templateFile:
248
 
        baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}")
249
 
        type(baseLineEd, templateFile)
250
 
        nextButton = waitForObject(":Next_QPushButton")
251
 
        clickButton(nextButton)
 
259
    __createProjectHandleQtQuickSelection__(qtQuickVersion, withControls)
252
260
    checkedTargets = __chooseTargets__(targets, available)
253
261
    snooze(1)
254
 
    nextButton = waitForObject(":Next_QPushButton")
255
 
    clickButton(nextButton)
 
262
    clickButton(waitForObject(":Next_QPushButton"))
256
263
    __createProjectHandleLastPage__()
257
264
 
258
265
    progressBarWait(10000)
259
266
    return checkedTargets, projectName
260
267
 
261
 
def createNewQtQuickUI(workingDir, qtQuickVersion=1):
262
 
    __createProjectOrFileSelectType__("  Applications", "Qt Quick %d UI" % qtQuickVersion)
 
268
def createNewQtQuickUI(workingDir, qtQuickVersion=1, withControls=False):
 
269
    __createProjectOrFileSelectType__("  Applications", "Qt Quick UI")
263
270
    if workingDir == None:
264
271
        workingDir = tempDir()
265
272
    projectName = __createProjectSetNameAndPath__(workingDir)
 
273
    __createProjectHandleQtQuickSelection__(qtQuickVersion, withControls)
266
274
    __createProjectHandleLastPage__()
267
275
    return projectName
268
276
 
322
330
# parameter target can be an OR'd value of Targets
323
331
# parameter availableTargets should be the result of __createProjectOrFileSelectType__()
324
332
#           or use None as a fallback
325
 
def __chooseTargets__(targets=Targets.DESKTOP_474_GCC, availableTargets=None,
326
 
                      isMaddeDisabled=True):
 
333
def __chooseTargets__(targets=Targets.DESKTOP_474_GCC, availableTargets=None):
327
334
    if availableTargets != None:
328
335
        available = availableTargets
329
336
    else:
333
340
        if platform.system() in ('Windows', 'Microsoft'):
334
341
            available.remove(Targets.EMBEDDED_LINUX)
335
342
            available.append(Targets.DESKTOP_480_MSVC2010)
336
 
    if isMaddeDisabled:
337
 
        for target in filter(lambda x: x in available,
338
 
                             (Targets.MAEMO5, Targets.HARMATTAN)):
339
 
            available.remove(target)
 
343
    for target in filter(lambda x: x in available,
 
344
                         (Targets.MAEMO5, Targets.HARMATTAN)):
 
345
        available.remove(target)
340
346
    checkedTargets = []
341
347
    for current in available:
342
348
        mustCheck = targets & current == current
445
451
            # assuming we're still on the build settings of the current project (TODO)
446
452
            switchViewTo(ViewConstants.PROJECTS)
447
453
            if sType == SubprocessType.QT_QUICK_UI:
448
 
                selectConfig = "QML Viewer"
 
454
                if "qmlscene" in executable:
 
455
                    selectConfig = "QML Scene"
 
456
                else:
 
457
                    selectConfig = "QML Viewer"
449
458
            else:
450
459
                selectConfig = executable
451
460
            selectFromCombo(waitForObject("{buddy={text='Run configuration:' type='QLabel' "