Reflect "access" -> "unlock" change in key request dialog.

This commit is contained in:
Michael Lotz
2013-03-05 11:04:38 -05:00
committed by Ryan Leavengood
parent 82b425a59f
commit 7b437e50eb
+11 -10
View File
@@ -25,7 +25,7 @@
static const uint32 kMessageCancel = 'btcl'; static const uint32 kMessageCancel = 'btcl';
static const uint32 kMessageOk = 'btok'; static const uint32 kMessageUnlock = 'btul';
class KeyRequestView : public BView { class KeyRequestView : public BView {
@@ -88,8 +88,9 @@ public:
buttons->GroupLayout()->AddItem(BSpaceLayoutItem::CreateGlue()); buttons->GroupLayout()->AddItem(BSpaceLayoutItem::CreateGlue());
fOkButton = new(std::nothrow) BButton("OK", new BMessage(kMessageOk)); fUnlockButton = new(std::nothrow) BButton("Unlock",
buttons->GroupLayout()->AddView(fOkButton); new BMessage(kMessageUnlock));
buttons->GroupLayout()->AddView(fUnlockButton);
rootLayout->AddView(controls); rootLayout->AddView(controls);
rootLayout->AddView(buttons); rootLayout->AddView(buttons);
@@ -99,8 +100,8 @@ public:
AttachedToWindow() AttachedToWindow()
{ {
fCancelButton->SetTarget(Window()); fCancelButton->SetTarget(Window());
fOkButton->SetTarget(Window()); fUnlockButton->SetTarget(Window());
fOkButton->MakeDefault(true); fUnlockButton->MakeDefault(true);
} }
void void
@@ -121,20 +122,20 @@ private:
BTextControl* fPassword; BTextControl* fPassword;
BCheckBox* fPersist; BCheckBox* fPersist;
BButton* fCancelButton; BButton* fCancelButton;
BButton* fOkButton; BButton* fUnlockButton;
}; };
KeyRequestWindow::KeyRequestWindow() KeyRequestWindow::KeyRequestWindow()
: :
BWindow(BRect(50, 50, 269, 302), "Access Keyring", BWindow(BRect(50, 50, 269, 302), "Unlock Keyring",
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS B_TITLED_WINDOW, B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS
| B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS), | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS),
fRequestView(NULL), fRequestView(NULL),
fDoneSem(-1), fDoneSem(-1),
fResult(B_ERROR) fResult(B_ERROR)
{ {
fDoneSem = create_sem(0, "keyring access dialog"); fDoneSem = create_sem(0, "keyring unlock dialog");
if (fDoneSem < 0) if (fDoneSem < 0)
return; return;
@@ -178,8 +179,8 @@ KeyRequestWindow::MessageReceived(BMessage* message)
{ {
switch (message->what) { switch (message->what) {
case kMessageCancel: case kMessageCancel:
case kMessageOk: case kMessageUnlock:
fResult = message->what == kMessageOk ? B_OK : B_CANCELED; fResult = message->what == kMessageUnlock ? B_OK : B_CANCELED;
release_sem(fDoneSem); release_sem(fDoneSem);
return; return;
} }