mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
Import video and image dialogs are now restrictive on definite file extensions (with option to select any)
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user