]> Shamusworld >> Repos - ttedit/commitdiff
Added preview window to file loading dialog. :-) master
authorShamus Hammons <jlhamm@acm.org>
Sat, 26 Mar 2016 04:28:25 +0000 (23:28 -0500)
committerShamus Hammons <jlhamm@acm.org>
Sat, 26 Mar 2016 04:28:25 +0000 (23:28 -0500)
13 files changed:
src/charwindow.cpp
src/charwindow.h
src/editwindow.cpp
src/global.cpp
src/global.h
src/glyphpoints.cpp
src/mainwindow.cpp
src/previewfiledialog.cpp [new file with mode: 0644]
src/previewfiledialog.h [new file with mode: 0644]
src/toolwindow.h
src/ttedit.cpp
src/ttedit.h
ttedit.pro

index 76112e4f8e92c96d59fc15ba45fd0bc84b9fd9b3..06b273dc79dee5aec307d0288a709d6820007807 100644 (file)
 #include "charwindow.h"
 #include "debug.h"
 
-//CharWindow::CharWindow(QWidget * parent/*= NULL*/): QWidget(parent, Qt::Tool), path(NULL)
+
 CharWindow::CharWindow(QWidget * parent/*= NULL*/): QWidget(parent, Qt::Window), path(NULL)
 {
        setWindowTitle("Character: Unknown");
 }
 
-void CharWindow::MakePathFromPoints(GlyphPoints * gp)
+
+QPainterPath * CharWindow::MakePathFromPoints(GlyphPoints * gp)
 {
        if (gp == NULL)
-               return;
+               return NULL;
 
        if (path != NULL)
                delete path;
@@ -49,10 +50,10 @@ void CharWindow::MakePathFromPoints(GlyphPoints * gp)
                if (gp->GetNumPoints(poly) < 3)
                        continue;
 
-               // Initial move: If our start point is on curve, then go to it. Otherwise,
-               // check previous point. If it's on curve, go to it otherwise go the
-               // midpoint between start point and previous (since it's between two curve
-               // control points).
+               // Initial move: If our start point is on curve, then go to it.
+               // Otherwise, check previous point. If it's on curve, go to it
+               // otherwise go the midpoint between start point and previous (since
+               // it's between two curve control points).
                IPoint pt = (gp->GetOnCurve(poly, 0)
                        ? gp->GetPoint(poly, 0) : (gp->GetPrevOnCurve(poly, 0)
                                ? gp->GetPrevPoint(poly, 0) : gp->GetMidpointToPrev(poly, 0)));
@@ -70,10 +71,10 @@ void CharWindow::MakePathFromPoints(GlyphPoints * gp)
                                if (gp->GetOnCurve(poly, i))
                                        continue;
 
-                               // We are now guaranteed that we are sitting on a curve control point
-                               // (off curve). Figure the extent of the curve: If the following is a
-                               // curve control point, then use the midpoint to it otherwise go to
-                               // the next point since it's on curve.
+                               // We are now guaranteed that we are sitting on a curve control
+                               // point (off curve). Figure the extent of the curve: If the
+                               // following is a curve control point, then use the midpoint to
+                               // it otherwise go to the next point since it's on curve.
                                IPoint pt = (gp->GetNextOnCurve(poly, i)
                                        ? gp->GetNextPoint(poly, i) : gp->GetMidpointToNext(poly, i));
 
@@ -83,18 +84,66 @@ void CharWindow::MakePathFromPoints(GlyphPoints * gp)
 
                path->closeSubpath();
        }
+
+       return path;
 }
 
+
+void CharWindow::RenderPathInImage(QPainterPath * path, QImage * img)
+{
+       if ((path == NULL) || (img == NULL))
+               return;
+
+       QPainter p(img);
+
+       p.setPen(QPen(Qt::black, 1.0, Qt::SolidLine));
+       p.setBrush(Qt::black);
+
+       QRectF rect = path->boundingRect();
+       QSize paintSize = img->size();
+
+#if 0
+       // For some reason, this code cuts off two pixels when rendering the path.
+       // Not sure why, but we compensate for that here.
+       paintSize.rwidth() -= 2;
+       paintSize.rheight() -= 2;
+#endif
+
+       p.translate(0, paintSize.height());
+       float extraX = 0.0f, extraY = 0.0f;
+       float xConvFac = (float)paintSize.width() / rect.width();
+       float yConvFac = (float)paintSize.height() / rect.height();
+
+       if (xConvFac > yConvFac)
+       {
+               // height is limiting factor (smaller than width)
+               p.scale(yConvFac, -yConvFac);
+               extraX = (((float)paintSize.width() / yConvFac) - rect.width()) / 2.0f;
+       }
+       else
+       {
+               // width is limiting factor (smaller than height)
+               p.scale(xConvFac, -xConvFac);
+               extraY = (((float)paintSize.height() / xConvFac) - rect.height()) / 2.0f;
+       }
+
+       p.translate(-rect.x() + extraX, -rect.y() + extraY);
+       p.drawPath(*path);
+}
+
+
 QSize CharWindow::minimumSizeHint() const
 {
        return QSize(50, 50);
 }
 
+
 QSize CharWindow::sizeHint() const
 {
        return QSize(200, 200);
 }
 
+
 void CharWindow::paintEvent(QPaintEvent * /*event*/)
 {
        if (path == NULL)
@@ -129,8 +178,6 @@ void CharWindow::paintEvent(QPaintEvent * /*event*/)
        {
                // width is limiting factor (smaller than height)
                p.scale(xConvFac, -xConvFac);
-//extraY = (rect.width() / (float)paintSize.width()) * (float)paintSize.height();
-//extraY = (extraY - rect.height()) / 2.0f;
                extraY = (((float)paintSize.height() / xConvFac) - rect.height()) / 2.0f;
        }
 
@@ -138,3 +185,4 @@ void CharWindow::paintEvent(QPaintEvent * /*event*/)
 
        p.drawPath(*path);
 }
+
index a5bfb18bbbbffd18aec1ac8c0e219ce9dad3d1f1..410475ff675a2d57337be2849b349403d2e14966 100644 (file)
@@ -17,40 +17,18 @@ class CharWindow: public QWidget
 
        public:
                CharWindow(QWidget * parent = NULL);
-               void MakePathFromPoints(GlyphPoints * gp);
+               QPainterPath * MakePathFromPoints(GlyphPoints * gp);
+               void RenderPathInImage(QPainterPath *, QImage *);
 
        protected:
                QSize minimumSizeHint() const;
                QSize sizeHint() const;
                void paintEvent(QPaintEvent * event);
 
-       private:
+       public:
                QImage img;
                QPainterPath * path;
 };
 
-#if 0
-#include <wx/wx.h>                                                             // So that whoever uses this can without having
-                                                                                               // to pull in a bunch of references manually
-#include <wx/minifram.h>
-
-class CharWindow: public wxMiniFrame
-{
-       private:
-       protected:
-       public:
-               wxBitmap * bmp;
-
-               // Constructor and destructor
-//             CharWindow(wxFrame * parent, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = 0);
-               CharWindow(wxFrame * parent, const wxString &title, const wxPoint &pos, const wxSize &size, long style);
-               ~CharWindow(void);
-
-               void OnPaint(wxPaintEvent &e);
-//             void OnMouseEvent(wxMouseEvent &e);
-
-       DECLARE_EVENT_TABLE()
-};
-#endif
-
 #endif // __CHARWINDOW_H__
+
index d24c447ab6b279bdab42760a7c804c6c61a748b8..dac63c28c736d5d3b2cf8bb8d9e8f151684bccec 100644 (file)
@@ -38,6 +38,7 @@
 #include "debug.h"
 #include "global.h"
 #include "mainwindow.h"
+#include "mathconstants.h"
 #include "ttedit.h"
 #include "vector.h"
 
@@ -581,8 +582,9 @@ void EditWindow::mouseMoveEvent(QMouseEvent * event)
                                }
                                else
                                {
-                                       // Figure out the angle between the "zero" vector and the current one,
-                                       // then rotate all points relative to the "zero" vector (done by paint())
+                                       // Figure out the angle between the "zero" vector and the
+                                       // current one, then rotate all points relative to the
+                                       // "zero" vector (done by paint())
 //                                     QPoint currentPoint = GetAdjustedMousePosition(event);
                                        Vector currentPoint = Painter::QtToCartesianCoords(Vector(event->x(), event->y()));
                                        Vector v1(rotationZeroPoint.x, rotationZeroPoint.y, 0,
@@ -593,8 +595,8 @@ void EditWindow::mouseMoveEvent(QMouseEvent * event)
                                        rotationAngle = v2.Angle(v1);
 
                                        QString s;
-                                       s.sprintf("%.3f degrees", rotationAngle * 180.0 / 3.14159265358979323);
-                                       ((TTEdit *)qApp)->mainWindow->statusBar()->showMessage(s);
+                                       s.sprintf("%.3f degrees", rotationAngle * RADIANS_TO_DEGREES);
+                                       Global::mainWindow->statusBar()->showMessage(s);
                                }
 
                                update();
@@ -776,14 +778,14 @@ void EditWindow::mouseReleaseEvent(QMouseEvent * event)
                        }
 
                        update();
-                       ((TTEdit *)qApp)->mainWindow->statusBar()->showMessage("");
+                       Global::mainWindow->statusBar()->showMessage("");
                }
 
 //             if (tool == TOOLScroll || tool == TOOLZoom)
 //                     ReleaseMouse();
 //this is prolly too much
-               ((TTEdit *)qApp)->charWnd->MakePathFromPoints(&pts);
-               ((TTEdit *)qApp)->charWnd->update();
+               Global::charWnd->MakePathFromPoints(&pts);
+               Global::charWnd->update();
 
                if (tool == TOOLMultiSelect)
                {
@@ -849,8 +851,8 @@ void EditWindow::keyPressEvent(QKeyEvent * event)
 //Not need but you need to call the base class for some reason??
 //     event->accept();
        update();
-       ((TTEdit *)qApp)->charWnd->MakePathFromPoints(&pts);
-       ((TTEdit *)qApp)->charWnd->update();
+       Global::charWnd->MakePathFromPoints(&pts);
+       Global::charWnd->update();
 }
 
 
index ad562ee503094339404e98be3e7eae352d91cffe..f34229ccf0f97e02b0e19d87317819ce7b67f27c 100644 (file)
@@ -49,3 +49,6 @@ int Global::numLayers = 1;
 std::vector<bool> Global::layerHidden;
 std::vector<bool> Global::layerLocked;
 
+CharWindow * Global::charWnd = 0;
+MainWindow * Global::mainWindow = 0;
+
index 64422da263b4509896a74cf6f2dcae3827e2a3b5..fc17a5a5f0d6ec91b41bbc9172da82b72a10fa60 100644 (file)
@@ -10,6 +10,8 @@
 #include "vector.h"
 
 class QFont;
+class CharWindow;
+class MainWindow;
 
 enum LineStyle { LSNone, LSSolid, LSDash, LSDot, LSDashDot, LSDashDotDot };
 
@@ -53,6 +55,9 @@ class Global
                static int numLayers;
                static std::vector<bool> layerHidden;
                static std::vector<bool> layerLocked;
+
+               static CharWindow * charWnd;
+               static MainWindow * mainWindow;
 };
 
 #endif // __GLOBALS_H__
index 856b85964e5d1c5764f1d7020d6fa0cc9baa9e0c..025f0e1ef3fde7be1c709ee943ada7084d23e7d9 100644 (file)
@@ -907,24 +907,29 @@ bool GlyphPoints::LoadGlyphFromFile(FILE * file)
 
        FreeAllocatedMemory();
 
-       fscanf(file, "%s V%f", line, &version);
-       fscanf(file, "%s %u", line, &numPoints);
+       int num = fscanf(file, "TTEGLYPH V%f\n", &version);
+
+       // Check to see if this is really a glyph file
+       if ((num != 1) || (version != 1.0))
+               return false;
+
+       num = fscanf(file, "POINTS %u\n", &numPoints);
        x = new int[numPoints];
        y = new int[numPoints];
        onCurve = new bool[numPoints];
 
        for(int i=0; i<numPoints; i++)
        {
-               fscanf(file, "%d %d %s", &x[i], &y[i], (char *)&line);
+               fscanf(file, "%d %d %s\n", &x[i], &y[i], (char *)&line);
                onCurve[i] = (line[0] == 'T' ? true : false);
        }
 
-       fscanf(file, "%s %u", line, &numPolys);
+       num = fscanf(file, "POLYS %u\n", &numPolys);
        polyEnd = new uint16_t[numPolys];
 
        for(int i=0; i<numPolys; i++)
        {
-               fscanf(file, "%u", &polyEnd[i]);
+               fscanf(file, "%u\n", &polyEnd[i]);
        }
 
        return true;
index 2c9b45d1024d27a29540d537771b802ca6afa945..173c977a8a04a0fe4cad8e6791d4ace2e418147b 100644 (file)
 #include "charwindow.h"
 #include "editwindow.h"
 #include "global.h"
+#include "previewfiledialog.h"
 #include "ttedit.h"
 
 
 MainWindow::MainWindow()
 {
-       ((TTEdit *)qApp)->charWnd = new CharWindow(this);
+       Global::charWnd = new CharWindow(this);
        editWnd = new EditWindow(this);
        setCentralWidget(editWnd);
        editWnd->setFocus();
        setWindowIcon(QIcon(":/res/ttedit.png"));
        setWindowTitle("TTEdit! - Untitled");
 
-#if 0
-//     createActions();
-       newAct = new QAction(QIcon(":/images/new.png"), tr("&New"), this);
-       newAct->setShortcuts(QKeySequence::New);
-       newAct->setStatusTip(tr("Create a new file"));
-       connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
-
-       openAct = new QAction(QIcon(":/images/open.png"), tr("&Open..."), this);
-       openAct->setShortcuts(QKeySequence::Open);
-       openAct->setStatusTip(tr("Open an existing file"));
-       connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
-
-       aboutQtAct = new QAction(tr("About &Qt"), this);
-       aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
-       connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-
-//     createMenus();
-       fileMenu = menuBar()->addMenu(tr("&File"));
-       fileMenu->addAction(newAct);
-       fileMenu->addAction(openAct);
-       fileMenu->addAction(saveAct);
-       fileMenu->addAction(saveAsAct);
-       fileMenu->addSeparator();
-       fileMenu->addAction(exitAct);
-
-       editMenu = menuBar()->addMenu(tr("&Edit"));
-       editMenu->addAction(cutAct);
-       editMenu->addAction(copyAct);
-       editMenu->addAction(pasteAct);
-
-       menuBar()->addSeparator();
-
-       helpMenu = menuBar()->addMenu(tr("&Help"));
-       helpMenu->addAction(aboutAct);
-       helpMenu->addAction(aboutQtAct);
-
-//     createToolBars();
-       fileToolBar = addToolBar(tr("File"));
-       fileToolBar->addAction(newAct);
-       fileToolBar->addAction(openAct);
-       fileToolBar->addAction(saveAct);
-
-       editToolBar = addToolBar(tr("Edit"));
-       editToolBar->addAction(cutAct);
-       editToolBar->addAction(copyAct);
-       editToolBar->addAction(pasteAct);
-#else
        CreateActions();
        CreateMenus();
        CreateToolbars();
-#endif
 
        //      Create status bar
        scaleIndicator = new QLabel("Scale: 100%");
@@ -116,7 +69,7 @@ MainWindow::MainWindow()
 //     setCurrentFile("");
        setUnifiedTitleAndToolBarOnMac(true);
 
-       ((TTEdit *)qApp)->charWnd->show();//eh?
+       Global::charWnd->show();
 }
 
 
@@ -206,8 +159,8 @@ void MainWindow::closeEvent(QCloseEvent * event)
 void MainWindow::NewGlyph(void)
 {
        editWnd->pts.Clear();
-       ((TTEdit *)qApp)->charWnd->MakePathFromPoints(&(editWnd->pts));
-       ((TTEdit *)qApp)->charWnd->update();
+       Global::charWnd->MakePathFromPoints(&(editWnd->pts));
+       Global::charWnd->update();
        filename.clear();
 //     editWnd->polyFirstPoint = true;
        editWnd->update();
@@ -218,8 +171,19 @@ void MainWindow::NewGlyph(void)
 
 void MainWindow::OpenFile(void)
 {
+#if 0
        filename = QFileDialog::getOpenFileName(this, tr("Open Glyph File"),
                "./", tr("Glyph files (*.glyph)"));
+#else
+       PreviewFileDialog * pfd = new PreviewFileDialog(this, tr("Open Glyph File"),
+               "./", tr("Glyph files (*.glyph)"));
+       pfd->setAcceptMode(QFileDialog::AcceptOpen);
+
+       if (pfd->exec() == false)
+               return;
+
+       filename = pfd->selectedFiles().at(0);
+#endif
        FILE * file = fopen(filename.toUtf8().data(), "r");
 
        //need to pop an error box here...
@@ -229,8 +193,8 @@ void MainWindow::OpenFile(void)
        editWnd->pts.LoadGlyphFromFile(file);
        fclose(file);
 
-       ((TTEdit *)qApp)->charWnd->MakePathFromPoints(&(editWnd->pts));
-       ((TTEdit *)qApp)->charWnd->update();
+       Global::charWnd->MakePathFromPoints(&(editWnd->pts));
+       Global::charWnd->update();
        editWnd->update();
        setWindowTitle(QString("TTEdit! - %1").arg(filename));
        editWnd->setFocus();
@@ -300,8 +264,8 @@ void MainWindow::ReadSettings(void)
        move(pos);
        pos = settings.value("charWndPos", QPoint(0, 0)).toPoint();
        size = settings.value("charWndSize", QSize(200, 200)).toSize();
-       ((TTEdit *)qApp)->charWnd->resize(size);
-       ((TTEdit *)qApp)->charWnd->move(pos);
+       Global::charWnd->resize(size);
+       Global::charWnd->move(pos);
 }
 
 
@@ -310,8 +274,8 @@ void MainWindow::WriteSettings(void)
        QSettings settings("Underground Software", "TTEdit");
        settings.setValue("pos", pos());
        settings.setValue("size", size());
-       settings.setValue("charWndPos", ((TTEdit *)qApp)->charWnd->pos());
-       settings.setValue("charWndSize", ((TTEdit *)qApp)->charWnd->size());
+       settings.setValue("charWndPos", Global::charWnd->pos());
+       settings.setValue("charWndSize", Global::charWnd->size());
 }
 
 
diff --git a/src/previewfiledialog.cpp b/src/previewfiledialog.cpp
new file mode 100644 (file)
index 0000000..b354247
--- /dev/null
@@ -0,0 +1,68 @@
+#include "previewfiledialog.h"
+#include <QLabel>
+#include <QGridLayout>
+#include <QPainterPath>
+#include <QPainter>
+#include "charwindow.h"
+#include "global.h"
+#include "glyphpoints.h"
+
+
+PreviewFileDialog::PreviewFileDialog(
+       QWidget * parent,
+       const QString & caption,
+       const QString & directory,
+       const QString & filter):
+    QFileDialog(parent, caption, directory, filter)
+{
+       setObjectName("PreviewFileDialog");
+       QVBoxLayout * box = new QVBoxLayout;
+       mpPreview = new QLabel(tr("Preview"), this);
+       mpPreview->setAlignment(Qt::AlignCenter);
+       mpPreview->setObjectName("labelPreview");
+       box->addWidget(mpPreview);
+       box->addStretch();
+       // add to QFileDialog layout
+       {
+               QGridLayout * layout = (QGridLayout *)this->layout();
+               layout->addLayout(box, 1, 3, 3, 1);
+       }
+
+       connect(this, SIGNAL(currentChanged(const QString &)), this, SLOT(HandleCurrentChanged(const QString &)));
+}
+
+
+void PreviewFileDialog::HandleCurrentChanged(const QString & path)
+{
+       if (path.endsWith(".glyph") == false)
+               return;
+
+       GlyphPoints gp;
+       QPainterPath * glyphPath = NULL;
+       FILE * fp = fopen(path.toUtf8().data(), "r");
+
+       if (fp != NULL)
+       {
+               if (gp.LoadGlyphFromFile(fp) == true)
+                       glyphPath = Global::charWnd->MakePathFromPoints(&gp);
+
+               fclose(fp);
+       }
+
+       QImage glyphImg(160, 160, QImage::Format_RGBA8888);
+       glyphImg.fill(Qt::transparent);
+       Global::charWnd->RenderPathInImage(glyphPath, &glyphImg);
+       QPixmap pixmap = QPixmap::fromImage(glyphImg);
+
+       if (pixmap.isNull() == false)
+       {
+               mpPreview->setPixmap(pixmap);//.scaled(mpPreview->width(), mpPreview->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
+//             return;
+       }
+
+//     mpPreview->setText(QString("not an image"));//<br>%1").arg(path));
+}
+
diff --git a/src/previewfiledialog.h b/src/previewfiledialog.h
new file mode 100644 (file)
index 0000000..78a693b
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef __PREVIEWFILEDIALOG_H__
+#define __PREVIEWFILEDIALOG_H__
+
+#include <QFileDialog>
+
+class QLabel;
+
+class PreviewFileDialog: public QFileDialog
+{
+       Q_OBJECT
+
+       public:
+               PreviewFileDialog(QWidget * parent = 0,
+                       const QString & caption = QString(),
+                       const QString & directory = QString(),
+                       const QString & filter = QString());
+
+       protected slots:
+               void HandleCurrentChanged(const QString & path);
+
+       protected:
+               QLabel * mpPreview;
+};
+
+#endif // __PREVIEWFILEDIALOG_H__
+
index 2864970fbb46c0bc4fc0768361ef6b4676008401..6fc37234868bdbe833ed8defa63d3df44b7bf916 100644 (file)
 // Enumerations
 
 enum ToolType {
-       TOOLNone = -1,                                                  // No tool
-       TOOLSelect = 0,                                                 // The "selection" tool
-       TOOLPolySelect,                                                 // Polygon selection tool
-       TOOLMultiSelect,                                                // Rectangle selection tool
-       TOOLZoom,                                                               // Zoom window tool
-       TOOLAddPt,                                                              // Add point tool
-       TOOLAddPoly,                                                    // Polygon creation tool
-       TOOLDelPt,                                                              // Delete point tool
-       TOOLDelPoly,                                                    // Delete polygon tool
-       TOOLRotate,                                                             // Rotate tool
-       TOOLRotatePoly,                                                 // Rotate polygon around centroid tool
-       TOOLFlipWinding,                                                // Change polygon's winding direction tool
-       TOOLScroll                                                              // Scroll window tool
+       TOOLNone = -1,          // No tool
+       TOOLSelect = 0,         // The "selection" tool
+       TOOLPolySelect,         // Polygon selection tool
+       TOOLMultiSelect,        // Rectangle selection tool
+       TOOLZoom,                       // Zoom window tool
+       TOOLAddPt,                      // Add point tool
+       TOOLAddPoly,            // Polygon creation tool
+       TOOLDelPt,                      // Delete point tool
+       TOOLDelPoly,            // Delete polygon tool
+       TOOLRotate,                     // Rotate tool
+       TOOLRotatePoly,         // Rotate polygon around centroid tool
+       TOOLFlipWinding,        // Change polygon's winding direction tool
+       TOOLScroll                      // Scroll window tool
 };
 
 class ToolWindow: public QWidget
index 46e994362cc29a78e90164fc329df9c499dce53a..f023f034e5d5f609e69dff76c6b622a1aff4b51f 100644 (file)
 
 #include "ttedit.h"
 #include <QApplication>
+#include "global.h"
 #include "mainwindow.h"
 
 // Main app constructor--we stick globally accessible stuff here...
 
-TTEdit::TTEdit(int & argc, char * argv[]): QApplication(argc, argv), charWnd(NULL)
+TTEdit::TTEdit(int & argc, char * argv[]): QApplication(argc, argv)
 {
-       mainWindow = new MainWindow;
-//printf("mainWindow.show();\n");
-       mainWindow->show();
+       Global::mainWindow = new MainWindow;
+       Global::mainWindow->show();
 }
 
 
@@ -35,11 +35,6 @@ int main(int argc, char * argv[])
 {
        Q_INIT_RESOURCE(ttedit);        // This must the same name as the exe filename
 
-//     QApplication app(argc, argv);
-//printf("TTEdit app(argc, argv);\n");
        TTEdit app(argc, argv);
-//printf("TTEMainWindow mainWindow;\n");
-//OK, it gets to here at least...
-//printf("return app.exec();\n");
        return app.exec();
 }
index 482b6accec5c9712e92420b1615b8300aca39699..7713a10481db7ea15e19ae04ae2ba901594f3768 100644 (file)
@@ -11,8 +11,8 @@
 #include <QtWidgets>
 
 // Forward declarations
-class CharWindow;
-class MainWindow;
+//class CharWindow;
+//class MainWindow;
 
 class TTEdit: public QApplication
 {
@@ -20,8 +20,8 @@ class TTEdit: public QApplication
                TTEdit(int & argc, char * argv[]);
 
        public:
-               CharWindow * charWnd;
-               MainWindow * mainWindow;
+//             CharWindow * charWnd;
+//             MainWindow * mainWindow;
 };
 
 #endif // __TTEDIT_H__
index 426123b155923112b7028507a7a4da88cc2503e5..d82bb0637ccb8350a60cc81770797d31aa2638a5 100644 (file)
@@ -14,6 +14,7 @@ HEADERS += src/list.h
 HEADERS += src/mainwindow.h
 HEADERS += src/mathconstants.h
 HEADERS += src/painter.h
+HEADERS += src/previewfiledialog.h
 HEADERS += src/toolwindow.h
 HEADERS += src/ttedit.h
 HEADERS += src/vector.h
@@ -25,6 +26,7 @@ SOURCES += src/global.cpp
 SOURCES += src/glyphpoints.cpp
 SOURCES += src/mainwindow.cpp
 SOURCES += src/painter.cpp
+SOURCES += src/previewfiledialog.cpp
 SOURCES += src/toolwindow.cpp
 SOURCES += src/ttedit.cpp
 SOURCES += src/vector.cpp