From 78ba2cf12ec5ef08b8d69eec642db96390415c07 Mon Sep 17 00:00:00 2001 From: Gary Date: Sun, 24 Sep 2017 15:33:43 +0800 Subject: MessageBox show at center of the current monitor --- .gitignore | 2 ++ qmidiplayer-desktop/qmpsettingswindow.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..63d31d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# User configuration +*.pro.user diff --git a/qmidiplayer-desktop/qmpsettingswindow.cpp b/qmidiplayer-desktop/qmpsettingswindow.cpp index 985dd67..ba460dd 100644 --- a/qmidiplayer-desktop/qmpsettingswindow.cpp +++ b/qmidiplayer-desktop/qmpsettingswindow.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "qmpsettingswindow.hpp" #include "ui_qmpsettingswindow.h" #include "qmpmainwindow.hpp" @@ -382,7 +383,9 @@ void qmpSettingsWindow::verifySF() if(((QCheckBox*)ui->twSoundfont->cellWidget(i,0))->isChecked())++sf; if(settings->value("Midi/DefaultOutput","Internal FluidSynth").toString()=="Internal FluidSynth"&&!sf) { - if(QMessageBox::question(this, + // blmark: show dialog at the current screen which user using now. + int curMonitor = QApplication::desktop()->screenNumber(this); + if(QMessageBox::question(QDesktopWidget().screen(curMonitor),//this, tr("No soundfont loaded"), tr("Internal fluidsynth was chosen as the default output but it has no soundfont set. " "Would you like to setup soundfonts now? After that you may have to reload the internal synth."))==QMessageBox::Yes) -- cgit v1.2.3