keystore_server: Use B_CLOSE_ON_ESCAPE in request dialogs.

Instead of doing it manually.
This commit is contained in:
Michael Lotz 2015-08-29 10:10:48 +02:00
parent b92e2c086f
commit 515e648d7b
4 changed files with 4 additions and 34 deletions

View File

@ -144,7 +144,8 @@ AppAccessRequestWindow::AppAccessRequestWindow(const char* keyringName,
:
BWindow(BRect(50, 50, 100, 100), B_TRANSLATE("Application keyring access"),
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS
| B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_AUTO_UPDATE_SIZE_LIMITS),
| B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_AUTO_UPDATE_SIZE_LIMITS
| B_CLOSE_ON_ESCAPE),
fRequestView(NULL),
fDoneSem(-1),
fResult(kMessageDisallow)
@ -175,20 +176,6 @@ AppAccessRequestWindow::~AppAccessRequestWindow()
}
void
AppAccessRequestWindow::DispatchMessage(BMessage* message, BHandler* handler)
{
int8 key;
if (message->what == B_KEY_DOWN
&& message->FindInt8("byte", 0, &key) == B_OK
&& key == B_ESCAPE) {
PostMessage(kMessageDisallow);
}
BWindow::DispatchMessage(message, handler);
}
void
AppAccessRequestWindow::MessageReceived(BMessage* message)
{

View File

@ -23,8 +23,6 @@ public:
bool appWasUpdated);
virtual ~AppAccessRequestWindow();
virtual void DispatchMessage(BMessage* message,
BHandler* handler);
virtual void MessageReceived(BMessage* message);
status_t RequestAppAccess(bool& allowAlways);

View File

@ -154,7 +154,8 @@ KeyRequestWindow::KeyRequestWindow()
:
BWindow(BRect(50, 50, 100, 100), B_TRANSLATE("Unlock keyring"),
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS
| B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_AUTO_UPDATE_SIZE_LIMITS),
| B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_AUTO_UPDATE_SIZE_LIMITS
| B_CLOSE_ON_ESCAPE),
fRequestView(NULL),
fDoneSem(-1),
fResult(B_ERROR)
@ -184,20 +185,6 @@ KeyRequestWindow::~KeyRequestWindow()
}
void
KeyRequestWindow::DispatchMessage(BMessage* message, BHandler* handler)
{
int8 key;
if (message->what == B_KEY_DOWN
&& message->FindInt8("byte", 0, &key) == B_OK
&& key == B_ESCAPE) {
PostMessage(kMessageCancel);
}
BWindow::DispatchMessage(message, handler);
}
void
KeyRequestWindow::MessageReceived(BMessage* message)
{

View File

@ -18,8 +18,6 @@ public:
KeyRequestWindow();
virtual ~KeyRequestWindow();
virtual void DispatchMessage(BMessage* message,
BHandler* handler);
virtual void MessageReceived(BMessage* message);
status_t RequestKey(const BString& keyringName,