diff --git a/doc/src/overview/creator-supported-platforms.qdoc b/doc/src/overview/creator-supported-platforms.qdoc index 800ba9ec266..13d53cb2640 100644 --- a/doc/src/overview/creator-supported-platforms.qdoc +++ b/doc/src/overview/creator-supported-platforms.qdoc @@ -49,7 +49,7 @@ \o Windows Vista - \o (K)Ubuntu Linux 8.04 (32-bit and 64-bit) or later, with the + \o (K)Ubuntu Linux 10.04 (32-bit and 64-bit) or later, with the following: \list diff --git a/src/app/main.cpp b/src/app/main.cpp index d22cccd51ee..4b1a327f0c5 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -283,7 +283,8 @@ int main(int argc, char **argv) uiLanguages.prepend(overrideLanguage); const QString &creatorTrPath = QCoreApplication::applicationDirPath() + QLatin1String(SHARE_PATH "/translations"); - foreach (const QString &locale, uiLanguages) { + foreach (QString locale, uiLanguages) { + locale.replace(QLatin1Char('-'), QLatin1Char('_')); // work around QTBUG-25973 if (translator.load(QLatin1String("qtcreator_") + locale, creatorTrPath)) { const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath); const QString &qtTrFile = QLatin1String("qt_") + locale; diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index b3d0a4b4691..c62b6a072ba 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -237,9 +237,7 @@ MainWindow::MainWindow() : #endif m_autoSaveSessionTimer = new QTimer(this); - m_autoSaveSessionTimer->setSingleShot(true); m_autoSaveSessionTimer->setInterval(10000); - m_autoSaveSessionTimer->start(); connect(m_autoSaveSessionTimer, SIGNAL(timeout()), m_coreImpl, SIGNAL(saveSettingsRequested())); } @@ -383,6 +381,7 @@ void MainWindow::extensionsInitialized() emit m_coreImpl->coreAboutToOpen(); show(); emit m_coreImpl->coreOpened(); + m_autoSaveSessionTimer->start(); } void MainWindow::closeEvent(QCloseEvent *event) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 8ae852501d0..8342836d8f9 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1260,13 +1260,15 @@ void ProjectExplorerPlugin::savePersistentSettings() if (d->m_shuttingDown) return; - foreach (Project *pro, d->m_session->projects()) - pro->saveSettings(); + if (!d->m_session->loadingSession()) { + foreach (Project *pro, d->m_session->projects()) + pro->saveSettings(); - if (d->m_session->isDefaultVirgin()) { - // do not save new virgin default sessions - } else { - d->m_session->save(); + if (d->m_session->isDefaultVirgin()) { + // do not save new virgin default sessions + } else { + d->m_session->save(); + } } QSettings *s = Core::ICore::settings(); @@ -1520,7 +1522,6 @@ void ProjectExplorerPlugin::restoreSession() Core::ICore::openFiles(combinedList, Core::ICore::OpenFilesFlags(Core::ICore::CanContainLineNumbers | Core::ICore::SwitchMode)); updateActions(); - } void ProjectExplorerPlugin::loadSession(const QString &session) diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 2127c90e149..8180416e95e 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -93,6 +93,7 @@ SessionManager::SessionManager(QObject *parent) m_sessionNode(new SessionNode(this)), m_sessionName(QLatin1String("default")), m_virginSession(true), + m_loadingSession(false), m_startupProject(0) { connect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)), @@ -294,6 +295,11 @@ void SessionManager::removeProject(Project *project) removeProjects(QList() << project); } +bool SessionManager::loadingSession() +{ + return m_loadingSession; +} + bool SessionManager::save() { if (debug) @@ -818,17 +824,23 @@ bool SessionManager::loadSession(const QString &session) } } + m_loadingSession = true; + // Allow everyone to set something in the session and before saving emit aboutToUnloadSession(m_sessionName); if (!isDefaultVirgin()) { - if (!save()) + if (!save()) { + m_loadingSession = false; return false; + } } // Clean up - if (!ICore::editorManager()->closeAllEditors()) + if (!ICore::editorManager()->closeAllEditors()) { + m_loadingSession = false; return false; + } setStartupProject(0); removeProjects(projects()); @@ -883,6 +895,7 @@ bool SessionManager::loadSession(const QString &session) // Starts a event loop, better do that at the very end askUserAboutFailedProjects(); + m_loadingSession = false; return true; } diff --git a/src/plugins/projectexplorer/session.h b/src/plugins/projectexplorer/session.h index d238080bde9..01c409c1cf4 100644 --- a/src/plugins/projectexplorer/session.h +++ b/src/plugins/projectexplorer/session.h @@ -123,6 +123,7 @@ public: QStringList projectsForSessionName(const QString &session) const; void reportProjectLoadingProgress(); + bool loadingSession(); signals: void projectAdded(ProjectExplorer::Project *project); void singleProjectAdded(ProjectExplorer::Project *project); @@ -169,6 +170,7 @@ private: mutable QStringList m_sessions; mutable QHash m_projectFileCache; + bool m_loadingSession; Project *m_startupProject; QList m_projects; diff --git a/tests/system/objects.map b/tests/system/objects.map index 2d613c1cd89..0dca5136ed9 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -1,10 +1,7 @@ -:*Qt Creator.Build Project_Core::Internal::FancyToolButton {text='Build Project' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Continue_Core::Internal::FancyToolButton {text='Continue' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Interrupt_Core::Internal::FancyToolButton {text='Interrupt' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:*Qt Creator.Run_Core::Internal::FancyToolButton {text='Run' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Start Debugging_Core::Internal::FancyToolButton {text='Start Debugging' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.findEdit_Utils::FilterLineEdit {name='findEdit' type='Utils::FilterLineEdit' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:*Qt Creator.qt_tabwidget_stackedwidget_QStackedWidget {name='qt_tabwidget_stackedwidget' type='QStackedWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator_Core::Internal::FancyToolButton {occurrence='3' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator_Utils::FilterLineEdit {type='Utils::FilterLineEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator_Utils::IconButton {occurrence='4' type='Utils::IconButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} @@ -49,12 +46,10 @@ :Qt Creator_CppEditor::Internal::CPPEditorWidget {type='CppEditor::Internal::CPPEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_QTableView {type='QTableView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_SearchResult_Core::Internal::OutputPaneToggleButton {occurrence='2' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator_Utils::IconButton {occurrence='2' type='Utils::IconButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Utils::NavigationTreeView {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Gui Application.Form file:_QLabel {name='formLabel' text='Form file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'} :Qt Gui Application.Header file:_QLabel {name='headerLabel' text='Header file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'} :Qt Gui Application.Source file:_QLabel {name='sourceLabel' text='Source file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'} -:Qt Gui Application.frame_QFrame {name='frame' type='QFrame' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'} :Qt Gui Application.scrollArea_QScrollArea {name='scrollArea' type='QScrollArea' visible='1'} :Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog {type='Qt4ProjectManager::Internal::GuiAppWizardDialog' unnamed='1' visible='1' windowTitle='Qt Gui Application'} :QtCreator.MenuBar_ProjectExplorer::Internal::MiniProjectTargetSelector {type='ProjectExplorer::Internal::MiniProjectTargetSelector'} diff --git a/tests/system/settings/unix/Nokia/qtversion.xml b/tests/system/settings/unix/Nokia/qtversion.xml index b565bd54aee..aa0a6f47d62 100644 --- a/tests/system/settings/unix/Nokia/qtversion.xml +++ b/tests/system/settings/unix/Nokia/qtversion.xml @@ -5,7 +5,7 @@ QtVersion.0 - 4 + 3 Qt for Fremantle PR1.3 Devices (Qt SDK) ~/QtSDK/Maemo/4.6.2/targets/fremantle-pr13/bin/qmake Qt4ProjectManager.QtVersion.Maemo @@ -15,7 +15,7 @@ QtVersion.1 - 5 + 4 Desktop Qt 4.7.4 for GCC (Qt SDK) ~/QtSDK/Desktop/Qt/474/gcc/bin/qmake Qt4ProjectManager.QtVersion.Desktop @@ -25,7 +25,7 @@ QtVersion.2 - 6 + 5 Simulator Qt for GCC (Qt SDK) ~/QtSDK/Simulator/Qt/gcc/bin/qmake Qt4ProjectManager.QtVersion.Simulator @@ -34,16 +34,6 @@ QtVersion.3 - - 8 - 4.7.0 - /usr/bin/qmake - Qt4ProjectManager.QtVersion.Desktop - false - - - - QtVersion.4 1 Harmattan Target (Qt SDK) @@ -53,7 +43,7 @@ - QtVersion.5 + QtVersion.4 2 Desktop Qt 4.8 for GCC (Qt SDK) @@ -64,7 +54,7 @@ QtVersion.Count - 6 + 5 Version diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index c11597dbf25..698105f5746 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -31,7 +31,7 @@ def ensureChecked(objectName, shouldBeChecked = True): else: state = "unchecked" test.log("New state for QCheckBox: %s" % state) - test.verify(object.checked == shouldBeChecked) + test.verify(waitFor("object.checked == shouldBeChecked", 1000)) return object # verify that an object is in an expected enable state. Returns the object. @@ -198,8 +198,10 @@ def logApplicationOutput(): try: output = waitForObject("{type='Core::OutputWindow' visible='1' windowTitle='Application Output Window'}", 20000) test.log("Application Output:\n%s" % output.plainText) + return str(output.plainText) except: test.fail("Could not find any Application Output - did the project run?") + return None # get the output from a given cmdline call def getOutputFromCmdline(cmdline): diff --git a/tests/system/suite_APTW/envvars b/tests/system/suite_APTW/envvars new file mode 100644 index 00000000000..00aad3eab7d --- /dev/null +++ b/tests/system/suite_APTW/envvars @@ -0,0 +1 @@ +QT_PLATFORM_PLUGIN=nonesuch diff --git a/tests/system/suite_APTW/objects.map b/tests/system/suite_APTW/objects.map new file mode 100644 index 00000000000..4ea1ec9a5c9 --- /dev/null +++ b/tests/system/suite_APTW/objects.map @@ -0,0 +1,24 @@ +:*Qt Creator.Clear_QToolButton {text='Clear' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Next_QPushButton {text~='(Next.*|Continue)' type='QPushButton' visible='1'} +:Options.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Options_Core::Internal::SettingsDialog'} +:Qt Creator.Compile Output_Core::OutputWindow {type='Core::OutputWindow' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Compile Output'} +:Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator.ReRun_QToolButton {toolTip='Re-run this run-configuration' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator.Stop_QToolButton {text='Stop' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator.scrollArea_QScrollArea {name='scrollArea' type='QScrollArea' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton {occurrence='3' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator_Core::Internal::MainWindow {type='Core::Internal::MainWindow' unnamed='1' visible='1' windowTitle?='*Qt Creator'} +:Qt Gui Application.Form file:_QLabel {name='formLabel' text='Form file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'} +:Qt Gui Application.Header file:_QLabel {name='headerLabel' text='Header file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'} +:Qt Gui Application.Source file:_QLabel {name='sourceLabel' text='Source file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'} +:Qt Gui Application.scrollArea_QScrollArea {name='scrollArea' type='QScrollArea' visible='1'} +:Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog {type='Qt4ProjectManager::Internal::GuiAppWizardDialog' unnamed='1' visible='1' windowTitle='Qt Gui Application'} +:addToVersionControlComboBox_QComboBox {name='addToVersionControlComboBox' type='QComboBox' visible='1'} +:formFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Form file:_QLabel' name='formFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'} +:headerFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Header file:_QLabel' name='headerFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'} +:scrollArea.Create Build Configurations:_QComboBox_2 {container=':Qt Gui Application.scrollArea_QScrollArea' leftWidget=':scrollArea.Create Build Configurations:_QLabel_2' type='QComboBox' unnamed='1' visible='1'} +:scrollArea.Create Build Configurations:_QLabel_2 {container=':Qt Gui Application.scrollArea_QScrollArea' text='Create build configurations:' type='QLabel' unnamed='1' visible='1'} +:scrollArea.Edit build configuration:_QComboBox {container=':Qt Creator.scrollArea_QScrollArea' leftWidget=':scrollArea.Edit build configuration:_QLabel' type='QComboBox' unnamed='1' visible='1'} +:scrollArea.Edit build configuration:_QLabel {container=':Qt Creator.scrollArea_QScrollArea' text='Edit build configuration:' type='QLabel' unnamed='1' visible='1'} +:scrollArea.Use Shadow Building_QCheckBox {container=':Qt Gui Application.scrollArea_QScrollArea' text='Shadow build' type='QCheckBox' unnamed='1' visible='1'} +:sourceFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Source file:_QLabel' name='sourceFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'} diff --git a/tests/system/suite_APTW/shared/aptw.py b/tests/system/suite_APTW/shared/aptw.py new file mode 100755 index 00000000000..eed8dd7e94c --- /dev/null +++ b/tests/system/suite_APTW/shared/aptw.py @@ -0,0 +1,29 @@ +# shared script for APTW suite +# helping to run and close app +# verification + +# verify if building and running of project was successful +def verifyBuildAndRun(): + # check compile output if build successful + checkCompile() + # check application output log + appOutput = logApplicationOutput() + if appOutput: + test.verify(re.search(".*([Pp]rogram).*(unexpectedly).*([Ff]inished).*", str(appOutput)) and + re.search('[Ss]tarting.*', str(appOutput)), + "Verifying if built app started and closed successfully.") + +# pick version 4.7.4 and then run project for debug and release +def pickVersion474runVerify(): + availableConfigs = iterateBuildConfigs(1, 0, ".*4.7.4.*") + if not availableConfigs: + test.fatal("Haven't found needed Qt version (Qt 4.7.4), quitting") + invokeMenuItem("File", "Save All") + invokeMenuItem("File", "Exit") + # select debug configuration + for config in availableConfigs: + selectBuildConfig(1, 0, config) + test.log("Using build config '%s'" % config) + runAndCloseApp() + verifyBuildAndRun() + mouseClick(waitForObject(":*Qt Creator.Clear_QToolButton")) diff --git a/tests/system/suite_APTW/suite.conf b/tests/system/suite_APTW/suite.conf new file mode 100644 index 00000000000..961a3700f63 --- /dev/null +++ b/tests/system/suite_APTW/suite.conf @@ -0,0 +1,10 @@ +AUT=qtcreator +CLASS= +CLASSPATH= +ENVVARS=envvars +HOOK_SUB_PROCESSES=false +IMPLICITAUTSTART=0 +LANGUAGE=Python +TEST_CASES=tst_APTW01 tst_APTW02 +VERSION=2 +WRAPPERS=Qt diff --git a/tests/system/suite_APTW/tst_APTW01/test.py b/tests/system/suite_APTW/tst_APTW01/test.py new file mode 100644 index 00000000000..f569699e314 --- /dev/null +++ b/tests/system/suite_APTW/tst_APTW01/test.py @@ -0,0 +1,13 @@ +source("../../shared/qtcreator.py") +source("../../shared/suites_qtta.py") +source("../shared/aptw.py") + +# test New Qt Gui Application build and run for release and debug option +def main(): + startApplication("qtcreator" + SettingsPath) + createProject_Qt_GUI(tempDir(), "SampleApp") + # pick version 4.7.4 and then run project for debug and release and verify results + pickVersion474runVerify() + #close Qt creator + invokeMenuItem("File", "Exit") +#no cleanup needed diff --git a/tests/system/suite_APTW/tst_APTW02/test.py b/tests/system/suite_APTW/tst_APTW02/test.py new file mode 100644 index 00000000000..d9711ba590b --- /dev/null +++ b/tests/system/suite_APTW/tst_APTW02/test.py @@ -0,0 +1,14 @@ +source("../../shared/qtcreator.py") +source("../../shared/suites_qtta.py") +source("../shared/aptw.py") + +# test New Qt Quick Application build and run for release and debug option +def main(): + startApplication("qtcreator" + SettingsPath) + createNewQtQuickApplication(tempDir(), "SampleApp") + waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)") + # pick version 4.7.4 and then run project for debug and release and verify results + pickVersion474runVerify() + #close Qt creator + invokeMenuItem("File", "Exit") +#no cleanup needed diff --git a/tests/system/suite_general/tst_select_all/test.py b/tests/system/suite_general/tst_select_all/test.py index be6ddf92aba..fda92a3ccfe 100644 --- a/tests/system/suite_general/tst_select_all/test.py +++ b/tests/system/suite_general/tst_select_all/test.py @@ -35,7 +35,7 @@ def main(): test.compare(editor.textCursor().selectionStart(), 0) test.compare(editor.textCursor().selectionEnd(), size) test.compare(editor.textCursor().position(), size) - test.log("Pressing key %s" % key) + test.log("Pressing key: %s" % key.replace("<", "").replace(">", "")) type(editor, key) if key == "": test.compare(editor.textCursor().selectionStart(), editor.textCursor().selectionEnd()) @@ -43,7 +43,7 @@ def main(): pos = size if key == "": pos -= 1 - if platform.system() != 'Darwin' and JIRA.isBugStillOpen(7215, JIRA.Bug.CREATOR): + if JIRA.isBugStillOpen(7215, JIRA.Bug.CREATOR): test.warning("Using workaround for %s-%d" % (JIRA.Bug.CREATOR, 7215)) pos = 0 test.compare(editor.textCursor().selectionStart(), pos)