aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-01-24 03:34:28 +0800
committerChristian Persch <chpe@src.gnome.org>2006-01-24 03:34:28 +0800
commitb32d62815640aabd7e2b8f88ee8577ad02c7796f (patch)
treea2380c994aea8d9e12d9f12be190b8b3fc996bc6
parent5846c7c6496a3c544b16405ff539b2062282b080 (diff)
downloadgsoc2013-epiphany-b32d62815640aabd7e2b8f88ee8577ad02c7796f.tar
gsoc2013-epiphany-b32d62815640aabd7e2b8f88ee8577ad02c7796f.tar.gz
gsoc2013-epiphany-b32d62815640aabd7e2b8f88ee8577ad02c7796f.tar.bz2
gsoc2013-epiphany-b32d62815640aabd7e2b8f88ee8577ad02c7796f.tar.lz
gsoc2013-epiphany-b32d62815640aabd7e2b8f88ee8577ad02c7796f.tar.xz
gsoc2013-epiphany-b32d62815640aabd7e2b8f88ee8577ad02c7796f.tar.zst
gsoc2013-epiphany-b32d62815640aabd7e2b8f88ee8577ad02c7796f.zip
Invert button order. Bug #327381.
2006-01-23 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/EphyPromptService.cpp: Invert button order. Bug #327381.
-rw-r--r--ChangeLog6
-rw-r--r--embed/mozilla/EphyPromptService.cpp28
2 files changed, 30 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 49044c7e5..db5904995 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-01-23 Christian Persch <chpe@cvs.gnome.org>
+
+ * embed/mozilla/EphyPromptService.cpp:
+
+ Invert button order. Bug #327381.
+
2006-01-22 Crispin Flowerday <gnome@flowerday.cx>
* lib/widgets/ephy-location-entry.c (ephy_location_entry_set_location):
diff --git a/embed/mozilla/EphyPromptService.cpp b/embed/mozilla/EphyPromptService.cpp
index 65e53d1a6..6779b0c5c 100644
--- a/embed/mozilla/EphyPromptService.cpp
+++ b/embed/mozilla/EphyPromptService.cpp
@@ -103,6 +103,7 @@ private:
PRInt32 mNumButtons;
PRInt32 mNumEntries;
PRInt32 mDefaultResponse;
+ PRInt32 mUnaffirmativeResponse;
PRInt32 mResponse;
PRBool mSuccess;
PRBool mDelay;
@@ -120,6 +121,7 @@ Prompter::Prompter (const char *aStock,
, mNumButtons(0)
, mNumEntries(0)
, mDefaultResponse(GTK_RESPONSE_ACCEPT)
+ , mUnaffirmativeResponse(0)
, mResponse(GTK_RESPONSE_CANCEL)
, mSuccess(PR_FALSE)
, mDelay(PR_FALSE)
@@ -268,6 +270,7 @@ Prompter::AddButtonWithFlags (PRInt32 aNum,
case nsIPromptService::BUTTON_TITLE_IS_STRING:
default:
label = freeme = ConvertAndEscapeButtonText (aText, MAX_BUTTON_TEXT_LENGTH);
+ /* We can't tell, so assume it's affirmative */
isAffirmative = TRUE;
break;
}
@@ -282,6 +285,11 @@ Prompter::AddButtonWithFlags (PRInt32 aNum,
gtk_dialog_set_response_sensitive (mDialog, aNum, FALSE);
}
+ if (!isAffirmative)
+ {
+ mUnaffirmativeResponse = aNum;
+ }
+
if (aDefault)
{
mDefaultResponse = aNum;
@@ -297,13 +305,25 @@ Prompter::AddButtonsWithFlags (PRUint32 aFlags,
const PRUnichar *aText2)
{
mDelay = (aFlags & nsIPromptService::BUTTON_DELAY_ENABLE) != 0;
+ mDefaultResponse = -1;
- AddButtonWithFlags (0, ((aFlags / nsIPromptService::BUTTON_POS_0) & 0xff), aText0,
- aFlags & nsIPromptService::BUTTON_POS_0_DEFAULT);
- AddButtonWithFlags (1, ((aFlags / nsIPromptService::BUTTON_POS_1) & 0xff), aText1,
- aFlags & nsIPromptService::BUTTON_POS_1_DEFAULT);
+ /* Reverse the order, on the assumption that what we passed is the
+ * 'windows' button order, and we want HIG order.
+ */
AddButtonWithFlags (2, ((aFlags / nsIPromptService::BUTTON_POS_2) & 0xff), aText2,
aFlags & nsIPromptService::BUTTON_POS_2_DEFAULT);
+ AddButtonWithFlags (1, ((aFlags / nsIPromptService::BUTTON_POS_1) & 0xff), aText1,
+ aFlags & nsIPromptService::BUTTON_POS_1_DEFAULT);
+ AddButtonWithFlags (0, ((aFlags / nsIPromptService::BUTTON_POS_0) & 0xff), aText0,
+ aFlags & nsIPromptService::BUTTON_POS_0_DEFAULT);
+
+ /* If no default was set, use the 'rightmost' unaffirmative response.
+ * This happens with the suite's password manager prompt.
+ */
+ if (mDefaultResponse == -1)
+ {
+ mDefaultResponse = mUnaffirmativeResponse;
+ }
}
void