OSDN Git Service

Merge remote branch 'origin/2.1'
[qt-creator-jp/qt-creator-jp.git] / src / plugins / debugger / debuggerengine.cpp
index 0af9b3d..cbb287f 100644 (file)
 #include <coreplugin/progressmanager/futureprogress.h>
 
 #include <projectexplorer/debugginghelper.h>
-#include <projectexplorer/environment.h>
-#include <projectexplorer/project.h>
-#include <projectexplorer/projectexplorerconstants.h>
-#include <projectexplorer/target.h>
-#include <projectexplorer/buildconfiguration.h>
-#include <projectexplorer/applicationrunconfiguration.h> // For LocalApplication*
+#include <projectexplorer/toolchain.h>
 
 #include <qt4projectmanager/qt4projectmanagerconstants.h>
 
 #include <texteditor/itexteditor.h>
 
+#include <utils/environment.h>
 #include <utils/savedaction.h>
 #include <utils/qtcassert.h>
 
@@ -114,6 +110,7 @@ DebuggerStartParameters::DebuggerStartParameters() :
     qmlServerAddress("127.0.0.1"),
     qmlServerPort(0),
     useServerStartScript(false),
+    connParams(SshConnectionParameters::NoProxy),
     toolChainType(ToolChain::UNKNOWN),
     startMode(NoStartMode),
     executableUid(0)
@@ -325,7 +322,7 @@ void DebuggerEnginePrivate::breakpointSetRemoveMarginActionTriggered()
     QAction *act = qobject_cast<QAction *>(sender());
     QTC_ASSERT(act, return);
     QList<QVariant> list = act->data().toList();
-    QTC_ASSERT(list.size() >= 3, return);
+    QTC_ASSERT(list.size() >= 3, qDebug() << list; return);
     const QString fileName = list.at(0).toString();
     const int lineNumber = list.at(1).toInt();
     const quint64 address = list.at(2).toULongLong();
@@ -337,7 +334,7 @@ void DebuggerEnginePrivate::breakpointEnableDisableMarginActionTriggered()
     QAction *act = qobject_cast<QAction *>(sender());
     QTC_ASSERT(act, return);
     QList<QVariant> list = act->data().toList();
-    QTC_ASSERT(list.size() == 2, return);
+    QTC_ASSERT(list.size() == 3, qDebug() << list; return);
     const QString fileName = list.at(0).toString();
     const int lineNumber = list.at(1).toInt();
     m_breakHandler.toggleBreakpointEnabled(fileName, lineNumber);
@@ -346,7 +343,7 @@ void DebuggerEnginePrivate::breakpointEnableDisableMarginActionTriggered()
 void DebuggerEnginePrivate::handleContextMenuRequest(const QVariant &parameters)
 {
     const QList<QVariant> list = parameters.toList();
-    QTC_ASSERT(list.size() == 3, return);
+    QTC_ASSERT(list.size() == 3, qDebug() << list; return);
     TextEditor::ITextEditor *editor =
         (TextEditor::ITextEditor *)(list.at(0).value<quint64>());
     int lineNumber = list.at(1).toInt();
@@ -772,7 +769,7 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
         ? d->m_startParameters.attachPID : 0;
 
     if (d->m_startParameters.environment.empty())
-        d->m_startParameters.environment = Environment().toStringList();
+        d->m_startParameters.environment = Utils::Environment().toStringList();
 
     if (d->m_startParameters.breakAtMain)
         breakByFunctionMain();
@@ -1023,8 +1020,7 @@ QStringList DebuggerEngine::qtDumperLibraryLocations() const
 
 void DebuggerEngine::showQtDumperLibraryWarning(const QString &details)
 {
-    //QMessageBox dialog(d->m_mainWindow); // FIXME
-    QMessageBox dialog;
+    QMessageBox dialog(plugin()->mainWindow());
     QPushButton *qtPref = dialog.addButton(tr("Open Qt4 Options"),
         QMessageBox::ActionRole);
     QPushButton *helperOff = dialog.addButton(tr("Turn off Helper Usage"),
@@ -1053,6 +1049,35 @@ void DebuggerEngine::showQtDumperLibraryWarning(const QString &details)
     }
 }
 
+void DebuggerEngine::showQmlObserverToolWarning()
+{
+    QMessageBox dialog(plugin()->mainWindow());
+    QPushButton *qtPref = dialog.addButton(tr("Open Qt4 Options"),
+        QMessageBox::ActionRole);
+    QPushButton *helperOff = dialog.addButton(tr("Turn off QML Observer Usage"),
+        QMessageBox::ActionRole);
+    QPushButton *justContinue = dialog.addButton(tr("Continue Anyway"),
+        QMessageBox::AcceptRole);
+    dialog.setDefaultButton(justContinue);
+    dialog.setWindowTitle(tr("QML Observer Missing"));
+    dialog.setText(tr("QML Observer could not be found."));
+    dialog.setInformativeText(tr(
+        "QML Observer is used to offer additional debugging features for "
+        "QML applications, such as interactive debugging and inspection tools."
+        "It must be compiled for each used Qt version separately. "
+        "On the Qt4 options page, select a Qt installation "
+        "and click Rebuild."));
+    dialog.exec();
+    if (dialog.clickedButton() == qtPref) {
+        Core::ICore::instance()->showOptionsDialog(
+            _(Qt4ProjectManager::Constants::QT_SETTINGS_CATEGORY),
+            _(Qt4ProjectManager::Constants::QTVERSION_SETTINGS_PAGE_ID));
+    } else if (dialog.clickedButton() == helperOff) {
+        theDebuggerAction(UseQmlObserver)
+            ->setValue(qVariantFromValue(false), false);
+    }
+}
+
 QString DebuggerEngine::qtDumperLibraryName() const
 {
     if (theDebuggerAction(UseCustomDebuggingHelperLocation)->value().toBool())
@@ -1667,6 +1692,11 @@ void DebuggerEngine::attemptBreakpointSynchronization()
 {
 }
 
+bool DebuggerEngine::acceptsBreakpoint(const BreakpointData *)
+{
+    return true;
+}
+
 void DebuggerEngine::selectThread(int)
 {
 }