aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-02-06 06:38:31 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-02-06 06:38:31 +0800
commit2f1334d2b432eec9ed13d64ac350beeeea43b49f (patch)
tree3c5bb65739aea95a16abf466219d5c5439389c32 /embed
parent7e908772c6a1050721a0a8ed4f4d1a0416277bbd (diff)
downloadgsoc2013-epiphany-2f1334d2b432eec9ed13d64ac350beeeea43b49f.tar
gsoc2013-epiphany-2f1334d2b432eec9ed13d64ac350beeeea43b49f.tar.gz
gsoc2013-epiphany-2f1334d2b432eec9ed13d64ac350beeeea43b49f.tar.bz2
gsoc2013-epiphany-2f1334d2b432eec9ed13d64ac350beeeea43b49f.tar.lz
gsoc2013-epiphany-2f1334d2b432eec9ed13d64ac350beeeea43b49f.tar.xz
gsoc2013-epiphany-2f1334d2b432eec9ed13d64ac350beeeea43b49f.tar.zst
gsoc2013-epiphany-2f1334d2b432eec9ed13d64ac350beeeea43b49f.zip
Fix #105184
2003-02-05 Marco Pesenti Gritti <marco@it.gnome.org> * embed/mozilla/PromptService.cpp: Fix #105184
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/PromptService.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/embed/mozilla/PromptService.cpp b/embed/mozilla/PromptService.cpp
index 6674bdd63..38434f1f9 100644
--- a/embed/mozilla/PromptService.cpp
+++ b/embed/mozilla/PromptService.cpp
@@ -65,7 +65,8 @@ class CPromptService: public nsIPromptService
nsresult AddButton (GtkWidget *dialog,
char type,
const PRUnichar *title,
- int id);
+ int id,
+ GtkWidget **widget);
};
NS_IMPL_ISUPPORTS1 (CPromptService, nsIPromptService)
@@ -223,7 +224,8 @@ NS_IMETHODIMP CPromptService::ConfirmCheck (nsIDOMWindow *parent,
NS_IMETHODIMP CPromptService::AddButton (GtkWidget *dialog,
char type,
const PRUnichar *title,
- int id)
+ int id,
+ GtkWidget **widget)
{
const char *btitle;
const nsACString &utf8string = NS_ConvertUCS2toUTF8 (title);
@@ -259,10 +261,10 @@ NS_IMETHODIMP CPromptService::AddButton (GtkWidget *dialog,
return NS_ERROR_FAILURE;
}
- gtk_dialog_add_button (GTK_DIALOG(dialog),
- btitle ? btitle :
- PromiseFlatCString(utf8string).get(),
- id);
+ *widget = gtk_dialog_add_button (GTK_DIALOG(dialog),
+ btitle ? btitle :
+ PromiseFlatCString(utf8string).get(),
+ id);
return NS_OK;
}
@@ -283,6 +285,7 @@ NS_IMETHODIMP CPromptService::ConfirmEx (nsIDOMWindow *parent,
{
GtkWidget *dialog;
GtkWidget *gparent;
+ GtkWidget *default_button = NULL;
GtkWidget *check_button = NULL;
int ret;
@@ -300,25 +303,27 @@ NS_IMETHODIMP CPromptService::ConfirmEx (nsIDOMWindow *parent,
{
check_button = gtk_check_button_new_with_label ("");
gtk_widget_show (check_button);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->vbox),
- check_button, FALSE, FALSE, 5);
+ gtk_box_pack_end (GTK_BOX (GTK_DIALOG(dialog)->vbox),
+ check_button, FALSE, FALSE, 5);
set_check_button_text (check_button, checkMsg);
set_check_button (check_button, checkValue);
}
AddButton (dialog, (buttonFlags >> 16) & 0xFF,
- button2Title, 2);
+ button2Title, 2, &default_button);
AddButton (dialog, (buttonFlags >> 8) & 0xFF,
- button1Title, 1);
+ button1Title, 1, &default_button);
AddButton (dialog, buttonFlags & 0xFF,
- button0Title, 0);
+ button0Title, 0, &default_button);
gtk_dialog_set_default_response (GTK_DIALOG(dialog), 0);
/* make a suitable sound */
gnome_triggers_vdo ("", "generic", NULL);
+ gtk_window_set_focus (GTK_WINDOW (dialog), default_button);
+
/* run dialog and capture return values */
ret = gtk_dialog_run (GTK_DIALOG (dialog));