void mnuCommandLinesAndParams(ArchiveManagerConfig* pCfg)
{
	Array<ArchiveFormat*> formats;
	pManager->GetFormats(formats);

	FarMenu menu(_M(MCommandLinesAndParamsArchiveFormat));

	for (unsigned int i = 0; i < formats.count(); i++)
	{
		ArchiveFormat* pFormat = formats[i];

		if ( pFormat->QueryCapability(AFF_SUPPORT_DEFAULT_COMMANDS) )
			menu.Add(pFormat->GetName(), 0, (void*)pFormat);
	}

	while ( true )
	{
		int nResult = menu.Run();

		if ( nResult != -1 )
		{
			ArchiveFormat* pFormat = (ArchiveFormat*)menu.GetData(nResult);
			dlgCommandLinesAndParams(pCfg, pFormat);
		}
		else
			break;
	}
}
Ejemplo n.º 2
0
void ArchivePanel::pGetOpenPluginInfo(
		OpenPluginInfo *pInfo
		)
{
	pInfo->StructSize = sizeof(OpenPluginInfo);

	pInfo->Flags = OPIF_USEFILTER | OPIF_USEHIGHLIGHTING | OPIF_USESORTGROUPS | OPIF_ADDDOTS;
	pInfo->CurDir = m_strPathInArchive;

	if ( m_pArchive )
	{
		ArchiveFormat *pFormat = m_pArchive->GetFormat();

		m_strPanelTitle.Format(
				_T(" %s%s%s%s%s "),
				pFormat->GetName(),
				_T(":"),
				FSF.PointToName(m_pArchive->GetFileName()),
				m_strPathInArchive.IsEmpty()?_T(""):_T("\\"),
				m_strPathInArchive.GetString()
				);

		pInfo->HostFile = m_pArchive->GetFileName();
		pInfo->PanelTitle = m_strPanelTitle;

		pInfo->InfoLines = m_pArchiveInfo;
		pInfo->InfoLinesNumber = m_nArchiveInfoItems;

		m_strShortcutData.Format(
				_T("%s%s%s"),
				GUID2STR(pFormat->GetUID()),
				GUID2STR(pFormat->GetPlugin()->GetUID()),
				GUID2STR(pFormat->GetModule()->GetUID())
				);

		pInfo->ShortcutData = m_strShortcutData;
	}
}
Ejemplo n.º 3
0
void UpdateFormats(FarDialog* D, ArchivePlugin* pPlugin, ArchiveFilterEntry* pFE)
{
	int index = 0;

	D->ListDelete(ID_FOF_FORMATLIST, NULL);
	
	index = D->ListAddStr(ID_FOF_FORMATLIST, _T("All"));
	D->ListSetDataEx(ID_FOF_FORMATLIST, index, (void*)0, sizeof(void*));

	FarListPos pos;

	pos.SelectPos = 0; //all
	pos.TopPos = -1;

	if ( pPlugin )
	{
		if ( pPlugin->QueryCapability(APF_SUPPORT_SINGLE_FORMAT_QUERY) )
		{
			Array<ArchiveFormat*> formats;
			pPlugin->GetFormats(formats);  //BUGBUG

			for (unsigned int i = 0; i < formats.count(); i++)
			{
				ArchiveFormat* pFormat = formats[i];

				index = D->ListAddStr(ID_FOF_FORMATLIST, pFormat->GetName());
				D->ListSetDataEx(ID_FOF_FORMATLIST, index, (void*)pFormat, sizeof(void*));

				if ( pFE && !pFE->IsAllFormats() && pFE->GetFormat() && (pFE->GetFormat()->GetUID() == pFormat->GetUID()) )
					pos.SelectPos = index;
			}
		}
	}

	D->ListSetCurrentPos(ID_FOF_FORMATLIST, &pos);
}