New feature: search by filename and file browser toolbar optimization (issue 788)

This patch adds "Find" entry box to the toolbar to perform case-insensitive search by part of image filename.
Also, there is a new option in preferences to display File Browser toolbar as single row or not. This also solves issue with lower resolution displays.
This commit is contained in:
Michael Ezra
2011-06-22 17:23:08 -04:00
parent 05fb2fb1c0
commit 86d600a8b3
13 changed files with 148 additions and 32 deletions

View File

@@ -693,6 +693,19 @@ bool FileBrowser::checkFilter (ThumbBrowserEntryBase* entryb) { // true -> entry
if (filter.showRanked[entry->thumbnail->getRank()]==false || filter.showCLabeled[entry->thumbnail->getColorLabel()]==false || (entry->thumbnail->getStage()==1 && !filter.showTrash) || (entry->thumbnail->getStage()==0 && !filter.showNotTrash))
return false;
// return false is query is not satisfied
if (filter.queryFileName.size()>0){
// check if image's FileName contains queryFileName (case insensitive)
// TODO should we provide case-sensitive search option via preferences?
Glib::ustring FileName;
FileName = Glib::path_get_basename (entry->thumbnail->getFileName());
FileName = FileName.uppercase();
//printf("FileBrowser::checkFilter FileName = '%s'; find() result= %i \n",FileName.c_str(), FileName.find(filter.queryFileName.uppercase()));
if (FileName.find(filter.queryFileName.uppercase())==-1)
return false;
}
// check exif filter
const CacheImageData* cfs = entry->thumbnail->getCacheImageData();
double tol = 0.01;