Have directory ID still accessible in recent changes despite showing name
Show it as tool tip and allow copying it via the context menu
This commit is contained in:
parent
bc3cc22d60
commit
28aa9a516c
|
@ -120,6 +120,8 @@ QVariant SyncthingRecentChangesModel::data(const QModelIndex &index, int role) c
|
|||
% QString::fromStdString(change.fileChange.eventTime.toString(DateTimeOutputFormat::DateAndTime, true)));
|
||||
case 1:
|
||||
return change.deviceId.isEmpty() ? change.fileChange.modifiedBy : change.deviceId;
|
||||
case 2:
|
||||
return change.directoryId;
|
||||
case 3:
|
||||
return change.fileChange.path; // usually too long so add a tooltip
|
||||
}
|
||||
|
|
|
@ -98,6 +98,9 @@ Item {
|
|||
function copyDeviceId() {
|
||||
plasmoid.nativeInterface.copyToClipboard(modifiedBy)
|
||||
}
|
||||
function copyFolderId() {
|
||||
plasmoid.nativeInterface.copyToClipboard(folderId)
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.Menu {
|
||||
|
@ -112,6 +115,11 @@ Item {
|
|||
icon: "network-server-symbolic"
|
||||
onClicked: recentChangesView.currentItem.copyDeviceId()
|
||||
}
|
||||
PlasmaComponents.MenuItem {
|
||||
text: qsTr("Copy directory ID")
|
||||
icon: "folder"
|
||||
onClicked: recentChangesView.currentItem.copyFolderId()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -597,6 +597,9 @@ void TrayWidget::showRecentChangesContextMenu(const QPoint &position)
|
|||
QIcon(QStringLiteral(":/icons/hicolor/scalable/places/network-workgroup.svg"))),
|
||||
tr("Copy device ID")),
|
||||
&QAction::triggered, this, copyRole(SyncthingRecentChangesModel::ModifiedBy));
|
||||
connect(menu.addAction(QIcon::fromTheme(QStringLiteral("folder"), QIcon(QStringLiteral(":/icons/hicolor/scalable/places/folder.svg"))),
|
||||
tr("Copy directory ID")),
|
||||
&QAction::triggered, this, copyRole(SyncthingRecentChangesModel::DirectoryId));
|
||||
showViewMenu(position, *m_ui->recentChangesTreeView, menu);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue