usbcheckpopupdlg.cpp 846 Bytes
#include <QTimer>
#include "usbcheckpopupdlg.h"
#include "ui_usbcheckpopupdlg.h"
#include "fileprocessor.h"

UsbCheckPopupDlg::UsbCheckPopupDlg(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::UsbCheckPopupDlg)
{
    ui->setupUi(this);
    setAttribute(Qt::WA_DeleteOnClose);
    setWindowFlags(Qt::Widget | Qt::FramelessWindowHint);
    setAttribute(Qt::WA_NoSystemBackground);
    setAttribute(Qt::WA_TranslucentBackground);


    timer = new QTimer(this);
    connect(timer,SIGNAL(timeout()),SLOT(usbCheckTimerFired()));
    timer->start(500);
}

UsbCheckPopupDlg::~UsbCheckPopupDlg()
{
    delete ui;
}

void UsbCheckPopupDlg::on_ctrBtnYes_clicked()
{
    accept();
}

void UsbCheckPopupDlg::usbCheckTimerFired(){
    QString strTemp;
    bool usbDetect = FileProcessor::detectUSB(strTemp);
    if(usbDetect){
        accept();
    }
}