Code

Fixed the parenting of the print dialog so that it cannot fall behind the main inksca...
authorjoelholdsworth <joelholdsworth@users.sourceforge.net>
Sat, 22 Dec 2007 21:06:55 +0000 (21:06 +0000)
committerjoelholdsworth <joelholdsworth@users.sourceforge.net>
Sat, 22 Dec 2007 21:06:55 +0000 (21:06 +0000)
src/file.cpp
src/file.h
src/print.cpp
src/print.h
src/ui/dialog/print.cpp
src/ui/dialog/print.h
src/verbs.cpp

index 904ff93231b39eeffd74576a307c4095caa5ef39..9b5f393122908c4254e1f6f2268a9121f35b141a 100644 (file)
@@ -1375,11 +1375,11 @@ sp_file_import_from_ocal(Gtk::Window &parentWindow)
  *  Print the current document, if any.
  */
 void
-sp_file_print()
+sp_file_print(Gtk::Window& parentWindow)
 {
     SPDocument *doc = SP_ACTIVE_DOCUMENT;
     if (doc)
-        sp_print_document(doc, FALSE);
+        sp_print_document(parentWindow, doc, FALSE);
 }
 
 
@@ -1388,11 +1388,11 @@ sp_file_print()
  *  the machine's print drivers.
  */
 void
-sp_file_print_direct()
+sp_file_print_direct(Gtk::Window& parentWindow)
 {
     SPDocument *doc = SP_ACTIVE_DOCUMENT;
     if (doc)
-        sp_print_document(doc, TRUE);
+        sp_print_document(parentWindow, doc, TRUE);
 }
 
 
index 7f960ab651410bcb5a7c129a601d1872c4227ac9..f3ba1576b26190ccdef965b154d27a20dfb48a35 100644 (file)
@@ -179,12 +179,12 @@ would be useful as instance methods
 /**
  *
  */
-void sp_file_print (void);
+void sp_file_print (Gtk::Window& parentWindow);
 
 /**
  *
  */
-void sp_file_print_direct (void);
+void sp_file_print_direct (Gtk::Window& parentWindow);
 
 /**
  *
index 0dfb8ab5a211ab5711589814fa2997754488fdb1..a24a01ff750f1e922308524a7e72f84780d01afa 100644 (file)
@@ -123,7 +123,7 @@ sp_print_preview_document(SPDocument *doc)
 }
 
 void
-sp_print_document(SPDocument *doc, unsigned int /*direct*/)
+sp_print_document(Gtk::Window& parentWindow, SPDocument *doc, unsigned int /*direct*/)
 {
     sp_document_ensure_up_to_date(doc);
 
@@ -135,7 +135,7 @@ sp_print_document(SPDocument *doc, unsigned int /*direct*/)
 
     // Run print dialog
     Inkscape::UI::Dialog::Print printop(doc,base);
-    Gtk::PrintOperationResult res = printop.run(Gtk::PRINT_OPERATION_ACTION_PRINT_DIALOG);
+    Gtk::PrintOperationResult res = printop.run(Gtk::PRINT_OPERATION_ACTION_PRINT_DIALOG, parentWindow);
     (void)res; // TODO handle this
 
     // Release arena
index 0ec3fb321fd9313f95788915d7640d849604db4e..69d4f836953aceaed8c3b25681279e18a215dc59 100644 (file)
@@ -11,6 +11,7 @@
  * This code is in public domain
  */
 
+#include <gtkmm.h>
 #include <libnr/nr-path.h>
 #include "forward.h"
 #include "extension/extension-forward.h"
@@ -40,7 +41,7 @@ void sp_print_get_param(SPPrintContext *ctx, gchar *name, bool *value);
 
 /* UI */
 void sp_print_preview_document(SPDocument *doc);
-void sp_print_document(SPDocument *doc, unsigned int direct);
+void sp_print_document(Gtk::Window& parentWindow, SPDocument *doc, unsigned int direct);
 void sp_print_document_to_file(SPDocument *doc, gchar const *filename);
 
 
index 9165167f430cdbf17b19795249390ceb63bdd64c..6740247cd57697fcb13d20d6b4d75c8602593041 100644 (file)
@@ -158,10 +158,10 @@ Print::Print(SPDocument *doc, SPItem *base) :
 }
 
 Gtk::PrintOperationResult
-Print::run(Gtk::PrintOperationAction action)
+Print::run(Gtk::PrintOperationAction action, Gtk::Window& parent)
 {
     Gtk::PrintOperationResult res;
-    res = _printop->run (action);
+    res = _printop->run (action, parent);
     return res;
 }
 
index d893efbf1c8d3026947a3b7f9e02c3aa63b21e81..721c910ffd77f1c5f4d3ed452922a2e894a95b81 100644 (file)
@@ -30,7 +30,7 @@ class Print {
 public:
     Print(SPDocument *doc, SPItem *base);
 
-    Gtk::PrintOperationResult run(Gtk::PrintOperationAction action);
+    Gtk::PrintOperationResult run(Gtk::PrintOperationAction action, Gtk::Window& parentWindow);
     //GtkPrintOperationResult run(GtkPrintOperationAction action);
 
 protected:
index 78dd8bee85570c33a0d8c9077ab41fec89efd40a..e96eca2cece341929122c91e670c60356ed9b7f4 100644 (file)
@@ -779,13 +779,13 @@ FileVerb::perform(SPAction *action, void *data, void */*pdata*/)
             sp_file_save_a_copy(*parent, NULL, NULL);
             break;
         case SP_VERB_FILE_PRINT:
-            sp_file_print();
+            sp_file_print(*parent);
             break;
         case SP_VERB_FILE_VACUUM:
             sp_file_vacuum();
             break;
         case SP_VERB_FILE_PRINT_DIRECT:
-            sp_file_print_direct();
+            sp_file_print_direct(*parent);
             break;
         case SP_VERB_FILE_PRINT_PREVIEW:
             sp_file_print_preview(NULL, NULL);