forked from qt-creator/qt-creator
New QmlDesigner plugin & Design mode
This adds a new "Design" mode that can be used to manipulate qml files in a visual way. It will only get build if you have the declarativeui module in Qt. This is a squashed import from the Bauhaus project. Share & enjoy :)
This commit is contained in:
@@ -33,7 +33,10 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/session.h>
|
||||
|
||||
#include <QtDebug>
|
||||
|
||||
@@ -60,10 +63,23 @@ QString Manager::mimeType() const
|
||||
|
||||
ProjectExplorer::Project *Manager::openProject(const QString &fileName)
|
||||
{
|
||||
Core::MessageManager *messageManager = Core::ICore::instance()->messageManager();
|
||||
messageManager->displayStatusBarMessage(tr("Loading project %1 ...").arg(fileName), 50000);
|
||||
|
||||
QFileInfo fileInfo(fileName);
|
||||
ProjectExplorer::ProjectExplorerPlugin *projectExplorer = ProjectExplorer::ProjectExplorerPlugin::instance();
|
||||
|
||||
foreach (ProjectExplorer::Project *pi, projectExplorer->session()->projects()) {
|
||||
if (fileName == pi->file()->fileName()) {
|
||||
messageManager->printToOutputPane(tr("Failed opening project '%1': Project already open").arg(QDir::toNativeSeparators(fileName)));
|
||||
messageManager->displayStatusBarMessage(tr("Failed opening project"), 5000);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (fileInfo.isFile()) {
|
||||
QmlProject *project = new QmlProject(this, fileName);
|
||||
messageManager->displayStatusBarMessage(tr("Done opening project"), 5000);
|
||||
return project;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ void QmlTaskManager::setTaskWindow(ProjectExplorer::TaskWindow *taskWindow)
|
||||
|
||||
void QmlTaskManager::documentUpdated(QmlEditor::QmlDocument::Ptr doc)
|
||||
{
|
||||
#if 0 // This will give way too many flickering errors in the build-results pane *when you're typing*
|
||||
m_taskWindow->clearTasks(Constants::TASK_CATEGORY_QML);
|
||||
|
||||
foreach (const QmlJS::DiagnosticMessage &msg, doc->diagnosticMessages()) {
|
||||
@@ -61,6 +62,7 @@ void QmlTaskManager::documentUpdated(QmlEditor::QmlDocument::Ptr doc)
|
||||
Constants::TASK_CATEGORY_QML);
|
||||
m_taskWindow->addTask(task);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
} // Internal
|
||||
|
||||
Reference in New Issue
Block a user