diff --git a/MM.cpp b/MM.cpp index 4871d82..18cbae4 100644 --- a/MM.cpp +++ b/MM.cpp @@ -19,6 +19,8 @@ #include "MM.h" +const QString MM::VERSION = "0.1.1"; +const QString MM::FILE_EXTENSION = "mmp"; const QColor MM::WHITE("#f6f5f5"); const QColor MM::BLUE_GRAY("#323541"); const QColor MM::DARK_GRAY("#272a36"); diff --git a/MM.h b/MM.h index a9bd9d7..e7b5abd 100644 --- a/MM.h +++ b/MM.h @@ -28,6 +28,9 @@ class MM { public: + // General. + static const QString VERSION; + static const QString FILE_EXTENSION; // GUI. static const int DEFAULT_WINDOW_WIDTH = 640; static const int DEFAULT_WINDOW_HEIGHT = 480; diff --git a/MainWindow.cpp b/MainWindow.cpp index 0787f51..d12c4ea 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -247,9 +247,8 @@ void MainWindow::open() { QString fileName = QFileDialog::getOpenFileName(this, tr("Open project"), - ".", // TODO : change this to previous used one, if any - //tr("MapMap files (*.%1)", MAPMAP_EXTENSION)); - tr("All files (*)")); + ".", + tr("MapMap files (*.%1)").arg(MM::FILE_EXTENSION)); if (! fileName.isEmpty()) loadFile(fileName); } @@ -280,8 +279,7 @@ bool MainWindow::saveAs() QString fileName = QFileDialog::getSaveFileName(this, tr("Save project"), ".", - tr("MapMap files (*.%1)", MAPMAP_EXTENSION) - ); + tr("MapMap files (*.%1)").arg(MM::FILE_EXTENSION)); // Restart video playback. XXX Hack videoTimer->start(); @@ -289,12 +287,12 @@ bool MainWindow::saveAs() if (fileName.isEmpty()) return false; - if (! fileName.endsWith(MAPMAP_EXTENSION)) + if (! fileName.endsWith(MM::FILE_EXTENSION)) { std::cout << "filename doesn't end with expected extension: " << fileName.toStdString() << std::endl; fileName.append("."); - fileName.append(MAPMAP_EXTENSION); + fileName.append(MM::FILE_EXTENSION); } // Save to filename. @@ -487,9 +485,7 @@ void MainWindow::about() // Pop-up about dialog. QMessageBox::about(this, tr("About MapMap"), - tr("

MapMap " - MAPMAP_VERSION - "

" + tr("

MapMap %1

" "

Copyright © 2013 Sofian Audry, Alexandre Quessy, Julien Keable, " "Mike Latona and Vasilis Liaskovitis." "

MapMap is a free software for video mapping. " @@ -507,7 +503,7 @@ void MainWindow::about() "This project was made possible by the support of the International Organization of " "La Francophonie." "http://www.francophonie.org/" - )); + ).arg(MM::VERSION)); // Restart video playback. XXX Hack videoTimer->start(); diff --git a/MainWindow.h b/MainWindow.h index 48db28f..b410259 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -43,9 +43,6 @@ #include "qttreepropertybrowser.h" #include "qtgroupboxpropertybrowser.h" -#define MAPMAP_VERSION "0.1.1" -#define MAPMAP_EXTENSION "mmp" - /** * This is the main window of MapMap. It acts as both a view and a controller interface. */