code_app/app/fwupgrade/mainwindow.h

73 lines
1.6 KiB
C
Raw Normal View History

2022-11-10 02:22:58 +00:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
2022-11-10 09:23:16 +00:00
#include "version/HGVersion.h"
#include "sane/sane_ex.h"
2022-11-10 02:22:58 +00:00
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
struct VersionInfo
{
std::string version;
std::string url;
std::string md5;
};
2022-11-10 02:22:58 +00:00
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
2022-11-10 09:23:16 +00:00
static QString passwordEncrypt(const QString& password);
static QString passwordDecrypt(const QString& transcode);
static QString GetDevType(const QString& fwVersion, bool *canLock);
2022-11-10 09:23:16 +00:00
signals:
void sane_dev_arrive(QString devName, bool opened);
void sane_dev_remove(QString devName);
private slots:
void on_sane_dev_arrive(QString devName, bool opened);
void on_sane_dev_remove(QString devName);
void on_btnExit_clicked();
void on_comboDevList_currentIndexChanged(int index);
void on_btnGetVersionList_clicked();
void on_comboVersionList_currentIndexChanged(int index);
void on_editFilePath_textChanged(const QString &arg1);
void on_btnOpenFilePath_clicked();
void on_btnDownloadUpgrade_clicked();
void on_btnUpgrade_clicked();
void on_comboDevList2_currentIndexChanged(int index);
void on_btnClearRollCount_clicked();
void on_btnModifyPassword_clicked();
private:
static int sane_ex_callback(SANE_Handle hdev, int code, void *data, unsigned int* len, void *param);
2022-11-10 02:22:58 +00:00
private:
Ui::MainWindow *ui;
2022-11-10 09:23:16 +00:00
HGVersionMgr m_versionMgr;
std::vector<VersionInfo> m_vVersion;
2022-11-10 09:23:16 +00:00
QString m_curDevName;
SANE_Handle m_curDevHandle;
QString m_curFwVersion;
2022-11-10 02:22:58 +00:00
};
#endif // MAINWINDOW_H