mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-21 19:35:49 +08:00
777ea21a00
- 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.
68 lines
1.9 KiB
C++
68 lines
1.9 KiB
C++
#ifndef AFCEXPLORER_H
|
|
#define AFCEXPLORER_H
|
|
|
|
#include "iDescriptor.h"
|
|
#include <QHBoxLayout>
|
|
#include <QInputDialog>
|
|
#include <QLabel>
|
|
#include <QListWidget>
|
|
#include <QMenu>
|
|
#include <QPushButton>
|
|
#include <QSplitter>
|
|
#include <QStack>
|
|
#include <QString>
|
|
#include <QTreeWidget>
|
|
#include <QVBoxLayout>
|
|
#include <QWidget>
|
|
#include <libimobiledevice/afc.h>
|
|
|
|
class AfcExplorerWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit AfcExplorerWidget(
|
|
afc_client_t afcClient = nullptr,
|
|
std::function<void()> onClientInvalidCb = nullptr,
|
|
iDescriptorDevice *device = nullptr, QWidget *parent = nullptr);
|
|
signals:
|
|
void fileSelected(const QString &filePath);
|
|
|
|
private slots:
|
|
void goBack();
|
|
void onItemDoubleClicked(QListWidgetItem *item);
|
|
void onBreadcrumbClicked();
|
|
void onFileListContextMenu(const QPoint &pos);
|
|
void onExportClicked();
|
|
void onImportClicked();
|
|
void onAddToFavoritesClicked();
|
|
|
|
private:
|
|
QWidget *m_explorer;
|
|
QPushButton *m_backBtn;
|
|
QPushButton *m_exportBtn;
|
|
QPushButton *m_importBtn;
|
|
QPushButton *m_addToFavoritesBtn;
|
|
QListWidget *m_fileList;
|
|
QStack<QString> m_history;
|
|
QHBoxLayout *m_breadcrumbLayout;
|
|
iDescriptorDevice *m_device;
|
|
|
|
// Current AFC mode
|
|
afc_client_t m_currentAfcClient;
|
|
|
|
void setupFileExplorer();
|
|
void loadPath(const QString &path);
|
|
void updateBreadcrumb(const QString &path);
|
|
void saveFavoritePlace(const QString &path, const QString &alias);
|
|
|
|
void setupContextMenu();
|
|
void exportSelectedFile(QListWidgetItem *item);
|
|
void exportSelectedFile(QListWidgetItem *item, const QString &directory);
|
|
int export_file_to_path(afc_client_t afc, const char *device_path,
|
|
const char *local_path);
|
|
int import_file_to_device(afc_client_t afc, const char *device_path,
|
|
const char *local_path);
|
|
};
|
|
|
|
#endif // AFCEXPLORER_H
|