QTfrontend/ui/page/pagevideos.cpp
branchflibqtfrontend
changeset 8218 a61eacecf091
parent 8203 2c98ec41697a
child 8330 aaefa587e277
child 8362 89a6b7cc6f95
equal deleted inserted replaced
8216:4a7535d17d57 8218:a61eacecf091
   860 void PageVideos::uploadToYouTube()
   860 void PageVideos::uploadToYouTube()
   861 {
   861 {
   862     int row = filesTable->currentRow();
   862     int row = filesTable->currentRow();
   863     VideoItem * item = nameItem(row);
   863     VideoItem * item = nameItem(row);
   864 
   864 
   865     if (item->pUploading)
   865     if (item->pUploading) //Act as 'cancel uploading' button
   866     {
   866     {
   867         // ask user if (s)he is serious
   867         // ask user if (s)he is serious
   868         QMessageBox reallyStopMsg(this);
   868         QMessageBox reallyStopMsg(this);
   869         reallyStopMsg.setIcon(QMessageBox::Question);
   869         reallyStopMsg.setIcon(QMessageBox::Question);
   870         reallyStopMsg.setWindowTitle(QMessageBox::tr("Videos - Are you sure?"));
   870         reallyStopMsg.setWindowTitle(QMessageBox::tr("Videos - Are you sure?"));
   872         reallyStopMsg.setWindowModality(Qt::WindowModal);
   872         reallyStopMsg.setWindowModality(Qt::WindowModal);
   873         reallyStopMsg.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
   873         reallyStopMsg.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
   874 
   874 
   875         if (reallyStopMsg.exec() != QMessageBox::Ok)
   875         if (reallyStopMsg.exec() != QMessageBox::Ok)
   876             return;
   876             return;
   877         item->pUploading->deleteLater();
   877         item->pUploading->abort();
       
   878         btnToYouTube->setText(QPushButton::tr("Upload to YouTube"));
   878         filesTable->setCellWidget(row, vcProgress, NULL); // remove progress bar
   879         filesTable->setCellWidget(row, vcProgress, NULL); // remove progress bar
   879         numUploads--;
   880         //numUploads--;
   880         return;
   881         return;
   881     }
   882     }
   882 
   883 
   883     if (!netManager)
   884     if (!netManager)
   884         netManager = new QNetworkAccessManager(this);
   885         netManager = new QNetworkAccessManager(this);