Commit d1481392 authored by longpanda's avatar longpanda
Browse files

Add QT GUI install program

parent dd2411d7
/****************************************************************************
** Meta object code from reading C++ file 'ventoy2diskwindow.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.9.0)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../ventoy2diskwindow.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'ventoy2diskwindow.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.9.0. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_MyQThread_t {
QByteArrayData data[5];
char stringdata0[33];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_MyQThread_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_MyQThread_t qt_meta_stringdata_MyQThread = {
{
QT_MOC_LITERAL(0, 0, 9), // "MyQThread"
QT_MOC_LITERAL(1, 10, 12), // "thread_event"
QT_MOC_LITERAL(2, 23, 0), // ""
QT_MOC_LITERAL(3, 24, 3), // "msg"
QT_MOC_LITERAL(4, 28, 4) // "data"
},
"MyQThread\0thread_event\0\0msg\0data"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_MyQThread[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
1, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
1, // signalCount
// signals: name, argc, parameters, tag, flags
1, 2, 19, 2, 0x06 /* Public */,
// signals: parameters
QMetaType::Void, QMetaType::Int, QMetaType::Int, 3, 4,
0 // eod
};
void MyQThread::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
MyQThread *_t = static_cast<MyQThread *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->thread_event((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
void **func = reinterpret_cast<void **>(_a[1]);
{
typedef void (MyQThread::*_t)(int , int );
if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&MyQThread::thread_event)) {
*result = 0;
return;
}
}
}
}
const QMetaObject MyQThread::staticMetaObject = {
{ &QThread::staticMetaObject, qt_meta_stringdata_MyQThread.data,
qt_meta_data_MyQThread, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *MyQThread::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *MyQThread::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_MyQThread.stringdata0))
return static_cast<void*>(const_cast< MyQThread*>(this));
return QThread::qt_metacast(_clname);
}
int MyQThread::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QThread::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 1)
qt_static_metacall(this, _c, _id, _a);
_id -= 1;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 1)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 1;
}
return _id;
}
// SIGNAL 0
void MyQThread::thread_event(int _t1, int _t2)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
struct qt_meta_stringdata_Ventoy2DiskWindow_t {
QByteArrayData data[19];
char stringdata0[367];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_Ventoy2DiskWindow_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_Ventoy2DiskWindow_t qt_meta_stringdata_Ventoy2DiskWindow = {
{
QT_MOC_LITERAL(0, 0, 17), // "Ventoy2DiskWindow"
QT_MOC_LITERAL(1, 18, 12), // "thread_event"
QT_MOC_LITERAL(2, 31, 0), // ""
QT_MOC_LITERAL(3, 32, 3), // "msg"
QT_MOC_LITERAL(4, 36, 4), // "data"
QT_MOC_LITERAL(5, 41, 23), // "part_style_check_action"
QT_MOC_LITERAL(6, 65, 8), // "QAction*"
QT_MOC_LITERAL(7, 74, 3), // "act"
QT_MOC_LITERAL(8, 78, 17), // "lang_check_action"
QT_MOC_LITERAL(9, 96, 24), // "on_ButtonInstall_clicked"
QT_MOC_LITERAL(10, 121, 23), // "on_ButtonUpdate_clicked"
QT_MOC_LITERAL(11, 145, 24), // "on_ButtonRefresh_clicked"
QT_MOC_LITERAL(12, 170, 37), // "on_comboBoxDevice_currentInde..."
QT_MOC_LITERAL(13, 208, 5), // "index"
QT_MOC_LITERAL(14, 214, 42), // "on_actionPartition_Configurat..."
QT_MOC_LITERAL(15, 257, 31), // "on_actionClear_Ventoy_triggered"
QT_MOC_LITERAL(16, 289, 33), // "on_actionShow_All_Devices_tog..."
QT_MOC_LITERAL(17, 323, 4), // "arg1"
QT_MOC_LITERAL(18, 328, 38) // "on_actionSecure_Boot_Support_..."
},
"Ventoy2DiskWindow\0thread_event\0\0msg\0"
"data\0part_style_check_action\0QAction*\0"
"act\0lang_check_action\0on_ButtonInstall_clicked\0"
"on_ButtonUpdate_clicked\0"
"on_ButtonRefresh_clicked\0"
"on_comboBoxDevice_currentIndexChanged\0"
"index\0on_actionPartition_Configuration_triggered\0"
"on_actionClear_Ventoy_triggered\0"
"on_actionShow_All_Devices_toggled\0"
"arg1\0on_actionSecure_Boot_Support_triggered"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_Ventoy2DiskWindow[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
11, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// slots: name, argc, parameters, tag, flags
1, 2, 69, 2, 0x08 /* Private */,
5, 1, 74, 2, 0x08 /* Private */,
8, 1, 77, 2, 0x08 /* Private */,
9, 0, 80, 2, 0x08 /* Private */,
10, 0, 81, 2, 0x08 /* Private */,
11, 0, 82, 2, 0x08 /* Private */,
12, 1, 83, 2, 0x08 /* Private */,
14, 0, 86, 2, 0x08 /* Private */,
15, 0, 87, 2, 0x08 /* Private */,
16, 1, 88, 2, 0x08 /* Private */,
18, 0, 91, 2, 0x08 /* Private */,
// slots: parameters
QMetaType::Void, QMetaType::Int, QMetaType::Int, 3, 4,
QMetaType::Void, 0x80000000 | 6, 7,
QMetaType::Void, 0x80000000 | 6, 7,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void, QMetaType::Int, 13,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void, QMetaType::Bool, 17,
QMetaType::Void,
0 // eod
};
void Ventoy2DiskWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Ventoy2DiskWindow *_t = static_cast<Ventoy2DiskWindow *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->thread_event((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
case 1: _t->part_style_check_action((*reinterpret_cast< QAction*(*)>(_a[1]))); break;
case 2: _t->lang_check_action((*reinterpret_cast< QAction*(*)>(_a[1]))); break;
case 3: _t->on_ButtonInstall_clicked(); break;
case 4: _t->on_ButtonUpdate_clicked(); break;
case 5: _t->on_ButtonRefresh_clicked(); break;
case 6: _t->on_comboBoxDevice_currentIndexChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
case 7: _t->on_actionPartition_Configuration_triggered(); break;
case 8: _t->on_actionClear_Ventoy_triggered(); break;
case 9: _t->on_actionShow_All_Devices_toggled((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 10: _t->on_actionSecure_Boot_Support_triggered(); break;
default: ;
}
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QAction* >(); break;
}
break;
case 2:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QAction* >(); break;
}
break;
}
}
}
const QMetaObject Ventoy2DiskWindow::staticMetaObject = {
{ &QMainWindow::staticMetaObject, qt_meta_stringdata_Ventoy2DiskWindow.data,
qt_meta_data_Ventoy2DiskWindow, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *Ventoy2DiskWindow::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *Ventoy2DiskWindow::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_Ventoy2DiskWindow.stringdata0))
return static_cast<void*>(const_cast< Ventoy2DiskWindow*>(this));
return QMainWindow::qt_metacast(_clname);
}
int Ventoy2DiskWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QMainWindow::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 11)
qt_static_metacall(this, _c, _id, _a);
_id -= 11;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 11)
qt_static_metacall(this, _c, _id, _a);
_id -= 11;
}
return _id;
}
QT_WARNING_POP
QT_END_MOC_NAMESPACE
/********************************************************************************
** Form generated from reading UI file 'partcfgdialog.ui'
**
** Created by: Qt User Interface Compiler version 5.9.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_PARTCFGDIALOG_H
#define UI_PARTCFGDIALOG_H
#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QDialog>
#include <QtWidgets/QGroupBox>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QPushButton>
QT_BEGIN_NAMESPACE
class Ui_PartCfgDialog
{
public:
QPushButton *pushButtonOK;
QPushButton *pushButtonCancel;
QGroupBox *groupBox;
QCheckBox *checkBox;
QGroupBox *groupBox_2;
QLineEdit *lineEdit;
QGroupBox *groupBox_3;
QComboBox *comboBox;
QGroupBox *groupBox_4;
QCheckBox *checkBox_2;
void setupUi(QDialog *PartCfgDialog)
{
if (PartCfgDialog->objectName().isEmpty())
PartCfgDialog->setObjectName(QStringLiteral("PartCfgDialog"));
PartCfgDialog->resize(420, 258);
pushButtonOK = new QPushButton(PartCfgDialog);
pushButtonOK->setObjectName(QStringLiteral("pushButtonOK"));
pushButtonOK->setGeometry(QRect(90, 210, 90, 30));
pushButtonCancel = new QPushButton(PartCfgDialog);
pushButtonCancel->setObjectName(QStringLiteral("pushButtonCancel"));
pushButtonCancel->setGeometry(QRect(230, 210, 90, 30));
groupBox = new QGroupBox(PartCfgDialog);
groupBox->setObjectName(QStringLiteral("groupBox"));
groupBox->setGeometry(QRect(10, 0, 400, 61));
checkBox = new QCheckBox(groupBox);
checkBox->setObjectName(QStringLiteral("checkBox"));
checkBox->setGeometry(QRect(10, 20, 381, 41));
checkBox->setAutoRepeatInterval(0);
groupBox_2 = new QGroupBox(PartCfgDialog);
groupBox_2->setObjectName(QStringLiteral("groupBox_2"));
groupBox_2->setGeometry(QRect(10, 60, 200, 61));
lineEdit = new QLineEdit(groupBox_2);
lineEdit->setObjectName(QStringLiteral("lineEdit"));
lineEdit->setGeometry(QRect(10, 30, 181, 26));
lineEdit->setMaxLength(14);
groupBox_3 = new QGroupBox(PartCfgDialog);
groupBox_3->setObjectName(QStringLiteral("groupBox_3"));
groupBox_3->setGeometry(QRect(210, 60, 200, 60));
comboBox = new QComboBox(groupBox_3);
comboBox->setObjectName(QStringLiteral("comboBox"));
comboBox->setGeometry(QRect(10, 30, 181, 26));
groupBox_4 = new QGroupBox(PartCfgDialog);
groupBox_4->setObjectName(QStringLiteral("groupBox_4"));
groupBox_4->setGeometry(QRect(10, 120, 401, 61));
checkBox_2 = new QCheckBox(groupBox_4);
checkBox_2->setObjectName(QStringLiteral("checkBox_2"));
checkBox_2->setGeometry(QRect(10, 30, 381, 24));
checkBox_2->setChecked(true);
retranslateUi(PartCfgDialog);
comboBox->setCurrentIndex(1);
QMetaObject::connectSlotsByName(PartCfgDialog);
} // setupUi
void retranslateUi(QDialog *PartCfgDialog)
{
PartCfgDialog->setWindowTitle(QApplication::translate("PartCfgDialog", "Partition Configuration", Q_NULLPTR));
pushButtonOK->setText(QApplication::translate("PartCfgDialog", "OK", Q_NULLPTR));
pushButtonCancel->setText(QApplication::translate("PartCfgDialog", "Cancel", Q_NULLPTR));
groupBox->setTitle(QString());
checkBox->setText(QApplication::translate("PartCfgDialog", "Preserve some space at the end of the disk", Q_NULLPTR));
groupBox_2->setTitle(QString());
groupBox_3->setTitle(QString());
comboBox->clear();
comboBox->insertItems(0, QStringList()
<< QApplication::translate("PartCfgDialog", "MB", Q_NULLPTR)
<< QApplication::translate("PartCfgDialog", "GB", Q_NULLPTR)
);
groupBox_4->setTitle(QString());
checkBox_2->setText(QApplication::translate("PartCfgDialog", "Align partitions with 4KB", Q_NULLPTR));
} // retranslateUi
};
namespace Ui {
class PartCfgDialog: public Ui_PartCfgDialog {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_PARTCFGDIALOG_H
/********************************************************************************
** Form generated from reading UI file 'ventoy2diskwindow.ui'
**
** Created by: Qt User Interface Compiler version 5.9.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_VENTOY2DISKWINDOW_H
#define UI_VENTOY2DISKWINDOW_H
#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QGroupBox>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QLabel>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QMenu>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QProgressBar>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_Ventoy2DiskWindow
{
public:
QAction *actionSecure_Boot_Support;
QAction *actionMBR;
QAction *actionGPT;
QAction *actionPartition_Configuration;
QAction *actionClear_Ventoy;
QAction *actionShow_All_Devices;
QWidget *centralwidget;
QGroupBox *groupBoxDevice;
QComboBox *comboBoxDevice;
QPushButton *ButtonRefresh;
QGroupBox *groupBoxVentoyLocal;
QLabel *labelVentoyLocalVer;
QLabel *labelVentoyLocalPartStyle;
QLabel *labelVentoyLocalSecure;
QGroupBox *groupBoxVentoyDevice;
QLabel *labelVentoyDeviceVer;
QLabel *labelVentoyDevicePartStyle;
QLabel *labelVentoyDeviceSecure;
QGroupBox *groupBoxStatus;
QProgressBar *progressBar;
QPushButton *ButtonInstall;
QPushButton *ButtonUpdate;
QMenuBar *menubar;
QMenu *menuOption;
QMenu *menuPartition_Style;
QMenu *menuLanguage;
void setupUi(QMainWindow *Ventoy2DiskWindow)
{
if (Ventoy2DiskWindow->objectName().isEmpty())
Ventoy2DiskWindow->setObjectName(QStringLiteral("Ventoy2DiskWindow"));
Ventoy2DiskWindow->resize(441, 367);
actionSecure_Boot_Support = new QAction(Ventoy2DiskWindow);
actionSecure_Boot_Support->setObjectName(QStringLiteral("actionSecure_Boot_Support"));
actionSecure_Boot_Support->setCheckable(true);
actionMBR = new QAction(Ventoy2DiskWindow);
actionMBR->setObjectName(QStringLiteral("actionMBR"));
actionMBR->setCheckable(true);
actionGPT = new QAction(Ventoy2DiskWindow);
actionGPT->setObjectName(QStringLiteral("actionGPT"));
actionGPT->setCheckable(true);
actionPartition_Configuration = new QAction(Ventoy2DiskWindow);
actionPartition_Configuration->setObjectName(QStringLiteral("actionPartition_Configuration"));
actionClear_Ventoy = new QAction(Ventoy2DiskWindow);
actionClear_Ventoy->setObjectName(QStringLiteral("actionClear_Ventoy"));
actionShow_All_Devices = new QAction(Ventoy2DiskWindow);
actionShow_All_Devices->setObjectName(QStringLiteral("actionShow_All_Devices"));
actionShow_All_Devices->setCheckable(true);
centralwidget = new QWidget(Ventoy2DiskWindow);
centralwidget->setObjectName(QStringLiteral("centralwidget"));
groupBoxDevice = new QGroupBox(centralwidget);
groupBoxDevice->setObjectName(QStringLiteral("groupBoxDevice"));
groupBoxDevice->setGeometry(QRect(10, 10, 421, 80));
comboBoxDevice = new QComboBox(groupBoxDevice);
comboBoxDevice->setObjectName(QStringLiteral("comboBoxDevice"));
comboBoxDevice->setGeometry(QRect(10, 40, 361, 26));
ButtonRefresh = new QPushButton(groupBoxDevice);
ButtonRefresh->setObjectName(QStringLiteral("ButtonRefresh"));
ButtonRefresh->setGeometry(QRect(380, 37, 30, 30));
QIcon icon;
icon.addFile(QStringLiteral("../refresh.ico"), QSize(), QIcon::Normal, QIcon::Off);
ButtonRefresh->setIcon(icon);
ButtonRefresh->setIconSize(QSize(24, 24));
groupBoxVentoyLocal = new QGroupBox(centralwidget);
groupBoxVentoyLocal->setObjectName(QStringLiteral("groupBoxVentoyLocal"));
groupBoxVentoyLocal->setGeometry(QRect(10, 100, 205, 80));
groupBoxVentoyLocal->setAlignment(Qt::AlignCenter);
labelVentoyLocalVer = new QLabel(groupBoxVentoyLocal);
labelVentoyLocalVer->setObjectName(QStringLiteral("labelVentoyLocalVer"));
labelVentoyLocalVer->setGeometry(QRect(30, 30, 135, 41));
labelVentoyLocalVer->setAlignment(Qt::AlignCenter);
labelVentoyLocalPartStyle = new QLabel(groupBoxVentoyLocal);
labelVentoyLocalPartStyle->setObjectName(QStringLiteral("labelVentoyLocalPartStyle"));
labelVentoyLocalPartStyle->setGeometry(QRect(172, 60, 31, 18));
labelVentoyLocalSecure = new QLabel(groupBoxVentoyLocal);
labelVentoyLocalSecure->setObjectName(QStringLiteral("labelVentoyLocalSecure"));
labelVentoyLocalSecure->setGeometry(QRect(12, 36, 21, 31));
labelVentoyLocalSecure->setPixmap(QPixmap(QString::fromUtf8("../secure.ico")));
groupBoxVentoyDevice = new QGroupBox(centralwidget);
groupBoxVentoyDevice->setObjectName(QStringLiteral("groupBoxVentoyDevice"));
groupBoxVentoyDevice->setGeometry(QRect(225, 100, 205, 80));
groupBoxVentoyDevice->setAlignment(Qt::AlignCenter);
labelVentoyDeviceVer = new QLabel(groupBoxVentoyDevice);
labelVentoyDeviceVer->setObjectName(QStringLiteral("labelVentoyDeviceVer"));
labelVentoyDeviceVer->setGeometry(QRect(30, 30, 135, 41));
labelVentoyDeviceVer->setAlignment(Qt::AlignCenter);
labelVentoyDevicePartStyle = new QLabel(groupBoxVentoyDevice);
labelVentoyDevicePartStyle->setObjectName(QStringLiteral("labelVentoyDevicePartStyle"));
labelVentoyDevicePartStyle->setGeometry(QRect(172, 60, 31, 18));
labelVentoyDeviceSecure = new QLabel(groupBoxVentoyDevice);
labelVentoyDeviceSecure->setObjectName(QStringLiteral("labelVentoyDeviceSecure"));
labelVentoyDeviceSecure->setGeometry(QRect(12, 36, 21, 31));
labelVentoyDeviceSecure->setPixmap(QPixmap(QString::fromUtf8("../secure.ico")));
groupBoxStatus = new QGroupBox(centralwidget);
groupBoxStatus->setObjectName(QStringLiteral("groupBoxStatus"));
groupBoxStatus->setGeometry(QRect(10, 190, 421, 61));
progressBar = new QProgressBar(groupBoxStatus);
progressBar->setObjectName(QStringLiteral("progressBar"));
progressBar->setGeometry(QRect(10, 30, 401, 23));
progressBar->setValue(0);
progressBar->setTextVisible(false);
ButtonInstall = new QPushButton(centralwidget);
ButtonInstall->setObjectName(QStringLiteral("ButtonInstall"));
ButtonInstall->setGeometry(QRect(90, 275, 101, 41));
ButtonUpdate = new QPushButton(centralwidget);
ButtonUpdate->setObjectName(QStringLiteral("ButtonUpdate"));
ButtonUpdate->setGeometry(QRect(250, 275, 101, 41));
Ventoy2DiskWindow->setCentralWidget(centralwidget);
menubar = new QMenuBar(Ventoy2DiskWindow);
menubar->setObjectName(QStringLiteral("menubar"));
menubar->setGeometry(QRect(0, 0, 441, 23));
menuOption = new QMenu(menubar);
menuOption->setObjectName(QStringLiteral("menuOption"));
menuPartition_Style = new QMenu(menuOption);
menuPartition_Style->setObjectName(QStringLiteral("menuPartition_Style"));
menuLanguage = new QMenu(menubar);
menuLanguage->setObjectName(QStringLiteral("menuLanguage"));
Ventoy2DiskWindow->setMenuBar(menubar);
menubar->addAction(menuOption->menuAction());
menubar->addAction(menuLanguage->menuAction());
menuOption->addAction(actionSecure_Boot_Support);
menuOption->addAction(menuPartition_Style->menuAction());
menuOption->addAction(actionPartition_Configuration);
menuOption->addAction(actionClear_Ventoy);
menuOption->addAction(actionShow_All_Devices);
menuPartition_Style->addAction(actionMBR);
menuPartition_Style->addAction(actionGPT);
retranslateUi(Ventoy2DiskWindow);
QMetaObject::connectSlotsByName(Ventoy2DiskWindow);
} // setupUi
void retranslateUi(QMainWindow *Ventoy2DiskWindow)
{
Ventoy2DiskWindow->setWindowTitle(QApplication::translate("Ventoy2DiskWindow", "Ventoy2Disk", Q_NULLPTR));
actionSecure_Boot_Support->setText(QApplication::translate("Ventoy2DiskWindow", "Secure Boot Support", Q_NULLPTR));
actionMBR->setText(QApplication::translate("Ventoy2DiskWindow", "MBR", Q_NULLPTR));
actionGPT->setText(QApplication::translate("Ventoy2DiskWindow", "GPT", Q_NULLPTR));
actionPartition_Configuration->setText(QApplication::translate("Ventoy2DiskWindow", "Partition Configuration", Q_NULLPTR));
actionClear_Ventoy->setText(QApplication::translate("Ventoy2DiskWindow", "Clear Ventoy", Q_NULLPTR));
actionShow_All_Devices->setText(QApplication::translate("Ventoy2DiskWindow", "Show All Devices", Q_NULLPTR));
groupBoxDevice->setTitle(QApplication::translate("Ventoy2DiskWindow", "Device", Q_NULLPTR));
ButtonRefresh->setText(QString());
groupBoxVentoyLocal->setTitle(QApplication::translate("Ventoy2DiskWindow", "Ventoy In Package", Q_NULLPTR));
labelVentoyLocalVer->setText(QApplication::translate("Ventoy2DiskWindow", "<html><head/><body><p><span style=\" font-size:20pt; font-weight:600; color:#ff0000;\">1.0.53</span></p></body></html>", Q_NULLPTR));
labelVentoyLocalPartStyle->setText(QApplication::translate("Ventoy2DiskWindow", "<html><head/><body><p>MBR</p></body></html>", Q_NULLPTR));
labelVentoyLocalSecure->setText(QString());
groupBoxVentoyDevice->setTitle(QApplication::translate("Ventoy2DiskWindow", "Ventoy In Device", Q_NULLPTR));
labelVentoyDeviceVer->setText(QApplication::translate("Ventoy2DiskWindow", "<html><head/><body><p><span style=\" font-size:20pt; font-weight:600; color:#ff0000;\">1.0.52</span></p></body></html>", Q_NULLPTR));
labelVentoyDevicePartStyle->setText(QApplication::translate("Ventoy2DiskWindow", "<html><head/><body><p>GPT</p></body></html>", Q_NULLPTR));
labelVentoyDeviceSecure->setText(QString());
groupBoxStatus->setTitle(QApplication::translate("Ventoy2DiskWindow", "Status: REDAY", Q_NULLPTR));
progressBar->setFormat(QString());
ButtonInstall->setText(QApplication::translate("Ventoy2DiskWindow", "Install", Q_NULLPTR));
ButtonUpdate->setText(QApplication::translate("Ventoy2DiskWindow", "Update", Q_NULLPTR));
menuOption->setTitle(QApplication::translate("Ventoy2DiskWindow", "Option", Q_NULLPTR));
menuPartition_Style->setTitle(QApplication::translate("Ventoy2DiskWindow", "Partition Style", Q_NULLPTR));
menuLanguage->setTitle(QApplication::translate("Ventoy2DiskWindow", "Language", Q_NULLPTR));
} // retranslateUi
};
namespace Ui {
class Ventoy2DiskWindow: public Ui_Ventoy2DiskWindow {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_VENTOY2DISKWINDOW_H
#include "ventoy2diskwindow.h"
#include <QApplication>
#include <QMessageBox>
#include <QFileInfo>
#include <QStyle>
#include <QDesktopWidget>
#include <QPixmap>
#include <unistd.h>
#include <sys/types.h>
extern "C" {
#include "ventoy_define.h"
#include "ventoy_util.h"
#include "ventoy_qt.h"
}
using namespace std;
char g_log_file[4096];
char g_ini_file[4096];
int main(int argc, char *argv[])
{
int ret;
QApplication a(argc, argv);
Ventoy2DiskWindow w;
#ifdef QT_CHECK_EUID
if (geteuid() != 0)
{
QMessageBox::critical(NULL, "Error", "Permission denied!\nPlease run with root privileges.");
return 1;
}
#endif
if (!QFileInfo::exists("./boot/boot.img"))
{
QMessageBox::critical(NULL, "Error", "Please run under the correct directory.");
return 1;
}
ventoy_log_init();
snprintf(g_log_file, sizeof(g_log_file), "./log.txt");
snprintf(g_ini_file, sizeof(g_ini_file), "./Ventoy2Disk.ini");
for (int i = 0; i < argc; i++)
{
if (argv[i] && argv[i + 1] && strcmp(argv[i], "-l") == 0)
{
snprintf(g_log_file, sizeof(g_log_file), "%s", argv[i + 1]);
}
else if (argv[i] && argv[i + 1] && strcmp(argv[i], "-i") == 0)
{
snprintf(g_ini_file, sizeof(g_ini_file), "%s", argv[i + 1]);
}
}
vlog("===================================================\n");
vlog("===== Ventoy2Disk %s powered by QT %s =====\n", ventoy_get_local_version(), qVersion());
vlog("===================================================\n");
ventoy_disk_init();
ventoy_http_init();
w.setGeometry(QStyle::alignedRect(Qt::LeftToRight,
Qt::AlignCenter,
w.size(),
a.desktop()->availableGeometry()));
QPixmap pix;
QIcon icon;
int len;
const uchar *data;
data = (const uchar *)get_window_icon_raw_data(&len);
pix.loadFromData(data, len);
icon.addPixmap(pix);
w.setWindowIcon(icon);
w.show();
w.setFixedSize(w.size());
ret = a.exec();
ventoy_disk_exit();
ventoy_http_exit();
vlog("######## Ventoy2Disk QT %s exit ########\n", ventoy_get_local_version());
/* log exit must at the end */
ventoy_log_exit();
return ret;
}
#include "partcfgdialog.h"
#include "ui_partcfgdialog.h"
#include <QDebug>
#include <QMessageBox>
PartCfgDialog::PartCfgDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::PartCfgDialog)
{
reserve = false;
unit = 1;
align = true;
valuestr = "";
resvalue = 0;
ui->setupUi(this);
ui->lineEdit->setEnabled(false);
ui->comboBox->setEnabled(false);
}
PartCfgDialog::~PartCfgDialog()
{
delete ui;
}
void PartCfgDialog::update_ui_status()
{
ui->checkBox->setChecked(reserve);
ui->lineEdit->setEnabled(reserve);
ui->comboBox->setEnabled(reserve);
ui->checkBox_2->setChecked(align);
}
void PartCfgDialog::update_language_ui(QJsonObject &obj)
{
ui->checkBox->setText(_LANG_STR("STR_PRESERVE_SPACE"));
ui->checkBox_2->setText(_LANG_STR("STR_PART_ALIGN_4KB"));
ui->pushButtonOK->setText(_LANG_STR("STR_BTN_OK"));
ui->pushButtonCancel->setText(_LANG_STR("STR_BTN_CANCEL"));
invalid_value = _LANG_STR("STR_SPACE_VAL_INVALID");
err_title = _LANG_STR("STR_ERROR");
}
void PartCfgDialog::on_pushButtonOK_clicked()
{
if (ui->checkBox->isChecked())
{
QString str = ui->lineEdit->text();
if (str.isEmpty())
{
QMessageBox::critical(NULL, err_title, invalid_value);
return;
}
for (int i = 0; i < str.size(); i++)
{
if (str[i] < '0' || str[i] > '9')
{
QMessageBox::critical(NULL, err_title, invalid_value);
return;
}
}
valuestr = str;
resvalue = str.toLongLong();
reserve = true;
}
else
{
reserve = false;
}
align = ui->checkBox_2->isChecked();
unit = ui->comboBox->currentIndex();
accept();
}
void PartCfgDialog::on_pushButtonCancel_clicked()
{
reject();
}
void PartCfgDialog::on_checkBox_stateChanged(int arg1)
{
(void)arg1;
if (ui->checkBox->isChecked())
{
ui->lineEdit->setEnabled(true);
ui->comboBox->setEnabled(true);
}
else
{
ui->lineEdit->setEnabled(false);
ui->comboBox->setEnabled(false);
}
}
#ifndef PARTCFGDIALOG_H
#define PARTCFGDIALOG_H
#include <QDialog>
#include <QJsonObject>
namespace Ui {
class PartCfgDialog;
}
class PartCfgDialog : public QDialog
{
Q_OBJECT
public:
bool reserve;
int unit;
bool align;
QString valuestr;
qint64 resvalue;
QString invalid_value;
QString err_title;
void update_ui_status();
void update_language_ui(QJsonObject &obj);
explicit PartCfgDialog(QWidget *parent = nullptr);
~PartCfgDialog();
private slots:
void on_pushButtonOK_clicked();
void on_pushButtonCancel_clicked();
void on_checkBox_stateChanged(int arg1);
private:
Ui::PartCfgDialog *ui;
};
#define _LANG_STR(id) obj.value(id).toString()
#endif // PARTCFGDIALOG_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PartCfgDialog</class>
<widget class="QDialog" name="PartCfgDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>420</width>
<height>258</height>
</rect>
</property>
<property name="windowTitle">
<string>Partition Configuration</string>
</property>
<widget class="QPushButton" name="pushButtonOK">
<property name="geometry">
<rect>
<x>90</x>
<y>210</y>
<width>90</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>OK</string>
</property>
</widget>
<widget class="QPushButton" name="pushButtonCancel">
<property name="geometry">
<rect>
<x>230</x>
<y>210</y>
<width>90</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>Cancel</string>
</property>
</widget>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>400</width>
<height>51</height>
</rect>
</property>
<property name="title">
<string/>
</property>
<widget class="QCheckBox" name="checkBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>381</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>Preserve some space at the end of the disk</string>
</property>
<property name="autoRepeatInterval">
<number>0</number>
</property>
</widget>
</widget>
<widget class="QGroupBox" name="groupBox_2">
<property name="geometry">
<rect>
<x>10</x>
<y>60</y>
<width>200</width>
<height>60</height>
</rect>
</property>
<property name="title">
<string/>
</property>
<widget class="QLineEdit" name="lineEdit">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>181</width>
<height>26</height>
</rect>
</property>
<property name="maxLength">
<number>14</number>
</property>
</widget>
</widget>
<widget class="QGroupBox" name="groupBox_3">
<property name="geometry">
<rect>
<x>210</x>
<y>60</y>
<width>200</width>
<height>60</height>
</rect>
</property>
<property name="title">
<string/>
</property>
<widget class="QComboBox" name="comboBox">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>181</width>
<height>26</height>
</rect>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>MB</string>
</property>
</item>
<item>
<property name="text">
<string>GB</string>
</property>
</item>
</widget>
</widget>
<widget class="QGroupBox" name="groupBox_4">
<property name="geometry">
<rect>
<x>10</x>
<y>130</y>
<width>401</width>
<height>51</height>
</rect>
</property>
<property name="title">
<string/>
</property>
<widget class="QCheckBox" name="checkBox_2">
<property name="geometry">
<rect>
<x>10</x>
<y>18</y>
<width>381</width>
<height>24</height>
</rect>
</property>
<property name="text">
<string>Align partitions with 4KB</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</widget>
</widget>
<resources/>
<connections/>
</ui>
This diff is collapsed.
/******************************************************************************
* secure_icon_data.c
*
* Copyright (c) 2021, longpanda <admin@ventoy.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
*/
#include <stdio.h>
#include <stdlib.h>
static unsigned char secure_icon_hexData[958] = {
0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x0D, 0x10, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xA8, 0x03,
0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x20, 0x00,
0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x03, 0x00, 0x00, 0x46, 0x5C,
0x00, 0x00, 0x46, 0x5C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8C,
0xFB, 0x01, 0x00, 0x8C, 0xFB, 0x2E, 0x00, 0x8C, 0xFB, 0x52, 0x00, 0x8C, 0xFB, 0x53, 0x00, 0x8C,
0xFB, 0x53, 0x00, 0x8C, 0xFB, 0x53, 0x00, 0x8C, 0xFB, 0x53, 0x00, 0x8C, 0xFB, 0x53, 0x00, 0x8C,
0xFB, 0x53, 0x00, 0x8C, 0xFB, 0x53, 0x00, 0x8C, 0xFB, 0x52, 0x00, 0x8C, 0xFB, 0x2E, 0x00, 0x8C,
0xFB, 0x01, 0x00, 0x8C, 0xFB, 0x3E, 0x00, 0x8C, 0xFB, 0xDA, 0x00, 0x8C, 0xFB, 0xF8, 0x00, 0x8C,
0xFB, 0xF7, 0x00, 0x8C, 0xFB, 0xF7, 0x00, 0x8C, 0xFB, 0xF7, 0x00, 0x8C, 0xFB, 0xF7, 0x00, 0x8C,
0xFB, 0xF7, 0x00, 0x8C, 0xFB, 0xF7, 0x00, 0x8C, 0xFB, 0xF7, 0x00, 0x8C, 0xFB, 0xF8, 0x00, 0x8C,
0xFB, 0xDA, 0x00, 0x8C, 0xFB, 0x3E, 0x00, 0x8C, 0xFB, 0x78, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0x78, 0x00, 0x8C, 0xFB, 0x7B, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0x7B, 0x00, 0x8C,
0xFB, 0x7A, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x86, 0xF1, 0xFF, 0x00, 0x7C, 0xDF, 0xFF, 0x00, 0x86, 0xF1, 0xFF, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C,
0xFB, 0x7A, 0x00, 0x8C, 0xFB, 0x7A, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x8C, 0xFC, 0xFF, 0x00, 0x7C, 0xDF, 0xFF, 0x00, 0x6C, 0xC4, 0xFF, 0x00, 0x7C,
0xDF, 0xFF, 0x00, 0x8C, 0xFC, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0x7A, 0x00, 0x8C, 0xFB, 0x7A, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x87, 0xF2, 0xFF, 0x00, 0x7D,
0xE1, 0xFF, 0x00, 0x87, 0xF2, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0x7A, 0x00, 0x8C, 0xFB, 0x7B, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x8C, 0xFC, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0x7B, 0x00, 0x8C,
0xFB, 0x77, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C,
0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C, 0xFB, 0xFF, 0x00, 0x8C,
0xFB, 0x77, 0x00, 0x8C, 0xFB, 0x3A, 0x00, 0x8C, 0xFB, 0xD4, 0x01, 0x8B, 0xF9, 0xF7, 0x03, 0x89,
0xF3, 0xFF, 0x01, 0x8B, 0xF8, 0xF8, 0x00, 0x8C, 0xFB, 0xF4, 0x00, 0x8C, 0xFB, 0xF4, 0x00, 0x8C,
0xFB, 0xF4, 0x01, 0x8B, 0xF8, 0xF8, 0x03, 0x89, 0xF3, 0xFF, 0x01, 0x8B, 0xF9, 0xF7, 0x00, 0x8C,
0xFB, 0xD4, 0x00, 0x8C, 0xFB, 0x3A, 0x00, 0x8C, 0xFB, 0x00, 0x00, 0x93, 0xFF, 0x1E, 0x1D, 0x6B,
0xA9, 0x6B, 0x32, 0x54, 0x6F, 0xF6, 0x22, 0x65, 0x9A, 0x7D, 0x00, 0x90, 0xFF, 0x39, 0x00, 0x8C,
0xFB, 0x3C, 0x00, 0x90, 0xFF, 0x39, 0x22, 0x65, 0x9A, 0x7D, 0x32, 0x54, 0x6F, 0xF6, 0x1D, 0x6B,
0xA9, 0x6B, 0x00, 0x93, 0xFF, 0x1E, 0x00, 0x8C, 0xFB, 0x00, 0x00, 0x8C, 0xFB, 0x00, 0x2A, 0x5D,
0x85, 0x00, 0x46, 0x3D, 0x36, 0x3A, 0x43, 0x41, 0x3F, 0xF3, 0x45, 0x3F, 0x3A, 0x58, 0x26, 0x62,
0x91, 0x00, 0x00, 0x8D, 0xFD, 0x00, 0x26, 0x62, 0x91, 0x00, 0x45, 0x3F, 0x3A, 0x58, 0x43, 0x41,
0x3F, 0xF3, 0x46, 0x3D, 0x36, 0x3A, 0x2A, 0x5D, 0x85, 0x00, 0x00, 0x8C, 0xFB, 0x00, 0x00, 0x00,
0x00, 0x00, 0x42, 0x42, 0x42, 0x00, 0x42, 0x42, 0x42, 0x27, 0x42, 0x42, 0x42, 0xE9, 0x42, 0x42,
0x42, 0x94, 0x42, 0x42, 0x42, 0x01, 0x42, 0x42, 0x42, 0x00, 0x42, 0x42, 0x42, 0x01, 0x42, 0x42,
0x42, 0x94, 0x42, 0x42, 0x42, 0xE9, 0x42, 0x42, 0x42, 0x27, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x00, 0x42, 0x42, 0x42, 0x04, 0x42, 0x42,
0x42, 0x96, 0x42, 0x42, 0x42, 0xF5, 0x42, 0x42, 0x42, 0x8E, 0x42, 0x42, 0x42, 0x53, 0x42, 0x42,
0x42, 0x8E, 0x42, 0x42, 0x42, 0xF5, 0x42, 0x42, 0x42, 0x96, 0x42, 0x42, 0x42, 0x04, 0x42, 0x42,
0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x00, 0x42, 0x42,
0x42, 0x00, 0x42, 0x42, 0x42, 0x16, 0x42, 0x42, 0x42, 0x96, 0x42, 0x42, 0x42, 0xE9, 0x42, 0x42,
0x42, 0xF3, 0x42, 0x42, 0x42, 0xE9, 0x42, 0x42, 0x42, 0x96, 0x42, 0x42, 0x42, 0x16, 0x42, 0x42,
0x42, 0x00, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42,
0x42, 0x00, 0x42, 0x42, 0x42, 0x00, 0x42, 0x42, 0x42, 0x00, 0x42, 0x42, 0x42, 0x05, 0x42, 0x42,
0x42, 0x31, 0x42, 0x42, 0x42, 0x4B, 0x42, 0x42, 0x42, 0x31, 0x42, 0x42, 0x42, 0x05, 0x42, 0x42,
0x42, 0x00, 0x42, 0x42, 0x42, 0x00, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x08,
0x00, 0x00, 0x80, 0x08, 0x00, 0x00, 0x80, 0x08, 0x00, 0x00, 0x80, 0x08, 0x00, 0x00
};
void *get_secure_icon_raw_data(int *len)
{
*len = (int)sizeof(secure_icon_hexData);
return secure_icon_hexData;
}
This diff is collapsed.
#ifndef VENTOY2DISKWINDOW_H
#define VENTOY2DISKWINDOW_H
#include <QMainWindow>
#include <QActionGroup>
#include <QJsonDocument>
#include <QFile>
#include <QJsonObject>
#include <QJsonArray>
#include <QVector>
#include <QtGlobal>
#include <QDebug>
#include <QCloseEvent>
#include <QThread>
#include "partcfgdialog.h"
QT_BEGIN_NAMESPACE
namespace Ui { class Ventoy2DiskWindow; }
QT_END_NAMESPACE
#define THREAD_TYPE_INSTALL 1
#define THREAD_TYPE_UPDATE 2
#define THREAD_MSG_PROGRESS_BAR 1
#define THREAD_MSG_INSTALL_FINISH 2
#define THREAD_MSG_UPDATE_FINISH 3
class MyQThread : public QThread
{
Q_OBJECT
public:
quint64 m_reserve_space;
int m_index;
int m_type;
int m_secureboot;
int m_align4K;
bool m_running;
void install_run();
void update_run();
explicit MyQThread(QObject *parent = nullptr);
protected:
void run();
signals:
void thread_event(int msg, int data);
public slots:
};
class Ventoy2DiskWindow : public QMainWindow
{
Q_OBJECT
public:
Ventoy2DiskWindow(QWidget *parent = nullptr);
~Ventoy2DiskWindow();
QActionGroup *m_part_group;
QActionGroup *m_lang_group;
QJsonArray m_lang_array;
PartCfgDialog *m_partcfg;
MyQThread *m_thread;
void FillDeviceList(const QString &select);
void OnInitWindow(void);
void LoadLanguages();
int lang_string(const QString &id, QString &str);
void update_ui_language();
void set_percent(int percent);
protected:
void showEvent(QShowEvent *ev);
void closeEvent(QCloseEvent *event);
private slots:
void thread_event(int msg, int data);
void part_style_check_action(QAction *act);
void lang_check_action(QAction *act);
void on_ButtonInstall_clicked();
void on_ButtonUpdate_clicked();
void on_ButtonRefresh_clicked();
void on_comboBoxDevice_currentIndexChanged(int index);
void on_actionPartition_Configuration_triggered();
void on_actionClear_Ventoy_triggered();
void on_actionShow_All_Devices_toggled(bool arg1);
void on_actionSecure_Boot_Support_triggered();
private:
Ui::Ventoy2DiskWindow *ui;
};
#define _LANG_STR(id) obj.value(id).toString()
#define VERSION_FMT "<html><head/><body><p><span style=\" font-size:20pt; font-weight:600; color:#ff0000;\">%s</span></p></body></html>"
#endif // VENTOY2DISKWINDOW_H
This diff is collapsed.
/******************************************************************************
* ventoy_qt.h
*
* Copyright (c) 2021, longpanda <admin@ventoy.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef __VENTOY_QT_H__
#define __VENTOY_QT_H__
int ventoy_disk_init(void);
void ventoy_disk_exit(void);
int ventoy_http_init(void);
void ventoy_http_exit(void);
int ventoy_log_init(void);
void ventoy_log_exit(void);
void *get_refresh_icon_raw_data(int *len);
void *get_secure_icon_raw_data(int *len);
void *get_window_icon_raw_data(int *len);
int ventoy_func_handler(const char *jsonstr, char *jsonbuf, int buflen);
const char * ventoy_code_get_cur_language(void);
int ventoy_code_get_cur_part_style(void);
void ventoy_code_set_cur_part_style(int style);
int ventoy_code_get_cur_show_all(void);
void ventoy_code_set_cur_show_all(int show_all);
void ventoy_code_set_cur_language(const char *lang);
void ventoy_code_save_cfg(void);
void ventoy_code_refresh_device(void);
int ventoy_code_is_busy(void);
int ventoy_code_get_percent(void);
int ventoy_code_get_result(void);
#endif /* __VENTOY_QT_H__ */
This diff is collapsed.
......@@ -31,6 +31,7 @@
#include <sys/types.h>
#include <sys/mount.h>
#include <linux/fs.h>
#include <linux/limits.h>
#include <dirent.h>
#include <pthread.h>
#include <ventoy_define.h>
......@@ -160,9 +161,10 @@ static int ventoy_http_save_cfg(void)
{
FILE *fp;
fp = fopen("./Ventoy2Disk.ini", "w");
fp = fopen(g_ini_file, "w");
if (!fp)
{
vlog("Failed to open %s code:%d\n", g_ini_file, errno);
return 0;
}
......@@ -180,7 +182,7 @@ static int ventoy_http_load_cfg(void)
char line[256];
FILE *fp;
fp = fopen("./Ventoy2Disk.ini", "r");
fp = fopen(g_ini_file, "r");
if (!fp)
{
return 0;
......@@ -1499,7 +1501,7 @@ int ventoy_http_start(const char *ip, const char *port)
{
"listening_ports", "24680",
"document_root", "WebUI",
"error_log_file", VTOY_LOG_FILE,
"error_log_file", g_log_file,
"request_timeout_ms", "10000",
NULL
};
......
......@@ -8,10 +8,15 @@
#include <errno.h>
#include <time.h>
#include <unistd.h>
#include <sys/types.h>
#include <linux/limits.h>
#include <ventoy_define.h>
#include <ventoy_util.h>
#include "ventoy_gtk.h"
char g_log_file[PATH_MAX];
char g_ini_file[PATH_MAX];
static int set_image_from_pixbuf(GtkBuilder *pBuilder, const char *id, const void *pData, int len)
{
GtkImage *pImage = NULL;
......@@ -53,6 +58,7 @@ int early_msgbox(GtkMessageType type, GtkButtonsType buttons, const char *str)
int main(int argc, char *argv[])
{
int i;
int len;
const void *pData = NULL;
GtkWidget *pWidget = NULL;
......@@ -74,6 +80,20 @@ int main(int argc, char *argv[])
return 1;
}
snprintf(g_log_file, sizeof(g_log_file), "log.txt");
snprintf(g_ini_file, sizeof(g_ini_file), "./Ventoy2Disk.ini");
for (i = 0; i < argc; i++)
{
if (argv[i] && argv[i + 1] && strcmp(argv[i], "-l") == 0)
{
snprintf(g_log_file, sizeof(g_log_file), "%s", argv[i + 1]);
}
else if (argv[i] && argv[i + 1] && strcmp(argv[i], "-i") == 0)
{
snprintf(g_ini_file, sizeof(g_ini_file), "%s", argv[i + 1]);
}
}
ventoy_log_init();
vlog("================================================\n");
......@@ -113,6 +133,7 @@ int main(int argc, char *argv[])
on_init_window(pBuilder);
g_signal_connect(G_OBJECT(pWidget), "delete_event", G_CALLBACK(on_exit_window), NULL);
g_signal_connect(G_OBJECT(pWidget), "destroy", G_CALLBACK(gtk_main_quit), NULL);
gtk_main();
......
......@@ -7,12 +7,17 @@
#include <unistd.h>
#include <fcntl.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <linux/limits.h>
#include <ventoy_define.h>
#include <ventoy_util.h>
#include <ventoy_json.h>
#include <ventoy_disk.h>
#include <ventoy_http.h>
char g_log_file[PATH_MAX];
char g_ini_file[PATH_MAX];
int ventoy_log_init(void);
void ventoy_log_exit(void);
......@@ -30,6 +35,7 @@ void ventoy_signal_stop(int sig)
int main(int argc, char **argv)
{
int i;
int rc;
const char *ip = "127.0.0.1";
const char *port = "24680";
......@@ -50,6 +56,20 @@ int main(int argc, char **argv)
port = argv[2];
}
snprintf(g_log_file, sizeof(g_log_file), "log.txt");
snprintf(g_ini_file, sizeof(g_ini_file), "./Ventoy2Disk.ini");
for (i = 0; i < argc; i++)
{
if (argv[i] && argv[i + 1] && strcmp(argv[i], "-l") == 0)
{
snprintf(g_log_file, sizeof(g_log_file), "%s", argv[i + 1]);
}
else if (argv[i] && argv[i + 1] && strcmp(argv[i], "-i") == 0)
{
snprintf(g_ini_file, sizeof(g_ini_file), "%s", argv[i + 1]);
}
}
ventoy_log_init();
vlog("===============================================\n");
......
This diff is collapsed.
......@@ -81,15 +81,19 @@ build_func() {
rm -f ../INSTALL/tool/$toolDir/Ventoy2Disk.${gtkver}_$libsuffix
cp -a Ventoy2Disk.${gtkver}_$libsuffix ../INSTALL/tool/$toolDir/Ventoy2Disk.${gtkver}
$1 -D_FILE_OFFSET_BITS=64 Ventoy2Disk/ventoy_gui.c -DVTOY_GUI_ARCH="\"$toolDir\"" -o VentoyGUI.$toolDir
cp -a VentoyGUI.$toolDir ../INSTALL/
$1 -O2 -D_FILE_OFFSET_BITS=64 Ventoy2Disk/ventoy_gui.c Ventoy2Disk/Core/ventoy_json.c -I Ventoy2Disk/Core -DVTOY_GUI_ARCH="\"$toolDir\"" -o VentoyGUI.$toolDir
cp -a VentoyGUI.$toolDir ../INSTALL/
}
build_func "gcc" '64' 'x86_64' 'gtk2'
build_func "gcc" '64' 'x86_64' 'gtk3'
build_func "gcc -m32" '32' 'i386' 'gtk2'
build_func "gcc -m32" '32' 'i386' 'gtk3'
build_func "aarch64-linux-gnu-gcc" 'aa64' 'aarch64' 'gtk3'
export PATH=/opt/mips-loongson-gcc8-linux-gnu-2021-02-08/bin/:$PATH
build_func "mips-linux-gnu-gcc -mips64r2 -mabi=64" 'm64e' 'mips64el' 'gtk3'
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment