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-16 08:33:02 +0400
committerAleksoid <aleksoid@users.sourceforge.net>2008-08-16 08:33:02 +0400
commite4c03bad00ab4c3ac0e386f5217a58f0405ae900 (patch)
tree95dee2ac37e308eb5336e9197637f2966c362808 /src/apps/mplayerc/PPageFormats.cpp
parent49f65bcc8da307a2b1f483b1a9a5d6bc347f1822 (diff)
FIX : Format & File Associate -
"Image File" now not include by pressing "Video" button on all language, Correct show non associated formats, Add MPC-HC default ICON for associated formats; git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@731 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/PPageFormats.cpp')
-rw-r--r--src/apps/mplayerc/PPageFormats.cpp43
1 files changed, 40 insertions, 3 deletions
diff --git a/src/apps/mplayerc/PPageFormats.cpp b/src/apps/mplayerc/PPageFormats.cpp
index b41a45aec..e27619efa 100644
--- a/src/apps/mplayerc/PPageFormats.cpp
+++ b/src/apps/mplayerc/PPageFormats.cpp
@@ -170,6 +170,19 @@ bool CPPageFormats::RegisterExt(CString ext, CString strProgID, CString strLabel
CRegKey key;
bool bSetValue;
+ if(!fRegister)
+ {
+ // Empty "to playlist option"
+ if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\enqueue\\command"))) return(false);
+ if(ERROR_SUCCESS != key.SetStringValue(NULL, _T(""))) return(false);
+
+ // Empty "Play option"
+ if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\open\\command"))) return(false);
+ if(ERROR_SUCCESS != key.SetStringValue(NULL, _T(""))) return(false);
+
+ return(true);
+ }
+
bSetValue = fRegister || (ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\open\\command"), KEY_READ));
// Create ProgID for this file type
@@ -193,6 +206,18 @@ bool CPPageFormats::RegisterExt(CString ext, CString strProgID, CString strLabel
if(ERROR_SUCCESS != key.Create(HKEY_LOCAL_MACHINE, g_strRegisteredKey + _T("\\FileAssociations"))) return(false);
if(ERROR_SUCCESS != key.SetStringValue(ext, strProgID)) return(false);
+ CString AppIcon = _T("");
+ TCHAR buff[MAX_PATH];
+
+ if(::GetModuleFileName(AfxGetInstanceHandle(), buff, MAX_PATH))
+ {
+ AppIcon = buff;
+ AppIcon = "\""+AppIcon+"\"";
+ AppIcon += _T(",0");
+ }
+ if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\DefaultIcon"))) return(false);
+ if(bSetValue && (ERROR_SUCCESS != key.SetStringValue(NULL, AppIcon))) return(false);
+
if(fRegister != IsRegistered(ext, strProgID))
SetFileAssociation (ext, strProgID, fRegister);
@@ -340,7 +365,8 @@ BOOL CPPageFormats::OnInitDialog()
CString label;
label.Format (_T("%s (%s)"), mf[i].GetLabel(), mf[i].GetExts());
// HACK: sorry, mpc is just not an image viewer :)
- if(!label.CompareNoCase(_T("Image file"))) continue;
+ //if(!label.CompareNoCase(_T("Image file"))) continue;
+ if(!label.CompareNoCase(ResStr(IDS_AG_IMAGE_FILE))) continue;
int iItem = m_list.InsertItem(i, label);
m_list.SetItemData(iItem, i);
engine_t e = mf[i].GetEngineType();
@@ -551,6 +577,16 @@ BOOL CPPageFormats::OnApply()
CMediaFormats& mf = AfxGetAppSettings().Formats;
+ CString AppIcon = _T("");
+ TCHAR buff[MAX_PATH];
+
+ if(::GetModuleFileName(AfxGetInstanceHandle(), buff, MAX_PATH))
+ {
+ AppIcon = buff;
+ AppIcon = "\""+AppIcon+"\"";
+ AppIcon += _T(",0");
+ }
+
if (m_pAAR)
{
// Register MPC for the windows "Default application" manager
@@ -565,7 +601,7 @@ BOOL CPPageFormats::OnApply()
// ==>> TODO icon !!!
key.SetStringValue(_T("ApplicationDescription"), ResStr(IDS_APP_DESCRIPTION), REG_EXPAND_SZ);
- key.SetStringValue(_T("ApplicationIcon"), _T(""), REG_EXPAND_SZ);
+ key.SetStringValue(_T("ApplicationIcon"), AppIcon, REG_EXPAND_SZ);
key.SetStringValue(_T("ApplicationName"), ResStr(IDR_MAINFRAME), REG_EXPAND_SZ);
}
}
@@ -729,7 +765,8 @@ void CPPageFormats::OnBnClickedButton14()
for(int i = 0, j = m_list.GetItemCount(); i < j; i++)
{
- if(!mf[m_list.GetItemData(i)].GetLabel().CompareNoCase(_T("Image file"))) continue;
+ //if(!mf[m_list.GetItemData(i)].GetLabel().CompareNoCase(_T("Image file"))) continue;
+ if(!mf[m_list.GetItemData(i)].GetLabel().CompareNoCase(ResStr(IDS_AG_IMAGE_FILE))) continue;
SetChecked(i, mf[(int)m_list.GetItemData(i)].IsAudioOnly()?0:1);
}