Added ALT+A to "add to own model set" (similar to ALT+S for stash)

This commit is contained in:
Klaus Basan
2017-09-19 09:00:17 +02:00
committed by Mathew Sutcliffe
parent 65bc1c00fb
commit 8427aa829d
3 changed files with 13 additions and 2 deletions

View File

@@ -27,6 +27,7 @@
#include "blackgui/models/aircraftmodellistmodel.h" #include "blackgui/models/aircraftmodellistmodel.h"
#include "blackgui/views/aircraftmodelview.h" #include "blackgui/views/aircraftmodelview.h"
#include "blackgui/views/viewbase.h" #include "blackgui/views/viewbase.h"
#include "blackgui/shortcut.h"
#include "blackmisc/aviation/aircrafticaocode.h" #include "blackmisc/aviation/aircrafticaocode.h"
#include "blackmisc/aviation/livery.h" #include "blackmisc/aviation/livery.h"
#include "blackmisc/icons.h" #include "blackmisc/icons.h"
@@ -39,7 +40,7 @@
#include <QAction> #include <QAction>
#include <QDialog> #include <QDialog>
#include <QFrame> #include <QFrame>
#include <QKeySequence> #include <QShortcut>
#include <QMenu> #include <QMenu>
#include <QModelIndex> #include <QModelIndex>
#include <QPoint> #include <QPoint>
@@ -129,9 +130,10 @@ namespace BlackGui
ui->tw_ModelsToBeMapped->setTabIcon(TabOwnModels, CIcons::appModels16()); ui->tw_ModelsToBeMapped->setTabIcon(TabOwnModels, CIcons::appModels16());
ui->tw_ModelsToBeMapped->setTabIcon(TabOwnModelSet, CIcons::appModels16()); ui->tw_ModelsToBeMapped->setTabIcon(TabOwnModelSet, CIcons::appModels16());
// custom menu // custom menu and shortcut
this->setContextMenuPolicy(Qt::CustomContextMenu); this->setContextMenuPolicy(Qt::CustomContextMenu);
connect(this, &CDbMappingComponent::customContextMenuRequested, this, &CDbMappingComponent::ps_onCustomContextMenu); connect(this, &CDbMappingComponent::customContextMenuRequested, this, &CDbMappingComponent::ps_onCustomContextMenu);
new QShortcut(CShortcut::keyAddToModelSet(), this, SLOT(ps_addToOwnModelSet()));
// vPilot // vPilot
this->initVPilotLoading(); this->initVPilotLoading();

View File

@@ -22,6 +22,12 @@ namespace BlackGui
return k; return k;
} }
const QKeySequence &CShortcut::keyAddToModelSet()
{
static const QKeySequence k(Qt::ALT + Qt::Key_A);
return k;
}
const QKeySequence &CShortcut::keyClearSelection() const QKeySequence &CShortcut::keyClearSelection()
{ {
static const QKeySequence k(Qt::CTRL + Qt::Key_Space); static const QKeySequence k(Qt::CTRL + Qt::Key_Space);

View File

@@ -32,6 +32,9 @@ namespace BlackGui
//! For stashing models //! For stashing models
static const QKeySequence &keyStash(); static const QKeySequence &keyStash();
//! Add to model set
static const QKeySequence &keyAddToModelSet();
//! For deselecting all //! For deselecting all
static const QKeySequence &keyClearSelection(); static const QKeySequence &keyClearSelection();