mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-22 03:45:51 +08:00
WIP: Implement Photo Export Manager and Enhance Media Preview Functionality
- Added PhotoExportManager class to handle exporting files from a device to a specified output directory, including cancellation support and progress tracking. - Introduced asynchronous file export using a worker thread, ensuring UI responsiveness during export operations. - Implemented filtering and sorting capabilities in PhotoModel, allowing users to view images and videos based on selected criteria. - Enhanced MediaPreviewDialog by commenting out the image loading logic for future implementation. - Updated VirtualLocation to manage device removal and improved image mounting logic. - Refactored code for better organization and maintainability, including the addition of helper methods for file handling and metadata extraction.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "virtual_location.h"
|
||||
#include "appcontext.h"
|
||||
#include "devdiskmanager.h"
|
||||
#include "iDescriptor.h"
|
||||
#include <QDebug>
|
||||
@@ -24,9 +25,6 @@ VirtualLocation::VirtualLocation(iDescriptorDevice *device, QWidget *parent)
|
||||
: QWidget{parent}, m_device(device)
|
||||
{
|
||||
// Create the main layout
|
||||
bool res = DevDiskManager::sharedInstance()->mountCompatibleImage(
|
||||
m_device, QString("/tmp"));
|
||||
qDebug() << "Mount result:" << res;
|
||||
QHBoxLayout *mainLayout = new QHBoxLayout(this);
|
||||
mainLayout->setContentsMargins(10, 10, 10, 10);
|
||||
mainLayout->setSpacing(10);
|
||||
@@ -152,6 +150,20 @@ VirtualLocation::VirtualLocation(iDescriptorDevice *device, QWidget *parent)
|
||||
|
||||
qDebug() << "QuickWidget status:" << m_quickWidget->status();
|
||||
qDebug() << "QuickWidget errors:" << m_quickWidget->errors();
|
||||
|
||||
connect(AppContext::sharedInstance(), &AppContext::deviceRemoved, this,
|
||||
[this](const std::string &udid) {
|
||||
if (m_device->udid == udid) {
|
||||
this->close();
|
||||
this->deleteLater();
|
||||
}
|
||||
// qDebug() << "VirtualLocation detected device change to"
|
||||
// << (device ? device->udid.c_str() : "null");
|
||||
});
|
||||
|
||||
bool res =
|
||||
DevDiskManager::sharedInstance()->downloadCompatibleImage(m_device);
|
||||
qDebug() << "Mount result:" << res;
|
||||
}
|
||||
|
||||
void VirtualLocation::onQuickWidgetStatusChanged(QQuickWidget::Status status)
|
||||
@@ -286,6 +298,15 @@ void VirtualLocation::updateInputsFromMap(double latitude, double longitude)
|
||||
|
||||
void VirtualLocation::onApplyClicked()
|
||||
{
|
||||
bool devImgSuccess =
|
||||
DevDiskManager::sharedInstance()->mountCompatibleImage(m_device);
|
||||
if (!devImgSuccess) {
|
||||
warn("Failed to mount developer image on device. Cannot set location.");
|
||||
qDebug() << "Failed to mount developer image on device. Cannot set "
|
||||
"location.";
|
||||
return;
|
||||
}
|
||||
|
||||
bool latOk, lonOk, altOk;
|
||||
double latitude = m_latitudeEdit->text().toDouble(&latOk);
|
||||
double longitude = m_longitudeEdit->text().toDouble(&lonOk);
|
||||
|
||||
Reference in New Issue
Block a user