Skip to content

Commit

Permalink
Add more keyboard shortcuts (#387)
Browse files Browse the repository at this point in the history
* Add shortcut to focus search input
* Add shortcut to apply config
* Add filter shortcut

Signed-off-by: Tobias Hammer <[email protected]>
  • Loading branch information
tohammer authored Dec 6, 2023
1 parent b293a1f commit c300fce
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,11 @@ void MainWindow::initView()
connect(settingsDlg, SIGNAL(FilterPathChanged()), this, SLOT(on_actionDefault_Filter_Reload_triggered()));
connect(settingsDlg, SIGNAL(PluginsAutoloadChanged()), this, SLOT(triggerPluginsAutoload()));

QAction *focusSearchTextbox = new QAction(this);
focusSearchTextbox->setShortcut(Qt::Key_L | Qt::CTRL);
connect(focusSearchTextbox, SIGNAL(triggered()), searchTextbox, SLOT(setFocus()));
addAction(focusSearchTextbox);

searchComboBox = new QComboBox();
searchComboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
searchComboBox->setLineEdit(searchTextbox);
Expand All @@ -484,6 +489,18 @@ void MainWindow::initView()

/* Update the scrollbutton status */
updateScrollButton();

/* Add shortcut to apply config */
QAction *applyConfig = new QAction(this);
applyConfig->setShortcut(Qt::Key_C | Qt::SHIFT | Qt::CTRL);
connect(applyConfig, SIGNAL(triggered()), this, SLOT(on_applyConfig_clicked()));
addAction(applyConfig);

/* Add shortcut to add filter */
QAction *addFilter = new QAction(this);
addFilter->setShortcut(Qt::Key_A | Qt::SHIFT | Qt::CTRL);
connect(addFilter, SIGNAL(triggered()), this, SLOT(on_action_menuFilter_Add_triggered()));
addAction(addFilter);
}

void MainWindow::initSignalConnections()
Expand Down

0 comments on commit c300fce

Please sign in to comment.