From 9803286d2661f0a0b089352a2a50a920b4457a52 Mon Sep 17 00:00:00 2001 From: Matt Keeter Date: Fri, 14 Mar 2014 10:39:47 -0400 Subject: [PATCH] Make load_stl return a boolean --- src/window.cpp | 5 ++++- src/window.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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(); -- 2.39.5