aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/baremetal/debugserverproviderchooser.h
blob: dd537318f8bee54d0281dbba60ec8645539ff217 (plain)
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
// Copyright (C) 2016 Denis Shienkov <denis.shienkov@gmail.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <QWidget>

QT_BEGIN_NAMESPACE
class QComboBox;
class QPushButton;
QT_END_NAMESPACE

namespace BareMetal {
namespace Internal {

class IDebugServerProvider;

// DebugServerProviderChooser

class DebugServerProviderChooser final : public QWidget
{
    Q_OBJECT

public:
    explicit DebugServerProviderChooser(
            bool useManageButton = true, QWidget *parent = nullptr);

    QString currentProviderId() const;
    void setCurrentProviderId(const QString &id);
    void populate();

signals:
    void providerChanged();

private:
    void currentIndexChanged(int index);
    void manageButtonClicked();
    bool providerMatches(const IDebugServerProvider *) const;
    QString providerText(const IDebugServerProvider *) const;

    QComboBox *m_chooser = nullptr;
    QPushButton *m_manageButton = nullptr;
};

} // namespace Internal
} // namespace BareMetal