]> git.sur5r.net Git - fstl/commitdiff
Make load_stl return a boolean
authorMatt Keeter <matt.j.keeter@gmail.com>
Fri, 14 Mar 2014 14:39:47 +0000 (10:39 -0400)
committerMatt Keeter <matt.j.keeter@gmail.com>
Fri, 14 Mar 2014 14:39:51 +0000 (10:39 -0400)
src/window.cpp
src/window.h

index 1e389f616aaea9c58652e33a64c371047cf967d4..a3c94d06cea48488abc8b66c67974ce8fee5a196 100644 (file)
@@ -68,8 +68,10 @@ void Window::on_about()
         "   style=\"color: #93a1a1;\">matt.j.keeter@gmail.com</a></p>");
 }
 
-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;
 }
index 55298da5bd5aa8dfa2a4b9a7968f95df1bb89d57..078a7f3c6708623cbfa41bad5f7fc256ddd6f649 100644 (file)
@@ -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();