From 7f628780d5765f97ba3c3b5ffd68387ec3868961 Mon Sep 17 00:00:00 2001
From: Gabriel Maia <gbl08ma@gmail.com>
Date: Wed, 7 Sep 2016 16:04:25 +0000
Subject: [PATCH] DiskProbe: select Find window text
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.
---
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 eee1c17..1e7d53f 100644
a
|
b
|
FindWindow::FindWindow(BRect _rect, BMessage& previous, BMessenger& target,
|
509 | 509 | message->AddInt8("mode", kAsciiMode); |
510 | 510 | if (mode == kAsciiMode) |
511 | 511 | item->SetMarked(true); |
512 | | fMenu->AddItem(item = new BMenuItem(B_TRANSLATE_COMMENT("Hexadecimal", |
| 512 | fMenu->AddItem(item = new BMenuItem(B_TRANSLATE_COMMENT("Hexadecimal", |
513 | 513 | "A menu item, as short as possible, noun is recommended if it is " |
514 | 514 | "shorter than adjective."), message = new BMessage(kMsgFindMode))); |
515 | 515 | message->AddInt8("mode", kHexMode); |
… |
… |
FindWindow::QuitRequested()
|
632 | 632 | |
633 | 633 | |
634 | 634 | void |
| 635 | FindWindow::Show() |
| 636 | { |
| 637 | fTextView->SelectAll(); |
| 638 | BWindow::Show(); |
| 639 | } |
| 640 | |
| 641 | |
| 642 | void |
635 | 643 | FindWindow::SetTarget(BMessenger& target) |
636 | 644 | { |
637 | 645 | fTarget = target; |
diff --git a/src/apps/diskprobe/FindWindow.h b/src/apps/diskprobe/FindWindow.h
index ce8e2b5..09df172 100644
a
|
b
|
class FindWindow : public BWindow {
|
30 | 30 | virtual void WindowActivated(bool active); |
31 | 31 | virtual void MessageReceived(BMessage *message); |
32 | 32 | virtual bool QuitRequested(); |
| 33 | virtual void Show(); |
33 | 34 | |
34 | 35 | void SetTarget(BMessenger &target); |
35 | 36 | |