Show search term in window tab
This commit is contained in:
@@ -397,8 +397,16 @@ GrepWindow::_SetWindowTitle()
|
|||||||
BString title;
|
BString title;
|
||||||
if (entry.InitCheck() == B_OK) {
|
if (entry.InitCheck() == B_OK) {
|
||||||
BPath path;
|
BPath path;
|
||||||
if (entry.GetPath(&path) == B_OK)
|
if (entry.GetPath(&path) == B_OK) {
|
||||||
title << B_TRANSLATE(APP_NAME) << ": " << path.Path();
|
if (fOldPattern.Length()) {
|
||||||
|
title = B_TRANSLATE("%appname% : %path% : %searchtext%");
|
||||||
|
title.ReplaceAll("%searchtext%", fOldPattern.String());
|
||||||
|
} else
|
||||||
|
title = B_TRANSLATE("%appname% : %path%");
|
||||||
|
|
||||||
|
title.ReplaceAll("%appname%", B_TRANSLATE(APP_NAME));
|
||||||
|
title.ReplaceAll("%path%", path.Path());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!title.Length())
|
if (!title.Length())
|
||||||
@@ -802,6 +810,8 @@ GrepWindow::_OnStartCancel()
|
|||||||
|
|
||||||
fOldPattern = fSearchText->Text();
|
fOldPattern = fSearchText->Text();
|
||||||
|
|
||||||
|
_SetWindowTitle();
|
||||||
|
|
||||||
FileIterator* iterator = new (nothrow) InitialIterator(fModel);
|
FileIterator* iterator = new (nothrow) InitialIterator(fModel);
|
||||||
fGrepper = new (nothrow) Grepper(fOldPattern.String(), fModel,
|
fGrepper = new (nothrow) Grepper(fOldPattern.String(), fModel,
|
||||||
this, iterator);
|
this, iterator);
|
||||||
@@ -1491,6 +1501,7 @@ GrepWindow::_OnFileDrop(BMessage* message)
|
|||||||
fModel->fSelectedFiles = *message;
|
fModel->fSelectedFiles = *message;
|
||||||
|
|
||||||
fSearchResults->MakeEmpty();
|
fSearchResults->MakeEmpty();
|
||||||
|
fOldPattern = "";
|
||||||
|
|
||||||
_SetWindowTitle();
|
_SetWindowTitle();
|
||||||
}
|
}
|
||||||
@@ -1500,6 +1511,7 @@ void
|
|||||||
GrepWindow::_OnRefsReceived(BMessage* message)
|
GrepWindow::_OnRefsReceived(BMessage* message)
|
||||||
{
|
{
|
||||||
_OnFileDrop(message);
|
_OnFileDrop(message);
|
||||||
|
fOldPattern = "";
|
||||||
// It seems a B_CANCEL always follows a B_REFS_RECEIVED
|
// It seems a B_CANCEL always follows a B_REFS_RECEIVED
|
||||||
// from a BFilePanel in Open mode.
|
// from a BFilePanel in Open mode.
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user