gdbchooserwidget.cpp 19.8 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/

#include "gdbchooserwidget.h"

#include <utils/pathchooser.h>
#include <projectexplorer/toolchain.h>
#include <coreplugin/coreconstants.h>

#include <utils/qtcassert.h>

#include <QtGui/QTreeView>
#include <QtGui/QStandardItemModel>
#include <QtGui/QStandardItem>
#include <QtGui/QToolButton>
#include <QtGui/QFormLayout>
#include <QtGui/QVBoxLayout>
#include <QtGui/QHBoxLayout>
#include <QtGui/QDialogButtonBox>
#include <QtGui/QMessageBox>
#include <QtGui/QPushButton>
#include <QtGui/QIcon>
#include <QtGui/QGroupBox>
#include <QtGui/QCheckBox>
#include <QtCore/QDebug>
#include <QtCore/QSet>
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
#include <QtCore/QProcess>

enum { binaryRole = Qt::UserRole + 1, toolChainRole = Qt::UserRole + 2 };
enum Columns { binaryColumn, toolChainColumn, ColumnCount };

typedef QList<QStandardItem *> StandardItemList;

Q_DECLARE_METATYPE(QList<int>)

static QList<int> allGdbToolChains()
{
    QList<int> rc;
67
68
    rc
#ifdef Q_OS_UNIX
69
70
       << ProjectExplorer::ToolChain_GCC
       << ProjectExplorer::ToolChain_LINUX_ICC
71
#endif
72
#ifdef Q_OS_WIN
73
74
75
       << ProjectExplorer::ToolChain_MinGW
       << ProjectExplorer::ToolChain_WINSCW
       << ProjectExplorer::ToolChain_GCCE
76
77
       << ProjectExplorer::ToolChain_RVCT2_ARMV5
       << ProjectExplorer::ToolChain_RVCT2_ARMV6
78
#endif
79
       << ProjectExplorer::ToolChain_GCC_MAEMO
80
#ifdef Q_OS_UNIX
81
82
       << ProjectExplorer::ToolChain_GCCE_GNUPOC
       << ProjectExplorer::ToolChain_RVCT_ARMV5_GNUPOC
83
#endif
84
85
       << ProjectExplorer::ToolChain_OTHER
       << ProjectExplorer::ToolChain_UNKNOWN;
86
87
88
89
90
    return rc;
}

static inline QString toolChainName(int tc)
{
91
    return ProjectExplorer::ToolChain::toolChainName(static_cast<ProjectExplorer::ToolChainType>(tc));
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
}

namespace Debugger {
namespace Internal {

// -----------------------------------------------

// Obtain a tooltip for a gdb binary by running --version
static inline QString gdbToolTip(const QString &binary)
{
    QProcess process;
    process.start(binary, QStringList(QLatin1String("--version")));
    process.closeWriteChannel();
    if (!process.waitForStarted())
        return GdbChooserWidget::tr("Unable to run '%1': %2").arg(binary, process.errorString());
    process.waitForFinished(); // That should never fail
    QString rc = QDir::toNativeSeparators(binary);
    rc += QLatin1String("\n\n");
    rc += QString::fromLocal8Bit(process.readAllStandardOutput());
    rc.remove(QLatin1Char('\r'));
    return rc;
}

// GdbBinaryModel: Show gdb binaries and associated toolchains as a list.
// Provides a delayed tooltip listing the gdb version as
// obtained by running it. Provides conveniences for getting/setting the maps and
// for listing the toolchains used and the ones still available.

class GdbBinaryModel : public QStandardItemModel {
public:
    typedef GdbChooserWidget::BinaryToolChainMap BinaryToolChainMap;

    explicit GdbBinaryModel(QObject * parent = 0);
    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;

    // get / set data as map.
    BinaryToolChainMap gdbBinaries() const;
    void setGdbBinaries(const BinaryToolChainMap &m);

    QString binary(int row) const;
    QList<int> toolChains(int row) const;

    QStringList binaries() const;
    QList<int> usedToolChains() const;
    QSet<int> unusedToolChainSet() const;
    QList<int> unusedToolChains() const;

    void append(const QString &binary, const QList<int> &toolChains);

    static void setBinaryItem(QStandardItem *item, const QString &binary);
    static void setToolChainItem(QStandardItem *item, const QList<int> &toolChain);
};

GdbBinaryModel::GdbBinaryModel(QObject *parent) :
    QStandardItemModel(0, ColumnCount, parent)
{
    QStringList headers;
    headers << GdbChooserWidget::tr("Binary") << GdbChooserWidget::tr("Toolchains");
    setHorizontalHeaderLabels(headers);
}

QVariant GdbBinaryModel::data(const QModelIndex &index, int role) const
{
    if (index.isValid() && role == Qt::ToolTipRole) {
        // Is there a tooltip set?
        const QString itemToolTip = itemFromIndex(index)->toolTip();
        if (!itemToolTip.isEmpty())
            return QVariant(itemToolTip);
        // Run the gdb and obtain the tooltip
        const QString tooltip = gdbToolTip(binary(index.row()));
        // Set on the whole row
        item(index.row(), binaryColumn)->setToolTip(tooltip);
        item(index.row(), toolChainColumn)->setToolTip(tooltip);
        return QVariant(tooltip);
    }
    return QStandardItemModel::data(index, role);
}

QStringList GdbBinaryModel::binaries() const
{
    QStringList rc;
    const int binaryCount = rowCount();
    for (int b = 0; b < binaryCount; b++)
        rc.push_back(binary(b));
    return rc;
}

QList<int> GdbBinaryModel::usedToolChains() const
{
    // Loop over model and collect all toolchains.
    QList<int> rc;
    const int binaryCount = rowCount();
    for (int b = 0; b < binaryCount; b++)
        foreach(int tc, toolChains(b))
            rc.push_back(tc);
    return rc;
}

QSet<int> GdbBinaryModel::unusedToolChainSet() const
{
    const QSet<int> used = usedToolChains().toSet();
    QSet<int> all = allGdbToolChains().toSet();
    return all.subtract(used);
}

QList<int> GdbBinaryModel::unusedToolChains() const
{
    QList<int> unused = unusedToolChainSet().toList();
    qSort(unused);
    return unused;
}

GdbBinaryModel::BinaryToolChainMap GdbBinaryModel::gdbBinaries() const
{
    BinaryToolChainMap rc;
    const int binaryCount = rowCount();
    for (int r = 0; r < binaryCount; r++) {
        const QString bin = binary(r);
        foreach(int tc, toolChains(r))
            rc.insert(bin, tc);
    }
    return rc;
}

void GdbBinaryModel::setGdbBinaries(const BinaryToolChainMap &m)
{
    removeRows(0, rowCount());
    foreach(const QString &binary, m.uniqueKeys())
        append(binary, m.values(binary));
}

QString GdbBinaryModel::binary(int row) const
{
    return item(row, binaryColumn)->data(binaryRole).toString();
}

QList<int> GdbBinaryModel::toolChains(int row) const
{
    const QVariant data = item(row, toolChainColumn)->data(toolChainRole);
    return qVariantValue<QList<int> >(data);
}

void GdbBinaryModel::setBinaryItem(QStandardItem *item, const QString &binary)
{
    const QFileInfo fi(binary);
    item->setText(fi.isAbsolute() ? fi.fileName() : QDir::toNativeSeparators(binary));
    item->setToolTip(QString());; // clean out delayed tooltip
    item->setData(QVariant(binary), binaryRole);
    item->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable);
}

void GdbBinaryModel::setToolChainItem(QStandardItem *item, const QList<int> &toolChains)
{
    // Format comma-separated list
    const QString toolChainSeparator = QLatin1String(", ");
    QString toolChainDesc;
    const int count = toolChains.size();
    for (int i = 0; i < count; i++) {
        if (i)
            toolChainDesc += toolChainSeparator;
        toolChainDesc += toolChainName(toolChains.at(i));
    }

    item->setText(toolChainDesc);
    item->setToolTip(QString());; // clean out delayed tooltip
    item->setData(qVariantFromValue(toolChains), toolChainRole);
    item->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable);
}

void GdbBinaryModel::append(const QString &binary, const QList<int> &toolChains)
{
    QStandardItem *binaryItem = new QStandardItem;
    QStandardItem *toolChainItem = new QStandardItem;
    GdbBinaryModel::setBinaryItem(binaryItem, binary);
    GdbBinaryModel::setToolChainItem(toolChainItem, toolChains);
    StandardItemList row;
    row << binaryItem << toolChainItem;
    appendRow(row);
}

// ----------- GdbChooserWidget
GdbChooserWidget::GdbChooserWidget(QWidget *parent) :
    QWidget(parent),
    m_treeView(new QTreeView),
276
    m_model(new GdbBinaryModel(m_treeView)),
277
    m_addButton(new QToolButton),
278
279
    m_deleteButton(new QToolButton),
    m_dirty(false)
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
{
    QHBoxLayout *mainHLayout = new QHBoxLayout;

    m_treeView->setRootIsDecorated(false);
    m_treeView->setModel(m_model);
    m_treeView->setUniformRowHeights(true);
    m_treeView->setAllColumnsShowFocus(true);
    m_treeView->setSelectionMode(QAbstractItemView::SingleSelection);
    connect(m_treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
            this, SLOT(slotCurrentChanged(QModelIndex,QModelIndex)));
    connect(m_treeView, SIGNAL(doubleClicked(QModelIndex)),
            this, SLOT(slotDoubleClicked(QModelIndex)));
    mainHLayout->addWidget(m_treeView);

    m_addButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_PLUS)));
    connect(m_addButton, SIGNAL(clicked()), this, SLOT(slotAdd()));

    m_deleteButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_MINUS)));
    m_deleteButton->setEnabled(false);
    connect(m_deleteButton, SIGNAL(clicked()), this, SLOT(slotRemove()));

    QVBoxLayout *vButtonLayout = new QVBoxLayout;
    vButtonLayout->addWidget(m_addButton);
    vButtonLayout->addWidget(m_deleteButton);
    vButtonLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));

    mainHLayout->addLayout(vButtonLayout);
    setLayout(mainHLayout);
}

QStandardItem *GdbChooserWidget::currentItem() const
{
    // Return the column-0-item
    QModelIndex currentIndex = m_treeView->currentIndex();
    if (!currentIndex.isValid())
        return 0;
    if (currentIndex.column() != binaryColumn)
        currentIndex = currentIndex.sibling(currentIndex.row(), binaryColumn);
    return m_model->itemFromIndex(currentIndex);
}

void GdbChooserWidget::slotAdd()
{
    // Any toolchains left?
    const QList<int> unusedToolChains = m_model->unusedToolChains();
    if (unusedToolChains.isEmpty())
        return;

    // On a binary or no current item: Add binary + toolchain
    BinaryToolChainDialog binaryDialog(this);
    binaryDialog.setToolChainChoices(unusedToolChains);
    if (binaryDialog.exec() != QDialog::Accepted)
        return;
    // Refuse binaries that already exist
    const QString path = binaryDialog.path();
    if (m_model->binaries().contains(path)) {
        QMessageBox::warning(this, tr("Duplicate binary"),
                             tr("The binary '%1' already exists.").arg(path));
        return;
    }
    // Add binary + toolchain to model
    m_model->append(path, binaryDialog.toolChains());
342
    m_dirty = true;
343
344
345
346
347
348
349
350
351
352
353
}

void GdbChooserWidget::slotRemove()
{
    if (QStandardItem *item = currentItem())
        removeItem(item);
}

void GdbChooserWidget::removeItem(QStandardItem *item)
{
    m_model->removeRow(item->row());
354
    m_dirty = true;
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
}

void GdbChooserWidget::slotCurrentChanged(const QModelIndex &current, const QModelIndex &)
{
    const bool hasItem = current.isValid() && m_model->itemFromIndex(current);
    m_deleteButton->setEnabled(hasItem);
}

void GdbChooserWidget::slotDoubleClicked(const QModelIndex &current)
{
    QTC_ASSERT(current.isValid(), return)
    // Show dialog to edit. Make all unused toolchains including the ones
    // previously assigned to that binary available.
    const int row = current.row();
    const QString oldBinary = m_model->binary(row);
    const QList<int> oldToolChains = m_model->toolChains(row);
    const QSet<int> toolChainChoices = m_model->unusedToolChainSet().unite(oldToolChains.toSet());

    BinaryToolChainDialog dialog(this);
    dialog.setPath(oldBinary);
375
376
    const BinaryToolChainMap map = gdbBinaries();
    dialog.setToolChainChoices(toolChainChoices.toList(), &map);
377
378
379
380
381
382
383
384
385
386
387
    dialog.setToolChains(oldToolChains);
    if (dialog.exec() != QDialog::Accepted)
        return;
    // Check if anything changed.
    const QString newBinary = dialog.path();
    const QList<int> newToolChains = dialog.toolChains();
    if (newBinary == oldBinary && newToolChains == oldToolChains)
        return;

    GdbBinaryModel::setBinaryItem(m_model->item(row, binaryColumn), newBinary);
    GdbBinaryModel::setToolChainItem(m_model->item(row, toolChainColumn), newToolChains);
388
    m_dirty = true;
389
390
391
392
393
394
395
396
397
398
}

GdbChooserWidget::BinaryToolChainMap GdbChooserWidget::gdbBinaries() const
{
    return m_model->gdbBinaries();
}

void GdbChooserWidget::setGdbBinaries(const BinaryToolChainMap &m)
{
    m_model->setGdbBinaries(m);
399
400
    for (int c = 0; c < ColumnCount; c++)
        m_treeView->resizeColumnToContents(c);
401
402
403
404
405
406
407
408
409
410
411
    m_dirty = false;
}

bool GdbChooserWidget::isDirty() const
{
    return m_dirty;
}

void GdbChooserWidget::clearDirty()
{
    m_dirty = false;
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
}

// -------------- ToolChainSelectorWidget
static const char *toolChainPropertyC = "toolChain";

static inline int toolChainOfCheckBox(const QCheckBox *c)
{
    return c->property(toolChainPropertyC).toInt();
}

static inline QVBoxLayout *createGroupBox(const QString &title, QVBoxLayout *lt)
{
    QGroupBox *gb = new QGroupBox(title);
    QVBoxLayout *gbLayout = new QVBoxLayout;
    gb->setLayout(gbLayout);
    lt->addWidget(gb);
    return gbLayout;
}

ToolChainSelectorWidget::ToolChainSelectorWidget(QWidget *parent) :
    QWidget(parent), m_valid(false)
{
    QVBoxLayout *mainLayout = new QVBoxLayout;
    QVBoxLayout *desktopLayout = createGroupBox(tr("Desktop/General"), mainLayout);
    QVBoxLayout *symbianLayout = createGroupBox(tr("Symbian"), mainLayout);
    QVBoxLayout *maemoLayout = createGroupBox(tr("Maemo"), mainLayout);

    // Group checkboxes into categories
    foreach(int tc, allGdbToolChains()) {
        switch (tc) {
442
443
444
445
446
        case ProjectExplorer::ToolChain_GCC:
        case ProjectExplorer::ToolChain_LINUX_ICC:
        case ProjectExplorer::ToolChain_MinGW:
        case ProjectExplorer::ToolChain_OTHER:
        case ProjectExplorer::ToolChain_UNKNOWN:
447
448
            desktopLayout->addWidget(createToolChainCheckBox(tc));
            break;
449
450
        case ProjectExplorer::ToolChain_MSVC:
        case ProjectExplorer::ToolChain_WINCE:
451
            break;
452
453
        case ProjectExplorer::ToolChain_WINSCW:
        case ProjectExplorer::ToolChain_GCCE:
454
455
        case ProjectExplorer::ToolChain_RVCT2_ARMV5:
        case ProjectExplorer::ToolChain_RVCT2_ARMV6:
456
457
        case ProjectExplorer::ToolChain_GCCE_GNUPOC:
        case ProjectExplorer::ToolChain_RVCT_ARMV5_GNUPOC:
458
459
            symbianLayout->addWidget(createToolChainCheckBox(tc));
            break;
460
        case ProjectExplorer::ToolChain_GCC_MAEMO:
461
462
            maemoLayout->addWidget(createToolChainCheckBox(tc));
            break;
463
        case ProjectExplorer::ToolChain_INVALID:
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
            break;
        }
    }
    setLayout(mainLayout);
}

QCheckBox *ToolChainSelectorWidget::createToolChainCheckBox(int tc)
{
    // Add checkbox
    QCheckBox *cb = new QCheckBox(toolChainName(tc));
    cb->setProperty(toolChainPropertyC, QVariant(tc));
    connect(cb, SIGNAL(stateChanged(int)), this, SLOT(slotCheckStateChanged(int)));
    m_checkBoxes.push_back(cb);
    return cb;
}

480
static inline QString msgDisabledToolChainToolTip(const QString &binary, int toolChain)
481
{
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
    return ToolChainSelectorWidget::tr(
    "<html><head/><body><p>Another gdb binary (<i>%1</i>) is currently configured "
    "to handle the toolchain <i>%2</i>.</p></body></html>").
    arg(QFileInfo(binary).fileName(), toolChainName(toolChain));
}

void ToolChainSelectorWidget::setEnabledToolChains(const QList<int> &enabled,
                                                   const BinaryToolChainMap *binaryToolChainMap)
{
    foreach(QCheckBox *cb, m_checkBoxes) {
        const int toolChain = toolChainOfCheckBox(cb);
        if (enabled.contains(toolChain)) {
            cb->setToolTip(QString());
        } else {
            // Toolchain is handled by a different binary, hint to user.
497
            cb->setEnabled(false);
498
499
500
501
502
            const QString binary = binaryToolChainMap ?  binaryToolChainMap->key(toolChain) : QString();
            if (!binary.isEmpty())
                cb->setToolTip(msgDisabledToolChainToolTip(binary, toolChain));
        }
    }
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
}

void ToolChainSelectorWidget::setCheckedToolChains(const QList<int> &checked)
{
    foreach(QCheckBox *cb, m_checkBoxes)
        if (checked.contains(toolChainOfCheckBox(cb)))
            cb->setChecked(true);
    // Trigger 'valid changed'
    slotCheckStateChanged(checked.isEmpty() ? Qt::Unchecked : Qt::Checked);
}

QList<int> ToolChainSelectorWidget::checkedToolChains() const
{
    QList<int> rc;
    foreach(const QCheckBox *cb, m_checkBoxes)
        if (cb->isChecked())
            rc.push_back(toolChainOfCheckBox(cb));
    return rc;
}

bool ToolChainSelectorWidget::isValid() const
{
    return m_valid;
}

void ToolChainSelectorWidget::slotCheckStateChanged(int state)
{
    // Emit signal if valid state changed
    const bool newValid = state == Qt::Checked || hasCheckedToolChain();
    if (newValid != m_valid) {
        m_valid = newValid;
        emit validChanged(m_valid);
    }
}

bool ToolChainSelectorWidget::hasCheckedToolChain() const
{
    foreach(const QCheckBox *cb, m_checkBoxes)
        if (cb->isChecked())
            return true;
    return false;
}

// -------------- ToolChainDialog
BinaryToolChainDialog::BinaryToolChainDialog(QWidget *parent) :
    QDialog(parent),
    m_toolChainSelector(new ToolChainSelectorWidget),
    m_mainLayout(new QFormLayout),
    m_buttonBox(new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel)),
    m_pathChooser(new Utils::PathChooser)
{

    setModal(true);
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    setWindowTitle(tr("Select binary and toolchains"));

559
    m_pathChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
    m_pathChooser->setPromptDialogTitle(tr("Gdb binary"));
    connect(m_pathChooser, SIGNAL(validChanged()), this, SLOT(slotValidChanged()));
    m_mainLayout->addRow(tr("Path:"), m_pathChooser);

    connect(m_toolChainSelector, SIGNAL(validChanged(bool)), this, SLOT(slotValidChanged()));
    m_mainLayout->addRow(m_toolChainSelector);

    connect(m_buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    m_mainLayout->addRow(m_buttonBox);
    setLayout(m_mainLayout);

    setOkButtonEnabled(false);
    m_pathChooser->setFocus();
}

576
577
void BinaryToolChainDialog::setToolChainChoices(const QList<int> &tcs,
                                                const BinaryToolChainMap *binaryToolChainMap)
578
{
579
    m_toolChainSelector->setEnabledToolChains(tcs, binaryToolChainMap);
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
}

void BinaryToolChainDialog::setToolChains(const QList<int> &tcs)
{
    m_toolChainSelector->setCheckedToolChains(tcs);
}

QList<int> BinaryToolChainDialog::toolChains() const
{
    return m_toolChainSelector->checkedToolChains();
}

void BinaryToolChainDialog::setOkButtonEnabled(bool v)
{
    m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(v);
}

void BinaryToolChainDialog::setPath(const QString &p)
{
    m_pathChooser->setPath(p);
}

QString BinaryToolChainDialog::path() const
{
604
    return m_pathChooser->rawPath();
605
606
607
608
609
610
611
612
613
}

void BinaryToolChainDialog::slotValidChanged()
{
    setOkButtonEnabled(m_pathChooser->isValid() && m_toolChainSelector->isValid());
}

} // namespace Internal
} // namespace Debugger