forked from qt-creator/qt-creator
KitChooser: Introduce virtual methods for Debugger.
Introduce virtual methods such that it is possible to write derived classes for specific KitInformation classes, allowing for filtering and setting text and tooltip. Remove debugging-specific code of KitChooser from the ProjectExplorer. Move populate() away from the constructor as not to call virtuals from it. Implement DebuggerKitChooser. It should no longer be possible to to choose an invalid kit for debugging from the debugger starter dialogs. Add a protected constructor to DeviceProcessesDialog allowing to pass a KitChooser. Change-Id: I8c683a2da7d69bfbccdc08213cb47d69a0df8b3e Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -1670,9 +1670,21 @@ void DebuggerPluginPrivate::attachToRunningApplication()
|
||||
attachToProcess(false);
|
||||
}
|
||||
|
||||
class DebuggerProcessesDialog : public ProjectExplorer::DeviceProcessesDialog {
|
||||
public:
|
||||
DebuggerProcessesDialog(DebuggerKitChooser::Mode m, QWidget *parent) :
|
||||
ProjectExplorer::DeviceProcessesDialog(new DebuggerKitChooser(m), parent)
|
||||
{
|
||||
addAcceptButton(DeviceProcessesDialog::tr("&Attach to Process"));
|
||||
}
|
||||
};
|
||||
|
||||
void DebuggerPluginPrivate::attachToProcess(bool startServerOnly)
|
||||
{
|
||||
DeviceProcessesDialog *dlg = new DeviceProcessesDialog(mainWindow());
|
||||
|
||||
const DebuggerKitChooser::Mode mode = startServerOnly ?
|
||||
DebuggerKitChooser::RemoteDebugging : DebuggerKitChooser::LocalDebugging;
|
||||
DeviceProcessesDialog *dlg = new DebuggerProcessesDialog(mode, mainWindow());
|
||||
dlg->addAcceptButton(DeviceProcessesDialog::tr("&Attach to Process"));
|
||||
dlg->showAllDevices();
|
||||
if (dlg->exec() == QDialog::Rejected) {
|
||||
|
||||
Reference in New Issue
Block a user