2011-11-10 15:20:17 +01:00
|
|
|
#ifndef QRCODEDIALOG_H
|
|
|
|
#define QRCODEDIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QImage>
|
2013-10-18 13:08:30 +02:00
|
|
|
#include <QLabel>
|
2011-11-10 15:20:17 +01:00
|
|
|
|
|
|
|
namespace Ui {
|
2013-10-16 15:14:26 +02:00
|
|
|
class ReceiveRequestDialog;
|
2011-11-10 15:20:17 +01:00
|
|
|
}
|
2012-06-24 18:28:05 +02:00
|
|
|
class OptionsModel;
|
2011-11-10 15:20:17 +01:00
|
|
|
|
2013-10-18 13:08:30 +02:00
|
|
|
/* Label widget for QR code. This image can be dragged, dropped, copied and saved
|
|
|
|
* to disk.
|
|
|
|
*/
|
|
|
|
class QRImageWidget : public QLabel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit QRImageWidget(QWidget *parent = 0);
|
|
|
|
QImage exportImage();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void saveImage();
|
|
|
|
void copyImage();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void mousePressEvent(QMouseEvent *event);
|
|
|
|
};
|
|
|
|
|
2013-10-16 15:14:26 +02:00
|
|
|
class ReceiveRequestDialog : public QDialog
|
2011-11-10 15:20:17 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-10-16 15:14:26 +02:00
|
|
|
explicit ReceiveRequestDialog(const QString &addr, const QString &label, quint64 amount, const QString &message, QWidget *parent = 0);
|
|
|
|
~ReceiveRequestDialog();
|
2011-11-10 15:20:17 +01:00
|
|
|
|
2012-06-24 18:28:05 +02:00
|
|
|
void setModel(OptionsModel *model);
|
|
|
|
|
2011-11-10 15:20:17 +01:00
|
|
|
private slots:
|
2012-06-24 18:28:05 +02:00
|
|
|
void on_lnReqAmount_textChanged();
|
|
|
|
void on_lnLabel_textChanged();
|
|
|
|
void on_lnMessage_textChanged();
|
2011-11-10 15:20:17 +01:00
|
|
|
|
2012-06-24 18:28:05 +02:00
|
|
|
void updateDisplayUnit();
|
2011-11-10 15:20:17 +01:00
|
|
|
|
|
|
|
private:
|
2013-10-16 15:14:26 +02:00
|
|
|
Ui::ReceiveRequestDialog *ui;
|
2012-06-24 18:28:05 +02:00
|
|
|
OptionsModel *model;
|
2011-11-10 15:20:17 +01:00
|
|
|
QString address;
|
|
|
|
|
|
|
|
void genCode();
|
2012-06-24 18:28:05 +02:00
|
|
|
QString getURI();
|
2011-11-10 15:20:17 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QRCODEDIALOG_H
|