Import video and image dialogs are now restrictive on definite file extensions (with option to select any)

This commit is contained in:
Tats
2014-06-26 00:56:53 -04:00
parent e8f7f44493
commit 03635c4904
3 changed files with 8 additions and 3 deletions
+3
View File
@@ -21,6 +21,9 @@
const QString MM::VERSION = "0.1.1";
const QString MM::FILE_EXTENSION = "mmp";
const QString MM::VIDEO_FILES_FILTER = "*.mov *.mp4 *.avi *.ogg *.ogv *.mpeg *.mpeg1 *.mpeg4 *.mpg *.mpg2 *.mp2 *.mjpq *.mjp *.wmv";
const QString MM::IMAGE_FILES_FILTER = "*.jpg *.jpeg *.gif *.png *.tiff *.tif *.bmp";
const QColor MM::WHITE("#f6f5f5");
const QColor MM::BLUE_GRAY("#323541");
const QColor MM::DARK_GRAY("#272a36");
+3
View File
@@ -31,6 +31,9 @@ public:
// General.
static const QString VERSION;
static const QString FILE_EXTENSION;
static const QString VIDEO_FILES_FILTER;
static const QString IMAGE_FILES_FILTER;
// GUI.
static const int DEFAULT_WINDOW_WIDTH = 640;
static const int DEFAULT_WINDOW_HEIGHT = 480;
+2 -3
View File
@@ -307,8 +307,7 @@ void MainWindow::importVideo()
// Pop-up file-choosing dialog to choose media file.
// TODO: restrict the type of files that can be imported
QString fileName = QFileDialog::getOpenFileName(this,
tr("Import media source file"), ".");
tr("Import media source file"), ".", tr("Video files (%1);;All files (*)").arg(MM::VIDEO_FILES_FILTER));
// Restart video playback. XXX Hack
videoTimer->start();
@@ -324,7 +323,7 @@ void MainWindow::importImage()
// Pop-up file-choosing dialog to choose media file.
// TODO: restrict the type of files that can be imported
QString fileName = QFileDialog::getOpenFileName(this,
tr("Import media source file"), ".");
tr("Import media source file"), ".", tr("Image files (%1);;All files (*)").arg(MM::IMAGE_FILES_FILTER));
// Restart video playback. XXX Hack
videoTimer->start();