Skip to content

Commit 51c7dd4

Browse files
committed
New way of handling explorer hot keys
New hotkeys : CTRL+A, CTRL+Z, CTRL+Y, SHIFT+DELETE, F5 Some code is removed or commented out : iExplorerPaneVisibility (not working) or invokeMenu method (superseeded by TranslateAccelerator)
1 parent eb66e96 commit 51c7dd4

File tree

11 files changed

+155
-146
lines changed

11 files changed

+155
-146
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,22 @@ SCEP is released under MIT license.
4444
- Full support for translated paths (Users, Desktop, Documents... folders)
4545
- Full support for Windows Known Folders, including virtual folders (such as Network or Libraries)
4646
- Main hot keys handled :
47+
- F2 : rename
48+
- F5 : refresh
4749
- CTRL+C : copy
4850
- CTRL+X : cut
4951
- CTRL+V : paste
50-
- F2 : rename
5152
- CTRL+L : address bar focus
53+
- CTRL+T : open new tab
54+
- CTRL+W : close current tab
55+
- CTRL+Z : undo
56+
- CTRL+Y : redo
57+
- CTRL+A : select all
5258
- DEL : delete
59+
- SHIFT+DEL : delete (without bin)
5360
- ALT+UP : navigate up
5461
- ALT+LEFT : navigate backward
5562
- ALT+RIGHT : navigate forward
56-
- CTRL+T : open new tab
57-
- CTRL+W : close current tab
5863
- Full support for icons and icons overlays.
5964
- On startup, SCEP reopens the previous tabs
6065
- Windows installer
@@ -68,11 +73,7 @@ Major missing features:
6873

6974
Minor missing features:
7075
- Handle remaining hot keys :
71-
- CTRL+Z : undo
72-
- CTRL+Y : redo
73-
- CTRL+A : select all
7476
- CTRL+SHIFT+N : create new folder
75-
- SHIFT+DEL : delete (without bin)
7677
- Handle navigation inside archives (zip) for breadcrumvs and address bars
7778
- Better CTRL-TAB behaviour
7879
- Tab context menu : close tab, duplicate tab, copy full path to clipboard, close other tabs...

code/SCEP/include/SCEP/ExplorerWidget.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public slots:
5757
void mkDir();
5858
void undo();
5959
void redo();
60+
void refresh();
6061
void navigateBackward();
6162
void navigateForward();
6263
void navigateUp();
@@ -77,6 +78,7 @@ protected slots:
7778
// QMenu* p_forwardMenu = nullptr; //!< Navigate forward action menu
7879
QAction* p_parentAction = nullptr; //!< Navigate to parent folder action
7980
BreadcrumbsAddressBar* p_addressBar = nullptr; //!< Address bar widget
81+
QAction* p_refreshAction = nullptr; //!< Refresh action
8082
QToolBar* p_toolBar = nullptr; //!< ToolBar containing navigation buttons and address bar
8183

8284
std::queue<NavigationRequest> m_pendingRequests = {}; //!< Navigation pathes requested but not processed yet

code/SCEP/include/SCEP/ExplorerWrapper.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Theme;
1919
* @ingroup SCEP
2020
* @brief
2121
*/
22-
class ExplorerWrapper : public QObject, public IServiceProvider, public IExplorerBrowserEvents, public IExplorerPaneVisibility
22+
class ExplorerWrapper : public QObject, public IServiceProvider, public IExplorerBrowserEvents//, public IExplorerPaneVisibility
2323
{
2424
Q_OBJECT
2525

@@ -50,7 +50,7 @@ class ExplorerWrapper : public QObject, public IServiceProvider, public IExplore
5050
IFACEMETHODIMP OnNavigationFailed(PCIDLIST_ABSOLUTE pidlFolder) override;
5151

5252
// IExplorerPaneVisibility
53-
HRESULT GetPaneState(REFEXPLORERPANE ep, EXPLORERPANESTATE *peps) override;
53+
// HRESULT GetPaneState(REFEXPLORERPANE ep, EXPLORERPANESTATE *peps) override;
5454

5555
public slots:
5656
void rename();
@@ -63,6 +63,7 @@ public slots:
6363
void mkDir();
6464
void undo();
6565
void redo();
66+
void refresh();
6667

6768
signals:
6869
void loading(const NavigationPath& path);
@@ -103,8 +104,6 @@ public slots:
103104
std::map<long, QString> getContextMenuCustomOptions(const std::vector<NavigationPath>& contextMenuSelectedPaths);
104105
void notifyContextMenuCustomOption(int iOption, const std::vector<NavigationPath>& contextMenuSelectedPaths);
105106

106-
void invokeMenu(const QString& verb, MenuRequest menuRequest);
107-
108107
private:
109108
Theme* ptr_theme = nullptr;
110109

code/SCEP/include/SCEP/Theme.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ class Theme
4242
Left, //!< Left arrow
4343
Right, //!< Right arrow
4444
Chevron_Left, //!< Left chevron
45-
Chevron_Right //!< Right chevron
45+
Chevron_Right, //!< Right chevron
46+
Refresh //!< Refresh
4647
};
4748

4849
public:

code/SCEP/resources/SCEP.qrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@
2222
<file>SCEP/icons/right-48-light.png</file>
2323
<file>SCEP/icons/up-48-dark.png</file>
2424
<file>SCEP/icons/up-48-light.png</file>
25+
<file>SCEP/icons/restart-48-dark.png</file>
26+
<file>SCEP/icons/restart-48-light.png</file>
2527
</qresource>
2628
</RCC>
887 Bytes
Loading
850 Bytes
Loading

code/SCEP/src/SCEP/ExplorerWidget.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ ExplorerWidget::ExplorerWidget(Theme* ptrTheme, QWidget* pParent, Qt::WindowFlag
5656
connect(p_addressBar, &BreadcrumbsAddressBar::path_requested, this, &ExplorerWidget::setCurrentPath);
5757
p_toolBar->addWidget(p_addressBar);
5858

59+
// Refresh button
60+
p_refreshAction = new QAction(ptr_theme->icon(Theme::Icon::Refresh), tr("Refresh"), this);
61+
p_refreshAction->setShortcut(Qt::Key_F5);
62+
connect(p_refreshAction, &QAction::triggered, this, &ExplorerWidget::refresh);
63+
p_toolBar->addAction(p_refreshAction);
64+
5965
// Menu bar
6066
QVBoxLayout* pLayout = new QVBoxLayout(this);
6167
pLayout->setContentsMargins(0, 0, 0, 0);
@@ -180,7 +186,7 @@ void ExplorerWidget::selectAll()
180186
//
181187
void ExplorerWidget::mkDir()
182188
{
183-
if (p_wrapper && (GetFocus() != (HWND) window()->winId()))
189+
if (p_wrapper)
184190
{
185191
p_wrapper->mkDir();
186192
}
@@ -202,6 +208,14 @@ void ExplorerWidget::redo()
202208
}
203209
}
204210
//
211+
void ExplorerWidget::refresh()
212+
{
213+
if (p_wrapper)
214+
{
215+
p_wrapper->refresh();
216+
}
217+
}
218+
//
205219
void ExplorerWidget::navigateBackward()
206220
{
207221
if (m_navigationHistory.hasBackward().has_value())

0 commit comments

Comments
 (0)