more c++ bug fixes

This commit is contained in:
R. Aidan Campbell 2018-04-30 19:45:20 -07:00
parent 21e0066be0
commit 69e36050c8
2 changed files with 12 additions and 7 deletions

View file

@ -1,16 +1,20 @@
#include "popupmanager.h"
QMessageBox *popupmanager::pinMsgBox = nullptr;
popupmanager::popupmanager(){}
// this opens a non-blocking informative message telling the user to enter the given pin
// it is open-loop: if the user cancels, nothing happens
// it is expected that upon pairing completion, the ::closePinDialog function will be called.
void popupmanager::displayPinDialog(QString pin, QWidget* parent) {
pinMsgBox = new QMessageBox( parent );
pinMsgBox->setAttribute( Qt::WA_DeleteOnClose ); //makes sure the msgbox is deleted automatically when closed
pinMsgBox->setStandardButtons( QMessageBox::Ok );
pinMsgBox->setText("Please enter the number " + pin + " on the GFE dialog on the computer.");
pinMsgBox->setInformativeText("This dialog will be dismissed once complete.");
pinMsgBox->open();
popupmanager::pinMsgBox = new QMessageBox( parent );
popupmanager::pinMsgBox->setAttribute( Qt::WA_DeleteOnClose ); //makes sure the msgbox is deleted automatically when closed
popupmanager::pinMsgBox->setStandardButtons( QMessageBox::Ok );
popupmanager::pinMsgBox->setText("Please enter the number " + pin + " on the GFE dialog on the computer.");
popupmanager::pinMsgBox->setInformativeText("This dialog will be dismissed once complete.");
popupmanager::pinMsgBox->open();
}
// to be called when the pairing is complete

View file

@ -6,11 +6,12 @@
class popupmanager
{
public:
popupmanager();
static void displayPinDialog(QString pin, QWidget* parent);
static void closePinDialog();
static QString getHostnameDialog(QWidget* parent);
private slots:
private:
static QMessageBox *pinMsgBox;
};