QmlProfiler: Cosmetics

Avoid using remote/local as (not user visible) names. 'internal'
means 'whatever the current target does', i.e. could be a remote setup,
'external' means 'attach to something running or waiting.

Also user setServerUrl() directly on the worker, no need go through
the 'opaque connection' mechanism here.

Change-Id: Id0e694562ce7d3129c7d0b790c91d465de24b4e4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2017-06-19 14:10:24 +02:00
parent e50ad1e09c
commit 56028d2e3e
3 changed files with 19 additions and 9 deletions

View File

@@ -28,10 +28,11 @@
#include <projectexplorer/kitchooser.h>
#include <coreplugin/id.h>
#include <QSpinBox>
#include <QDialogButtonBox>
#include <QFormLayout>
#include <QLabel>
#include <QPushButton>
#include <QSpinBox>
using namespace ProjectExplorer;
@@ -63,11 +64,20 @@ QmlProfilerAttachDialog::QmlProfilerAttachDialog(QWidget *parent) :
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
QLabel *hint = new QLabel(this);
hint->setWordWrap(true);
hint->setTextFormat(Qt::RichText);
hint->setText(tr("Select an externally started QML-debug enabled application.<p>"
"Commonly used command-line arguments are:")
+ "<p><tt>-qmljsdebugger=port:&lt;port&gt;,host:&lt;host&gt;,block,</tt><br>"
"<tt>&nbsp;<tt>&nbsp;services:EngineControl,DebugMessages[,...]</tt><p>");
QFormLayout *formLayout = new QFormLayout();
formLayout->addRow(tr("Kit:"), d->kitChooser);
formLayout->addRow(tr("&Port:"), d->portSpinBox);
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
verticalLayout->addWidget(hint);
verticalLayout->addLayout(formLayout);
verticalLayout->addWidget(buttonBox);

View File

@@ -254,7 +254,7 @@ QmlProfilerTool::QmlProfilerTool(QObject *parent)
act = new QAction(tr("QML Profiler"), this);
act->setToolTip(description);
menu->addAction(ActionManager::registerAction(act, "QmlProfiler.Local"),
menu->addAction(ActionManager::registerAction(act, "QmlProfiler.Internal"),
Debugger::Constants::G_ANALYZER_TOOLS);
QObject::connect(act, &QAction::triggered, this, [this] {
if (!prepareTool())
@@ -267,11 +267,11 @@ QmlProfilerTool::QmlProfilerTool(QObject *parent)
act->setEnabled(d->m_startAction->isEnabled());
});
act = new QAction(tr("QML Profiler (External)"), this);
act = new QAction(tr("QML Profiler (Attach to Waiting Application)"), this);
act->setToolTip(description);
menu->addAction(ActionManager::registerAction(act, "QmlProfiler.Remote"),
menu->addAction(ActionManager::registerAction(act, "QmlProfiler.AttachToWaitingApplication"),
Debugger::Constants::G_ANALYZER_REMOTE_TOOLS);
QObject::connect(act, &QAction::triggered, this, &QmlProfilerTool::startRemoteTool);
QObject::connect(act, &QAction::triggered, this, &QmlProfilerTool::attachToWaitingApplication);
Utils::ToolbarDescription toolbar;
toolbar.addAction(d->m_startAction);
@@ -546,7 +546,7 @@ bool QmlProfilerTool::prepareTool()
return true;
}
void QmlProfilerTool::startRemoteTool()
void QmlProfilerTool::attachToWaitingApplication()
{
if (!prepareTool())
return;
@@ -589,8 +589,8 @@ void QmlProfilerTool::startRemoteTool()
RunConfiguration *rc = Debugger::startupRunConfiguration();
auto runControl = new RunControl(rc, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
runControl->createWorker(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
runControl->setConnection(UrlConnection(serverUrl));
auto profiler = new QmlProfilerRunner(runControl);
profiler->setServerUrl(serverUrl);
ProjectExplorerPlugin::startRunControl(runControl);
}

View File

@@ -53,7 +53,7 @@ public:
void finalizeRunControl(QmlProfilerRunner *runWorker);
bool prepareTool();
void startRemoteTool();
void attachToWaitingApplication();
QString summary(const QVector<int> &typeIds) const;
QStringList details(int typeId) const;