From: Matt Keeter Date: Fri, 14 Mar 2014 14:39:47 +0000 (-0400) Subject: Make load_stl return a boolean X-Git-Tag: v0.9.0~18 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9803286d2661f0a0b089352a2a50a920b4457a52;p=fstl Make load_stl return a boolean --- diff --git a/src/window.cpp b/src/window.cpp index 1e389f6..a3c94d0 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -68,8 +68,10 @@ void Window::on_about() " style=\"color: #93a1a1;\">matt.j.keeter@gmail.com

"); } -void Window::load_stl(const QString &filename) +bool Window::load_stl(const QString& filename) { + if (!open_action->isEnabled()) return false; + canvas->set_status("Loading " + filename); Loader* loader = new Loader(this, filename); @@ -90,4 +92,5 @@ void Window::load_stl(const QString &filename) this, &Window::setWindowTitle); loader->start(); + return true; } diff --git a/src/window.h b/src/window.h index 55298da..078a7f3 100644 --- a/src/window.h +++ b/src/window.h @@ -10,7 +10,7 @@ class Window : public QMainWindow Q_OBJECT public: explicit Window(QWidget* parent=0); - void load_stl(const QString& filename); + bool load_stl(const QString& filename); public slots: void on_open();