示例#1
0
文件: core.cpp 项目: ReDetection/qTox
void Core::onFileTransferFinished(ToxFile file)
{
     if (file.direction == file.SENDING)
          emit fileUploadFinished(file.filePath);
     else
          emit fileDownloadFinished(file.filePath);
}
示例#2
0
MainDlg::MainDlg(QWidget *parent) : QDialog(parent), ui(new Ui::MainDlg) {
    ui->setupUi(this);



    this->setWindowFlags(Qt::FramelessWindowHint);
    this->setWindowOpacity(0.95);
    this->setFixedSize(this->geometry().size());

    //prepare system tray icon
    trayIcon = new QSystemTrayIcon(this);
    trayIcon->setIcon(QIcon(":/rsc/package.png"));
    trayIcon->setVisible(true);
    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason)));

    //prepare nice wait layer
    waitLayer = new QLabel(this);
    waitLayer->setGraphicsEffect(new QGraphicsBlurEffect());
    waitLayer->setPixmap(this->grab());
    waitLayer->hide();

    //connect minimize and close signals
    connect(ui->titleBar, SIGNAL(closeApp()), this, SLOT(closeApp()));
    connect(ui->titleBar, SIGNAL(minimizeApp()), this, SLOT(minimizeApp()));
    connect(ui->titleBar, SIGNAL(aboutApp()), this, SLOT(about()));

    //show waitLayer while working
    showWaitLayer(true);

    //retrieve once-for-all tmpPath
    tmpDir = FileTools::getInstance()->getTmpPath();

    //retrieve and parse list.xml
    dfh = new DownloadFileHandler(listDotZipPath, tmpDir, false);
    qDebug()<<tmpDir;
    connect(dfh, SIGNAL(fileDownloadFinished()), this, SLOT(parseListDotXml()));
    connect(dfh, SIGNAL(fileDownloadError(QString)), this, SLOT(downloadError(QString)));
    dfh->beginDownload();
}