Skip to content

Commit

Permalink
Add option to show cover art widget in the 'view menu'
Browse files Browse the repository at this point in the history
  • Loading branch information
cardinot committed Sep 10, 2014
1 parent 1db21a8 commit b458f13
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 2 deletions.
8 changes: 7 additions & 1 deletion res/skins/Deere1280x800-WXGA/skin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<attribute config_key="[Microphone],show_microphone">0</attribute>
<attribute config_key="[VinylControl],show_vinylcontrol">0</attribute>
<attribute config_key="[PreviewDeck],show_previewdeck">0</attribute>
<attribute config_key="[CoverArt],show_coverart">0</attribute>
</attributes>
</manifest>

Expand Down Expand Up @@ -2498,7 +2499,12 @@
<!--Library Tree View-->
<LibrarySidebar></LibrarySidebar>
<!--Cover Art-->
<CoverArt></CoverArt>
<CoverArt>
<Connection>
<ConfigKey>[CoverArt],show_coverart</ConfigKey>
<BindProperty>visible</BindProperty>
</Connection>
</CoverArt>
</Children>
</WidgetGroup>
<WidgetGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/controllers/controlpickermenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,9 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
addControl("[PreviewDeck]", "show_previewdeck",
tr("Preview Deck Show/Hide"),
tr("Show/hide the preview deck"), guiMenu);
addControl("[CoverArt]", "show_coverart",
tr("Cover Art Show/Hide"),
tr("Show/hide the cover art"), guiMenu);

const int iNumDecks = ControlObject::get(ConfigKey("[Master]", "num_decks"));
QString spinnyTitle = tr("Vinyl Spinner Show/Hide");
Expand Down
22 changes: 21 additions & 1 deletion src/mixxx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,10 @@ void MixxxMainWindow::slotViewShowPreviewDeck(bool enable) {
toggleVisibility(ConfigKey("[PreviewDeck]", "show_previewdeck"), enable);
}

void MixxxMainWindow::slotViewShowCoverArt(bool enable) {
toggleVisibility(ConfigKey("[CoverArt]", "show_coverart"), enable);
}

void setVisibilityOptionState(QAction* pAction, ConfigKey key) {
ControlObject* pVisibilityControl = ControlObject::getControl(key);
pAction->setEnabled(pVisibilityControl != NULL);
Expand All @@ -829,6 +833,8 @@ void MixxxMainWindow::onNewSkinLoaded() {
ConfigKey("[Microphone]", "show_microphone"));
setVisibilityOptionState(m_pViewShowPreviewDeck,
ConfigKey("[PreviewDeck]", "show_previewdeck"));
setVisibilityOptionState(m_pViewShowCoverArt,
ConfigKey("[CoverArt]", "show_coverart"));
}

int MixxxMainWindow::noSoundDlg(void)
Expand Down Expand Up @@ -1255,7 +1261,7 @@ void MixxxMainWindow::initActions()

QString showPreviewDeckTitle = tr("Show Preview Deck");
QString showPreviewDeckText = tr("Show the preview deck in the Mixxx interface.") +
" " + mayNotBeSupported;
" " + mayNotBeSupported;
m_pViewShowPreviewDeck = new QAction(showPreviewDeckTitle, this);
m_pViewShowPreviewDeck->setCheckable(true);
m_pViewShowPreviewDeck->setShortcut(
Expand All @@ -1267,6 +1273,19 @@ void MixxxMainWindow::initActions()
connect(m_pViewShowPreviewDeck, SIGNAL(toggled(bool)),
this, SLOT(slotViewShowPreviewDeck(bool)));

QString showCoverArtTitle = tr("Show Cover Art");
QString showCoverArtText = tr("Show the cover art in the Mixxx interface.") +
" " + mayNotBeSupported;
m_pViewShowCoverArt = new QAction(showCoverArtTitle, this);
m_pViewShowCoverArt->setCheckable(true);
m_pViewShowCoverArt->setShortcut(
QKeySequence(m_pKbdConfig->getValueString(ConfigKey("[KeyboardShortcuts]",
"ViewMenu_ShowCoverArt"),
tr("Ctrl+5", "Menubar|View|Show Cover Art"))));
m_pViewShowCoverArt->setStatusTip(showCoverArtText);
m_pViewShowCoverArt->setWhatsThis(buildWhatsThis(showCoverArtTitle, showCoverArtText));
connect(m_pViewShowCoverArt, SIGNAL(toggled(bool)),
this, SLOT(slotViewShowCoverArt(bool)));

QString recordTitle = tr("&Record Mix");
QString recordText = tr("Record your mix to a file");
Expand Down Expand Up @@ -1378,6 +1397,7 @@ void MixxxMainWindow::initMenuBar()
m_pViewMenu->addAction(m_pViewVinylControl);
#endif
m_pViewMenu->addAction(m_pViewShowPreviewDeck);
m_pViewMenu->addAction(m_pViewShowCoverArt);
m_pViewMenu->addSeparator();
m_pViewMenu->addAction(m_pViewFullScreen);

Expand Down
2 changes: 2 additions & 0 deletions src/mixxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class MixxxMainWindow : public QMainWindow {
void slotViewShowVinylControl(bool);
void slotViewShowMicrophone(bool);
void slotViewShowPreviewDeck(bool);
void slotViewShowCoverArt(bool);
// toogle full screen mode
void slotViewFullScreen(bool toggle);
// Reload the skin.
Expand Down Expand Up @@ -228,6 +229,7 @@ class MixxxMainWindow : public QMainWindow {
QAction* m_pViewVinylControl;
QAction* m_pViewShowMicrophone;
QAction* m_pViewShowPreviewDeck;
QAction* m_pViewShowCoverArt;
QAction* m_pViewFullScreen;
QAction* m_pHelpAboutApp;
QAction* m_pHelpSupport;
Expand Down
1 change: 1 addition & 0 deletions src/skin/legacyskinparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,7 @@ QWidget* LegacySkinParser::parseSearchBox(QDomElement node) {

QWidget* LegacySkinParser::parseCoverArt(QDomElement node) {
WCoverArt* pCoverArt = new WCoverArt(m_pParent, m_pConfig);
setupConnections(node, pCoverArt);
setupBaseWidget(node, pCoverArt);
setupWidget(node, pCoverArt);
pCoverArt->setup(node, *m_pContext);
Expand Down
4 changes: 4 additions & 0 deletions src/skin/tooltips.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ void Tooltips::addStandardTooltips() {
<< tr("Preview Deck")
<< tr("Show/hide the Preview deck.");

add("show_coverart")
<< tr("Cover Art")
<< tr("Show/hide the Cover Art.");

add("microphone_volume")
<< tr("Microphone Volume")
<< tr("Adjusts the microphone volume.")
Expand Down

1 comment on commit b458f13

@esbrandt
Copy link

Choose a reason for hiding this comment

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

Is there a reason why the new Show Cover Art option in the view menu again displays a button Show Cover Art below the library tree? I think we can assume that if a user activates the option in the view menu, he actually wants to see the cover.

IMO away with the redundant button and leave View>Show Cover Art + the associated shortcut the only option to activate the widget.

Please sign in to comment.