Changeset View
Changeset View
Standalone View
Standalone View
src/wizard/bluewizard.cpp
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | 41 | { | |||
---|---|---|---|---|---|
68 | setButtonText(QWizard::NextButton, i18nc("Action to go to the next page on the wizard", "Next")); | 68 | setButtonText(QWizard::NextButton, i18nc("Action to go to the next page on the wizard", "Next")); | ||
69 | setButtonText(QWizard::FinishButton, i18nc("Action to finish the wizard", "Finish")); | 69 | setButtonText(QWizard::FinishButton, i18nc("Action to finish the wizard", "Finish")); | ||
70 | 70 | | |||
71 | // Initialize BluezQt | 71 | // Initialize BluezQt | ||
72 | m_manager = new BluezQt::Manager(this); | 72 | m_manager = new BluezQt::Manager(this); | ||
73 | BluezQt::InitManagerJob *initJob = m_manager->init(); | 73 | BluezQt::InitManagerJob *initJob = m_manager->init(); | ||
74 | initJob->start(); | 74 | initJob->start(); | ||
75 | connect(initJob, &BluezQt::InitManagerJob::result, this, &BlueWizard::initJobResult); | 75 | connect(initJob, &BluezQt::InitManagerJob::result, this, &BlueWizard::initJobResult); | ||
76 | | ||||
77 | // When Finished page is opened, close wizard automatically | ||||
78 | connect(this, &QWizard::currentIdChanged, this, [this](int id) { | ||||
79 | if (id == Success) { | ||||
80 | done(QDialog::Accepted); | ||||
81 | } | ||||
82 | // Sending notification in SuccessPage is asynchronous, so this needs to be queued. | ||||
83 | }, Qt::QueuedConnection); | ||||
76 | } | 84 | } | ||
77 | 85 | | |||
78 | BluezQt::DevicePtr BlueWizard::device() const | 86 | BluezQt::DevicePtr BlueWizard::device() const | ||
79 | { | 87 | { | ||
80 | return m_device; | 88 | return m_device; | ||
81 | } | 89 | } | ||
82 | 90 | | |||
83 | void BlueWizard::setDevice(BluezQt::DevicePtr device) | 91 | void BlueWizard::setDevice(BluezQt::DevicePtr device) | ||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |