
def invokeMenuItem(menu, item):
    menuObject = waitForObjectItem("{type='QMenuBar' visible='true'}", menu)
    activateItem(menuObject)
    activateItem(waitForObjectItem(menuObject, item))

def openQmakeProject(projectPath):
    invokeMenuItem("File", "Open File or Project...")
    waitForObject("{name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}")
    type(findObject("{name='fileNameEdit' type='QLineEdit'}"), projectPath)
    clickButton(findObject("{text='Open' type='QPushButton'}"))
    waitForObject("{type='Qt4ProjectManager::Internal::ProjectLoadWizard' visible='1' windowTitle='Project Setup'}")
    selectFromCombo(":scrollArea.Create Build Configurations:_QComboBox", "per Qt Version a Debug and Release")
    clickButton(findObject("{text='Finish' type='QPushButton'}"))

def openCmakeProject(projectPath):
    invokeMenuItem("File", "Open File or Project...")
    waitForObject("{name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}")
    type(findObject("{name='fileNameEdit' type='QLineEdit'}"), projectPath)
    clickButton(findObject("{text='Open' type='QPushButton'}"))
    clickButton(waitForObject(":CMake Wizard.Next_QPushButton", 20000))
    clickButton(waitForObject(":CMake Wizard.Run CMake_QPushButton", 20000))
    clickButton(waitForObject(":CMake Wizard.Finish_QPushButton", 60000))


def invokeMenuItem(menu, item):
    menuObject = waitForObjectItem("{type='QMenuBar' visible='true'}", menu)
    activateItem(menuObject)
    activateItem(waitForObjectItem(menuObject, item))

def openQmakeProject(projectPath):
    invokeMenuItem("File", "Open File or Project...")
    waitForObject("{name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}")
    type(findObject("{name='fileNameEdit' type='QLineEdit'}"), projectPath)
    clickButton(findObject("{text='Open' type='QPushButton'}"))
    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(findObject("{text='Finish' type='QPushButton'}"))

def openCmakeProject(projectPath):
    invokeMenuItem("File", "Open File or Project...")
    waitForObject("{name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}")
    type(findObject("{name='fileNameEdit' type='QLineEdit'}"), projectPath)
    clickButton(findObject("{text='Open' type='QPushButton'}"))
    clickButton(waitForObject(":CMake Wizard.Next_QPushButton", 20000))
    clickButton(waitForObject(":CMake Wizard.Run CMake_QPushButton", 20000))
    clickButton(waitForObject(":CMake Wizard.Finish_QPushButton", 60000))

Fix openQmakeProject to match new combo value.
Fix openQmakeProject to match new combo value.

Change-Id: Ice0050bf1bb7af59eb57c1e9218d96b3114f4c08
Reviewed-on: http://codereview.qt.nokia.com/4129
Reviewed-by: Qt Sanity Bot <5581206bb7e0307f0d99eb71898ae6b694149ca5@ovi.com>
Reviewed-by: Christian Stenger <accbb51712d7b9c4fb108439d01e716148e5f9e6@nokia.com>
