mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-22 03:45:51 +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:
@@ -51,7 +51,6 @@ DevDiskImagesWidget::DevDiskImagesWidget(iDescriptorDevice *device,
|
||||
[this](QListWidgetItem *item) {
|
||||
m_mountButton->setEnabled(item != nullptr);
|
||||
});
|
||||
// connect
|
||||
}
|
||||
|
||||
void DevDiskImagesWidget::setupUi()
|
||||
@@ -76,25 +75,6 @@ void DevDiskImagesWidget::setupUi()
|
||||
mountLayout->addWidget(m_check_mountedButton);
|
||||
layout->addLayout(mountLayout);
|
||||
|
||||
auto *pathLayout = new QHBoxLayout();
|
||||
// main path/info row (no shadow)
|
||||
auto *pathWidget = new QWidget();
|
||||
pathWidget->setLayout(pathLayout);
|
||||
QLabel *tipLabel =
|
||||
new QLabel("You can change the download path from settings :");
|
||||
tipLabel->setStyleSheet("font-size: 9px;");
|
||||
pathLayout->addWidget(tipLabel);
|
||||
QPushButton *openSettingsButton = new QPushButton("Open Settings");
|
||||
openSettingsButton->setSizePolicy(QSizePolicy::Preferred,
|
||||
QSizePolicy::Preferred);
|
||||
pathLayout->addWidget(openSettingsButton);
|
||||
pathLayout->addStretch();
|
||||
connect(openSettingsButton, &QPushButton::clicked, this, [this]() {
|
||||
SettingsManager::sharedInstance()->showSettingsDialog();
|
||||
});
|
||||
pathLayout->setContentsMargins(10, 10, 10, 10);
|
||||
layout->addWidget(pathWidget);
|
||||
|
||||
m_stackedWidget = new QStackedWidget(this);
|
||||
layout->addWidget(m_stackedWidget);
|
||||
|
||||
@@ -128,13 +108,13 @@ void DevDiskImagesWidget::setupUi()
|
||||
|
||||
m_stackedWidget->addWidget(m_imageListWidget);
|
||||
|
||||
if (DevDiskManager::sharedInstance()->isImageListReady()) {
|
||||
m_processIndicator->start();
|
||||
m_stackedWidget->setCurrentIndex(0); // Show loading page
|
||||
// TODO: we may force to refetch most up to date image list
|
||||
QTimer::singleShot(500, this, [this]() {
|
||||
displayImages();
|
||||
m_stackedWidget->setCurrentWidget(m_imageListWidget);
|
||||
} else {
|
||||
m_processIndicator->start();
|
||||
m_stackedWidget->setCurrentIndex(0); // Show loading page
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void DevDiskImagesWidget::fetchImages()
|
||||
@@ -258,6 +238,7 @@ void DevDiskImagesWidget::displayImages()
|
||||
|
||||
auto *downloadButton =
|
||||
new QPushButton(info.isDownloaded ? "Re-download" : "Download");
|
||||
downloadButton->setDefault(true);
|
||||
downloadButton->setProperty("version", info.version);
|
||||
connect(downloadButton, &QPushButton::clicked, this,
|
||||
&DevDiskImagesWidget::onDownloadButtonClicked);
|
||||
@@ -584,7 +565,7 @@ void DevDiskImagesWidget::mountImage(const QString &version)
|
||||
m_mountButton->setText("Mounting...");
|
||||
|
||||
mobile_image_mounter_error_t err =
|
||||
DevDiskManager::sharedInstance()->mountImage(version, udid);
|
||||
DevDiskManager::sharedInstance()->mountImage(version, m_currentDevice);
|
||||
|
||||
auto updateUI = [&]() {
|
||||
m_mountButton->setEnabled(true);
|
||||
|
||||
Reference in New Issue
Block a user