Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksoid <aleksoid@users.sourceforge.net>2008-08-19 16:29:23 +0400
committerAleksoid <aleksoid@users.sourceforge.net>2008-08-19 16:29:23 +0400
commit4945cb9064217b091093382ece43a6b266077008 (patch)
tree36dff2295d582db400c55c4b02441ae7e95408fe /src/apps/mplayerc/PPageFormats.cpp
parent109e845500190373c372414b8664a6611dfddf06 (diff)
ADD : Adding Entries to the Explorer Context Menu for Directory(MPC now reads the entire directory)
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@736 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/PPageFormats.cpp')
-rw-r--r--src/apps/mplayerc/PPageFormats.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/apps/mplayerc/PPageFormats.cpp b/src/apps/mplayerc/PPageFormats.cpp
index e4c38abfb..89a3af578 100644
--- a/src/apps/mplayerc/PPageFormats.cpp
+++ b/src/apps/mplayerc/PPageFormats.cpp
@@ -603,11 +603,13 @@ BOOL CPPageFormats::OnApply()
}
}
-
+
+ int cntChecked = 0;
for(int i = 0; i < m_list.GetItemCount(); i++)
{
int iChecked = GetChecked(i);
if(iChecked == 2) continue;
+ cntChecked += iChecked;
CAtlList<CString> exts;
Explode(mf[(int)m_list.GetItemData(i)].GetExtsWithPeriod(), exts, ' ');
@@ -616,6 +618,32 @@ BOOL CPPageFormats::OnApply()
while(pos)
RegisterExt(exts.GetNext(pos), mf[(int)m_list.GetItemData(i)].GetProgId(), mf[(int)m_list.GetItemData(i)].GetLabel(), !!iChecked);
}
+
+ CRegKey key;
+ if(cntChecked)
+ {
+ if(ERROR_SUCCESS == key.Create(HKEY_CLASSES_ROOT, _T("Directory\\shell\\mplayerc.enqueue"))){
+ key.SetStringValue(NULL, ResStr(IDS_ADD_TO_PLAYLIST));
+ }
+
+ if(ERROR_SUCCESS == key.Create(HKEY_CLASSES_ROOT, _T("Directory\\shell\\mplayerc.enqueue\\command"))){
+ key.SetStringValue(NULL, GetEnqueueCommand());
+ }
+
+ if(ERROR_SUCCESS == key.Create(HKEY_CLASSES_ROOT, _T("Directory\\shell\\mplayerc.play"))){
+ key.SetStringValue(NULL, ResStr(IDS_OPEN_WITH_MPC));
+ }
+
+ if(ERROR_SUCCESS == key.Create(HKEY_CLASSES_ROOT, _T("Directory\\shell\\mplayerc.play\\command"))){
+ key.SetStringValue(NULL, GetOpenCommand());
+ }
+ }
+ else
+ {
+ key.Attach(HKEY_CLASSES_ROOT);
+ key.RecurseDeleteKey(_T("Directory\\shell\\mplayerc.enqueue"));
+ key.RecurseDeleteKey(_T("Directory\\shell\\mplayerc.play"));
+ }
{
SetListItemState(m_list.GetSelectionMark(), mf[m_list.GetItemData(m_list.GetSelectionMark())].GetProgId());