Skip to content

Commit

Permalink
Update TrackTableview after key notation changed
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Mar 23, 2019
1 parent 755ad3a commit 9640a6f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/widget/wkey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
WKey::WKey(const char* group, QWidget* pParent)
: WLabel(pParent),
m_dOldValue(0),
m_pKeyNotation("[Library]", "key_notation", this),
m_keyNotation("[Library]", "key_notation", this),
m_engineKeyDistance(group, "visual_key_distance", this) {
setValue(m_dOldValue);
m_pKeyNotation.connectValueChanged(this, &WKey::keyNotationChanged);
m_keyNotation.connectValueChanged(this, &WKey::keyNotationChanged);
m_engineKeyDistance.connectValueChanged(this, &WKey::setCents);
}

Expand Down
2 changes: 1 addition & 1 deletion src/widget/wkey.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class WKey : public WLabel {
double m_dOldValue;
bool m_displayCents;
bool m_displayKey;
ControlProxy m_pKeyNotation;
ControlProxy m_keyNotation;
ControlProxy m_engineKeyDistance;
};

Expand Down
10 changes: 10 additions & 0 deletions src/widget/wtracktableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ WTrackTableView::WTrackTableView(QWidget * parent,
m_pCOTGuiTick = new ControlProxy("[Master]", "guiTick50ms", this);
m_pCOTGuiTick->connectValueChanged(this, &WTrackTableView::slotGuiTick50ms);

m_pKeyNotation = new ControlProxy("[Library]", "key_notation", this);
m_pCOTGuiTick->connectValueChanged(this, &WTrackTableView::keyNotationChanged);

This comment has been minimized.

Copy link
@uklotzde

uklotzde Apr 1, 2019

Contributor

I didn't see this copy&paste error 🙈 Should be easy to fix

This comment has been minimized.

Copy link
@daschuer

daschuer Apr 1, 2019

Author Member

Oh yes definitely :-)



connect(this, SIGNAL(scrollValueChanged(int)),
this, SLOT(slotScrollValueChanged(int)));

Expand Down Expand Up @@ -1990,3 +1994,9 @@ void WTrackTableView::restoreCurrentVScrollBarPos()
{
restoreVScrollBarPos(getTrackModel());
}

void WTrackTableView::keyNotationChanged()
{
QWidget::update();
}

2 changes: 2 additions & 0 deletions src/widget/wtracktableview.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class WTrackTableView : public WLibraryTableView {

void slotTrackInfoClosed();
void slotTagFetcherClosed();
void keyNotationChanged();

private:

Expand Down Expand Up @@ -215,6 +216,7 @@ class WTrackTableView : public WLibraryTableView {
bool m_bPlaylistMenuLoaded;
bool m_bCrateMenuLoaded;
ControlProxy* m_pCOTGuiTick;
ControlProxy* m_pKeyNotation;
};

#endif

0 comments on commit 9640a6f

Please sign in to comment.