Beispiel #1
0
void FileList::ReadPanelModes()
{
	HierarchicalConfig *PanelModeCfg = Db->CreatePanelModeConfig();

	for (int I=0; I<10; I++)
	{
		unsigned __int64 id = PanelModeCfg->GetKeyID(0, FormatString() << I);
		if (!id)
			continue;

		string strColumnTitles, strColumnWidths;
		PanelModeCfg->GetValue(id, L"ColumnTitles", strColumnTitles);
		PanelModeCfg->GetValue(id, L"ColumnWidths", strColumnWidths);

		if (strColumnTitles.IsEmpty() || strColumnWidths.IsEmpty())
			continue;

		string strStatusColumnTitles, strStatusColumnWidths;
		PanelModeCfg->GetValue(id, L"StatusColumnTitles", strStatusColumnTitles);
		PanelModeCfg->GetValue(id, L"StatusColumnWidths", strStatusColumnWidths);

		unsigned __int64 Flags=0;
		PanelModeCfg->GetValue(id, L"Flags", &Flags);

		PanelViewSettings NewSettings=ViewSettingsArray[VIEW_0+I];

		if (!strColumnTitles.IsEmpty())
			TextToViewSettings(strColumnTitles,strColumnWidths,NewSettings.ColumnType,
			                   NewSettings.ColumnWidth,NewSettings.ColumnWidthType,NewSettings.ColumnCount);

		if (!strStatusColumnTitles.IsEmpty())
			TextToViewSettings(strStatusColumnTitles,strStatusColumnWidths,NewSettings.StatusColumnType,
			                   NewSettings.StatusColumnWidth,NewSettings.StatusColumnWidthType,NewSettings.StatusColumnCount);

		NewSettings.Flags = (DWORD)Flags;

		ViewSettingsArray[VIEW_0+I] = NewSettings;
	}

	delete PanelModeCfg;
}
Beispiel #2
0
void HighlightFiles::InitHighlightFiles(HierarchicalConfig *ExternCfg)
{
	string strGroupName, strMask;
	const int GroupDelta[4]={DEFAULT_SORT_GROUP,0,DEFAULT_SORT_GROUP+1,DEFAULT_SORT_GROUP};
	const wchar_t *KeyNames[4]={HighlightKeyName,SortGroupsKeyName,SortGroupsKeyName,HighlightKeyName};
	const wchar_t *GroupNames[4]={fmtFirstGroup,fmtUpperGroup,fmtLowerGroup,fmtLastGroup};
	int  *Count[4] = {&FirstCount,&UpperCount,&LowerCount,&LastCount};
	HiData.Free();
	FirstCount=UpperCount=LowerCount=LastCount=0;
	HierarchicalConfig *cfg = ExternCfg? ExternCfg : CreateHighlightConfig();

	for (int j=0; j<4; j++)
	{
		unsigned __int64 root = cfg->GetKeyID(0,KeyNames[j]);
		if (!root)
			continue;

		for (int i=0;; i++)
		{
			strGroupName.Format(GroupNames[j],i);
			unsigned __int64 key = cfg->GetKeyID(root,strGroupName);
			if (!key)
				break;

			if (!cfg->GetValue(key,HLS.Mask,strMask))
				break;

			FileFilterParams *HData = HiData.addItem();

			if (HData)
			{
				LoadFilter(cfg,key,HData,strMask,GroupDelta[j]+(GroupDelta[j]==DEFAULT_SORT_GROUP?0:i),(GroupDelta[j]==DEFAULT_SORT_GROUP?false:true));
				(*(Count[j]))++;
			}
			else
				break;
		}
	}

	if(cfg != ExternCfg)
	{
		delete cfg;
	}
}