+ QString filename = QFileDialog::getOpenFileName(
+ this, "Load .stl file", QString(), "*.stl");
+ if (not filename.isNull())
+ {
+ load_stl(filename);
+ }
+}
+
+void Window::on_about()
+{
+ QMessageBox::about(this, "",
+ "<p align=\"center\"><b>fstl</b></p>"
+ "<p>A fast viewer for <code>.stl</code> files.<br>"
+ "<a href=\"https://github.com/mkeeter/fstl\""
+ " style=\"color: #93a1a1;\">https://github.com/mkeeter/fstl</a></p>"
+ "<p>© 2014 Matthew Keeter<br>"
+ "<a href=\"mailto:matt.j.keeter@gmail.com\""
+ " style=\"color: #93a1a1;\">matt.j.keeter@gmail.com</a></p>");
+}
+
+void Window::on_ascii_stl()
+{
+ QMessageBox::critical(this, "Error",
+ "<b>Error:</b><br>"
+ "Cannot open ASCII <code>.stl</code> file<br>"
+ "Please convert to binary <code>.stl</code> and retry");
+}
+
+void Window::enable_open()
+{
+ open_action->setEnabled(true);
+}
+
+void Window::disable_open()
+{
+ open_action->setEnabled(false);
+}
+
+bool Window::load_stl(const QString& filename)
+{
+ if (!open_action->isEnabled()) return false;
+
+ canvas->set_status("Loading " + filename);
+