From 1bf0271fa05292b195f47932bc43ae0ebf7ca726 Mon Sep 17 00:00:00 2001 From: Gabriel Maia Date: Wed, 7 Sep 2016 16:04:25 +0000 Subject: [PATCH] DiskProbe: select Find window text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Select the text to find as the Find window is opened. This makes the behavior more consistent with other apps. Fixes the main subject of #10844. Also removes trailing whitespace. Signed-off-by: Axel Dörfler --- src/apps/diskprobe/FindWindow.cpp | 10 +++++++++- src/apps/diskprobe/FindWindow.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/apps/diskprobe/FindWindow.cpp b/src/apps/diskprobe/FindWindow.cpp index eee1c1720c..1e7d53fe00 100644 --- a/src/apps/diskprobe/FindWindow.cpp +++ b/src/apps/diskprobe/FindWindow.cpp @@ -509,7 +509,7 @@ FindWindow::FindWindow(BRect _rect, BMessage& previous, BMessenger& target, message->AddInt8("mode", kAsciiMode); if (mode == kAsciiMode) item->SetMarked(true); - fMenu->AddItem(item = new BMenuItem(B_TRANSLATE_COMMENT("Hexadecimal", + fMenu->AddItem(item = new BMenuItem(B_TRANSLATE_COMMENT("Hexadecimal", "A menu item, as short as possible, noun is recommended if it is " "shorter than adjective."), message = new BMessage(kMsgFindMode))); message->AddInt8("mode", kHexMode); @@ -631,6 +631,14 @@ FindWindow::QuitRequested() } +void +FindWindow::Show() +{ + fTextView->SelectAll(); + BWindow::Show(); +} + + void FindWindow::SetTarget(BMessenger& target) { diff --git a/src/apps/diskprobe/FindWindow.h b/src/apps/diskprobe/FindWindow.h index ce8e2b5718..09df172853 100644 --- a/src/apps/diskprobe/FindWindow.h +++ b/src/apps/diskprobe/FindWindow.h @@ -30,6 +30,7 @@ class FindWindow : public BWindow { virtual void WindowActivated(bool active); virtual void MessageReceived(BMessage *message); virtual bool QuitRequested(); + virtual void Show(); void SetTarget(BMessenger &target);