Add a dropdown to choose searchengine when in basic mode in

the search sidebar panel.

b  = 86483
r  = matt
sr = alecf
This commit is contained in:
sgehani%netscape.com 2007-09-06 21:58:13 +00:00
Родитель 5d0748fadb
Коммит eceb4b6f2c
2 изменённых файлов: 160 добавлений и 140 удалений

Просмотреть файл

@ -334,6 +334,7 @@ nsIRDFResource *InternetSearchDataSource::kNC_Title;
nsIRDFResource *InternetSearchDataSource::kNC_Data;
nsIRDFResource *InternetSearchDataSource::kNC_Name;
nsIRDFResource *InternetSearchDataSource::kNC_Description;
nsIRDFResource *InternetSearchDataSource::kNC_Version;
nsIRDFResource *InternetSearchDataSource::kNC_actionButton;
nsIRDFResource *InternetSearchDataSource::kNC_actionBar;
nsIRDFResource *InternetSearchDataSource::kNC_LastText;
@ -400,6 +401,7 @@ InternetSearchDataSource::InternetSearchDataSource(void)
gRDFService->GetResource(NC_NAMESPACE_URI "data", &kNC_Data);
gRDFService->GetResource(NC_NAMESPACE_URI "Name", &kNC_Name);
gRDFService->GetResource(NC_NAMESPACE_URI "Description", &kNC_Description);
gRDFService->GetResource(NC_NAMESPACE_URI "Version", &kNC_Version);
gRDFService->GetResource(NC_NAMESPACE_URI "actionButton", &kNC_actionButton);
gRDFService->GetResource(NC_NAMESPACE_URI "actionBar", &kNC_actionBar);
gRDFService->GetResource(NC_NAMESPACE_URI "LastText", &kNC_LastText);
@ -464,6 +466,7 @@ InternetSearchDataSource::~InternetSearchDataSource (void)
NS_IF_RELEASE(kNC_Data);
NS_IF_RELEASE(kNC_Name);
NS_IF_RELEASE(kNC_Description);
NS_IF_RELEASE(kNC_Version);
NS_IF_RELEASE(kNC_actionButton);
NS_IF_RELEASE(kNC_actionBar);
NS_IF_RELEASE(kNC_LastText);
@ -3123,27 +3126,37 @@ InternetSearchDataSource::updateDataHintsInGraph(nsIRDFResource *engine, const P
}
}
// save/update version of search engine (if specified)
nsAutoString versionValue;
if (NS_SUCCEEDED(rv = GetData(dataUni, "search", 0, "version", versionValue)))
{
nsCOMPtr<nsIRDFLiteral> versionLiteral;
if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(versionValue.GetUnicode(),
getter_AddRefs(versionLiteral))))
{
rv = updateAtom(mInner, engine, kNC_Version, versionLiteral, nsnull);
}
}
nsAutoString buttonValue;
if (NS_SUCCEEDED(rv = GetData(dataUni, "search", 0, "actionButton", buttonValue)))
{
nsCOMPtr<nsIRDFLiteral> descLiteral;
nsCOMPtr<nsIRDFLiteral> buttonLiteral;
if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(buttonValue.GetUnicode(),
getter_AddRefs(descLiteral))))
getter_AddRefs(buttonLiteral))))
{
rv = updateAtom(mInner, engine, kNC_actionButton, descLiteral, nsnull);
rv = updateAtom(mInner, engine, kNC_actionButton, buttonLiteral, nsnull);
}
}
nsAutoString barValue;
if (NS_SUCCEEDED(rv = GetData(dataUni, "search", 0, "actionBar", barValue)))
{
nsCOMPtr<nsIRDFLiteral> descLiteral;
nsCOMPtr<nsIRDFLiteral> barLiteral;
if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(barValue.GetUnicode(),
getter_AddRefs(descLiteral))))
getter_AddRefs(barLiteral))))
{
rv = updateAtom(mInner, engine, kNC_actionBar, descLiteral, nsnull);
rv = updateAtom(mInner, engine, kNC_actionBar, barLiteral, nsnull);
}
}
@ -5050,7 +5063,13 @@ InternetSearchDataSource::ParseHTML(nsIURI *aURL, nsIRDFResource *mParent, nsIRD
nsAutoString site(hrefStr);
#ifdef DEBUG_SEARCH_OUTPUT
printf("HREF: '%s'\n", href);
char *hrefCStr = hrefStr.ToNewCString();
if (hrefCStr)
{
printf("HREF: '%s'\n", hrefCStr);
nsCRT::free(hrefCStr);
hrefCStr = nsnull;
}
#endif
nsCOMPtr<nsIRDFResource> res;

Просмотреть файл

@ -64,6 +64,7 @@ private:
static nsIRDFResource *kNC_Data;
static nsIRDFResource *kNC_Name;
static nsIRDFResource *kNC_Description;
static nsIRDFResource *kNC_Version;
static nsIRDFResource *kNC_actionButton;
static nsIRDFResource *kNC_actionBar;
static nsIRDFResource *kNC_LastText;