void MainWindow::on_actionOpenXML_triggered()
{
    QString path = Settings.openPath();
#ifdef Q_OS_MAC
    path.append("/*");
#endif
    QStringList filenames = QFileDialog::getOpenFileNames(this, tr("Open File"), path,
        tr("MLT XML (*.mlt);;All Files (*)"));
    if (filenames.length() > 0) {
        QString url = filenames.first();
        MltXmlChecker checker;
        if (checker.check(url)) {
            if (!isCompatibleWithGpuMode(checker))
                return;
            isXmlRepaired(checker, url);
            // Check if the locale usage differs.
            // Get current locale.
            QString localeName = QString(::setlocale(MLT_LC_CATEGORY, nullptr)).toUpper();
            // Test if it is C or POSIX.
            bool currentlyUsingLocale = (localeName != "" && localeName != "C" && localeName != "POSIX");
            if (currentlyUsingLocale != checker.usesLocale()) {
                // Show a warning dialog and cancel if requested.
                QMessageBox dialog(QMessageBox::Question,
                   qApp->applicationName(),
                   tr("The decimal point of the MLT XML file\nyou want to open is incompatible.\n\n"
                      "Do you want to continue to open this MLT XML file?"),
                   QMessageBox::No |
                   QMessageBox::Yes,
                   this);
                dialog.setWindowModality(QmlApplication::dialogModality());
                dialog.setDefaultButton(QMessageBox::No);
                dialog.setEscapeButton(QMessageBox::No);
                if (dialog.exec() != QMessageBox::Yes)
                    return;
            }
        }
        Settings.setOpenPath(QFileInfo(url).path());
        activateWindow();
        if (filenames.length() > 1)
            m_multipleFiles = filenames;
        if (!MLT.openXML(url)) {
            open(MLT.producer());
            m_recentDock->add(url);
            LOG_INFO() << url;
        }
        else {
            showStatusMessage(tr("Failed to open ") + url);
            emit openFailed(url);
        }
    }
}
void MainWindow::on_actionOpenXML_triggered()
{
    QString path = Settings.openPath();
#ifdef Q_OS_MAC
    path.append("/*");
#endif
    QStringList filenames = QFileDialog::getOpenFileNames(this, tr("Open File"), path,
        tr("MLT XML (*.mlt);;All Files (*)"));
    if (filenames.length() > 0) {
        QString url = filenames.first();
        MltXmlChecker checker;
        if (checker.check(url)) {
            if (!isCompatibleWithGpuMode(checker))
                return;
            isXmlRepaired(checker, url);
             
             
            QString localeName = QString(::setlocale(MLT_LC_CATEGORY, nullptr)).toUpper();
             
            bool currentlyUsingLocale = (localeName != "" && localeName != "C" && localeName != "POSIX");
            if (currentlyUsingLocale != checker.usesLocale()) {
                 
                QMessageBox dialog(QMessageBox::Question,
                   qApp->applicationName(),
                   tr("The decimal point of the MLT XML file\nyou want to open is incompatible.\n\n"
                      "Do you want to continue to open this MLT XML file?"),
                   QMessageBox::No |
                   QMessageBox::Yes,
                   this);
                dialog.setWindowModality(QmlApplication::dialogModality());
                dialog.setDefaultButton(QMessageBox::No);
                dialog.setEscapeButton(QMessageBox::No);
                if (dialog.exec() != QMessageBox::Yes)
                    return;
            }
        }
        Settings.setOpenPath(QFileInfo(url).path());
        activateWindow();
        if (filenames.length() > 1)
            m_multipleFiles = filenames;
        if (!MLT.openXML(url)) {
            open(MLT.producer());
            m_recentDock->add(url);
            LOG_INFO() << url;
        }
        else {
            showStatusMessage(tr("Failed to open ") + url);
            emit openFailed(url);
        }
    }
}