Remove selection requirement to toggle Camera Column

This commit is contained in:
manongjohn 2019-09-19 20:44:23 -04:00
parent 83fe31d0e0
commit 31e2aba9e1
4 changed files with 24 additions and 16 deletions

View file

@ -49,11 +49,6 @@ void TColumnSelection::enableCommands() {
enableCommand(this, MI_Resequence, &TColumnSelection::resequence);
enableCommand(this, MI_CloneChild, &TColumnSelection::cloneChild);
enableCommand(this, MI_FoldColumns, &TColumnSelection::hideColumns);
if (Preferences::instance()->isShowKeyframesOnXsheetCellAreaEnabled())
enableCommand(this, MI_ToggleXsheetCameraColumn,
&TColumnSelection::toggleCameraColumn);
enableCommand(this, MI_Reframe1, &TColumnSelection::reframe1Cells);
enableCommand(this, MI_Reframe2, &TColumnSelection::reframe2Cells);
enableCommand(this, MI_Reframe3, &TColumnSelection::reframe3Cells);
@ -270,11 +265,3 @@ void TColumnSelection::hideColumns() {
// TApp::instance()->->notify(TColumnHeadChange());
app->getCurrentScene()->setDirtyFlag(true);
}
//-----------------------------------------------------------------------------
void TColumnSelection::toggleCameraColumn() {
Preferences *pref = Preferences::instance();
pref->enableXsheetCameraColumn(!pref->isXsheetCameraColumnVisible());
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
}

View file

@ -45,7 +45,6 @@ public:
void cloneChild();
void hideColumns();
void toggleCameraColumn();
void reframeCells(int count);
void reframe1Cells() { reframeCells(1); }

View file

@ -1758,7 +1758,7 @@ void MainWindow::defineActions() {
"Alt+L");
createRightClickMenuAction(MI_ToggleXSheetToolbar,
tr("Toggle XSheet Toolbar"), "");
createRightClickMenuAction(MI_ToggleXsheetCameraColumn,
createMenuXsheetAction(MI_ToggleXsheetCameraColumn,
tr("Show/Hide Xsheet Camera Column"), "");
createMenuCellsAction(MI_Reverse, tr("&Reverse"), "");
createMenuCellsAction(MI_Swing, tr("&Swing"), "");

View file

@ -2131,3 +2131,25 @@ void PrintXsheetCommand::execute() {
TSystem::showDocument(fp);
}
//-----------------------------------------------------------------------------
class ToggleXsheetCameraColumnCommand final : public MenuItemHandler {
public:
ToggleXsheetCameraColumnCommand()
: MenuItemHandler(MI_ToggleXsheetCameraColumn) {}
void execute() override {
Preferences *pref = Preferences::instance();
if (!pref->isShowKeyframesOnXsheetCellAreaEnabled()) {
DVGui::warning(
QObject::tr("Please enable \"Show Keyframes on Cell Area\" to show "
"or hide the camera column."));
return;
}
pref->enableXsheetCameraColumn(!pref->isXsheetCameraColumnVisible());
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
}
} ToggleXsheetCameraColumnCommand;