Skip to content

Commit

Permalink
FIXED: Regression - keyboard shortcut for scenes did not work.
Browse files Browse the repository at this point in the history
  • Loading branch information
gottcode committed Sep 13, 2012
1 parent 0be069b commit 8e0fdfc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
24 changes: 18 additions & 6 deletions src/scene_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)));
}

Expand Down
2 changes: 2 additions & 0 deletions src/scene_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8e0fdfc

Please sign in to comment.