mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Connect the progress events to the progress bar
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1d67bae745
commit
724170f4b6
3 changed files with 16 additions and 0 deletions
|
@ -30,6 +30,7 @@ void ConfigureDiveComputer::readSettings(device_data_t *data)
|
|||
connect(readThread, SIGNAL(error(QString)), this, SLOT(setError(QString)));
|
||||
connect(readThread, SIGNAL(devicedetails(DeviceDetails *)), this,
|
||||
SIGNAL(deviceDetailsChanged(DeviceDetails *)));
|
||||
connect(readThread, SIGNAL(progress(int)), this, SLOT(progressEvent(int)));
|
||||
|
||||
readThread->start();
|
||||
}
|
||||
|
@ -45,6 +46,7 @@ void ConfigureDiveComputer::saveDeviceDetails(DeviceDetails *details, device_dat
|
|||
connect(writeThread, SIGNAL(finished()),
|
||||
this, SLOT(writeThreadFinished()), Qt::QueuedConnection);
|
||||
connect(writeThread, SIGNAL(error(QString)), this, SLOT(setError(QString)));
|
||||
connect(writeThread, SIGNAL(progress(int)), this, SLOT(progressEvent(int)));
|
||||
|
||||
writeThread->setDeviceDetails(details);
|
||||
writeThread->start();
|
||||
|
@ -504,6 +506,8 @@ void ConfigureDiveComputer::startFirmwareUpdate(QString fileName, device_data_t
|
|||
connect(firmwareThread, SIGNAL(finished()),
|
||||
this, SLOT(firmwareThreadFinished()), Qt::QueuedConnection);
|
||||
connect(firmwareThread, SIGNAL(error(QString)), this, SLOT(setError(QString)));
|
||||
connect(firmwareThread, SIGNAL(progress(int)), this, SLOT(progressEvent(int)));
|
||||
|
||||
firmwareThread->start();
|
||||
}
|
||||
|
||||
|
@ -518,10 +522,16 @@ void ConfigureDiveComputer::resetSettings(device_data_t *data)
|
|||
connect(resetThread, SIGNAL(finished()),
|
||||
this, SLOT(resetThreadFinished()), Qt::QueuedConnection);
|
||||
connect(resetThread, SIGNAL(error(QString)), this, SLOT(setError(QString)));
|
||||
connect(resetThread, SIGNAL(progress(int)), this, SLOT(progressEvent(int)));
|
||||
|
||||
resetThread->start();
|
||||
}
|
||||
|
||||
void ConfigureDiveComputer::progressEvent(int percent)
|
||||
{
|
||||
emit progress(percent);
|
||||
}
|
||||
|
||||
void ConfigureDiveComputer::setState(ConfigureDiveComputer::states newState)
|
||||
{
|
||||
currentState = newState;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue