-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve entry table display/functionality in GUI #849
Conversation
Add additional columns 'Password', 'Notes', 'Expires', 'Created', 'Modified', 'Accessed' and 'Attachments' to entry table display. With this, the entry display is in par with KeePassX 0.4.x.
Add 'copy-on-doubleclick' functionality for entry table columns 'Username', 'Password' and 'Notes'.
On Travis CI, entry->attachments()->keys().join() does not exist when it should (http://doc.qt.io/qt-5/qlist.html#more-members). Using for loop construct for now.
src/gui/entry/EntryModel.cpp
Outdated
* instead this should be global and user-configurable (or derived automatically | ||
* from current regional settings) | ||
*/ | ||
QString timeFormat("d MMM yyyy HH:mm:ss"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fonic since this is a constant, this could be declared as such in the EntryModel
header file.
static const QString DefaultTimeFormat("d MMM yyyy HH:mm:ss");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could do that, but I think this should be a global, user-configurable setting as the way timestamps are displayed varies from one country/language to another.
How about putting it in src/core/Config.cpp:
void Config::init(const QString& fileName)
{
m_defaults.insert("DateTimeFormat", "d MMM yyyy HH:mm:ss");
}
and then fetching it from the config whenever it's needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fonic personally, I'd leave it non-configurable, and set the format to ISO 8601. We can always make it configurable if we ever get that request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should read the locale display preference from the OS and use that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do that. Quite easy actually: QDateTime.toString(Qt::DefaultLocaleShortDate)
. Uses the application's locale and falls back to the system's locale if nothing is set specifically for the application.
To allow for correct sorting, I'd implement Qt::UserRole
like done here.
Update entry model test to account for additional columns 'Password', 'Notes', 'Expires', 'Created', 'Modified', 'Accessed' and 'Attachments'.
Instead of using a hard-coded date/time format string to display timestamps, use format defined by current application locale (defaults to system locale if not explicitely set). Separate display (uses QStrings) and sorting (uses QDateTimes) of timestamps by adding a custom role (Qt::UserRole) to the model.
Add header menu (right click on header): - actions to toggle columns visibility - actions to resize all columns - actions to reset column configuration Make changes persistent by saving/loading to/from configuration Change EntryModel::columnCount() to comply to Qt documentation advisory Lots of code cleanup (comments, TODOs, coding rules)
Use old-style QMenu->addAction(const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut = 0) to add actions to header menu to fix compile errors on Travis CI.
Column 'Group' is no longer added/deleted when switching between list and search mode, but shown/hidden instead. Therefore, when in list mode, column 'Group' with index 0 is hidden and cannot be clicked. Alter test to click column 'Title' with index 1 instead.
So, lots of progress here. Please test and let me know what you think. When testing, please focus on the functionality for now. I think I'll restructure this with clean commits once the functionality is defined/decided, as the current approach of keeping track of the view state is inefficient. Btw:
|
Add functionality for hidden/cleartext display of usernames and passwords: - modify data providers of entry view model - add settings to entry view / entry view model - add corresponding checkbox actions to entry view header menu - make settings persistent by saving/loading to/from configuration Again lots of code cleanup (variable names, includes, comments, TODOs, code formatting)
I'll stop development at the current state until things listed in the TODO section have been discussed and decided as those greatly affect implementation. From my point of view, all functionality is there - now it's only a matter of deciding together which pieces to integrate in what way and how (separate pull requests, all in one, ...). |
@fonic tested that quickly on linux. This is pretty neat, good job! I'd personally vote for enabling only a subset of the available fields by default (maybe title & username & url & modified date?)
You mean if the header state should be global or per-database file? I'd go for a global header state. AFAICT it's easier to implement and I feel like the convenience of being able to set it once for all databases wins over being able to customize it for specific databases. |
Generally I would prefer KISS
I'd go for a global header state as well. This needs to be saved in the configuration to restore the state when keepassxc is re-opened
I think it should be separate but if we save the state in the configuration the search state should be saved as well
I agree with your opinion |
Hi there, sorry that it took me so long to respond, I was on badly needed vacation ;) I'll continue working on this shortly.
I would suggest displaying all available fields by default so new users see what is available and can customize to their needs. Just my opinion, of course we can do it your way, too.
Yes, that's exactly what I meant. I already implemented both ways, the complexity of having separate states (i.e. per database) is actually not that bad. Syncing the view, on the other hand, is quite difficult (see below).
Good. I agree, I think having separate states is just confusing to users, because every time a tab is selected the view changes. Saving/loading to/from configuration is already implemented, but not yet uploaded.
Why do you vote for separate? Just asking.
I love KISS, the question in this case is KISS for whom:
Just so that you understand: syncing the view states is actually quite difficult due to the way the header state is represented in Qt (binary stream). To make the whole decision process easier, I coded a version that allows toggling of everything we discuss here (e.g. sync splitter yes/no, sync header state yes/no). I think actually testing this is better than words. Will upload that shortly. After that, I'll start submitting the changes cleaned up and piece by piece within a new pull request- |
Thank you very much for taking on this feature @fonic , It's the only functionality I find myself missing with keepassxc. Just thought I'd +1 your thought to retain the option to show all fields. I happen to primarily use the Note field (since, for auto-type, we don't have much say on what goes in Title) but different people will have different styles. |
There is a chance that these changes will be in version 2.3.0? |
Absolutely |
@fonic any news on this? |
Sorry for replying so late. Q3/Q4 is always the busiest time of the year at my workplace, I just couldn't find the time to work on anything else over the last couple of months. Thankfully, that's behind me now :) I'll check what has changed in the code base since then and continue to work on this. |
Closing this pull request in favor of new pull request #1305. |
Description
This adds to the entry table:
With this, the entry table gets mostly in par with KeePassX 0.4.x.
All changes are currently prefixed with /** @author Fonic [...] */ comments and there are in-code TODOs to be resolved. Those will of course be cleaned/removed once this is ready to be shipped.
Please note that this is work in progress and that I'm still familiarizing myself with the project and its guidelines. Thus, if something is not the way it's supposed to be, please be so kind and point it out.
Motivation
In my opinion, this addresses a major disadvantage of KeePassXC. Not only the additional columns, but more importantly the 'copy-on-doubleclick' really adds to the usability.
I am aware that redesigning the entry table already is a goal within this project (#129). My contribution may either be a step towards this or at least fill the gap until this is done.
DONE
TODO
How has this been tested?
Screenshots:
Types of changes
Checklist (in progress):
-DWITH_ASAN=ON
. [REQUIRED]