diff options
author | David Tardon <dtardon@redhat.com> | 2011-11-28 13:13:27 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2011-12-05 15:11:50 +0100 |
commit | 5628699db434d4a84b6dd883538066ea972c47f6 (patch) | |
tree | c642fc020bc2e59885f6ec947231d9d44b3742f6 /vcl | |
parent | 803749150ca60e26a2f4e672ac96760dc8f8cc81 (diff) |
set parent window
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk/gdi/salprn-gtk.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/vcl/unx/gtk/gdi/salprn-gtk.cxx b/vcl/unx/gtk/gdi/salprn-gtk.cxx index 5116a356b7a8..31238f503a94 100644 --- a/vcl/unx/gtk/gdi/salprn-gtk.cxx +++ b/vcl/unx/gtk/gdi/salprn-gtk.cxx @@ -27,6 +27,7 @@ * instead of those above. */ +#include "unx/gtk/gtkframe.hxx" #include "unx/gtk/gtkprn.hxx" #include "vcl/configsettings.hxx" @@ -34,6 +35,7 @@ #include "vcl/print.hxx" #include "vcl/svapp.hxx" #include "vcl/unohelp.hxx" +#include "vcl/window.hxx" #include <gtk/gtkprinter.h> #include <gtk/gtkprintsettings.h> @@ -381,12 +383,20 @@ GtkPrintDialog::GtkPrintDialog(vcl::PrinterController& io_rController) void GtkPrintDialog::impl_initDialog() { - //To-Do, get best parent //To-Do, like fpicker, set UI language m_pDialog = gtk_print_unix_dialog_new(NULL, NULL); - //To-Do - //gtk_window_set_transient_for(GTK_WINDOW(m_pDialog), parent); + Window* const pTopWindow(Application::GetActiveTopWindow()); + if (pTopWindow) + { + GtkSalFrame* const pFrame(dynamic_cast<GtkSalFrame*>(pTopWindow->ImplGetFrame())); + if (pFrame) + { + GtkWindow* const pParent(GTK_WINDOW(pFrame->getWindow())); + if (pParent) + gtk_window_set_transient_for(GTK_WINDOW(m_pDialog), pParent); + } + } gtk_print_unix_dialog_set_manual_capabilities(GTK_PRINT_UNIX_DIALOG(m_pDialog), GtkPrintCapabilities(GTK_PRINT_CAPABILITY_COPIES | GTK_PRINT_CAPABILITY_COLLATE | |