From 3475b83e9083cab393d2256cf68a7473a8778e68 Mon Sep 17 00:00:00 2001 From: Aesylwinn Date: Fri, 29 Jul 2016 15:00:35 -0400 Subject: [PATCH] Clean up modifier/shortcut class and handle focus out event, Improve shortcut labels, Adjust menu titles and remove menu navigation (can conflict with shortcuts) --- apps/opencs/model/prefs/modifiersetting.cpp | 59 ++++---- apps/opencs/model/prefs/modifiersetting.hpp | 3 + apps/opencs/model/prefs/shortcutsetting.cpp | 105 +++++++------ apps/opencs/model/prefs/shortcutsetting.hpp | 7 +- apps/opencs/model/prefs/state.cpp | 156 ++++++++++---------- apps/opencs/view/doc/view.cpp | 38 ++--- 6 files changed, 187 insertions(+), 181 deletions(-) diff --git a/apps/opencs/model/prefs/modifiersetting.cpp b/apps/opencs/model/prefs/modifiersetting.cpp index 12a4b5d80..bbdad163d 100644 --- a/apps/opencs/model/prefs/modifiersetting.cpp +++ b/apps/opencs/model/prefs/modifiersetting.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -61,6 +60,10 @@ namespace CSMPrefs return handleEvent(target, mod, button); } + else if (event->type() == QEvent::FocusOut) + { + resetState(); + } return false; } @@ -80,24 +83,10 @@ namespace CSMPrefs if (value == Qt::RightButton) { // Clear modifier - QKeySequence sequence; int modifier = 0; + storeValue(modifier); - State::get().getShortcutManager().getSequence(getKey(), sequence, modifier); - - modifier = 0; - State::get().getShortcutManager().setSequence(getKey(), sequence, modifier); - - // Store - { - std::string value = State::get().getShortcutManager().convertToString(sequence, modifier); - - QMutexLocker lock(getMutex()); - getValues().setString(getKey(), getParent()->getKey(), value); - } - - // Update button - mButton->setText(""); + resetState(); } return false; @@ -112,32 +101,44 @@ namespace CSMPrefs // Update modifier - QKeySequence sequence; - int modifier = 0; + int modifier = value; + storeValue(modifier); - State::get().getShortcutManager().getSequence(getKey(), sequence, modifier); + resetState(); - modifier = value; + return true; + } + + void ModifierSetting::storeValue(int modifier) + { + QKeySequence sequence; + int ignored; + State::get().getShortcutManager().getSequence(getKey(), sequence, ignored); State::get().getShortcutManager().setSequence(getKey(), sequence, modifier); - // Store - { - std::string value = State::get().getShortcutManager().convertToString(sequence, modifier); + // Convert to string and assign + std::string value = State::get().getShortcutManager().convertToString(sequence, modifier); + { QMutexLocker lock(getMutex()); getValues().setString(getKey(), getParent()->getKey(), value); } getParent()->getState()->update(*this); + } - // Update button - QString text = QString::fromUtf8(State::get().getShortcutManager().convertToString(modifier).c_str()); - - mButton->setText(text); + void ModifierSetting::resetState() + { mButton->setChecked(false); mEditorActive = false; - return true; + // Button text + QKeySequence sequence; + int modifier = 0; + State::get().getShortcutManager().getSequence(getKey(), sequence, modifier); + + QString text = QString::fromUtf8(State::get().getShortcutManager().convertToString(modifier).c_str()); + mButton->setText(text); } void ModifierSetting::buttonToggled(bool checked) diff --git a/apps/opencs/model/prefs/modifiersetting.hpp b/apps/opencs/model/prefs/modifiersetting.hpp index b1394b6ea..95983f66d 100644 --- a/apps/opencs/model/prefs/modifiersetting.hpp +++ b/apps/opencs/model/prefs/modifiersetting.hpp @@ -29,6 +29,9 @@ namespace CSMPrefs bool handleEvent(QObject* target, int mod, int value); + void storeValue(int modifier); + void resetState(); + QPushButton* mButton; bool mEditorActive; diff --git a/apps/opencs/model/prefs/shortcutsetting.cpp b/apps/opencs/model/prefs/shortcutsetting.cpp index c98384695..82ecd7c81 100644 --- a/apps/opencs/model/prefs/shortcutsetting.cpp +++ b/apps/opencs/model/prefs/shortcutsetting.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -13,14 +12,14 @@ namespace CSMPrefs { + const int ShortcutSetting::MaxKeys; + ShortcutSetting::ShortcutSetting(Category* parent, Settings::Manager* values, QMutex* mutex, const std::string& key, const std::string& label) : Setting(parent, values, mutex, key, label) , mEditorActive(false) , mEditorPos(0) { - const int MaxKeys = 4; // A limitation of QKeySequence - for (int i = 0; i < MaxKeys; ++i) { mEditorKeys[i] = 0; @@ -30,8 +29,8 @@ namespace CSMPrefs std::pair ShortcutSetting::makeWidgets(QWidget* parent) { QKeySequence sequence; - int modifier = 0; - State::get().getShortcutManager().getSequence(getKey(), sequence, modifier); + int ignored = 0; + State::get().getShortcutManager().getSequence(getKey(), sequence, ignored); QString text = QString::fromUtf8(State::get().getShortcutManager().convertToString(sequence).c_str()); @@ -87,14 +86,16 @@ namespace CSMPrefs return handleEvent(target, mod, key, false); } + else if (event->type() == QEvent::FocusOut) + { + resetState(); + } return false; } bool ShortcutSetting::handleEvent(QObject* target, int mod, int value, bool active) { - const int MaxKeys = 4; // A limitation of QKeySequence - // Modifiers are handled differently const int Blacklist[] = { @@ -112,24 +113,10 @@ namespace CSMPrefs if (value == Qt::RightButton && !active) { // Clear sequence - QKeySequence sequence; - int modifier = 0; - - State::get().getShortcutManager().getSequence(getKey(), sequence, modifier); - - sequence = QKeySequence(0, 0, 0, 0); - State::get().getShortcutManager().setSequence(getKey(), sequence, modifier); - - // Store - { - std::string value = State::get().getShortcutManager().convertToString(sequence, modifier); - - QMutexLocker lock(getMutex()); - getValues().setString(getKey(), getParent()->getKey(), value); - } + QKeySequence sequence = QKeySequence(0, 0, 0, 0); + storeValue(sequence); - // Update button - mButton->setText(""); + resetState(); } return false; @@ -145,37 +132,10 @@ namespace CSMPrefs if (!active || mEditorPos >= MaxKeys) { // Update key - QKeySequence sequence; - int modifier = 0; + QKeySequence sequence = QKeySequence(mEditorKeys[0], mEditorKeys[1], mEditorKeys[2], mEditorKeys[3]); + storeValue(sequence); - State::get().getShortcutManager().getSequence(getKey(), sequence, modifier); - - sequence = QKeySequence(mEditorKeys[0], mEditorKeys[1], mEditorKeys[2], mEditorKeys[3]); - State::get().getShortcutManager().setSequence(getKey(), sequence, modifier); - - // Store - { - std::string value = State::get().getShortcutManager().convertToString(sequence, modifier); - - QMutexLocker lock(getMutex()); - getValues().setString(getKey(), getParent()->getKey(), value); - } - - getParent()->getState()->update(*this); - - // Update button - QString text = QString::fromUtf8(State::get().getShortcutManager().convertToString(sequence).c_str()); - - mButton->setText(text); - mButton->setChecked(false); - mEditorActive = false; - - // Reset - mEditorPos = 0; - for (int i = 0; i < MaxKeys; ++i) - { - mEditorKeys[i] = 0; - } + resetState(); } else { @@ -194,6 +154,43 @@ namespace CSMPrefs return true; } + void ShortcutSetting::storeValue(const QKeySequence& sequence) + { + QKeySequence ignored; + int modifier; + State::get().getShortcutManager().getSequence(getKey(), ignored, modifier); + State::get().getShortcutManager().setSequence(getKey(), sequence, modifier); + + // Convert to string and assign + std::string value = State::get().getShortcutManager().convertToString(sequence, modifier); + + { + QMutexLocker lock(getMutex()); + getValues().setString(getKey(), getParent()->getKey(), value); + } + + getParent()->getState()->update(*this); + } + + void ShortcutSetting::resetState() + { + mButton->setChecked(false); + mEditorActive = false; + mEditorPos = 0; + for (int i = 0; i < MaxKeys; ++i) + { + mEditorKeys[i] = 0; + } + + // Button text + QKeySequence sequence; + int modifier = 0; + State::get().getShortcutManager().getSequence(getKey(), sequence, modifier); + + QString text = QString::fromUtf8(State::get().getShortcutManager().convertToString(sequence).c_str()); + mButton->setText(text); + } + void ShortcutSetting::buttonToggled(bool checked) { if (checked) diff --git a/apps/opencs/model/prefs/shortcutsetting.hpp b/apps/opencs/model/prefs/shortcutsetting.hpp index 0521e2291..bb38b580a 100644 --- a/apps/opencs/model/prefs/shortcutsetting.hpp +++ b/apps/opencs/model/prefs/shortcutsetting.hpp @@ -29,11 +29,16 @@ namespace CSMPrefs bool handleEvent(QObject* target, int mod, int value, bool active); + void storeValue(const QKeySequence& sequence); + void resetState(); + + static const int MaxKeys = 4; + QPushButton* mButton; bool mEditorActive; int mEditorPos; - int mEditorKeys[4]; + int mEditorKeys[MaxKeys]; private slots: diff --git a/apps/opencs/model/prefs/state.cpp b/apps/opencs/model/prefs/state.cpp index 1813bf4db..ac562eaaf 100644 --- a/apps/opencs/model/prefs/state.cpp +++ b/apps/opencs/model/prefs/state.cpp @@ -218,116 +218,116 @@ void CSMPrefs::State::declare() declareCategory ("Key Bindings"); declareSubcategory ("Document"); - declareShortcut ("document-file-newgame", "Create new game", QKeySequence()); - declareShortcut ("document-file-newaddon", "Create new addon", QKeySequence()); + declareShortcut ("document-file-newgame", "New Game", QKeySequence()); + declareShortcut ("document-file-newaddon", "New Addon", QKeySequence()); declareShortcut ("document-file-open", "Open", QKeySequence()); declareShortcut ("document-file-save", "Save", QKeySequence(Qt::ControlModifier | Qt::Key_S)); declareShortcut ("document-file-verify", "Verify", QKeySequence()); declareShortcut ("document-file-merge", "Merge", QKeySequence()); - declareShortcut ("document-file-errorlog", "Load error log", QKeySequence()); + declareShortcut ("document-file-errorlog", "Open Load Error Log", QKeySequence()); declareShortcut ("document-file-metadata", "Meta Data", QKeySequence()); - declareShortcut ("document-file-close", "Close", QKeySequence()); - declareShortcut ("document-file-exit", "Exit", QKeySequence()); + declareShortcut ("document-file-close", "Close Document", QKeySequence()); + declareShortcut ("document-file-exit", "Exit Application", QKeySequence()); declareShortcut ("document-edit-undo", "Undo", QKeySequence(Qt::ControlModifier | Qt::Key_Z)); declareShortcut ("document-edit-redo", "Redo", QKeySequence(Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Z)); - declareShortcut ("document-edit-preferences", "Show Preferences", QKeySequence()); - declareShortcut ("document-edit-search", "Show Search", QKeySequence()); + declareShortcut ("document-edit-preferences", "Open Preferences", QKeySequence()); + declareShortcut ("document-edit-search", "Search", QKeySequence()); declareShortcut ("document-view-newview", "New View", QKeySequence()); - declareShortcut ("document-view-statusbar", "Show Status Bar", QKeySequence()); - declareShortcut ("document-view-filters", "Show Filters", QKeySequence()); - declareShortcut ("document-world-regions", "Show Regions", QKeySequence()); - declareShortcut ("document-world-cells", "Show Cells", QKeySequence()); - declareShortcut ("document-world-referencables", "Show Referencables", QKeySequence()); - declareShortcut ("document-world-references", "Show References", QKeySequence()); - declareShortcut ("document-world-pathgrid", "Show Pathgrids", QKeySequence()); - declareShortcut ("document-world-regionmap", "Show Region Map", QKeySequence()); - declareShortcut ("document-mechanics-globals", "Show Globals", QKeySequence()); - declareShortcut ("document-mechanics-gamesettings", "Show Game Settings", QKeySequence()); - declareShortcut ("document-mechanics-scripts", "Show Scripts", QKeySequence()); - declareShortcut ("document-mechanics-spells", "Show Spells", QKeySequence()); - declareShortcut ("document-mechanics-enchantments", "Show Enchantments", QKeySequence()); - declareShortcut ("document-mechanics-magiceffects", "Show Magic Effects", QKeySequence()); - declareShortcut ("document-mechanics-startscripts", "Show Start Scripts", QKeySequence()); - declareShortcut ("document-character-skills", "Show Skills", QKeySequence()); - declareShortcut ("document-character-classes", "Show Classes", QKeySequence()); - declareShortcut ("document-character-factions", "Show Factions", QKeySequence()); - declareShortcut ("document-character-races", "Show Races", QKeySequence()); - declareShortcut ("document-character-birthsigns", "Show Birthsigns", QKeySequence()); - declareShortcut ("document-character-topics", "Show Topics", QKeySequence()); - declareShortcut ("document-character-journals", "Show Journals", QKeySequence()); - declareShortcut ("document-character-topicinfos", "Show Topic Infos", QKeySequence()); - declareShortcut ("document-character-journalinfos", "Show Journal Infos", QKeySequence()); - declareShortcut ("document-character-bodyparts", "Show Body Parts", QKeySequence()); - declareShortcut ("document-assets-sounds", "Show Sound Assets", QKeySequence()); - declareShortcut ("document-assets-soundgens", "Show Sound Generators", QKeySequence()); - declareShortcut ("document-assets-meshes", "Show Mesh Assets", QKeySequence()); - declareShortcut ("document-assets-icons", "Show Icon Assets", QKeySequence()); - declareShortcut ("document-assets-music", "Show Music Assets", QKeySequence()); - declareShortcut ("document-assets-soundres", "Show Sound Files", QKeySequence()); - declareShortcut ("document-assets-textures", "TShow exture Assets", QKeySequence()); - declareShortcut ("document-assets-videos", "Show Video Assets", QKeySequence()); + declareShortcut ("document-view-statusbar", "Toggle Status Bar", QKeySequence()); + declareShortcut ("document-view-filters", "Open Filter List", QKeySequence()); + declareShortcut ("document-world-regions", "Open Region List", QKeySequence()); + declareShortcut ("document-world-cells", "Open Cell List", QKeySequence()); + declareShortcut ("document-world-referencables", "Open Object List", QKeySequence()); + declareShortcut ("document-world-references", "Open Instance List", QKeySequence()); + declareShortcut ("document-world-pathgrid", "Open Pathgrid List", QKeySequence()); + declareShortcut ("document-world-regionmap", "Open Region Map", QKeySequence()); + declareShortcut ("document-mechanics-globals", "Open Global List", QKeySequence()); + declareShortcut ("document-mechanics-gamesettings", "Open Game Settings", QKeySequence()); + declareShortcut ("document-mechanics-scripts", "Open Script List", QKeySequence()); + declareShortcut ("document-mechanics-spells", "Open Spell List", QKeySequence()); + declareShortcut ("document-mechanics-enchantments", "Open Enchantment List", QKeySequence()); + declareShortcut ("document-mechanics-magiceffects", "Open Magic Effect List", QKeySequence()); + declareShortcut ("document-mechanics-startscripts", "Open Start Script List", QKeySequence()); + declareShortcut ("document-character-skills", "Open Skill List", QKeySequence()); + declareShortcut ("document-character-classes", "Open Class List", QKeySequence()); + declareShortcut ("document-character-factions", "Open Faction List", QKeySequence()); + declareShortcut ("document-character-races", "Open Race List", QKeySequence()); + declareShortcut ("document-character-birthsigns", "Open Birthsign List", QKeySequence()); + declareShortcut ("document-character-topics", "Open Topic List", QKeySequence()); + declareShortcut ("document-character-journals", "Open Journal List", QKeySequence()); + declareShortcut ("document-character-topicinfos", "Open Topic Info List", QKeySequence()); + declareShortcut ("document-character-journalinfos", "Open Journal Info List", QKeySequence()); + declareShortcut ("document-character-bodyparts", "Open Body Part List", QKeySequence()); + declareShortcut ("document-assets-sounds", "Open Sound Asset List", QKeySequence()); + declareShortcut ("document-assets-soundgens", "Open Sound Generator List", QKeySequence()); + declareShortcut ("document-assets-meshes", "Open Mesh Asset List", QKeySequence()); + declareShortcut ("document-assets-icons", "Open Icon Asset List", QKeySequence()); + declareShortcut ("document-assets-music", "Open Music Asset List", QKeySequence()); + declareShortcut ("document-assets-soundres", "Open Sound File List", QKeySequence()); + declareShortcut ("document-assets-textures", "Open Texture Asset List", QKeySequence()); + declareShortcut ("document-assets-videos", "Open Video Asset List", QKeySequence()); declareShortcut ("document-debug-run", "Run Debug", QKeySequence()); declareShortcut ("document-debug-shutdown", "Stop Debug", QKeySequence()); - declareShortcut ("document-debug-runlog", "Run Log", QKeySequence()); + declareShortcut ("document-debug-runlog", "Open Run Log", QKeySequence()); declareSubcategory ("Table"); - 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 row/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()); + 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 Row/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()); declareSubcategory ("Report Table"); - 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()); + 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()); declareSubcategory ("1st/Free Camera"); declareShortcut ("free-forward", "Forward", QKeySequence(Qt::Key_W), Qt::Key_Shift); declareShortcut ("free-backward", "Backward", QKeySequence(Qt::Key_S)); declareShortcut ("free-left", "Left", QKeySequence(Qt::Key_A)); declareShortcut ("free-right", "Right", QKeySequence(Qt::Key_D)); - declareModifier ("free-forward", "Speed modifier"); - declareShortcut ("free-roll-left", "Roll left", QKeySequence(Qt::Key_Q)); - declareShortcut ("free-roll-right", "Roll right", QKeySequence(Qt::Key_E)); - declareShortcut ("free-speed-mode", "Speed mode toggle", QKeySequence(Qt::Key_F)); + declareModifier ("free-forward", "Speed Modifier"); + declareShortcut ("free-roll-left", "Roll Left", QKeySequence(Qt::Key_Q)); + declareShortcut ("free-roll-right", "Roll Right", QKeySequence(Qt::Key_E)); + declareShortcut ("free-speed-mode", "Toggle Speed Mode", QKeySequence(Qt::Key_F)); declareSubcategory ("Orbit Camera"); declareShortcut ("orbit-up", "Up", QKeySequence(Qt::Key_W), Qt::Key_Shift); declareShortcut ("orbit-down", "Down", QKeySequence(Qt::Key_S)); declareShortcut ("orbit-left", "Left", QKeySequence(Qt::Key_A)); declareShortcut ("orbit-right", "Right", QKeySequence(Qt::Key_D)); - declareModifier ("orbit-up", "Speed modifier"); - declareShortcut ("orbit-roll-left", "Roll left", QKeySequence(Qt::Key_Q)); - declareShortcut ("orbit-roll-right", "Roll right", QKeySequence(Qt::Key_E)); - declareShortcut ("orbit-speed-mode", "Speed mode toggle", QKeySequence(Qt::Key_F)); - declareShortcut ("orbit-center-selection", "Center on selected", QKeySequence(Qt::Key_C)); + declareModifier ("orbit-up", "Speed Modifier"); + declareShortcut ("orbit-roll-left", "Roll Left", QKeySequence(Qt::Key_Q)); + declareShortcut ("orbit-roll-right", "Roll Right", QKeySequence(Qt::Key_E)); + declareShortcut ("orbit-speed-mode", "Toggle Speed Mode", QKeySequence(Qt::Key_F)); + declareShortcut ("orbit-center-selection", "Center On Selected", QKeySequence(Qt::Key_C)); declareSubcategory ("Scene"); - declareShortcut ("scene-navi-primary", "Camera rotation from mouse movement", QKeySequence(Qt::LeftButton)); - declareShortcut ("scene-navi-secondary", "Camera translation from mouse movement", + declareShortcut ("scene-navi-primary", "Camera Rotation From Mouse Movement", QKeySequence(Qt::LeftButton)); + declareShortcut ("scene-navi-secondary", "Camera Translation From Mouse Movement", QKeySequence(Qt::ControlModifier | (int)Qt::LeftButton)); - declareShortcut ("scene-edit-primary", "Primary edit", QKeySequence(Qt::RightButton)); - declareShortcut ("scene-edit-secondary", "Secondary edit", + declareShortcut ("scene-edit-primary", "Primary Edit", QKeySequence(Qt::RightButton)); + declareShortcut ("scene-edit-secondary", "Secondary Edit", QKeySequence(Qt::ControlModifier | (int)Qt::RightButton)); - declareShortcut ("scene-select-primary", "Primary select", QKeySequence(Qt::MiddleButton)); - declareShortcut ("scene-select-secondary", "Secondary select", + declareShortcut ("scene-select-primary", "Primary Select", QKeySequence(Qt::MiddleButton)); + declareShortcut ("scene-select-secondary", "Secondary Select", QKeySequence(Qt::ControlModifier | (int)Qt::MiddleButton)); - declareShortcut ("scene-load-cam-cell", "Load camera cell", QKeySequence(Qt::KeypadModifier | Qt::Key_5)); - declareShortcut ("scene-load-cam-eastcell", "Load east cell", QKeySequence(Qt::KeypadModifier | Qt::Key_6)); - declareShortcut ("scene-load-cam-northcell", "Load north cell", QKeySequence(Qt::KeypadModifier | Qt::Key_8)); - declareShortcut ("scene-load-cam-westcell", "Load west cell", QKeySequence(Qt::KeypadModifier | Qt::Key_4)); - declareShortcut ("scene-load-cam-southcell", "Load south cell", QKeySequence(Qt::KeypadModifier | Qt::Key_2)); + declareShortcut ("scene-load-cam-cell", "Load Camera Cell", QKeySequence(Qt::KeypadModifier | Qt::Key_5)); + declareShortcut ("scene-load-cam-eastcell", "Load East Cell", QKeySequence(Qt::KeypadModifier | Qt::Key_6)); + declareShortcut ("scene-load-cam-northcell", "Load North Cell", QKeySequence(Qt::KeypadModifier | Qt::Key_8)); + declareShortcut ("scene-load-cam-westcell", "Load West Cell", QKeySequence(Qt::KeypadModifier | Qt::Key_4)); + declareShortcut ("scene-load-cam-southcell", "Load South Cell", QKeySequence(Qt::KeypadModifier | Qt::Key_2)); declareShortcut ("scene-edit-abort", "Abort", QKeySequence(Qt::Key_Escape)); - declareShortcut ("scene-focus-toolbar", "Toggle toolbar focus", QKeySequence(Qt::Key_T)); - declareShortcut ("scene-render-stats", "Debug rendering stats", QKeySequence(Qt::Key_F3)); + declareShortcut ("scene-focus-toolbar", "Toggle Toolbar Focus", QKeySequence(Qt::Key_T)); + declareShortcut ("scene-render-stats", "Debug Rendering Stats", QKeySequence(Qt::Key_F3)); } void CSMPrefs::State::declareCategory (const std::string& key) diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index df7146404..ff49a90fd 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -45,7 +45,7 @@ void CSVDoc::View::closeEvent (QCloseEvent *event) void CSVDoc::View::setupFileMenu() { - QMenu *file = menuBar()->addMenu (tr ("&File")); + QMenu *file = menuBar()->addMenu (tr ("File")); QAction *newGame = new QAction (tr ("New Game"), this); connect (newGame, SIGNAL (triggered()), this, SIGNAL (newGameRequest())); @@ -58,17 +58,17 @@ void CSVDoc::View::setupFileMenu() setupShortcut("document-file-newaddon", newAddon); file->addAction (newAddon); - QAction *open = new QAction (tr ("&Open"), this); + QAction *open = new QAction (tr ("Open"), this); connect (open, SIGNAL (triggered()), this, SIGNAL (loadDocumentRequest())); setupShortcut("document-file-open", open); file->addAction (open); - mSave = new QAction (tr ("&Save"), this); + mSave = new QAction (tr ("Save"), this); connect (mSave, SIGNAL (triggered()), this, SLOT (save())); setupShortcut("document-file-save", mSave); file->addAction (mSave); - mVerify = new QAction (tr ("&Verify"), this); + mVerify = new QAction (tr ("Verify"), this); connect (mVerify, SIGNAL (triggered()), this, SLOT (verify())); setupShortcut("document-file-verify", mVerify); file->addAction (mVerify); @@ -78,7 +78,7 @@ void CSVDoc::View::setupFileMenu() setupShortcut("document-file-merge", mMerge); file->addAction (mMerge); - QAction *loadErrors = new QAction (tr ("Load Error Log"), this); + QAction *loadErrors = new QAction (tr ("Open Load Error Log"), this); connect (loadErrors, SIGNAL (triggered()), this, SLOT (loadErrorLog())); setupShortcut("document-file-errorlog", loadErrors); file->addAction (loadErrors); @@ -88,12 +88,12 @@ void CSVDoc::View::setupFileMenu() setupShortcut("document-file-metadata", meta); file->addAction (meta); - QAction *close = new QAction (tr ("&Close"), this); + QAction *close = new QAction (tr ("Close Document"), this); connect (close, SIGNAL (triggered()), this, SLOT (close())); setupShortcut("document-file-close", close); file->addAction(close); - QAction *exit = new QAction (tr ("&Exit"), this); + QAction *exit = new QAction (tr ("Exit Application"), this); connect (exit, SIGNAL (triggered()), this, SLOT (exit())); connect (this, SIGNAL(exitApplicationRequest(CSVDoc::View *)), &mViewManager, SLOT(exitApplication(CSVDoc::View *))); setupShortcut("document-file-exit", exit); @@ -103,17 +103,17 @@ void CSVDoc::View::setupFileMenu() void CSVDoc::View::setupEditMenu() { - QMenu *edit = menuBar()->addMenu (tr ("&Edit")); + QMenu *edit = menuBar()->addMenu (tr ("Edit")); - mUndo = mDocument->getUndoStack().createUndoAction (this, tr("&Undo")); + mUndo = mDocument->getUndoStack().createUndoAction (this, tr("Undo")); setupShortcut("document-edit-undo", mUndo); edit->addAction (mUndo); - mRedo= mDocument->getUndoStack().createRedoAction (this, tr("&Redo")); + mRedo= mDocument->getUndoStack().createRedoAction (this, tr("Redo")); setupShortcut("document-edit-redo", mRedo); edit->addAction (mRedo); - QAction *userSettings = new QAction (tr ("&Preferences"), this); + QAction *userSettings = new QAction (tr ("Preferences"), this); connect (userSettings, SIGNAL (triggered()), this, SIGNAL (editSettingsRequest())); setupShortcut("document-edit-preferences", userSettings); edit->addAction (userSettings); @@ -126,14 +126,14 @@ void CSVDoc::View::setupEditMenu() void CSVDoc::View::setupViewMenu() { - QMenu *view = menuBar()->addMenu (tr ("&View")); + QMenu *view = menuBar()->addMenu (tr ("View")); - QAction *newWindow = new QAction (tr ("&New View"), this); + QAction *newWindow = new QAction (tr ("New View"), this); connect (newWindow, SIGNAL (triggered()), this, SLOT (newView())); setupShortcut("document-view-newview", newWindow); view->addAction (newWindow); - mShowStatusBar = new QAction (tr ("Show Status Bar"), this); + mShowStatusBar = new QAction (tr ("Toggle Status Bar"), this); mShowStatusBar->setCheckable (true); connect (mShowStatusBar, SIGNAL (toggled (bool)), this, SLOT (toggleShowStatusBar (bool))); setupShortcut("document-view-statusbar", mShowStatusBar); @@ -150,7 +150,7 @@ void CSVDoc::View::setupViewMenu() void CSVDoc::View::setupWorldMenu() { - QMenu *world = menuBar()->addMenu (tr ("&World")); + QMenu *world = menuBar()->addMenu (tr ("World")); QAction *regions = new QAction (tr ("Regions"), this); connect (regions, SIGNAL (triggered()), this, SLOT (addRegionsSubView())); @@ -187,14 +187,14 @@ void CSVDoc::View::setupWorldMenu() void CSVDoc::View::setupMechanicsMenu() { - QMenu *mechanics = menuBar()->addMenu (tr ("&Mechanics")); + QMenu *mechanics = menuBar()->addMenu (tr ("Mechanics")); QAction *globals = new QAction (tr ("Globals"), this); connect (globals, SIGNAL (triggered()), this, SLOT (addGlobalsSubView())); setupShortcut("document-mechanics-globals", globals); mechanics->addAction (globals); - QAction *gmsts = new QAction (tr ("Game settings"), this); + QAction *gmsts = new QAction (tr ("Game Settings"), this); connect (gmsts, SIGNAL (triggered()), this, SLOT (addGmstsSubView())); setupShortcut("document-mechanics-gamesettings", gmsts); mechanics->addAction (gmsts); @@ -282,7 +282,7 @@ void CSVDoc::View::setupCharacterMenu() void CSVDoc::View::setupAssetsMenu() { - QMenu *assets = menuBar()->addMenu (tr ("&Assets")); + QMenu *assets = menuBar()->addMenu (tr ("Assets")); QAction *sounds = new QAction (tr ("Sounds"), this); connect (sounds, SIGNAL (triggered()), this, SLOT (addSoundsSubView())); @@ -354,7 +354,7 @@ void CSVDoc::View::setupDebugMenu() setupShortcut("document-debug-shutdown", mStopDebug); debug->addAction (mStopDebug); - QAction *runLog = new QAction (tr ("Run Log"), this); + QAction *runLog = new QAction (tr ("Open Run Log"), this); connect (runLog, SIGNAL (triggered()), this, SLOT (addRunLogSubView())); setupShortcut("document-debug-runlog", runLog); debug->addAction (runLog);