mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
Add an object saving completion message, so that the user knows when saving is finished.
This commit is contained in:
parent
2387958422
commit
864dbb0ab5
@ -172,6 +172,7 @@ void UAVObjectUtilManager::objectPersistenceOperationFailed()
|
||||
obj->disconnect(this);
|
||||
queue.dequeue(); // We can now remove the object, it failed anyway.
|
||||
saveState = IDLE;
|
||||
emit saveCompleted(obj->getField("ObjectID")->getValue().toInt(), false);
|
||||
saveNextObject();
|
||||
}
|
||||
}
|
||||
@ -199,6 +200,7 @@ void UAVObjectUtilManager::objectPersistenceUpdated(UAVObject * obj)
|
||||
obj->disconnect(this);
|
||||
queue.dequeue(); // We can now remove the object, it's done.
|
||||
saveState = IDLE;
|
||||
emit saveCompleted(obj->getField("ObjectID")->getValue().toInt(), true);
|
||||
saveNextObject();
|
||||
}
|
||||
}
|
||||
|
@ -67,6 +67,8 @@ public:
|
||||
UAVObjectManager* getObjectManager();
|
||||
void saveObjectToSD(UAVObject *obj);
|
||||
|
||||
signals:
|
||||
void saveCompleted(int objectID, bool status);
|
||||
|
||||
private:
|
||||
QMutex *mutex;
|
||||
|
@ -84,6 +84,7 @@ void ImportSummaryDialog::doTheSaving()
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
|
||||
UAVObjectUtilManager *utilManager = pm->getObject<UAVObjectUtilManager>();
|
||||
connect(utilManager, SIGNAL(saveCompleted(int,bool)), this, SLOT(updateSaveCompletion()));
|
||||
|
||||
for(int i=0; i < ui->importSummaryList->rowCount(); i++) {
|
||||
QString uavObjectName = ui->importSummaryList->item(i,1)->text();
|
||||
@ -91,12 +92,17 @@ void ImportSummaryDialog::doTheSaving()
|
||||
if (box->isChecked()) {
|
||||
UAVObject* obj = objManager->getObject(uavObjectName);
|
||||
utilManager->saveObjectToSD(obj);
|
||||
ui->progressBar->setValue(i);
|
||||
this->repaint();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ImportSummaryDialog::updateSaveCompletion()
|
||||
{
|
||||
ui->progressBar->setValue(ui->progressBar->value()+1);
|
||||
}
|
||||
|
||||
void ImportSummaryDialog::changeEvent(QEvent *e)
|
||||
{
|
||||
QDialog::changeEvent(e);
|
||||
|
@ -57,8 +57,10 @@ protected:
|
||||
private:
|
||||
Ui::ImportSummaryDialog *ui;
|
||||
|
||||
private slots:
|
||||
public slots:
|
||||
void updateSaveCompletion();
|
||||
|
||||
private slots:
|
||||
void doTheSaving();
|
||||
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user