* \brief Add a file to the download list * @param desc as the given file description */
| 152 | * @param desc as the given file description |
| 153 | */ |
| 154 | int UBDownloadManager::addFileToDownload(sDownloadFileDesc desc) |
| 155 | { |
| 156 | // Set the ID for this download |
| 157 | desc.id = mLastID; |
| 158 | mLastID++; |
| 159 | |
| 160 | // Add the file to the pending download list |
| 161 | mPendingDL.append(desc); |
| 162 | |
| 163 | // If the download is modal, show the download dialog |
| 164 | if(desc.modal) |
| 165 | { |
| 166 | // Update the download order (priority to modal files) |
| 167 | updateDownloadOrder(); |
| 168 | UBApplication::mainWindow->showDownloadWidget(); |
| 169 | } |
| 170 | UBApplication::boardController->paletteManager()->startDownloads(); |
| 171 | |
| 172 | emit fileAddedToDownload(); |
| 173 | |
| 174 | return desc.id; |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * \brief Initialize the download manager |
no test coverage detected