2011-07-19 15:50:42 +02:00
|
|
|
#ifndef SMARTSAVEBUTTON_H
|
|
|
|
#define SMARTSAVEBUTTON_H
|
|
|
|
|
|
|
|
#include "uavtalk/telemetrymanager.h"
|
|
|
|
#include "extensionsystem/pluginmanager.h"
|
|
|
|
#include "uavobjectmanager.h"
|
|
|
|
#include "uavobject.h"
|
|
|
|
#include <QPushButton>
|
|
|
|
#include <QList>
|
|
|
|
#include <QEventLoop>
|
|
|
|
#include "uavobjectutilmanager.h"
|
|
|
|
#include <QObject>
|
2011-07-26 21:35:38 +02:00
|
|
|
#include <QDebug>
|
2011-07-19 15:50:42 +02:00
|
|
|
class smartSaveButton:public QObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
smartSaveButton(QPushButton * update,QPushButton * save);
|
|
|
|
void setObjects(QList<UAVObject *>);
|
|
|
|
void addObject(UAVObject *);
|
|
|
|
void clearObjects();
|
|
|
|
signals:
|
|
|
|
void preProcessOperations();
|
2011-07-26 21:35:38 +02:00
|
|
|
void saveSuccessfull();
|
|
|
|
void beginOp();
|
|
|
|
void endOp();
|
2011-07-19 15:50:42 +02:00
|
|
|
private slots:
|
|
|
|
void processClick();
|
|
|
|
void transaction_finished(UAVObject* obj, bool result);
|
|
|
|
void saving_finished(int,bool);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QPushButton *bupdate;
|
|
|
|
QPushButton *bsave;
|
|
|
|
quint32 current_objectID;
|
|
|
|
UAVObject * current_object;
|
|
|
|
bool up_result;
|
|
|
|
bool sv_result;
|
|
|
|
QEventLoop loop;
|
|
|
|
QList<UAVObject *> objects;
|
|
|
|
protected:
|
2011-07-26 00:18:41 +02:00
|
|
|
public slots:
|
|
|
|
void enableControls(bool value);
|
2011-07-19 15:50:42 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // SMARTSAVEBUTTON_H
|