forked from qt-creator/qt-creator
debugger: merge local and remote core selection
Change-Id: I1659eb5a13283814d307c4b4b7adaec87bbbbe9d Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -180,136 +180,6 @@ void ProcessListFilterModel::populate
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AttachCoreDialog
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
class AttachCoreDialogPrivate
|
||||
{
|
||||
public:
|
||||
PathChooser *execFileName;
|
||||
PathChooser *coreFileName;
|
||||
ProfileChooser *profileComboBox;
|
||||
PathChooser *overrideStartScriptFileName;
|
||||
QDialogButtonBox *buttonBox;
|
||||
};
|
||||
|
||||
AttachCoreDialog::AttachCoreDialog(QWidget *parent)
|
||||
: QDialog(parent), d(new AttachCoreDialogPrivate)
|
||||
{
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
setWindowTitle(tr("Start Debugger"));
|
||||
|
||||
d->coreFileName = new PathChooser(this);
|
||||
d->coreFileName->setExpectedKind(PathChooser::File);
|
||||
d->coreFileName->setPromptDialogTitle(tr("Select Core File"));
|
||||
|
||||
d->execFileName = new PathChooser(this);
|
||||
d->execFileName->setExpectedKind(PathChooser::File);
|
||||
d->execFileName->setPromptDialogTitle(tr("Select Executable"));
|
||||
|
||||
d->overrideStartScriptFileName = new PathChooser(this);
|
||||
d->overrideStartScriptFileName->setExpectedKind(PathChooser::File);
|
||||
d->overrideStartScriptFileName->setPromptDialogTitle(tr("Select Startup Script"));
|
||||
|
||||
d->profileComboBox = new ProfileChooser(this, ProfileChooser::RemoteDebugging);
|
||||
|
||||
QFrame *line = new QFrame(this);
|
||||
line->setFrameShape(QFrame::HLine);
|
||||
line->setFrameShadow(QFrame::Sunken);
|
||||
|
||||
d->buttonBox = new QDialogButtonBox(this);
|
||||
d->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
|
||||
d->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
|
||||
|
||||
QFormLayout *formLayout = new QFormLayout;
|
||||
formLayout->setContentsMargins(0, 0, 0, 0);
|
||||
formLayout->setHorizontalSpacing(6);
|
||||
formLayout->setVerticalSpacing(6);
|
||||
formLayout->addRow(tr("&Executable:"), d->execFileName);
|
||||
formLayout->addRow(tr("&Core file:"), d->coreFileName);
|
||||
formLayout->addRow(tr("&Target:"), d->profileComboBox);
|
||||
formLayout->addRow(tr("Override &start script:"), d->overrideStartScriptFileName);
|
||||
|
||||
QVBoxLayout *vboxLayout = new QVBoxLayout(this);
|
||||
vboxLayout->addLayout(formLayout);
|
||||
vboxLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
||||
vboxLayout->addWidget(line);
|
||||
vboxLayout->addWidget(d->buttonBox);
|
||||
|
||||
connect(d->buttonBox, SIGNAL(accepted()), SLOT(accept()));
|
||||
connect(d->buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
||||
connect(d->coreFileName, SIGNAL(changed(QString)), SLOT(changed()));
|
||||
changed();
|
||||
}
|
||||
|
||||
AttachCoreDialog::~AttachCoreDialog()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
QString AttachCoreDialog::executableFile() const
|
||||
{
|
||||
return d->execFileName->path();
|
||||
}
|
||||
|
||||
void AttachCoreDialog::setExecutableFile(const QString &fileName)
|
||||
{
|
||||
d->execFileName->setPath(fileName);
|
||||
changed();
|
||||
}
|
||||
|
||||
QString AttachCoreDialog::coreFile() const
|
||||
{
|
||||
return d->coreFileName->path();
|
||||
}
|
||||
|
||||
void AttachCoreDialog::setCoreFile(const QString &fileName)
|
||||
{
|
||||
d->coreFileName->setPath(fileName);
|
||||
changed();
|
||||
}
|
||||
|
||||
Id AttachCoreDialog::profileId() const
|
||||
{
|
||||
return d->profileComboBox->currentProfileId();
|
||||
}
|
||||
|
||||
void AttachCoreDialog::setProfileIndex(int i)
|
||||
{
|
||||
if (i >= 0 && i < d->profileComboBox->count())
|
||||
d->profileComboBox->setCurrentIndex(i);
|
||||
}
|
||||
|
||||
int AttachCoreDialog::profileIndex() const
|
||||
{
|
||||
return d->profileComboBox->currentIndex();
|
||||
}
|
||||
|
||||
QString AttachCoreDialog::overrideStartScript() const
|
||||
{
|
||||
return d->overrideStartScriptFileName->path();
|
||||
}
|
||||
|
||||
void AttachCoreDialog::setOverrideStartScript(const QString &scriptName)
|
||||
{
|
||||
d->overrideStartScriptFileName->setPath(scriptName);
|
||||
}
|
||||
|
||||
bool AttachCoreDialog::isValid() const
|
||||
{
|
||||
return d->profileComboBox->currentIndex() >= 0 &&
|
||||
!coreFile().isEmpty();
|
||||
}
|
||||
|
||||
void AttachCoreDialog::changed()
|
||||
{
|
||||
d->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(isValid());
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AttachExternalDialog
|
||||
|
||||
Reference in New Issue
Block a user