mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 08:38:45 +00:00
Device: allow status updates from all methods
turned statusCallback into a member of Device (instead of a parameter to download() and preview(). This allows all methods to access it, directly and provide better feedback during open/close/erase.
This commit is contained in:
@@ -266,11 +266,10 @@ DownloadRideDialog::downloadClicked()
|
||||
QList<DeviceDownloadFile> files;
|
||||
|
||||
DevicesPtr devtype = Devices::getType(deviceCombo->currentText());
|
||||
DevicePtr device = devtype->newDevice( dev );
|
||||
DevicePtr device = devtype->newDevice( dev,
|
||||
boost::bind(&DownloadRideDialog::updateStatus, this, _1) );
|
||||
|
||||
if( ! device->preview(
|
||||
boost::bind(&DownloadRideDialog::updateStatus, this, _1),
|
||||
err ) ){
|
||||
if( ! device->preview( err ) ){
|
||||
|
||||
QMessageBox::information(this, tr("Preview failed"), err);
|
||||
updateAction( actionIdle );
|
||||
@@ -287,7 +286,6 @@ DownloadRideDialog::downloadClicked()
|
||||
|
||||
if (!device->download( home, files,
|
||||
boost::bind(&DownloadRideDialog::isCancelled, this),
|
||||
boost::bind(&DownloadRideDialog::updateStatus, this, _1),
|
||||
boost::bind(&DownloadRideDialog::updateProgress, this, _1),
|
||||
err))
|
||||
{
|
||||
@@ -398,7 +396,8 @@ DownloadRideDialog::eraseClicked()
|
||||
}
|
||||
assert(dev);
|
||||
DevicesPtr devtype = Devices::getType(deviceCombo->currentText());
|
||||
DevicePtr device = devtype->newDevice( dev );
|
||||
DevicePtr device = devtype->newDevice( dev,
|
||||
boost::bind(&DownloadRideDialog::updateStatus, this, _1) );
|
||||
|
||||
QString err;
|
||||
if( device->cleanup( err) )
|
||||
|
||||
Reference in New Issue
Block a user