*/
#include <config.h>
-#include <gtkmm.h>
-#include <libglademm.h>
+
+// Too hard to make concept checks work with this file
+#ifdef _GLIBCPP_CONCEPT_CHECKS
+#undef _GLIBCPP_CONCEPT_CHECKS
+#endif
#include "GPrint.h"
#include "ControlPrint.h"
#include "ghelpers.h"
#include "PrinterParams.h"
+
+#include "support/convert.h"
#include "support/lstrings.h"
-#include "support/tostr.h"
+
+#include <libglademm.h>
using std::string;
using namespace lyx::support;
pp.all_pages = all_->get_active();
pp.from_page = pp.to_page = 0;
if (!fromEntry_->get_text().empty()) {
- pp.from_page = strToInt(fromEntry_->get_text());
+ pp.from_page = convert<int>(fromEntry_->get_text());
if (!toEntry_->get_text().empty())
- pp.to_page = strToInt(toEntry_->get_text());
+ pp.to_page = convert<int>(toEntry_->get_text());
}
pp.odd_pages = odd_->get_active();
pp.even_pages = even_->get_active();
fileEntry_->set_text(pp.file_name);
all_->set_active(pp.all_pages);
- string const from = ( pp.from_page ? tostr(pp.from_page) : string() );
- string const to = ( pp.to_page ? tostr(pp.to_page) : string() );
+ string const from = ( pp.from_page ? convert<string>(pp.from_page) : string() );
+ string const to = ( pp.to_page ? convert<string>(pp.to_page) : string() );
fromEntry_->set_text(from);
toEntry_->set_text(to);
odd_->set_active(pp.odd_pages);
if (fromTo_->get_active()) {
string from = fromEntry_->get_text();
string to = toEntry_->get_text();
- if (from.empty() || (!to.empty() && strToInt(from) > strToInt(to)))
+ if (from.empty() || (!to.empty() && convert<int>(from) > convert<int>(to)))
activate = ButtonPolicy::SMI_INVALID;
}
bool const enableCounter = printer_->get_active();
Gtk::Button * ok;
Gtk::Button * cancel;
- Gtk::Button * apply;
xml_->get_widget("PrintButton", ok);
xml_->get_widget("CancelButton", cancel);
+
setOK(ok);
setCancel(cancel);
Gtk::Button * browse;
xml_->get_widget("Browse", browse);
- browse->signal_clicked().connect(SigC::slot(*this, &GPrint::onBrowse));
-
- fileEntry_->signal_changed().connect(SigC::bind(SigC::slot(*this, &GPrint::onTargetEdit), fileEntry_));
- printerEntry_->signal_changed().connect(SigC::bind(SigC::slot(*this, &GPrint::onTargetEdit), printerEntry_));
- fromEntry_->signal_changed().connect(SigC::slot(*this, &GPrint::onFromToEdit));
- toEntry_->signal_changed().connect(SigC::slot(*this, &GPrint::onFromToEdit));
- printer_->signal_toggled().connect(SigC::slot(*this, &GPrint::updateUI));
- file_->signal_toggled().connect(SigC::slot(*this, &GPrint::updateUI));
- all_->signal_toggled().connect(SigC::slot(*this, &GPrint::updateUI));
- fromTo_->signal_toggled().connect(SigC::slot(*this, &GPrint::updateUI));
- number_->signal_changed().connect(SigC::slot(*this, &GPrint::updateUI));
+ browse->signal_clicked().connect(sigc::mem_fun(*this, &GPrint::onBrowse));
+
+ fileEntry_->signal_changed().connect(sigc::bind(sigc::mem_fun(*this, &GPrint::onTargetEdit), fileEntry_));
+ printerEntry_->signal_changed().connect(sigc::bind(sigc::mem_fun(*this, &GPrint::onTargetEdit), printerEntry_));
+ fromEntry_->signal_changed().connect(sigc::mem_fun(*this, &GPrint::onFromToEdit));
+ toEntry_->signal_changed().connect(sigc::mem_fun(*this, &GPrint::onFromToEdit));
+ printer_->signal_toggled().connect(sigc::mem_fun(*this, &GPrint::updateUI));
+ file_->signal_toggled().connect(sigc::mem_fun(*this, &GPrint::updateUI));
+ all_->signal_toggled().connect(sigc::mem_fun(*this, &GPrint::updateUI));
+ fromTo_->signal_toggled().connect(sigc::mem_fun(*this, &GPrint::updateUI));
+ number_->signal_changed().connect(sigc::mem_fun(*this, &GPrint::updateUI));
controller().initialiseParams("");
update();