feat: recognize recovery devices & add heic support

- Added RecoveryDeviceSidebarItem class for managing recovery devices in the sidebar.
- Unified device selection structure with DeviceSelection to handle normal, recovery, and pending devices.
- Updated DeviceSidebarWidget to support adding and removing recovery devices.
- Refactored sidebar navigation and selection handling to accommodate new device types.

refactor: Enhance Disk Usage Widget UI

- Improved styling and layout of disk usage bars for better visual representation.
- Removed unnecessary paint event override and adjusted layout settings.
- Added object names for easier styling and debugging.

fix: Update File Explorer Widget for AFC2 Support

- Integrated a stacked widget to switch between normal and AFC2 explorers.
- Simplified sidebar setup and item handling for better maintainability.
- Connected sidebar item clicks to switch between AFC explorers.

feat: Implement InfoLabel for Copying Text

- Created InfoLabel class to display text that can be copied to the clipboard.
- Added hover effects and temporary text change on copy action.

chore: Clean up Unused Code and Comments

- Removed commented-out code and unnecessary forward declarations across multiple files.
- Streamlined includes and improved code readability.

fix: Improve Recovery Device Info Widget

- Updated RecoveryDeviceInfoWidget to display device information more clearly.
- Added error handling for recovery mode exit operations with user feedback.

feat: Add Responsive QLabel for Image Display

- Introduced ResponsiveQLabel to handle responsive image scaling in the UI.
- Replaced static image display with responsive label in JailbrokenWidget for better adaptability.
This commit is contained in:
uncor3
2025-10-08 05:00:02 +00:00
parent ef56f7af33
commit 777ea21a00
34 changed files with 921 additions and 645 deletions
+15 -9
View File
@@ -3,11 +3,12 @@
#include "libirecovery.h"
#include <QDebug>
#include <QLabel>
#include <QMessageBox>
#include <QPushButton>
#include <QVBoxLayout>
RecoveryDeviceInfoWidget::RecoveryDeviceInfoWidget(RecoveryDeviceInfo *info,
QWidget *parent)
RecoveryDeviceInfoWidget::RecoveryDeviceInfoWidget(
const iDescriptorRecoveryDevice *info, QWidget *parent)
: QWidget{parent}
{
ecid = info->ecid; // Assuming ecid is unique for each device
@@ -22,13 +23,13 @@ RecoveryDeviceInfoWidget::RecoveryDeviceInfoWidget(RecoveryDeviceInfo *info,
QString::fromStdString(parse_recovery_mode(info->mode))));
devLayout->addWidget(new QLabel("ECID: " + QString::number(info->ecid)));
devLayout->addWidget(new QLabel("CPID: " + QString::number(info->cpid)));
devLayout->addWidget(new QLabel("BDID: " + QString::number(info->bdid)));
devLayout->addWidget(new QLabel(info->displayName));
QPushButton *exitRecoveyMode = new QPushButton("Exit Recovery Mode");
connect(exitRecoveyMode, &QPushButton::clicked, this, [this, info]() {
irecv_client_t client = NULL;
irecv_error_t ierr =
irecv_open_with_ecid_and_attempts(&client, info->ecid, 3);
irecv_error_t ierr = irecv_open_with_ecid_and_attempts(
&client, info->ecid, RECOVERY_CLIENT_CONNECTION_TRIES);
irecv_error_t error = IRECV_E_SUCCESS;
if (ierr != IRECV_E_SUCCESS) {
printf("Failed to open device with ECID %llu: %s\n", info->ecid,
@@ -45,12 +46,17 @@ RecoveryDeviceInfoWidget::RecoveryDeviceInfoWidget(RecoveryDeviceInfo *info,
error = irecv_setenv(client, "auto-boot", "true");
if (error != IRECV_E_SUCCESS) {
QMessageBox::critical(
this, "Error",
"Failed to set environment variable 'auto-boot' to 'true'");
qDebug() << "Failed to set environment variable: "
<< irecv_strerror(error);
}
error = irecv_saveenv(client);
if (error != IRECV_E_SUCCESS) {
QMessageBox::critical(this, "Error",
"Failed to save environment variables");
qDebug() << "Failed to save environment variables: "
<< irecv_strerror(error);
}
@@ -58,13 +64,13 @@ RecoveryDeviceInfoWidget::RecoveryDeviceInfoWidget(RecoveryDeviceInfo *info,
error = irecv_reboot(client);
if (error != IRECV_E_SUCCESS) {
// debug("%s\n", irecv_strerror(error));
qDebug() << "Failed to send reboot command: "
QMessageBox::critical(this, "Error",
"Failed to send reboot command");
qDebug() << "critical to send reboot command: "
<< irecv_strerror(error);
} else {
// debug("%s\n", irecv_strerror(error));
}
irecv_close(client);
});
devLayout->addWidget(exitRecoveyMode);
devLayout->addWidget(exitRecoveyMode, 0, Qt::AlignCenter);
}