diff options
author | Underground78 <underground78@users.sourceforge.net> | 2013-09-09 00:31:44 +0400 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2013-09-09 00:55:10 +0400 |
commit | 46ec52589cbc72bcb9a625bb9659a2ffe000eebb (patch) | |
tree | 87c1515a82f7867ce163d453040172a1a9ce32e8 /src | |
parent | faaba813b7fd8c39aa05bc85893e0717c769a136 (diff) |
Playlist menu: Disable entries that don't make sense for non-local files.
Diffstat (limited to 'src')
-rw-r--r-- | src/mpc-hc/PlayerPlaylistBar.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mpc-hc/PlayerPlaylistBar.cpp b/src/mpc-hc/PlayerPlaylistBar.cpp index ab089e672..64e7f322f 100644 --- a/src/mpc-hc/PlayerPlaylistBar.cpp +++ b/src/mpc-hc/PlayerPlaylistBar.cpp @@ -1347,8 +1347,8 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p) m_list.SubItemHitTest(&lvhti);
POSITION pos = FindPos(lvhti.iItem);
- //bool fSelected = (pos == m_pl.GetPos());
- bool fOnItem = !!(lvhti.flags & LVHT_ONITEM);
+ bool bOnItem = !!(lvhti.flags & LVHT_ONITEM);
+ bool bIsLocalFile = bOnItem ? FileExists(m_pl.GetAt(pos).m_fns.GetHead()) : false;
CMenu m;
m.CreatePopupMenu();
@@ -1372,17 +1372,17 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint p) CAppSettings& s = AfxGetAppSettings();
- m.AppendMenu(MF_STRING | (!fOnItem ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED), M_OPEN, ResStr(IDS_PLAYLIST_OPEN));
+ m.AppendMenu(MF_STRING | (!bOnItem ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED), M_OPEN, ResStr(IDS_PLAYLIST_OPEN));
if (((CMainFrame*)AfxGetMainWnd())->GetPlaybackMode() == PM_CAPTURE) {
m.AppendMenu(MF_STRING | MF_ENABLED, M_ADD, ResStr(IDS_PLAYLIST_ADD));
}
- m.AppendMenu(MF_STRING | (/*fSelected||*/!fOnItem ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED), M_REMOVE, ResStr(IDS_PLAYLIST_REMOVE));
- m.AppendMenu(MF_STRING | (/*fSelected||*/!fOnItem ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED), M_RECYCLE, ResStr(IDS_FILE_RECYCLE));
+ m.AppendMenu(MF_STRING | (!bOnItem ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED), M_REMOVE, ResStr(IDS_PLAYLIST_REMOVE));
+ m.AppendMenu(MF_STRING | ((!bOnItem || !bIsLocalFile) ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED), M_RECYCLE, ResStr(IDS_FILE_RECYCLE));
m.AppendMenu(MF_SEPARATOR);
m.AppendMenu(MF_STRING | (!m_pl.GetCount() ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED), M_CLEAR, ResStr(IDS_PLAYLIST_CLEAR));
m.AppendMenu(MF_SEPARATOR);
- m.AppendMenu(MF_STRING | (!fOnItem ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED), M_CLIPBOARD, ResStr(IDS_PLAYLIST_COPYTOCLIPBOARD));
- m.AppendMenu(MF_STRING | (!fOnItem ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED), M_SHOWFOLDER, ResStr(IDS_PLAYLIST_SHOWFOLDER));
+ m.AppendMenu(MF_STRING | (!bOnItem ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED), M_CLIPBOARD, ResStr(IDS_PLAYLIST_COPYTOCLIPBOARD));
+ m.AppendMenu(MF_STRING | ((!bOnItem || !bIsLocalFile) ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED), M_SHOWFOLDER, ResStr(IDS_PLAYLIST_SHOWFOLDER));
m.AppendMenu(MF_STRING | (!m_pl.GetCount() ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED), M_SAVEAS, ResStr(IDS_PLAYLIST_SAVEAS));
m.AppendMenu(MF_SEPARATOR);
m.AppendMenu(MF_STRING | (!m_pl.GetCount() ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED), M_SORTBYNAME, ResStr(IDS_PLAYLIST_SORTBYLABEL));
|