aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmpmainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qmidiplayer-desktop/qmpmainwindow.cpp')
-rw-r--r--qmidiplayer-desktop/qmpmainwindow.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp
index c04bc93..73c2895 100644
--- a/qmidiplayer-desktop/qmpmainwindow.cpp
+++ b/qmidiplayer-desktop/qmpmainwindow.cpp
@@ -6,6 +6,7 @@
#include <QFont>
#include <QDirIterator>
#include <QDesktopWidget>
+#include <QMessageBox>
#include "qmpmainwindow.hpp"
#include "ui_qmpmainwindow.h"
#include "../core/qmpmidiplay.hpp"
@@ -27,14 +28,14 @@ char* wcsto8bit(const wchar_t* s)
#define LOAD_FILE \
{\
char* c=wcsto8bit(fns.toStdWString().c_str());\
- if(!player->playerLoadFile(c)){free(c);return;}\
+ if(!player->playerLoadFile(c)){free(c);QMessageBox::critical(this,tr("Error"),tr("%1 is not a valid midi file.").arg(fns));return;}\
free(c);\
}
#else
#define LOAD_SOUNDFONT \
player->pushSoundFont(settingsw->getSFWidget()->item(i)->text().toStdString().c_str())
#define LOAD_FILE \
- if(!player->playerLoadFile(fns.toStdString().c_str()))return
+ if(!player->playerLoadFile(fns.toStdString().c_str())){QMessageBox::critical(this,tr("Error"),tr("%1 is not a valid midi file.").arg(fns));return;}
#endif
#define UPDATE_INTERVAL 66