Commit 379e4ed3 authored by hjk's avatar hjk

debugger: Merge "Start and Debug {Local,Remote} Application" dialogs

Change-Id: I81a95b592c480254d84d45e71d95f924944db1eb
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 7e099127
This diff is collapsed.
......@@ -44,7 +44,6 @@ class QSettings;
QT_END_NAMESPACE
namespace Core { class Id; }
namespace ProjectExplorer { class Profile; }
namespace Debugger {
class DebuggerStartParameters;
......@@ -54,63 +53,33 @@ namespace Internal {
class AttachCoreDialogPrivate;
class AttachToQmlPortDialogPrivate;
class ProcessListFilterModel;
class StartExternalDialogPrivate;
class StartExternalParameters;
class StartRemoteDialogPrivate;
class StartApplicationParameters;
class StartApplicationDialogPrivate;
class StartRemoteEngineDialogPrivate;
class StartRemoteParameters;
class StartExternalDialog : public QDialog
class StartApplicationDialog : public QDialog
{
Q_OBJECT
public:
explicit StartExternalDialog(QWidget *parent);
~StartExternalDialog();
static bool run(QWidget *parent, QSettings *settings, DebuggerStartParameters *sp);
private slots:
void changed();
void historyIndexChanged(int);
private:
StartExternalParameters parameters() const;
void setParameters(const StartExternalParameters &p);
void setHistory(const QList<StartExternalParameters> &l);
QString executableFile() const;
void setExecutableFile(const QString &executable);
Core::Id profileId() const;
bool isValid() const;
StartExternalDialogPrivate *d;
};
class StartRemoteDialog : public QDialog
{
Q_OBJECT
public:
explicit StartRemoteDialog(QWidget *parent, bool enableStartScript);
~StartRemoteDialog();
explicit StartApplicationDialog(QWidget *parent);
~StartApplicationDialog();
static bool run(QWidget *parent, QSettings *settings,
bool useScript, DebuggerStartParameters *sp);
DebuggerStartParameters *sp);
private slots:
void updateState();
void historyIndexChanged(int);
void updateState();
private:
StartRemoteParameters parameters() const;
void setParameters(const StartRemoteParameters &);
void setHistory(const QList<StartRemoteParameters> &);
StartApplicationParameters parameters() const;
void setParameters(const StartApplicationParameters &p);
void setHistory(const QList<StartApplicationParameters> &l);
void setScriptVisible(bool on);
Core::Id profileId() const;
StartRemoteDialogPrivate *d;
StartApplicationDialogPrivate *d;
};
class AttachToQmlPortDialog : public QDialog
......
......@@ -775,9 +775,8 @@ public slots:
void debugProject();
void debugProjectWithoutDeploy();
void debugProjectBreakMain();
void startExternalApplication();
void startAndDebugApplication();
void startRemoteCdbSession();
void startRemoteProcess();
void startRemoteServer();
void attachToRemoteServer();
void attachToProcess(bool startServerOnly);
......@@ -1115,8 +1114,7 @@ public:
Utils::ProxyAction *m_hiddenStopAction;
QAction *m_startAction;
QAction *m_debugWithoutDeployAction;
QAction *m_startLocalProcessAction;
QAction *m_startRemoteProcessAction;
QAction *m_startAndDebugApplicationAction;
QAction *m_startRemoteServerAction;
QAction *m_attachToRunningApplication;
QAction *m_attachToQmlPortAction;
......@@ -1238,8 +1236,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) :
m_reverseToolButton = 0;
m_startAction = 0;
m_debugWithoutDeployAction = 0;
m_startLocalProcessAction = 0;
m_startRemoteProcessAction = 0;
m_startAndDebugApplicationAction = 0;
m_attachToRemoteServerAction = 0;
m_attachToRunningApplication = 0;
m_attachToQmlPortAction = 0;
......@@ -1512,12 +1509,13 @@ void DebuggerPluginPrivate::debugProjectBreakMain()
pe->runProject(pro, DebugRunModeWithBreakOnMain);
}
void DebuggerPluginPrivate::startExternalApplication()
void DebuggerPluginPrivate::startAndDebugApplication()
{
DebuggerStartParameters sp;
if (StartExternalDialog::run(mainWindow(), m_coreSettings, &sp))
if (RunControl *rc = m_debuggerRunControlFactory->create(sp))
if (StartApplicationDialog::run(mainWindow(), m_coreSettings, &sp)) {
if (RunControl *rc = createDebugger(sp))
startDebugger(rc);
}
}
void DebuggerPluginPrivate::attachCore()
......@@ -1598,21 +1596,11 @@ void DebuggerPluginPrivate::startRemoteCdbSession()
startDebugger(rc);
}
void DebuggerPluginPrivate::startRemoteProcess()
{
DebuggerStartParameters sp;
if (StartRemoteDialog::run(mainWindow(), m_coreSettings, true, &sp)) {
sp.startMode = StartRemoteProcess;
if (RunControl *rc = createDebugger(sp))
startDebugger(rc);
}
}
void DebuggerPluginPrivate::attachToRemoteServer()
{
DebuggerStartParameters sp;
if (StartRemoteDialog::run(mainWindow(), m_coreSettings, false, &sp)) {
sp.startMode = AttachToRemoteServer;
sp.startMode = AttachToRemoteServer;
if (StartApplicationDialog::run(mainWindow(), m_coreSettings, &sp)) {
sp.closeMode = KillAtClose;
sp.useServerStartScript = false;
sp.serverStartScript.clear();
......@@ -2144,10 +2132,9 @@ void DebuggerPluginPrivate::setInitialState()
m_reverseDirectionAction->setEnabled(false);
m_toolTipManager->closeAllToolTips();
m_startLocalProcessAction->setEnabled(true);
m_startAndDebugApplicationAction->setEnabled(true);
m_attachToQmlPortAction->setEnabled(true);
m_attachToCoreAction->setEnabled(true);
m_startRemoteProcessAction->setEnabled(true);
m_attachToRemoteServerAction->setEnabled(true);
m_attachToRunningApplication->setEnabled(true);
m_detachAction->setEnabled(false);
......@@ -2269,10 +2256,9 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
m_hiddenStopAction->setAction(m_undisturbableAction);
}
m_startLocalProcessAction->setEnabled(true);
m_startAndDebugApplicationAction->setEnabled(true);
m_attachToQmlPortAction->setEnabled(true);
m_attachToCoreAction->setEnabled(true);
m_startRemoteProcessAction->setEnabled(true);
m_attachToRemoteServerAction->setEnabled(true);
m_attachToRunningApplication->setEnabled(true);
......@@ -2923,10 +2909,9 @@ void DebuggerPluginPrivate::extensionsInitialized()
act->setText(tr("Start Debugging Without Deployment"));
connect(act, SIGNAL(triggered()), this, SLOT(debugProjectWithoutDeploy()));
// Handling of external applications.
act = m_startLocalProcessAction = new QAction(this);
act->setText(tr("Start and Debug External Application..."));
connect(act, SIGNAL(triggered()), SLOT(startExternalApplication()));
act = m_startAndDebugApplicationAction = new QAction(this);
act->setText(tr("Start and Debug Application..."));
connect(act, SIGNAL(triggered()), SLOT(startAndDebugApplication()));
#ifdef WITH_LLDB
act = m_startRemoteLldbAction = new QAction(this);
......@@ -2938,10 +2923,6 @@ void DebuggerPluginPrivate::extensionsInitialized()
act->setText(tr("Load Core File..."));
connect(act, SIGNAL(triggered()), SLOT(attachCore()));
act = m_startRemoteProcessAction = new QAction(this);
act->setText(tr("Start and Debug Remote Application..."));
connect(act, SIGNAL(triggered()), SLOT(startRemoteProcess()));
act = m_attachToRemoteServerAction = new QAction(this);
act->setText(tr("Attach to Remote Debug Server..."));
connect(act, SIGNAL(triggered()), SLOT(attachToRemoteServer()));
......@@ -3001,8 +2982,8 @@ void DebuggerPluginPrivate::extensionsInitialized()
cmd->setDescription(tr("Attach to Running Application"));
mstart->addAction(cmd, Debugger::Constants::G_START_LOCAL);
cmd = ActionManager::registerAction(m_startLocalProcessAction,
"Debugger.StartLocalProcess", globalcontext);
cmd = ActionManager::registerAction(m_startAndDebugApplicationAction,
"Debugger.StartAndDebugApplication", globalcontext);
cmd->setAttribute(Command::CA_Hide);
mstart->addAction(cmd, Debugger::Constants::G_START_LOCAL);
......@@ -3010,7 +2991,6 @@ void DebuggerPluginPrivate::extensionsInitialized()
// visible in the start menu, but still be "there".
// m_startLocalProcessAction->setVisible(on);
// m_attachToRemoteServerAction->setVisible(on);
// m_startRemoteProcessAction->setVisible(on);
// m_startRemoteServerAction->setVisible(on);
cmd = ActionManager::registerAction(m_attachToCoreAction,
......@@ -3023,11 +3003,6 @@ void DebuggerPluginPrivate::extensionsInitialized()
cmd->setAttribute(Command::CA_Hide);
mstart->addAction(cmd, Constants::G_MANUAL_REMOTE);
cmd = ActionManager::registerAction(m_startRemoteProcessAction,
"Debugger.StartRemoteProcess", globalcontext);
cmd->setAttribute(Command::CA_Hide);
mstart->addAction(cmd, Constants::G_MANUAL_REMOTE);
cmd = ActionManager::registerAction(m_startRemoteServerAction,
"Debugger.StartRemoteServer", globalcontext);
cmd->setDescription(tr("Start Gdbserver"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment