mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1060424 Escape should abort the profile unlock r=bsmedberg
This commit is contained in:
parent
b21e2bff7c
commit
3f8ed79ff5
@ -1794,15 +1794,14 @@ ProfileLockedDialog(nsIFile* aProfileDir, nsIFile* aProfileLocalDir,
|
|||||||
|
|
||||||
nsXPIDLString killMessage;
|
nsXPIDLString killMessage;
|
||||||
#ifndef XP_MACOSX
|
#ifndef XP_MACOSX
|
||||||
static const char16_t kRestartNoUnlocker[] = {'r','e','s','t','a','r','t','M','e','s','s','a','g','e','N','o','U','n','l','o','c','k','e','r','\0'}; // "restartMessageNoUnlocker"
|
sb->FormatStringFromName(aUnlocker ? MOZ_UTF16("restartMessageUnlocker")
|
||||||
static const char16_t kRestartUnlocker[] = {'r','e','s','t','a','r','t','M','e','s','s','a','g','e','U','n','l','o','c','k','e','r','\0'}; // "restartMessageUnlocker"
|
: MOZ_UTF16("restartMessageNoUnlocker"),
|
||||||
#else
|
|
||||||
static const char16_t kRestartNoUnlocker[] = {'r','e','s','t','a','r','t','M','e','s','s','a','g','e','N','o','U','n','l','o','c','k','e','r','M','a','c','\0'}; // "restartMessageNoUnlockerMac"
|
|
||||||
static const char16_t kRestartUnlocker[] = {'r','e','s','t','a','r','t','M','e','s','s','a','g','e','U','n','l','o','c','k','e','r','M','a','c','\0'}; // "restartMessageUnlockerMac"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sb->FormatStringFromName(aUnlocker ? kRestartUnlocker : kRestartNoUnlocker,
|
|
||||||
params, 2, getter_Copies(killMessage));
|
params, 2, getter_Copies(killMessage));
|
||||||
|
#else
|
||||||
|
sb->FormatStringFromName(aUnlocker ? MOZ_UTF16("restartMessageUnlockerMac")
|
||||||
|
: MOZ_UTF16("restartMessageNoUnlockerMac"),
|
||||||
|
params, 2, getter_Copies(killMessage));
|
||||||
|
#endif
|
||||||
|
|
||||||
nsXPIDLString killTitle;
|
nsXPIDLString killTitle;
|
||||||
sb->FormatStringFromName(MOZ_UTF16("restartTitle"),
|
sb->FormatStringFromName(MOZ_UTF16("restartTitle"),
|
||||||
@ -1819,23 +1818,22 @@ ProfileLockedDialog(nsIFile* aProfileDir, nsIFile* aProfileLocalDir,
|
|||||||
int32_t button;
|
int32_t button;
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
mozilla::widget::android::GeckoAppShell::KillAnyZombies();
|
mozilla::widget::android::GeckoAppShell::KillAnyZombies();
|
||||||
button = 1;
|
button = 0;
|
||||||
#else
|
#else
|
||||||
const uint32_t flags =
|
const uint32_t flags =
|
||||||
(nsIPromptService::BUTTON_TITLE_CANCEL *
|
|
||||||
nsIPromptService::BUTTON_POS_0) +
|
|
||||||
(nsIPromptService::BUTTON_TITLE_IS_STRING *
|
(nsIPromptService::BUTTON_TITLE_IS_STRING *
|
||||||
nsIPromptService::BUTTON_POS_1) +
|
nsIPromptService::BUTTON_POS_0) +
|
||||||
nsIPromptService::BUTTON_POS_1_DEFAULT;
|
(nsIPromptService::BUTTON_TITLE_CANCEL *
|
||||||
|
nsIPromptService::BUTTON_POS_1);
|
||||||
|
|
||||||
bool checkState = false;
|
bool checkState = false;
|
||||||
rv = ps->ConfirmEx(nullptr, killTitle, killMessage, flags,
|
rv = ps->ConfirmEx(nullptr, killTitle, killMessage, flags,
|
||||||
nullptr, killTitle, nullptr, nullptr,
|
killTitle, nullptr, nullptr, nullptr,
|
||||||
&checkState, &button);
|
&checkState, &button);
|
||||||
NS_ENSURE_SUCCESS_LOG(rv, rv);
|
NS_ENSURE_SUCCESS_LOG(rv, rv);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (button == 1) {
|
if (button == 0) {
|
||||||
rv = aUnlocker->Unlock(nsIProfileUnlocker::FORCE_QUIT);
|
rv = aUnlocker->Unlock(nsIProfileUnlocker::FORCE_QUIT);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
return rv;
|
return rv;
|
||||||
@ -1890,8 +1888,7 @@ ProfileMissingDialog(nsINativeAppSupport* aNative)
|
|||||||
nsXPIDLString missingMessage;
|
nsXPIDLString missingMessage;
|
||||||
|
|
||||||
// profileMissing
|
// profileMissing
|
||||||
static const char16_t kMissing[] = {'p','r','o','f','i','l','e','M','i','s','s','i','n','g','\0'};
|
sb->FormatStringFromName(MOZ_UTF16("profileMissing"), params, 2, getter_Copies(missingMessage));
|
||||||
sb->FormatStringFromName(kMissing, params, 2, getter_Copies(missingMessage));
|
|
||||||
|
|
||||||
nsXPIDLString missingTitle;
|
nsXPIDLString missingTitle;
|
||||||
sb->FormatStringFromName(MOZ_UTF16("profileMissingTitle"),
|
sb->FormatStringFromName(MOZ_UTF16("profileMissingTitle"),
|
||||||
|
Loading…
Reference in New Issue
Block a user