mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-23 05:11:33 +00:00
More shortcuts.
This commit is contained in:
parent
3f7f75cc9d
commit
b204758be1
5 changed files with 59 additions and 3 deletions
|
@ -93,7 +93,7 @@ namespace CSMPrefs
|
||||||
const int MaxKeys = 4; // A limitation of QKeySequence
|
const int MaxKeys = 4; // A limitation of QKeySequence
|
||||||
|
|
||||||
// Modifiers are handled differently
|
// Modifiers are handled differently
|
||||||
const int Blacklist[]
|
const int Blacklist[] =
|
||||||
{
|
{
|
||||||
Qt::Key_Shift,
|
Qt::Key_Shift,
|
||||||
Qt::Key_Control,
|
Qt::Key_Control,
|
||||||
|
|
|
@ -268,6 +268,25 @@ void CSMPrefs::State::declare()
|
||||||
declareShortcut ("document-debug-shutdown", "Stop Debug", QKeySequence());
|
declareShortcut ("document-debug-shutdown", "Stop Debug", QKeySequence());
|
||||||
declareShortcut ("document-debug-runlog", "Run Log", QKeySequence());
|
declareShortcut ("document-debug-runlog", "Run Log", QKeySequence());
|
||||||
|
|
||||||
|
declareSeparator ();
|
||||||
|
declareShortcut ("table-edit", "Edit record", QKeySequence());
|
||||||
|
declareShortcut ("table-add", "Add row/record", QKeySequence(Qt::ControlModifier | Qt::Key_N));
|
||||||
|
declareShortcut ("table-clone", "Clone record", QKeySequence());
|
||||||
|
declareShortcut ("table-revert", "Revert record", QKeySequence());
|
||||||
|
declareShortcut ("table-remove", "Remove record", QKeySequence(Qt::Key_Delete));
|
||||||
|
declareShortcut ("table-moveup", "Move record up", QKeySequence());
|
||||||
|
declareShortcut ("table-movedown", "Move record down", QKeySequence());
|
||||||
|
declareShortcut ("table-view", "View record", QKeySequence());
|
||||||
|
declareShortcut ("table-preview", "Preview record", QKeySequence());
|
||||||
|
declareShortcut ("table-extendeddelete", "Extended record deletion", QKeySequence());
|
||||||
|
declareShortcut ("table-extendedrevert", "Extended record revertion", QKeySequence());
|
||||||
|
|
||||||
|
declareSeparator ();
|
||||||
|
declareShortcut ("reporttable-show", "Show report", QKeySequence());
|
||||||
|
declareShortcut ("reporttable-remove", "Remove report", QKeySequence(Qt::Key_Delete));
|
||||||
|
declareShortcut ("reporttable-replace", "Replace report", QKeySequence());
|
||||||
|
declareShortcut ("reporttable-refresh", "Refresh report", QKeySequence());
|
||||||
|
|
||||||
declareSeparator ();
|
declareSeparator ();
|
||||||
declareShortcut ("free-forward", "Free camera forward", QKeySequence(Qt::Key_W), Qt::Key_Shift);
|
declareShortcut ("free-forward", "Free camera forward", QKeySequence(Qt::Key_W), Qt::Key_Shift);
|
||||||
declareShortcut ("free-backward", "Free camera backward", QKeySequence(Qt::Key_S));
|
declareShortcut ("free-backward", "Free camera backward", QKeySequence(Qt::Key_S));
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "../../model/tools/reportmodel.hpp"
|
#include "../../model/tools/reportmodel.hpp"
|
||||||
|
|
||||||
#include "../../model/prefs/state.hpp"
|
#include "../../model/prefs/state.hpp"
|
||||||
|
#include "../../model/prefs/shortcut.hpp"
|
||||||
|
|
||||||
#include "../../view/world/idtypedelegate.hpp"
|
#include "../../view/world/idtypedelegate.hpp"
|
||||||
|
|
||||||
|
@ -171,14 +172,20 @@ CSVTools::ReportTable::ReportTable (CSMDoc::Document& document,
|
||||||
mShowAction = new QAction (tr ("Show"), this);
|
mShowAction = new QAction (tr ("Show"), this);
|
||||||
connect (mShowAction, SIGNAL (triggered()), this, SLOT (showSelection()));
|
connect (mShowAction, SIGNAL (triggered()), this, SLOT (showSelection()));
|
||||||
addAction (mShowAction);
|
addAction (mShowAction);
|
||||||
|
CSMPrefs::Shortcut* showShortcut = new CSMPrefs::Shortcut("reporttable-show", this);
|
||||||
|
showShortcut->associateAction(mShowAction);
|
||||||
|
|
||||||
mRemoveAction = new QAction (tr ("Remove from list"), this);
|
mRemoveAction = new QAction (tr ("Remove from list"), this);
|
||||||
connect (mRemoveAction, SIGNAL (triggered()), this, SLOT (removeSelection()));
|
connect (mRemoveAction, SIGNAL (triggered()), this, SLOT (removeSelection()));
|
||||||
addAction (mRemoveAction);
|
addAction (mRemoveAction);
|
||||||
|
CSMPrefs::Shortcut* removeShortcut = new CSMPrefs::Shortcut("reporttable-remove", this);
|
||||||
|
removeShortcut->associateAction(mRemoveAction);
|
||||||
|
|
||||||
mReplaceAction = new QAction (tr ("Replace"), this);
|
mReplaceAction = new QAction (tr ("Replace"), this);
|
||||||
connect (mReplaceAction, SIGNAL (triggered()), this, SIGNAL (replaceRequest()));
|
connect (mReplaceAction, SIGNAL (triggered()), this, SIGNAL (replaceRequest()));
|
||||||
addAction (mReplaceAction);
|
addAction (mReplaceAction);
|
||||||
|
CSMPrefs::Shortcut* replaceShortcut = new CSMPrefs::Shortcut("reporttable-replace", this);
|
||||||
|
replaceShortcut->associateAction(mReplaceAction);
|
||||||
|
|
||||||
if (mRefreshState)
|
if (mRefreshState)
|
||||||
{
|
{
|
||||||
|
@ -186,6 +193,8 @@ CSVTools::ReportTable::ReportTable (CSMDoc::Document& document,
|
||||||
mRefreshAction->setEnabled (!(mDocument.getState() & mRefreshState));
|
mRefreshAction->setEnabled (!(mDocument.getState() & mRefreshState));
|
||||||
connect (mRefreshAction, SIGNAL (triggered()), this, SIGNAL (refreshRequest()));
|
connect (mRefreshAction, SIGNAL (triggered()), this, SIGNAL (refreshRequest()));
|
||||||
addAction (mRefreshAction);
|
addAction (mRefreshAction);
|
||||||
|
CSMPrefs::Shortcut* refreshShortcut = new CSMPrefs::Shortcut("reporttable-refresh", this);
|
||||||
|
refreshShortcut->associateAction(mRefreshAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
mDoubleClickActions.insert (std::make_pair (Qt::NoModifier, Action_Edit));
|
mDoubleClickActions.insert (std::make_pair (Qt::NoModifier, Action_Edit));
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
#include "../../model/prefs/shortcut.hpp"
|
||||||
|
|
||||||
#include "../../model/world/nestedtableproxymodel.hpp"
|
#include "../../model/world/nestedtableproxymodel.hpp"
|
||||||
#include "../../model/world/universalid.hpp"
|
#include "../../model/world/universalid.hpp"
|
||||||
#include "../../model/world/commands.hpp"
|
#include "../../model/world/commands.hpp"
|
||||||
|
@ -60,14 +62,16 @@ CSVWorld::NestedTable::NestedTable(CSMDoc::Document& document,
|
||||||
if (!fixedRows)
|
if (!fixedRows)
|
||||||
{
|
{
|
||||||
mAddNewRowAction = new QAction (tr ("Add new row"), this);
|
mAddNewRowAction = new QAction (tr ("Add new row"), this);
|
||||||
|
|
||||||
connect(mAddNewRowAction, SIGNAL(triggered()),
|
connect(mAddNewRowAction, SIGNAL(triggered()),
|
||||||
this, SLOT(addNewRowActionTriggered()));
|
this, SLOT(addNewRowActionTriggered()));
|
||||||
|
CSMPrefs::Shortcut* addRowShortcut = new CSMPrefs::Shortcut("table-add", this);
|
||||||
|
addRowShortcut->associateAction(mAddNewRowAction);
|
||||||
|
|
||||||
mRemoveRowAction = new QAction (tr ("Remove rows"), this);
|
mRemoveRowAction = new QAction (tr ("Remove rows"), this);
|
||||||
|
|
||||||
connect(mRemoveRowAction, SIGNAL(triggered()),
|
connect(mRemoveRowAction, SIGNAL(triggered()),
|
||||||
this, SLOT(removeRowActionTriggered()));
|
this, SLOT(removeRowActionTriggered()));
|
||||||
|
CSMPrefs::Shortcut* removeRowShortcut = new CSMPrefs::Shortcut("table-remove", this);
|
||||||
|
removeRowShortcut->associateAction(mRemoveRowAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
mEditIdAction = new TableEditIdAction(*this, this);
|
mEditIdAction = new TableEditIdAction(*this, this);
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "../../model/world/commanddispatcher.hpp"
|
#include "../../model/world/commanddispatcher.hpp"
|
||||||
|
|
||||||
#include "../../model/prefs/state.hpp"
|
#include "../../model/prefs/state.hpp"
|
||||||
|
#include "../../model/prefs/shortcut.hpp"
|
||||||
|
|
||||||
#include "tableeditidaction.hpp"
|
#include "tableeditidaction.hpp"
|
||||||
#include "util.hpp"
|
#include "util.hpp"
|
||||||
|
@ -283,49 +284,72 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id,
|
||||||
mEditAction = new QAction (tr ("Edit Record"), this);
|
mEditAction = new QAction (tr ("Edit Record"), this);
|
||||||
connect (mEditAction, SIGNAL (triggered()), this, SLOT (editRecord()));
|
connect (mEditAction, SIGNAL (triggered()), this, SLOT (editRecord()));
|
||||||
addAction (mEditAction);
|
addAction (mEditAction);
|
||||||
|
CSMPrefs::Shortcut* editShortcut = new CSMPrefs::Shortcut("table-edit", this);
|
||||||
|
editShortcut->associateAction(mEditAction);
|
||||||
|
|
||||||
if (createAndDelete)
|
if (createAndDelete)
|
||||||
{
|
{
|
||||||
mCreateAction = new QAction (tr ("Add Record"), this);
|
mCreateAction = new QAction (tr ("Add Record"), this);
|
||||||
connect (mCreateAction, SIGNAL (triggered()), this, SIGNAL (createRequest()));
|
connect (mCreateAction, SIGNAL (triggered()), this, SIGNAL (createRequest()));
|
||||||
addAction (mCreateAction);
|
addAction (mCreateAction);
|
||||||
|
CSMPrefs::Shortcut* createShortcut = new CSMPrefs::Shortcut("table-add", this);
|
||||||
|
createShortcut->associateAction(mCreateAction);
|
||||||
|
|
||||||
mCloneAction = new QAction (tr ("Clone Record"), this);
|
mCloneAction = new QAction (tr ("Clone Record"), this);
|
||||||
connect(mCloneAction, SIGNAL (triggered()), this, SLOT (cloneRecord()));
|
connect(mCloneAction, SIGNAL (triggered()), this, SLOT (cloneRecord()));
|
||||||
addAction(mCloneAction);
|
addAction(mCloneAction);
|
||||||
|
CSMPrefs::Shortcut* cloneShortcut = new CSMPrefs::Shortcut("table-clone", this);
|
||||||
|
cloneShortcut->associateAction(mCloneAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
mRevertAction = new QAction (tr ("Revert Record"), this);
|
mRevertAction = new QAction (tr ("Revert Record"), this);
|
||||||
connect (mRevertAction, SIGNAL (triggered()), mDispatcher, SLOT (executeRevert()));
|
connect (mRevertAction, SIGNAL (triggered()), mDispatcher, SLOT (executeRevert()));
|
||||||
addAction (mRevertAction);
|
addAction (mRevertAction);
|
||||||
|
CSMPrefs::Shortcut* revertShortcut = new CSMPrefs::Shortcut("table-revert", this);
|
||||||
|
revertShortcut->associateAction(mRevertAction);
|
||||||
|
|
||||||
mDeleteAction = new QAction (tr ("Delete Record"), this);
|
mDeleteAction = new QAction (tr ("Delete Record"), this);
|
||||||
connect (mDeleteAction, SIGNAL (triggered()), mDispatcher, SLOT (executeDelete()));
|
connect (mDeleteAction, SIGNAL (triggered()), mDispatcher, SLOT (executeDelete()));
|
||||||
addAction (mDeleteAction);
|
addAction (mDeleteAction);
|
||||||
|
CSMPrefs::Shortcut* deleteShortcut = new CSMPrefs::Shortcut("table-remove", this);
|
||||||
|
deleteShortcut->associateAction(mDeleteAction);
|
||||||
|
|
||||||
|
|
||||||
mMoveUpAction = new QAction (tr ("Move Up"), this);
|
mMoveUpAction = new QAction (tr ("Move Up"), this);
|
||||||
connect (mMoveUpAction, SIGNAL (triggered()), this, SLOT (moveUpRecord()));
|
connect (mMoveUpAction, SIGNAL (triggered()), this, SLOT (moveUpRecord()));
|
||||||
addAction (mMoveUpAction);
|
addAction (mMoveUpAction);
|
||||||
|
CSMPrefs::Shortcut* moveUpShortcut = new CSMPrefs::Shortcut("table-moveup", this);
|
||||||
|
moveUpShortcut->associateAction(mMoveUpAction);
|
||||||
|
|
||||||
mMoveDownAction = new QAction (tr ("Move Down"), this);
|
mMoveDownAction = new QAction (tr ("Move Down"), this);
|
||||||
connect (mMoveDownAction, SIGNAL (triggered()), this, SLOT (moveDownRecord()));
|
connect (mMoveDownAction, SIGNAL (triggered()), this, SLOT (moveDownRecord()));
|
||||||
addAction (mMoveDownAction);
|
addAction (mMoveDownAction);
|
||||||
|
CSMPrefs::Shortcut* moveDownShortcut = new CSMPrefs::Shortcut("table-movedown", this);
|
||||||
|
moveDownShortcut->associateAction(mMoveDownAction);
|
||||||
|
|
||||||
mViewAction = new QAction (tr ("View"), this);
|
mViewAction = new QAction (tr ("View"), this);
|
||||||
connect (mViewAction, SIGNAL (triggered()), this, SLOT (viewRecord()));
|
connect (mViewAction, SIGNAL (triggered()), this, SLOT (viewRecord()));
|
||||||
addAction (mViewAction);
|
addAction (mViewAction);
|
||||||
|
CSMPrefs::Shortcut* viewShortcut = new CSMPrefs::Shortcut("table-view", this);
|
||||||
|
viewShortcut->associateAction(mViewAction);
|
||||||
|
|
||||||
mPreviewAction = new QAction (tr ("Preview"), this);
|
mPreviewAction = new QAction (tr ("Preview"), this);
|
||||||
connect (mPreviewAction, SIGNAL (triggered()), this, SLOT (previewRecord()));
|
connect (mPreviewAction, SIGNAL (triggered()), this, SLOT (previewRecord()));
|
||||||
addAction (mPreviewAction);
|
addAction (mPreviewAction);
|
||||||
|
CSMPrefs::Shortcut* previewShortcut = new CSMPrefs::Shortcut("table-preview", this);
|
||||||
|
previewShortcut->associateAction(mPreviewAction);
|
||||||
|
|
||||||
mExtendedDeleteAction = new QAction (tr ("Extended Delete Record"), this);
|
mExtendedDeleteAction = new QAction (tr ("Extended Delete Record"), this);
|
||||||
connect (mExtendedDeleteAction, SIGNAL (triggered()), this, SLOT (executeExtendedDelete()));
|
connect (mExtendedDeleteAction, SIGNAL (triggered()), this, SLOT (executeExtendedDelete()));
|
||||||
addAction (mExtendedDeleteAction);
|
addAction (mExtendedDeleteAction);
|
||||||
|
CSMPrefs::Shortcut* extendedDeleteShortcut = new CSMPrefs::Shortcut("table-extendeddelete", this);
|
||||||
|
extendedDeleteShortcut->associateAction(mExtendedDeleteAction);
|
||||||
|
|
||||||
mExtendedRevertAction = new QAction (tr ("Extended Revert Record"), this);
|
mExtendedRevertAction = new QAction (tr ("Extended Revert Record"), this);
|
||||||
connect (mExtendedRevertAction, SIGNAL (triggered()), this, SLOT (executeExtendedRevert()));
|
connect (mExtendedRevertAction, SIGNAL (triggered()), this, SLOT (executeExtendedRevert()));
|
||||||
addAction (mExtendedRevertAction);
|
addAction (mExtendedRevertAction);
|
||||||
|
CSMPrefs::Shortcut* extendedRevertShortcut = new CSMPrefs::Shortcut("table-extendedrevert", this);
|
||||||
|
extendedRevertShortcut->associateAction(mExtendedRevertAction);
|
||||||
|
|
||||||
mEditIdAction = new TableEditIdAction (*this, this);
|
mEditIdAction = new TableEditIdAction (*this, this);
|
||||||
connect (mEditIdAction, SIGNAL (triggered()), this, SLOT (editCell()));
|
connect (mEditIdAction, SIGNAL (triggered()), this, SLOT (editCell()));
|
||||||
|
|
Loading…
Reference in a new issue