mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-21 19:35:49 +08:00
integrate ZUpdater & refactor device management and UI components
- Integrated ZUpdater to handle auto updating - Updated DeviceManagerWidget to improve device selection logic and ensure current device is set correctly when devices are added or removed. - Enhanced FileExplorerWidget to reset the view when sidebar items are clicked. - Changed ZIconWidget to inherit from QAbstractButton for better button behavior and removed unnecessary mouse event handling. - Updated iDescriptor to include device version parsing and improved device version retrieval logic. - Refactored iFuseDiskUnmountButton and iFuseDiskUnmountButton to use ZIconWidget for a consistent UI. - Improved iFuseWidget to handle device selection more robustly and update UI accordingly. - Added SponsorAppCard and SponsorWidget to promote sponsorship within the app. - Updated ToolboxWidget to streamline device selection and toolbox functionality. - General code cleanup and comments for better maintainability.
This commit is contained in:
+20
-15
@@ -70,20 +70,23 @@ void DevDiskImageHelper::setupUI()
|
||||
|
||||
void DevDiskImageHelper::start()
|
||||
{
|
||||
// if (m_mode == Mode::AutoMount) {
|
||||
// hide();
|
||||
// } else {
|
||||
// show();
|
||||
// }
|
||||
|
||||
m_loadingIndicator->start();
|
||||
showStatus("Please wait...");
|
||||
|
||||
// Start download check in background
|
||||
DevDiskManager::sharedInstance()->downloadCompatibleImage(m_device);
|
||||
unsigned int device_version = get_device_version(m_device->device);
|
||||
unsigned int deviceMajorVersion = (device_version >> 16) & 0xFF;
|
||||
unsigned int deviceMinorVersion = (device_version >> 8) & 0xFF;
|
||||
|
||||
// Check mounted image status
|
||||
QTimer::singleShot(500, this, &DevDiskImageHelper::checkAndMount);
|
||||
// we dont have developer disk images for ios 6 and below
|
||||
if (deviceMajorVersion > 5) {
|
||||
// TODO: maybe check isMountAvailable and finishWithFailure if false
|
||||
const bool isMountAvailable =
|
||||
DevDiskManager::sharedInstance()->downloadCompatibleImage(m_device);
|
||||
QTimer::singleShot(500, this, &DevDiskImageHelper::checkAndMount);
|
||||
} else {
|
||||
finishWithSuccess();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void DevDiskImageHelper::checkAndMount()
|
||||
@@ -91,7 +94,8 @@ void DevDiskImageHelper::checkAndMount()
|
||||
GetMountedImageResult result =
|
||||
DevDiskManager::sharedInstance()->getMountedImage(
|
||||
m_device->udid.c_str());
|
||||
|
||||
qDebug() << "checkAndMount result:" << result.success
|
||||
<< result.message.c_str() << QString::fromStdString(result.sig);
|
||||
if (!result.success) {
|
||||
showRetryUI(QString::fromStdString(result.message));
|
||||
return;
|
||||
@@ -103,6 +107,8 @@ void DevDiskImageHelper::checkAndMount()
|
||||
finishWithSuccess();
|
||||
return;
|
||||
}
|
||||
|
||||
onMountButtonClicked();
|
||||
}
|
||||
|
||||
void DevDiskImageHelper::onMountButtonClicked()
|
||||
@@ -139,8 +145,8 @@ void DevDiskImageHelper::onMountButtonClicked()
|
||||
showStatus("Mounting developer disk image...");
|
||||
|
||||
mobile_image_mounter_error_t err =
|
||||
DevDiskManager::sharedInstance()->mountImage(
|
||||
versionToMount, QString::fromStdString(m_device->udid));
|
||||
DevDiskManager::sharedInstance()->mountImage(versionToMount,
|
||||
m_device);
|
||||
|
||||
m_isMounting = false;
|
||||
if (err == MOBILE_IMAGE_MOUNTER_E_SUCCESS) {
|
||||
@@ -199,8 +205,7 @@ void DevDiskImageHelper::onImageDownloadFinished(const QString &version,
|
||||
showStatus("Download complete. Mounting...");
|
||||
|
||||
mobile_image_mounter_error_t err =
|
||||
DevDiskManager::sharedInstance()->mountImage(
|
||||
version, QString::fromStdString(m_device->udid));
|
||||
DevDiskManager::sharedInstance()->mountImage(version, m_device);
|
||||
|
||||
if (err == MOBILE_IMAGE_MOUNTER_E_SUCCESS) {
|
||||
showStatus("Developer disk image mounted successfully");
|
||||
|
||||
Reference in New Issue
Block a user