]>
glassweightruler.freedombox.rocks Git - Ventoy.git/blob - LinuxGUI/Ventoy2Disk/QT/ventoy2diskwindow.h
1 #ifndef VENTOY2DISKWINDOW_H
2 #define VENTOY2DISKWINDOW_H
5 #include <QActionGroup>
6 #include <QJsonDocument>
13 #include <QCloseEvent>
15 #include "partcfgdialog.h"
18 namespace Ui
{ class Ventoy2DiskWindow
; }
21 #define THREAD_TYPE_INSTALL 1
22 #define THREAD_TYPE_UPDATE 2
24 #define THREAD_MSG_PROGRESS_BAR 1
25 #define THREAD_MSG_INSTALL_FINISH 2
26 #define THREAD_MSG_UPDATE_FINISH 3
28 class MyQThread
: public QThread
32 quint64 m_reserve_space
;
41 explicit MyQThread(QObject
*parent
= nullptr);
45 void thread_event(int msg
, int data
);
50 class Ventoy2DiskWindow
: public QMainWindow
55 Ventoy2DiskWindow(QWidget
*parent
= nullptr);
58 QActionGroup
*m_part_group
;
59 QActionGroup
*m_lang_group
;
60 QJsonArray m_lang_array
;
61 PartCfgDialog
*m_partcfg
;
64 void FillDeviceList(const QString
&select
);
65 void OnInitWindow(void);
67 int lang_string(const QString
&id
, QString
&str
);
68 void update_ui_language();
69 void set_percent(int percent
);
71 void showEvent(QShowEvent
*ev
);
72 void closeEvent(QCloseEvent
*event
);
76 void thread_event(int msg
, int data
);
77 void part_style_check_action(QAction
*act
);
78 void lang_check_action(QAction
*act
);
80 void on_ButtonInstall_clicked();
82 void on_ButtonUpdate_clicked();
84 void on_ButtonRefresh_clicked();
86 void on_comboBoxDevice_currentIndexChanged(int index
);
88 void on_actionPartition_Configuration_triggered();
90 void on_actionClear_Ventoy_triggered();
92 void on_actionShow_All_Devices_toggled(bool arg1
);
94 void on_actionSecure_Boot_Support_triggered();
97 Ui::Ventoy2DiskWindow
*ui
;
102 #define _LANG_STR(id) obj.value(id).toString()
103 #define VERSION_FMT "<html><head/><body><p><span style=\" font-size:20pt; font-weight:600; color:#ff0000;\">%s</span></p></body></html>"
105 #endif // VENTOY2DISKWINDOW_H