- Add patch to make file chooser dialog modal

This commit is contained in:
Christopher Aillon 2005-08-06 17:15:21 +00:00
parent 2fd123aa8d
commit 031833db88
2 changed files with 73 additions and 2 deletions

View File

@ -0,0 +1,66 @@
Index: widget/src/gtk2/nsFilePicker.cpp
===================================================================
RCS file: /cvsroot/mozilla/widget/src/gtk2/nsFilePicker.cpp,v
retrieving revision 1.10
diff -p -u -u -p -U10 -r1.10 nsFilePicker.cpp
--- widget/src/gtk2/nsFilePicker.cpp 1 Jul 2005 04:40:30 -0000 1.10
+++ widget/src/gtk2/nsFilePicker.cpp 16 Jul 2005 08:39:26 -0000
@@ -457,28 +457,32 @@ confirm_overwrite_file (GtkWidget *paren
leafName.get()
};
nsXPIDLString title, message;
bundle->GetStringFromName(NS_LITERAL_STRING("confirmTitle").get(),
getter_Copies(title));
bundle->FormatStringFromName(NS_LITERAL_STRING("confirmFileReplacing").get(),
formatStrings, NS_ARRAY_LENGTH(formatStrings),
getter_Copies(message));
+ GtkWindow *parent_window = GTK_WINDOW(parent);
GtkWidget *dialog;
- dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
+ dialog = gtk_message_dialog_new(parent_window,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_YES_NO,
NS_ConvertUTF16toUTF8(message).get());
gtk_window_set_title(GTK_WINDOW(dialog), NS_ConvertUTF16toUTF8(title).get());
+ if (parent_window && parent_window->group) {
+ gtk_window_group_add_window(parent_window->group, GTK_WINDOW(dialog));
+ }
PRBool result = (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES);
gtk_widget_destroy (dialog);
return result;
}
NS_IMETHODIMP
nsFilePicker::Show(PRInt16 *aReturn)
{
@@ -491,20 +495,24 @@ nsFilePicker::Show(PRInt16 *aReturn)
GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
const gchar *accept_button = (mMode == GTK_FILE_CHOOSER_ACTION_SAVE)
? GTK_STOCK_SAVE : GTK_STOCK_OPEN;
GtkWidget *file_chooser =
_gtk_file_chooser_dialog_new(title, parent_widget, action,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
accept_button, GTK_RESPONSE_ACCEPT,
NULL);
+ if (parent_widget && parent_widget->group) {
+ gtk_window_group_add_window(parent_widget->group, GTK_WINDOW(file_chooser));
+ }
+
if (mMode == nsIFilePicker::modeOpenMultiple) {
_gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER(file_chooser), TRUE);
} else if (mMode == nsIFilePicker::modeSave) {
char *default_filename = ToNewUTF8String(mDefault);
_gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(file_chooser),
NS_STATIC_CAST(const gchar*, default_filename));
nsMemory::Free(default_filename);
}
gtk_dialog_set_default_response(GTK_DIALOG(file_chooser), GTK_RESPONSE_ACCEPT);

View File

@ -8,7 +8,7 @@ ExcludeArch: ppc64
Summary: Mozilla Thunderbird mail/newsgroup client Summary: Mozilla Thunderbird mail/newsgroup client
Name: thunderbird Name: thunderbird
Version: 1.0.6 Version: 1.0.6
Release: 2 Release: 3
Epoch: 0 Epoch: 0
URL: http://www.mozilla.org/projects/thunderbird/ URL: http://www.mozilla.org/projects/thunderbird/
License: MPL License: MPL
@ -55,7 +55,8 @@ Patch42: firefox-1.0-download-to-desktop.patch
Patch43: firefox-1.0-uriloader.patch Patch43: firefox-1.0-uriloader.patch
# Backported patches, intended for upstream # Backported patches, intended for upstream
Patch90: firefox-PR1-gtk-file-chooser-morefixes.patch Patch90: thunderbird-1.0-gtk-file-chooser-morefixes.patch
Patch91: firefox-1.1-modal-filechooser.patch
# Already upstreamed # Already upstreamed
Patch101: thunderbird-0.8.0-pkgconfig.patch Patch101: thunderbird-0.8.0-pkgconfig.patch
@ -122,6 +123,7 @@ echo "mk_add_options MOZ_MAKE_FLAGS='%{?_smp_mflags}'" >> .mozconfig
%patch42 -p0 %patch42 -p0
%patch43 -p0 %patch43 -p0
%patch90 -p0 -b .gtk-file-chooser-morefixes %patch90 -p0 -b .gtk-file-chooser-morefixes
%patch91 -p0
%patch101 -p0 -b .pkgconfig %patch101 -p0 -b .pkgconfig
%patch102 -p0 %patch102 -p0
%patch103 -p0 %patch103 -p0
@ -207,6 +209,9 @@ cd -
#=============================================================================== #===============================================================================
%changelog %changelog
* Sat Aug 6 2005 Christopher Aillon <caillon@redhat.com> 1.0.6-3
- Add patch to make file chooser dialog modal
* Fri Jul 22 2005 Christopher Aillon <caillon@redhat.com> 1.0.6-2 * Fri Jul 22 2005 Christopher Aillon <caillon@redhat.com> 1.0.6-2
- Update to 1.0.6 - Update to 1.0.6