Add natural sort of entry list

Introduce a third unsorted status that shows entries in the order they occur in the KDBX file.

* Add keyboard shortcut Ctrl+Alt+Up/Down to move entries up and down in sort order
* Add entry context menu icons to achieve movement up/down
* Only show menu icons when in natural sort order
* Add Material Design icons for moving up/down

* Add feature to track non-data changes and force a save on exit to ensure they are not lost when locking a database. This allows users to make entry movements and group expand/collapse operations and not lose that state.

Remove saveas
This commit is contained in:
Holger Böhnke authored and Jonathan White committed 2020-05-22 12:13:20 -04:00
1 parent 43c82ccb09
commit eb198271ac
24 files changed
+500 -11

No files matched your search

+36 -1
View File
@@ -497,10 +497,41 @@ void EntryModel::entryRemoved()
if (m_group) {
m_entries = m_group->entries();
}
endRemoveRows();
}
void EntryModel::entryAboutToMoveUp(int row)
{
beginMoveRows(QModelIndex(), row, row, QModelIndex(), row - 1);
if (m_group) {
m_entries.move(row, row - 1);
}
}
void EntryModel::entryMovedUp()
{
if (m_group) {
m_entries = m_group->entries();
}
endMoveRows();
}
void EntryModel::entryAboutToMoveDown(int row)
{
beginMoveRows(QModelIndex(), row, row, QModelIndex(), row + 2);
if (m_group) {
m_entries.move(row, row + 1);
}
}
void EntryModel::entryMovedDown()
{
if (m_group) {
m_entries = m_group->entries();
}
endMoveRows();
}
void EntryModel::entryDataChanged(Entry* entry)
{
int row = m_entries.indexOf(entry);
@@ -524,6 +555,10 @@ void EntryModel::makeConnections(const Group* group)
connect(group, SIGNAL(entryAdded(Entry*)), SLOT(entryAdded(Entry*)));
connect(group, SIGNAL(entryAboutToRemove(Entry*)), SLOT(entryAboutToRemove(Entry*)));
connect(group, SIGNAL(entryRemoved(Entry*)), SLOT(entryRemoved()));
connect(group, SIGNAL(entryAboutToMoveUp(int)), SLOT(entryAboutToMoveUp(int)));
connect(group, SIGNAL(entryMovedUp()), SLOT(entryMovedUp()));
connect(group, SIGNAL(entryAboutToMoveDown(int)), SLOT(entryAboutToMoveDown(int)));
connect(group, SIGNAL(entryMovedDown()), SLOT(entryMovedDown()));
connect(group, SIGNAL(entryDataChanged(Entry*)), SLOT(entryDataChanged(Entry*)));
}