#include "ButtonController.h"
#include "buffer.h"
+#include "bufferparams.h"
#include "gettext.h"
#include "helper_funcs.h"
#include "PrinterParams.h"
#include "support/tostr.h"
#include "support/filetools.h"
+#include "support/globbing.h"
#include "support/path.h"
#include "support/systemcall.h"
#include "debug.h"
-using namespace lyx::support;
+using lyx::support::bformat;
+using lyx::support::ChangeExtension;
+using lyx::support::FileFilterList;
+using lyx::support::IsDirWriteable;
+using lyx::support::MakeAbsPath;
+using lyx::support::MakeDisplayPath;
+using lyx::support::Path;
+using lyx::support::QuoteName;
+using lyx::support::Systemcall;
using std::endl;
+using std::string;
+
ControlPrint::ControlPrint(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d),
PrinterParams & ControlPrint::params() const
{
- Assert(params_);
+ BOOST_ASSERT(params_);
return *params_;
}
}
-string const ControlPrint::Browse(string const & in_name)
+string const ControlPrint::browse(string const & in_name) const
{
- string const title = _("Print to file");
- string const pattern = "*.ps";
-
- // Show the file browser dialog
- return browseRelFile(in_name, buffer()->filePath(),
- title, pattern, true);
+ return browseRelFile(in_name, buffer().filePath(),
+ _("Print to file"),
+ FileFilterList("PostScript files (*.ps)"),
+ true);
}
command += lyxrc.print_extra_options + ' ';
}
- command += buffer()->params.dvips_options() + ' ';
+ command += buffer()->params().dvips_options() + ' ';
if (!Exporter::Export(buffer(), "dvi", true)) {
showPrintError(buffer()->fileName());
}
// Push directory path.
- string path = buffer()->filePath();
- if (lyxrc.use_tempdir || !IsDirWriteable(path)) {
- path = buffer()->tmppath;
- }
+ string const path = buffer()->temppath();
Path p(path);
// there are three cases here: