diff options
author | Chris Xiong <chirs241097@gmail.com> | 2019-11-16 12:30:51 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2019-11-16 12:30:51 +0800 |
commit | af657df8a4accb3758138769e3cc5b86530b57d5 (patch) | |
tree | 9563dc2e9b1ea36dc4d50be52c2e1d717f1fb8d6 /qmidiplayer-desktop/main.cpp | |
parent | c12df3744f04716e88e905888beeaaa4f331d687 (diff) | |
download | QMidiPlayer-af657df8a4accb3758138769e3cc5b86530b57d5.tar.xz |
Even more fixes for Microsoft(R) Windows(R) operating system.
Device initalization file dialog doesn't work correctly on Windows.
Make hiding console an option on Windows.
For some dumb reason preset selection dialog refuses to work if no
soundfont is selected.
Diffstat (limited to 'qmidiplayer-desktop/main.cpp')
-rw-r--r-- | qmidiplayer-desktop/main.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/qmidiplayer-desktop/main.cpp b/qmidiplayer-desktop/main.cpp index ba44e99..37f6338 100644 --- a/qmidiplayer-desktop/main.cpp +++ b/qmidiplayer-desktop/main.cpp @@ -27,9 +27,6 @@ int main(int argc,char **argv) { -#ifdef _WIN32 - FreeConsole(); -#endif QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QCoreApplication::setApplicationName("qmidiplayer"); QCoreApplication::setApplicationVersion(APP_VERSION); @@ -52,8 +49,16 @@ int main(int argc,char **argv) clp.addPositionalArgument("file",QCoreApplication::translate("main","midi files to play (optional)."),"[files...]"); clp.addOption(QCommandLineOption("plugin",QCoreApplication::translate("main","Load a plugin from <plugin library>."),"plugin library")); clp.addOption(QCommandLineOption({"l","load-all-files"},QCoreApplication::translate("main","Load all files from the same folder."))); +#ifdef _WIN32 + clp.addOption(QCommandLineOption("keep-console",QCoreApplication::translate("main","Keep console window open."))); +#endif clp.process(a); +#ifdef _WIN32 + if(!clp.isSet("keep-console")) + FreeConsole(); +#endif + qmpMainWindow w(&clp); if(w.parseArgs()==1)return 0; w.init(); |