-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add "Reload File" feature #625
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ void ShortcutManager::initializeShortcutsList() | |
{ | ||
shortcutsList.append({tr("Open"), "open", keyBindingsToStringList(QKeySequence::Open), {}}); | ||
shortcutsList.append({tr("Open URL"), "openurl", QStringList(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_O).toString()), {}}); | ||
shortcutsList.append({tr("Reload File"), "reloadfile", keyBindingsToStringList(QKeySequence::Refresh), {}}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indeed this is cmd+r on macOS, but this conflicts with rename. I don't know which should be prioritized--maybe refresh is more important. Make sure this doesn't conflict on other platforms too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, you can take a look at my latest commit and see if you like that idea or have a different suggestion perhaps. |
||
shortcutsList.append({tr("Open Containing Folder"), "opencontainingfolder", {}, {}}); | ||
//Sets open containing folder action name to platform-appropriate alternative | ||
#ifdef Q_OS_WIN | ||
|
@@ -58,7 +59,10 @@ void ShortcutManager::initializeShortcutsList() | |
#endif | ||
shortcutsList.append({tr("Copy"), "copy", keyBindingsToStringList(QKeySequence::Copy), {}}); | ||
shortcutsList.append({tr("Paste"), "paste", keyBindingsToStringList(QKeySequence::Paste), {}}); | ||
shortcutsList.append({tr("Rename"), "rename", QStringList({QKeySequence(Qt::Key_F2).toString(), QKeySequence(Qt::CTRL | Qt::Key_R).toString()}), {}}); | ||
shortcutsList.append({tr("Rename"), "rename", QStringList(QKeySequence(Qt::Key_F2).toString()), {}}); | ||
// ctrl+r for renaming, unless it conflicts with refresh (i.e. reload file) | ||
if (!QKeySequence::keyBindings(QKeySequence::Refresh).contains(QKeySequence(Qt::CTRL | Qt::Key_R))) | ||
shortcutsList.last().defaultShortcuts << QKeySequence(Qt::CTRL | Qt::Key_R).toString(); | ||
// cmd+enter for renaming, mac-style | ||
shortcutsList.last().defaultShortcuts.prepend(QKeySequence(Qt::CTRL | Qt::Key_Return).toString()); | ||
|
||
|
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.
The cache key includes the file size, but this ensures it handles situations in which the size doesn't change (e.g. an uncompressed BMP was re-saved).