From e3faa18bb88fb55355383095f80514990affd4d7 Mon Sep 17 00:00:00 2001 From: Martin Dvorak Date: Sun, 11 Feb 2024 16:12:33 +0100 Subject: [PATCH] Adding shortcut for knowledge tool Mind menu to be started from anywhere. --- app/src/qt/main_menu_presenter.cpp | 3 +++ app/src/qt/main_menu_view.cpp | 5 +++++ app/src/qt/main_menu_view.h | 1 + app/src/qt/main_window_presenter.cpp | 5 ----- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/src/qt/main_menu_presenter.cpp b/app/src/qt/main_menu_presenter.cpp index dd6639e1..5635c4a0 100644 --- a/app/src/qt/main_menu_presenter.cpp +++ b/app/src/qt/main_menu_presenter.cpp @@ -36,6 +36,9 @@ MainMenuPresenter::MainMenuPresenter(MainWindowPresenter* mwp) QObject::connect( view->actionMindWingman, SIGNAL(triggered()), mwp, SLOT(handleActionWingman())); + QObject::connect( + view->actionMindTool, SIGNAL(triggered()), + mwp, SLOT(doActionRunToolDialogAnywhere())); QObject::connect( view->actionMindThink, SIGNAL(triggered()), mwp, SLOT(doActionMindToggleThink())); diff --git a/app/src/qt/main_menu_view.cpp b/app/src/qt/main_menu_view.cpp index 1d873bb5..a28d450e 100644 --- a/app/src/qt/main_menu_view.cpp +++ b/app/src/qt/main_menu_view.cpp @@ -113,6 +113,10 @@ MainMenuView::MainMenuView(MainWindowView& mainWindowView) actionMindWingman->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_Slash)); actionMindWingman->setStatusTip(tr("Open Wingman dialog...")); + actionMindTool = new QAction(QIcon(":/menu-icons/find.svg"), tr("&Find on Web"), mainWindow); + actionMindTool->setShortcut(QKeySequence(Qt::ALT+Qt::Key_1)); + actionMindTool->setStatusTip(tr("Find Notebook or Note name; selected text or text under cursor on the web...")); + // scope ... don't show any N/O older than 1Y/3M/... actionMindScope = new QAction(QIcon(":/menu-icons/filter.svg"), tr("S&cope"), mainWindow); actionMindScope->setStatusTip(tr("Don't show Notebooks and Notes older than...")); @@ -186,6 +190,7 @@ MainMenuView::MainMenuView(MainWindowView& mainWindowView) menuMind->addAction(actionMindThink); menuMind->addAction(actionMindAutolink); menuMind->addAction(actionMindWingman); + menuMind->addAction(actionMindTool); menuMind->addAction(actionMindScope); menuMind->addSeparator(); menuMind->addMenu(submenuMindLibrary); diff --git a/app/src/qt/main_menu_view.h b/app/src/qt/main_menu_view.h index d25c0ec2..e31d09b3 100644 --- a/app/src/qt/main_menu_view.h +++ b/app/src/qt/main_menu_view.h @@ -78,6 +78,7 @@ class MainMenuView : public QObject QAction* actionMindThink; QAction* actionMindAutolink; QAction* actionMindWingman; + QAction* actionMindTool; QAction* actionMindScope; QAction* actionMindForget; QAction* actionMindSnapshot; diff --git a/app/src/qt/main_window_presenter.cpp b/app/src/qt/main_window_presenter.cpp index c235cbe1..422c3ad0 100644 --- a/app/src/qt/main_window_presenter.cpp +++ b/app/src/qt/main_window_presenter.cpp @@ -181,11 +181,6 @@ MainWindowPresenter::MainWindowPresenter(MainWindowView& view) orloj->getOutlineHeaderEdit()->getView()->getHeaderEditor(), SIGNAL(signalPasteImageData(QImage)), this, SLOT(doActionEditPasteImageData(QImage)) ); - QObject::connect( - new QShortcut(QKeySequence("Alt+1"), view.getOrloj()), SIGNAL(activated()), - this, SLOT(doActionRunToolDialogAnywhere()) - ); - // wire TOP toolbar signals QObject::connect( view.getToolBar()->actionNewOutlineOrNote, SIGNAL(triggered()), this, SLOT(doActionOutlineOrNoteNew())