| 162 | } |
| 163 | |
| 164 | rdcstr ReplayManager::CopyCaptureToRemote(const rdcstr &localpath, QWidget *window) |
| 165 | { |
| 166 | if(!m_Remote) |
| 167 | return ""; |
| 168 | |
| 169 | rdcstr remotepath; |
| 170 | |
| 171 | QAtomicInt copied = 0; |
| 172 | float progress = 0.0f; |
| 173 | |
| 174 | auto lambda = [this, localpath, &remotepath, &progress, &copied](IReplayController *r) { |
| 175 | QMutexLocker autolock(&m_RemoteLock); |
| 176 | remotepath = m_Remote->CopyCaptureToRemote(localpath, [&progress](float p) { progress = p; }); |
| 177 | copied = 1; |
| 178 | }; |
| 179 | |
| 180 | // we should never have the thread running at this point, but let's be safe. |
| 181 | if(IsRunning()) |
| 182 | { |
| 183 | AsyncInvoke(lambda); |
| 184 | } |
| 185 | else |
| 186 | { |
| 187 | LambdaThread *thread = new LambdaThread([&lambda]() { lambda(NULL); }); |
| 188 | thread->selfDelete(true); |
| 189 | thread->setName(lit("CopyCaptureToRemote")); |
| 190 | thread->start(); |
| 191 | } |
| 192 | |
| 193 | ShowProgressDialog( |
| 194 | window, tr("Transferring..."), [&copied]() { return copied == 1; }, |
| 195 | [&progress]() { return progress; }); |
| 196 | |
| 197 | return remotepath; |
| 198 | } |
| 199 | |
| 200 | void ReplayManager::CopyCaptureFromRemote(const rdcstr &remotepath, const rdcstr &localpath, |
| 201 | QWidget *window) |
no test coverage detected