Exemplo n.º 1
0
void AutoSearchFrame::addEntry(const AutoSearchPtr as, int pos) {
	if(as == NULL)
		return;
		
	if(pos < 0)
		pos = 0;

	TStringList lst;
	lst.push_back(Text::toT(as->getSearchString()));
	lst.push_back(Text::toT(getType(as->getFileType())));
		
	if(as->getAction() == 0){
		lst.push_back(CTSTRING(DOWNLOAD));
	}else if(as->getAction() == 1){
		lst.push_back(CTSTRING(ADD_TO_QUEUE));
	}else if(as->getAction() == 2){
		lst.push_back(CTSTRING(AS_REPORT));
	}
		
	lst.push_back(Text::toT(as->getTarget()));
	lst.push_back(Text::toT(as->getRemove()? "Yes" : "No"));
	lst.push_back(Text::toT(as->getNickPattern()));
	lst.push_back((as->getLastSearch() > 0 ? formatSearchDate(as->getLastSearch()).c_str() : _T("Unknown")));

	bool b = as->getEnabled();
	int i = ctrlAutoSearch.insert(pos, lst, 0, (LPARAM)as.get());
	ctrlAutoSearch.SetCheckState(i, b);
}
Exemplo n.º 2
0
void AutoSearchFrame::ItemInfo::update(const AutoSearchPtr& as) {
	string target = as->getTarget();
	if (target.empty()) {
		target = CSTRING(SETTINGS_DOWNLOAD_DIRECTORY);
	}

	columns[COLUMN_VALUE] = Text::toT(as->getDisplayName());
	columns[COLUMN_LASTSEARCH] = (as->getLastSearch() > 0 ? formatSearchDate(as->getLastSearch()) : _T("Unknown"));
	columns[COLUMN_TYPE] = Text::toT(as->getDisplayType());
	columns[COLUMN_BUNDLES] = Text::toT(AutoSearchManager::getInstance()->getBundleStatuses(as));
	columns[COLUMN_SEARCH_STATUS] = Text::toT(as->getSearchingStatus());
	columns[COLUMN_EXPIRATION] = Text::toT(as->getExpiration());
	columns[COLUMN_ERROR] = Text::toT(as->getLastError());
	columns[COLUMN_ACTION] = as->getAction() == 0 ? TSTRING(DOWNLOAD) : as->getAction() == 1 ? TSTRING(ADD_TO_QUEUE) : TSTRING(AS_REPORT);
	columns[COLUMN_EXPIRATION] = Text::toT(as->getExpiration());
	columns[COLUMN_REMOVE] = as->getRemove() ? TSTRING(YES) : TSTRING(NO);
	columns[COLUMN_PATH] = Text::toT(target);
	columns[COLUMN_USERMATCH] = Text::toT(as->getNickPattern());

	setGroupId(AutoSearchManager::getInstance()->getGroupIndex(as));

}
Exemplo n.º 3
0
void AutoSearchFrame::updateItem(const AutoSearchPtr as, int pos) {
	ctrlAutoSearch.SetItemText(pos, COLUMN_LASTSEARCH, (as->getLastSearch() > 0 ? formatSearchDate(as->getLastSearch()).c_str() : _T("Unknown")));
}