]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlPrint.C
The reference dialog now disconnects from the inset on Apply. Its behaviour
[lyx.git] / src / frontends / controllers / ControlPrint.C
index 183b8e0b2beb20fa41efbf4c71caa40232cd7941..a9fb35a0c3e0ffd69d845c90202e71914f11730e 100644 (file)
  */
 
 #include <config.h>
+#include <utility>
 
 #ifdef __GNUG__
 #pragma implementation
 #endif
 
+#include "ViewBase.h"
+#include "ButtonControllerBase.h"
 #include "ControlPrint.h"
 #include "buffer.h"
 #include "Dialogs.h"
 #include "lyxrc.h"
 #include "PrinterParams.h"
 #include "Liason.h"
-
+#include "helper_funcs.h" // browseFile
 #include "lyx_gui_misc.h" // WriteAlert
+#include "gettext.h"
+#include "BufferView.h"
+#include "support/LAssert.h"
 
 using Liason::printBuffer;
 using Liason::getPrinterParams;
+using std::make_pair;
 
 ControlPrint::ControlPrint(LyXView & lv, Dialogs & d)
-       : ControlDialog<ControlConnectBD>(lv, d)
+    : ControlDialog<ControlConnectBD>(lv, d),
+      params_(0)
 {
        d_.showPrint.connect(SigC::slot(this, &ControlPrint::show));
 }
@@ -52,15 +60,9 @@ void ControlPrint::apply()
 }
 
 
-LyXView * ControlPrint::lv() const
-{
-       return &lv_;
-}
-
-
 PrinterParams & ControlPrint::params() const
 {
-       Assert(params_);
+       lyx::Assert(params_);
        return *params_;
 }
 
@@ -83,3 +85,13 @@ void ControlPrint::clearParams()
 }
 
 
+string const ControlPrint::Browse(string const & in_name)
+{
+       string const title = N_("Print to file");
+       string const pattern = "*.ps";
+
+       // Show the file browser dialog
+       return browseFile(&lv_, in_name, title, pattern,
+                          make_pair(string(), string()),
+                          make_pair(string(), string()));
+}