File indexing completed on 2024-04-14 05:19:47

0001 /*
0002     SPDX-FileCopyrightText: 2010 UFO Coders <info@ufocoders.com>
0003 
0004     SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "ui_discover.h"
0010 
0011 #include <QWizardPage>
0012 
0013 #include <BluezQt/Types>
0014 
0015 class KMessageWidget;
0016 
0017 class BlueWizard;
0018 class DevicesProxyModel;
0019 
0020 class DiscoverPage : public QWizardPage, public Ui::Discover
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     explicit DiscoverPage(BlueWizard *parent = nullptr);
0026 
0027     void initializePage() override;
0028     bool isComplete() const override;
0029     int nextId() const override;
0030 
0031 protected:
0032     void showEvent(QShowEvent *event) override;
0033 
0034 private Q_SLOTS:
0035     void indexSelected(const QModelIndex &index);
0036     void itemDoubleClicked(const QModelIndex &index);
0037 
0038     void usableAdapterChanged(BluezQt::AdapterPtr adapter);
0039     void checkAdapters();
0040     void fixAdaptersError();
0041 
0042 private:
0043     BlueWizard *const m_wizard;
0044     DevicesProxyModel *const m_model;
0045     BluezQt::Manager *m_manager = nullptr;
0046     BluezQt::AdapterPtr m_adapter;
0047     KMessageWidget *m_warningWidget = nullptr;
0048 };