mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 16:32:59 +00:00
Bug 545506 - Fix the custom header/footer dialog in GTK's print dialog r=roc
--HG-- extra : rebase_source : 79f5dc473d9e9812041a76853237aaead86f0e69
This commit is contained in:
parent
95e9cf4463
commit
d02e9cfda0
@ -131,6 +131,7 @@ ShowCustomDialog(GtkComboBox *changed_box, gpointer user_data)
|
||||
return;
|
||||
}
|
||||
|
||||
GtkWindow* printDialog = GTK_WINDOW(user_data);
|
||||
nsCOMPtr<nsIStringBundleService> bundleSvc =
|
||||
do_GetService(NS_STRINGBUNDLE_CONTRACTID);
|
||||
|
||||
@ -139,8 +140,8 @@ ShowCustomDialog(GtkComboBox *changed_box, gpointer user_data)
|
||||
nsXPIDLString intlString;
|
||||
|
||||
printBundle->GetStringFromName(NS_LITERAL_STRING("headerFooterCustom").get(), getter_Copies(intlString));
|
||||
GtkWidget* prompt_dialog = gtk_dialog_new_with_buttons(NS_ConvertUTF16toUTF8(intlString).get(), NULL,
|
||||
GTK_DIALOG_MODAL,
|
||||
GtkWidget* prompt_dialog = gtk_dialog_new_with_buttons(NS_ConvertUTF16toUTF8(intlString).get(), printDialog,
|
||||
(GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR),
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
|
||||
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
@ -162,6 +163,7 @@ ShowCustomDialog(GtkComboBox *changed_box, gpointer user_data)
|
||||
gtk_entry_set_text(GTK_ENTRY(custom_entry), current_text);
|
||||
gtk_editable_select_region(GTK_EDITABLE(custom_entry), 0, -1);
|
||||
}
|
||||
gtk_entry_set_activates_default(GTK_ENTRY(custom_entry), TRUE);
|
||||
|
||||
GtkWidget* custom_vbox = gtk_vbox_new(TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(custom_vbox), custom_label, FALSE, FALSE, 0);
|
||||
@ -567,7 +569,7 @@ nsPrintDialogWidgetGTK::ConstructHeaderFooterDropdown(const PRUnichar *currentSt
|
||||
g_object_set_data_full(G_OBJECT(dropdown), "custom-text", custom_string, (GDestroyNotify) free);
|
||||
}
|
||||
|
||||
g_signal_connect(dropdown, "changed", (GCallback) ShowCustomDialog, NULL);
|
||||
g_signal_connect(dropdown, "changed", (GCallback) ShowCustomDialog, dialog);
|
||||
return dropdown;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user