Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow renaming of FX mixer channels with the F2 and enter keys. #4348

Merged
merged 4 commits into from
May 13, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/FxLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class FxLine : public QWidget

static const int FxLineHeight;

void renameChannel();

private:
void drawFxLine( QPainter* p, const FxLine *fxLine, bool isActive, bool sendToThis, bool receiveFromThis );
QString elideName( const QString & name );
Expand All @@ -98,7 +100,6 @@ class FxLine : public QWidget
QGraphicsView * m_view;

private slots:
void renameChannel();
void renameFinished();
void removeChannel();
void removeUnusedChannels();
Expand Down
3 changes: 3 additions & 0 deletions include/FxMixerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ class EXPORT FxMixerView : public QWidget, public ModelView,
void moveChannelLeft(int index, int focusIndex);
void moveChannelRight(int index);

// rename the channel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is useless and should be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I see what you're saying. I was following the rest of the code there, it looks more out of place without the comment IMO. I could remove all these comments as they are all pretty redundant, but for now I'll just remove the one I added.

image

void renameChannel(int index);

// make sure the display syncs up with the fx mixer.
// useful for loading projects
void refreshDisplay();
Expand Down
11 changes: 11 additions & 0 deletions src/gui/FxMixerView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,12 @@ void FxMixerView::moveChannelRight(int index)
}


void FxMixerView::renameChannel(int index)
{
m_fxChannelViews[index]->m_fxLine->renameChannel();
}



void FxMixerView::keyPressEvent(QKeyEvent * e)
{
Expand Down Expand Up @@ -527,6 +533,11 @@ void FxMixerView::keyPressEvent(QKeyEvent * e)
addNewChannel();
}
break;
case Qt::Key_F2:
case Qt::Key_Enter:
case Qt::Key_Return:
renameChannel( m_currentFxLine->channelIndex() );
break;
}
}

Expand Down