mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-23 05:01:19 -05:00
More detailed KeeShare sharing messages (#2946)
* ShareObserver watches all shares ShareObserver watches all shares to and considers settings only on checking for changes. This fixes an assertion when an export group signal is received, but export was disabled. * Extend share message in group view Extended the message for shared groups to indicate deactivate import/export and errors when the share was not correctly configured.
This commit is contained in:
parent
1493943e2e
commit
29c79c935a
@ -162,18 +162,32 @@ QString KeeShare::sharingLabel(const Group* group)
|
||||
}
|
||||
|
||||
const auto reference = referenceOf(share);
|
||||
if (!reference.isValid()) {
|
||||
return tr("Invalid sharing reference");
|
||||
}
|
||||
QStringList messages;
|
||||
switch (reference.type) {
|
||||
case KeeShareSettings::Inactive:
|
||||
return tr("Inactive share %1").arg(reference.path);
|
||||
messages << tr("Inactive share %1").arg(reference.path);
|
||||
break;
|
||||
case KeeShareSettings::ImportFrom:
|
||||
return tr("Imported from %1").arg(reference.path);
|
||||
messages << tr("Imported from %1").arg(reference.path);
|
||||
break;
|
||||
case KeeShareSettings::ExportTo:
|
||||
return tr("Exported to %1").arg(reference.path);
|
||||
messages << tr("Exported to %1").arg(reference.path);
|
||||
break;
|
||||
case KeeShareSettings::SynchronizeWith:
|
||||
return tr("Synchronized with %1").arg(reference.path);
|
||||
messages << tr("Synchronized with %1").arg(reference.path);
|
||||
break;
|
||||
}
|
||||
|
||||
return {};
|
||||
const auto active = KeeShare::active();
|
||||
if (reference.isImporting() && !active.in) {
|
||||
messages << tr("Import is disabled in settings");
|
||||
}
|
||||
if (reference.isExporting() && !active.out) {
|
||||
messages << tr("Export is disabled in settings");
|
||||
}
|
||||
return messages.join("\n");
|
||||
}
|
||||
|
||||
QPixmap KeeShare::indicatorBadge(const Group* group, QPixmap pixmap)
|
||||
|
@ -190,7 +190,6 @@ void ShareObserver::reinitialize()
|
||||
KeeShareSettings::Reference newReference;
|
||||
};
|
||||
|
||||
const auto active = KeeShare::active();
|
||||
QList<Update> updated;
|
||||
const QList<Group*> groups = m_db->rootGroup()->groupsRecursive(true);
|
||||
for (Group* group : groups) {
|
||||
@ -202,9 +201,7 @@ void ShareObserver::reinitialize()
|
||||
m_groupToReference.remove(couple.group);
|
||||
m_referenceToGroup.remove(couple.oldReference);
|
||||
m_shareToGroup.remove(couple.oldReference.path);
|
||||
if (couple.newReference.isValid()
|
||||
&& ((active.in && couple.newReference.isImporting())
|
||||
|| (active.out && couple.newReference.isExporting()))) {
|
||||
if (couple.newReference.isValid()) {
|
||||
m_groupToReference[couple.group] = couple.newReference;
|
||||
m_referenceToGroup[couple.newReference] = couple.group;
|
||||
m_shareToGroup[couple.newReference.path] = couple.group;
|
||||
|
Loading…
Reference in New Issue
Block a user