Rename `SyncthingDeviceModel::IsOwnDevice` in accordance with recent UI changes
This commit is contained in:
parent
f5795d45c2
commit
abf1dd0748
|
@ -62,7 +62,7 @@ Item {
|
|||
icon.source: plasmoid.nativeInterface.faUrl + (paused ? "play" : "pause")
|
||||
icon.cache: false
|
||||
tooltip: paused ? qsTr("Resume") : qsTr("Pause")
|
||||
enabled: !isOwnDevice
|
||||
enabled: !isThisDevice
|
||||
onClicked: {
|
||||
paused ? plasmoid.nativeInterface.connection.resumeDevice(
|
||||
[devId]) : plasmoid.nativeInterface.connection.pauseDevice(
|
||||
|
|
|
@ -63,7 +63,7 @@ Item {
|
|||
icon.source: plasmoid.faUrl + (paused ? "play" : "pause")
|
||||
icon.cache: false
|
||||
tooltip: paused ? qsTr("Resume") : qsTr("Pause")
|
||||
enabled: !isOwnDevice
|
||||
enabled: !isThisDevice
|
||||
onClicked: {
|
||||
paused ? plasmoid.connection.resumeDevice(
|
||||
[devId]) : plasmoid.connection.pauseDevice(
|
||||
|
|
|
@ -28,7 +28,7 @@ QHash<int, QByteArray> SyncthingDeviceModel::roleNames() const
|
|||
{ DeviceStatus, "status" },
|
||||
{ Qt::DecorationRole, "statusIcon" },
|
||||
{ DevicePaused, "paused" },
|
||||
{ IsOwnDevice, "isOwnDevice" },
|
||||
{ IsThisDevice, "isThisDevice" },
|
||||
{ IsPinned, "isPinned" },
|
||||
{ DeviceStatusString, "statusString" },
|
||||
{ DeviceStatusColor, "statusColor" },
|
||||
|
@ -300,7 +300,7 @@ QVariant SyncthingDeviceModel::data(const QModelIndex &index, int role) const
|
|||
}
|
||||
break;
|
||||
case IsPinned:
|
||||
case IsOwnDevice:
|
||||
case IsThisDevice:
|
||||
return dev.status == SyncthingDevStatus::ThisDevice;
|
||||
case DeviceStatus:
|
||||
return static_cast<int>(dev.status);
|
||||
|
@ -352,8 +352,8 @@ int SyncthingDeviceModel::columnCount(const QModelIndex &parent) const
|
|||
void SyncthingDeviceModel::devStatusChanged(const SyncthingDev &, int index)
|
||||
{
|
||||
const QModelIndex modelIndex1(this->index(index, 0, QModelIndex()));
|
||||
static const QVector<int> modelRoles1(
|
||||
{ Qt::DisplayRole, Qt::EditRole, Qt::DecorationRole, DevicePaused, DeviceStatus, DeviceStatusString, DeviceStatusColor, DeviceId });
|
||||
static const QVector<int> modelRoles1({ Qt::DisplayRole, Qt::EditRole, Qt::DecorationRole, DevicePaused, DeviceStatus, DeviceStatusString,
|
||||
DeviceStatusColor, DeviceId, IsThisDevice, IsPinned });
|
||||
emit dataChanged(modelIndex1, modelIndex1, modelRoles1);
|
||||
const QModelIndex modelIndex2(this->index(index, 1, QModelIndex()));
|
||||
static const QVector<int> modelRoles2({ Qt::DisplayRole, Qt::EditRole, Qt::ForegroundRole });
|
||||
|
|
|
@ -17,7 +17,7 @@ public:
|
|||
enum SyncthingDeviceModelRole {
|
||||
DeviceStatus = SyncthingModelUserRole + 1,
|
||||
DevicePaused,
|
||||
IsOwnDevice,
|
||||
IsThisDevice,
|
||||
DeviceStatusString,
|
||||
DeviceStatusColor,
|
||||
DeviceId,
|
||||
|
|
|
@ -53,7 +53,7 @@ void DevButtonsItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem
|
|||
painter->drawText(textRect, displayText(index.data(Qt::DisplayRole), option.locale), textOption);
|
||||
|
||||
// draw buttons
|
||||
if (index.data(SyncthingDeviceModel::IsOwnDevice).toBool()) {
|
||||
if (index.data(SyncthingDeviceModel::IsThisDevice).toBool()) {
|
||||
return;
|
||||
}
|
||||
const int buttonY = option.rect.y() + centerObj(option.rect.height(), 16);
|
||||
|
|
Loading…
Reference in New Issue