mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-22 03:45:51 +08:00
8d7b027992
- Added new settings keys in SettingsManager for download path, auto-check updates, auto-raise window, switch to new device, unmount iFuse on exit, theme, and connection timeout. - Implemented methods to get and set these new settings. - Updated SettingsWidget to include UI elements for the new settings, including checkboxes and a combo box for theme selection. - Refactored loadSettings and saveSettings methods to handle new settings. - Removed deprecated settings UI elements to streamline the interface. - Introduced VirtualLocation widget for managing virtual location settings with a map interface. - Integrated QML for map visualization and input handling for latitude and longitude. - Added functionality to apply virtual location settings to the connected device.
124 lines
3.3 KiB
C++
124 lines
3.3 KiB
C++
#ifndef INSTALLEDAPPSWIDGET_H
|
|
#define INSTALLEDAPPSWIDGET_H
|
|
|
|
#include "iDescriptor.h"
|
|
#include "zlineedit.h"
|
|
#include <QCheckBox>
|
|
#include <QEnterEvent>
|
|
#include <QFrame>
|
|
#include <QFutureWatcher>
|
|
#include <QGroupBox>
|
|
#include <QHBoxLayout>
|
|
#include <QLabel>
|
|
#include <QNetworkAccessManager>
|
|
#include <QNetworkReply>
|
|
#include <QPainter>
|
|
#include <QPainterPath>
|
|
#include <QPixmap>
|
|
#include <QProgressBar>
|
|
#include <QPushButton>
|
|
#include <QScrollArea>
|
|
#include <QSplitter>
|
|
#include <QStackedWidget>
|
|
#include <QVBoxLayout>
|
|
#include <QWidget>
|
|
#include <libimobiledevice/afc.h>
|
|
#include <libimobiledevice/house_arrest.h>
|
|
|
|
// Custom App Tab Widget
|
|
class AppTabWidget : public QGroupBox
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
AppTabWidget(const QString &appName, const QString &bundleId,
|
|
const QString &version, QWidget *parent = nullptr);
|
|
|
|
void setSelected(bool selected);
|
|
bool isSelected() const { return m_selected; }
|
|
|
|
QString getBundleId() const { return m_bundleId; }
|
|
QString getAppName() const { return m_appName; }
|
|
QString getVersion() const { return m_version; }
|
|
void updateStyles();
|
|
|
|
signals:
|
|
void clicked();
|
|
|
|
protected:
|
|
void mousePressEvent(QMouseEvent *event) override;
|
|
|
|
private:
|
|
void fetchAppIcon();
|
|
void setupUI();
|
|
|
|
QString m_appName;
|
|
QString m_bundleId;
|
|
QString m_version;
|
|
bool m_selected = false;
|
|
|
|
QLabel *m_iconLabel;
|
|
QLabel *m_nameLabel;
|
|
QLabel *m_versionLabel;
|
|
QList<AppTabWidget *> m_appTabs;
|
|
};
|
|
|
|
class InstalledAppsWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit InstalledAppsWidget(iDescriptorDevice *device,
|
|
QWidget *parent = nullptr);
|
|
~InstalledAppsWidget();
|
|
|
|
private slots:
|
|
void onAppsDataReady();
|
|
void onAppTabClicked();
|
|
void onContainerDataReady();
|
|
void onFileSharingFilterChanged(bool enabled);
|
|
|
|
private:
|
|
void setupUI();
|
|
void createLoadingWidget();
|
|
void createErrorWidget();
|
|
void createContentWidget();
|
|
void createLeftPanel();
|
|
void createRightPanel();
|
|
void fetchInstalledApps();
|
|
void createAppTab(const QString &appName, const QString &bundleId,
|
|
const QString &version);
|
|
void showLoadingState();
|
|
void showErrorState(const QString &error);
|
|
void selectAppTab(AppTabWidget *tab);
|
|
void filterApps(const QString &searchText);
|
|
void loadAppContainer(const QString &bundleId);
|
|
void cleanupHouseArrestClients();
|
|
|
|
iDescriptorDevice *m_device;
|
|
QHBoxLayout *m_mainLayout;
|
|
QStackedWidget *m_stackedWidget;
|
|
QWidget *m_loadingWidget;
|
|
QWidget *m_errorWidget;
|
|
QWidget *m_contentWidget;
|
|
QLabel *m_errorLabel;
|
|
ZLineEdit *m_searchEdit;
|
|
QCheckBox *m_fileSharingCheckBox;
|
|
QScrollArea *m_tabScrollArea;
|
|
QWidget *m_tabContainer;
|
|
QVBoxLayout *m_tabLayout;
|
|
QProgressBar *m_progressBar;
|
|
QScrollArea *m_containerScrollArea;
|
|
QWidget *m_containerWidget;
|
|
QVBoxLayout *m_containerLayout;
|
|
QFutureWatcher<QVariantMap> *m_watcher;
|
|
QFutureWatcher<QVariantMap> *m_containerWatcher;
|
|
QSplitter *m_splitter;
|
|
house_arrest_client_t m_houseArrestClient = nullptr;
|
|
afc_client_t m_houseArrestAfcClient = nullptr;
|
|
// App data storage
|
|
QList<AppTabWidget *> m_appTabs;
|
|
AppTabWidget *m_selectedTab = nullptr;
|
|
};
|
|
|
|
#endif // INSTALLEDAPPSWIDGET_H
|