]> git.sur5r.net Git - fstl/commitdiff
Set window title to filename
authorMatt Keeter <matt.j.keeter@gmail.com>
Fri, 7 Mar 2014 17:45:07 +0000 (11:45 -0600)
committerMatt Keeter <matt.j.keeter@gmail.com>
Fri, 7 Mar 2014 17:45:07 +0000 (11:45 -0600)
src/loader.cpp
src/loader.h
src/window.cpp

index 866616132b63729ce811cd6860994ceb3d961674..4131d02ae9be18c427c24b3123f735371d0eca09 100644 (file)
@@ -9,4 +9,5 @@ Loader::Loader(QObject* parent, const QString& filename)
 void Loader::run()
 {
     emit got_mesh(Mesh::load_stl(filename));
+    emit loaded_file(filename);
 }
index 29508f0041099fd275dc377887d8e9417be4bacc..350985cd9c5f6f7bc6e56bb3135e955fc12f8273 100644 (file)
@@ -13,6 +13,7 @@ public:
     void run();
 
 signals:
+    void loaded_file(QString filename);
     void got_mesh(Mesh* m);
 
 private:
index 6b125636027a33836aa0ef234972abf964113cc3..1b3530b3f21bf00e8e300ef7ea033c41b6c0c321 100644 (file)
@@ -77,13 +77,16 @@ void Window::disable_open_action()
 
 void Window::load_stl(const QString &filename)
 {
-    disable_open_action();
     Loader* loader = new Loader(this, filename);
+    connect(loader, SIGNAL(started()),
+            this, SLOT(disable_open_action()));
     connect(loader, SIGNAL(got_mesh(Mesh*)),
             canvas, SLOT(load_mesh(Mesh*)));
     connect(loader, SIGNAL(finished()),
             loader, SLOT(deleteLater()));
     connect(loader, SIGNAL(finished()),
             this, SLOT(enable_open_action()));
+    connect(loader, SIGNAL(loaded_file(QString)),
+            this, SLOT(setWindowTitle(QString)));
     loader->start();
 }