mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-22 03:45:51 +08:00
6bbad2a3b6
- Introduced devicePasswordProtected signal in AppContext to notify when a device is password protected. - Modified DeviceManagerWidget to handle devicePasswordProtected signal and update pending device state accordingly. - Enhanced DevicePendingWidget to display appropriate messages based on device lock status.
62 lines
1.8 KiB
C++
62 lines
1.8 KiB
C++
#ifndef DEVICEMANAGERWIDGET_H
|
|
#define DEVICEMANAGERWIDGET_H
|
|
|
|
#include "devicemenuwidget.h"
|
|
#include "devicependingwidget.h"
|
|
#include "devicesidebarwidget.h"
|
|
#include "iDescriptor.h"
|
|
#include <QHBoxLayout>
|
|
#include <QMap>
|
|
#include <QStackedWidget>
|
|
#include <QWidget>
|
|
|
|
class DeviceManagerWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit DeviceManagerWidget(QWidget *parent = nullptr);
|
|
|
|
void addDevice(iDescriptorDevice *device);
|
|
// TODO:udid or uuid ?
|
|
void addPendingDevice(const QString &udid, bool locked);
|
|
void addPairedDevice(iDescriptorDevice *device);
|
|
|
|
void removeDevice(const std::string &uuid);
|
|
void setCurrentDevice(const std::string &uuid);
|
|
std::string getCurrentDevice() const;
|
|
|
|
// Get the device widget at a specific index
|
|
QWidget *getDeviceWidget(int deviceIndex) const;
|
|
|
|
// Navigation methods
|
|
void setDeviceNavigation(int deviceIndex, const QString §ion);
|
|
|
|
signals:
|
|
void deviceChanged(std::string deviceUuid);
|
|
void sidebarNavigationChanged(std::string deviceUuid,
|
|
const QString §ion);
|
|
void updateNoDevicesConnected();
|
|
private slots:
|
|
void onSidebarDeviceChanged(std::string deviceUuid);
|
|
void onSidebarNavigationChanged(std::string deviceUuid,
|
|
const QString §ion);
|
|
|
|
private:
|
|
void setupUI();
|
|
|
|
QHBoxLayout *m_mainLayout;
|
|
DeviceSidebarWidget *m_sidebar;
|
|
QStackedWidget *m_stackedWidget;
|
|
|
|
QMap<std::string, std::pair<DeviceMenuWidget *, DeviceSidebarItem *>>
|
|
m_deviceWidgets; // Map to store devices by UDID
|
|
|
|
QMap<std::string,
|
|
std::pair<DevicePendingWidget *, DevicePendingSidebarItem *>>
|
|
m_pendingDeviceWidgets; // Map to store devices by UDID
|
|
|
|
std::string m_currentDeviceUuid;
|
|
};
|
|
|
|
#endif // DEVICEMANAGERWIDGET_H
|