Beispiel #1
0
// IRMAAuthenticationManager
STDMETHODIMP CRealMediaPlayer::HandleAuthenticationRequest(IRMAAuthenticationManagerResponse* pResponse)
{
	CAuthDlg dlg;

	if(dlg.DoModal() == IDOK)
	{
		pResponse->AuthenticationRequestDone(
			PNR_OK, CStringA(dlg.m_username), CStringA(dlg.m_password));
		return PNR_OK;
	}

	return pResponse->AuthenticationRequestDone(PNR_NOT_AUTHORIZED, NULL, NULL);
}
Beispiel #2
0
STDMETHODIMP CShellExt::XMenuExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
{
    METHOD_PROLOGUE(CShellExt, MenuExt);

    if (HIWORD(lpici->lpVerb ))
        return E_FAIL;

    AddRef();

    CStringArray &files = pThis->m_astrFileNames;

    switch (LOWORD(lpici->lpVerb))
    {
    case IDM_AUTHENTICATION:	{
	CAuthDlg dlg;
	dlg.DoModal();
	break;
    }

    case IDM_ACL_SET:			{
	CSetAfsAcl dlg;
	ASSERT(files.GetSize() == 1);
	dlg.SetDir(files[0]);
	dlg.DoModal();
	break;
    }

    case IDM_VOLUME_PROPERTIES:	{
	CVolumeInfo dlg;
	dlg.SetFiles(files);
	dlg.DoModal();
	break;
    }

    case IDM_VOLUMEPARTITION_UPDATENAMEIDTABLE:
	CheckVolumes();
	break;

    case IDM_MOUNTPOINT_SHOW:
	ListMount(files);
	break;

    case IDM_MOUNTPOINT_REMOVE:	{
	int nChoice = ShowMessageBox(IDS_REALLY_DEL_MOUNT_POINTS, MB_ICONQUESTION | MB_YESNO, IDS_REALLY_DEL_MOUNT_POINTS);
	if (nChoice == IDYES)
	    RemoveMount(files);
	break;
    }

    case IDM_MOUNTPOINT_MAKE:	{
	CMakeMountPointDlg dlg;
	ASSERT(files.GetSize() == 1);
	dlg.SetDir(files[0]);
	dlg.DoModal();
	break;
    }

    case IDM_FLUSH:
	Flush(files);
	break;

    case IDM_FLUSH_VOLUME:
	FlushVolume(files);
	break;

    case IDM_SHOW_SERVER:
	WhereIs(files);
	break;

    case IDM_SHOWCELL:
	WhichCell(files);
	break;

    case IDM_SERVER_STATUS: {
	CServerStatusDlg dlg;
	dlg.DoModal();
	break;
    }

        /*
	case IDM_SUBMOUNTS_EDIT:	{
	CSubmountsDlg dlg;
	dlg.DoModal();
	break;
	}
	case IDM_SUBMOUNTS_CREATE:	{
	ASSERT(files.GetSize() == 1);
	CSubmountsDlg dlg;
	dlg.SetAddOnlyMode(files[0]);
	dlg.DoModal();
	break;
	}
        */
    case IDM_SYMBOLICLINK_REMOVE: {
	if (files.GetSize()>1)
	    break;
	CString msg=files.GetAt(0);
	int i;
	if ((i=msg.ReverseFind('\\'))>0)
	    msg=msg.Left(i+1);
	else if ((i=msg.ReverseFind(':'))>0)
	    msg=msg.Left(i+1)+"\\";
	if (!SetCurrentDirectory(msg))
	{
	    MessageBeep((UINT)-1);
	    ShowMessageBox(IDS_UNABLE_TO_SET_CURRENT_DIRECTORY,MB_OK,IDS_UNABLE_TO_SET_CURRENT_DIRECTORY);
	    break;
	}
	msg=files.GetAt(0);
	if ((i=msg.ReverseFind('\\'))>0||((i=msg.ReverseFind(':'))>0))
	    msg=msg.Right(msg.GetLength()-i-1);
	int nChoice = ShowMessageBox(IDS_REALLY_REMOVE_SYMLINK, MB_ICONQUESTION | MB_YESNO, IDS_REALLY_REMOVE_SYMLINK,msg);
	if (nChoice == IDYES)
	    RemoveSymlink(files.GetAt(0));
	break;
    }

    case IDM_SYMBOLICLINK_ADD: {
	CStringA msg(files.GetAt(0));
	int i;
	if ((i=msg.ReverseFind('\\'))>0)
	    msg=msg.Left(i+1);
	else if ((i=msg.ReverseFind(':'))>0)
	    msg=msg.Left(i+1)+"\\";
	CMakeSymbolicLinkDlg dlg;
	dlg.Setbase(msg);
	dlg.DoModal();
	break;
    }

    case IDM_SYMBOLICLINK_SHOW:
	ListSymlink(files);
	break;

    case IDM_REMOVE_SYMLINK:	{
	if (files.GetSize()>1)
	    break;
	int nChoice = ShowMessageBox(IDS_REALLY_REMOVE_SYMLINK, MB_ICONQUESTION | MB_YESNO, IDS_REALLY_REMOVE_SYMLINK);
	if (nChoice == IDYES)
	    RemoveSymlink(files.GetAt(0));
	}
	break;
    default:
	ASSERT(FALSE);
	Release();
	return E_INVALIDARG;
    }

    Release();

    return NOERROR;
}