Permalink
Browse files

FIXED: Regression - keyboard shortcut for scenes did not work.

  • Loading branch information...
1 parent 0be069b commit 8e0fdfcb3b560bc37838989e5a4982eabfc25355 @gottcode committed Sep 13, 2012
Showing with 21 additions and 6 deletions.
  1. +1 −0 ChangeLog
  2. +18 −6 src/scene_list.cpp
  3. +2 −0 src/scene_list.h
View
@@ -1,4 +1,5 @@
2012-09-13 Graeme Gott <graeme@gottcode.org>
+ * FIXED: Regression - keyboard shortcut for scenes did not work.
* FIXED: Did not show scene list if mouse was over interface.
* FIXED: Hiding toolbar did not shrink header.
View
@@ -112,11 +112,13 @@ SceneList::SceneList(QWidget* parent) :
connect(m_hide_button, SIGNAL(clicked()), this, SLOT(hideScenes()));
// Create action for toggling scenes
- action = new QAction(tr("Toggle Scene List"), this);
- action->setShortcut(tr("Shift+F4"));
- ActionManager::instance()->addAction("ToggleScenes", action);
- connect(action, SIGNAL(changed()), this, SLOT(updateShortcuts()));
+ m_toggle_action = new QAction(tr("Toggle Scene List"), this);
+ m_toggle_action->setShortcut(tr("Shift+F4"));
+ connect(m_toggle_action, SIGNAL(changed()), this, SLOT(updateShortcuts()));
+ connect(m_toggle_action, SIGNAL(triggered()), this, SLOT(toggleScenes()));
+ ActionManager::instance()->addAction("ToggleScenes", m_toggle_action);
updateShortcuts();
+ parent->addAction(m_toggle_action);
// Create scene view
m_filter_model = new QSortFilterProxyModel(this);
@@ -376,12 +378,22 @@ void SceneList::setFilter(const QString& filter)
//-----------------------------------------------------------------------------
+void SceneList::toggleScenes()
+{
+ if (scenesVisible()) {
+ hideScenes();
+ } else {
+ showScenes();
+ }
+}
+
+//-----------------------------------------------------------------------------
+
void SceneList::updateShortcuts()
{
QKeySequence shortcut = ActionManager::instance()->action("ToggleScenes")->shortcut();
- m_show_button->setShortcut(shortcut);
+ m_toggle_action->setShortcut(shortcut);
m_show_button->setToolTip(tr("Show scene list (%1)").arg(shortcut.toString(QKeySequence::NativeText)));
- m_hide_button->setShortcut(shortcut);
m_hide_button->setToolTip(tr("Hide scene list (%1)").arg(shortcut.toString(QKeySequence::NativeText)));
}
View
@@ -57,12 +57,14 @@ private slots:
void sceneSelected(const QModelIndex& index);
void selectCurrentScene();
void setFilter(const QString& filter);
+ void toggleScenes();
void updateShortcuts();
private:
void moveSelectedScenes(int movement);
private:
+ QAction* m_toggle_action;
QToolButton* m_show_button;
QListView* m_scenes;
QLineEdit* m_filter;

0 comments on commit 8e0fdfc

Please sign in to comment.