Subversion Repositories tpanel

Rev

Rev 399 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 399 Rev 401
Line 610... Line 610...
610
#endif
610
#endif
611
    gPageManager->regDownloadSurface(bind(&MainWindow::_downloadSurface, this, std::placeholders::_1, std::placeholders::_2));
611
    gPageManager->regDownloadSurface(bind(&MainWindow::_downloadSurface, this, std::placeholders::_1, std::placeholders::_2));
612
    gPageManager->regDisplayMessage(bind(&MainWindow::_displayMessage, this, std::placeholders::_1, std::placeholders::_2));
612
    gPageManager->regDisplayMessage(bind(&MainWindow::_displayMessage, this, std::placeholders::_1, std::placeholders::_2));
613
    gPageManager->regAskPassword(bind(&MainWindow::_askPassword, this, std::placeholders::_1,
613
    gPageManager->regAskPassword(bind(&MainWindow::_askPassword, this, std::placeholders::_1,
614
                                      std::placeholders::_2,
614
                                      std::placeholders::_2,
-
 
615
                                      std::placeholders::_3,
-
 
616
                                      std::placeholders::_4,
615
                                      std::placeholders::_3));
617
                                      std::placeholders::_5));
616
    gPageManager->regFileDialogFunction(bind(&MainWindow::_fileDialog, this,
618
    gPageManager->regFileDialogFunction(bind(&MainWindow::_fileDialog, this,
617
                                             std::placeholders::_1,
619
                                             std::placeholders::_1,
618
                                             std::placeholders::_2,
620
                                             std::placeholders::_2,
619
                                             std::placeholders::_3,
621
                                             std::placeholders::_3,
620
                                             std::placeholders::_4));
622
                                             std::placeholders::_4));
Line 2318... Line 2320...
2318
    msgBox.setWindowModality(Qt::WindowModality::ApplicationModal);
2320
    msgBox.setWindowModality(Qt::WindowModality::ApplicationModal);
2319
    msgBox.addButton(QMessageBox::Ok);
2321
    msgBox.addButton(QMessageBox::Ok);
2320
    msgBox.exec();
2322
    msgBox.exec();
2321
}
2323
}
2322
 
2324
 
2323
void MainWindow::askPassword(ulong handle, const string msg, const string& title)
2325
void MainWindow::askPassword(ulong handle, const string msg, const string& title, int x, int y)
2324
{
2326
{
2325
    DECL_TRACER("MainWindow::askPassword(const string msg, const string& title)");
2327
    DECL_TRACER("MainWindow::askPassword(const string msg, const string& title, int x, int y)");
2326
 
2328
 
2327
    TQtInputLine *inputLine = new TQtInputLine(this);
2329
    TQtInputLine *inputLine = new TQtInputLine(this);
2328
    inputLine->setMessage(msg);
2330
    inputLine->setMessage(msg);
2329
    inputLine->setWindowTitle(title.c_str());
2331
    inputLine->setWindowTitle(title.c_str());
2330
    inputLine->setWindowModality(Qt::WindowModality::ApplicationModal);
2332
    inputLine->setWindowModality(Qt::WindowModality::ApplicationModal);
Line 2332... Line 2334...
2332
    int bt = inputLine->exec();
2334
    int bt = inputLine->exec();
2333
 
2335
 
2334
    if (bt == QDialog::Rejected)
2336
    if (bt == QDialog::Rejected)
2335
    {
2337
    {
2336
        if (gPageManager)
2338
        if (gPageManager)
2337
            gPageManager->callSetPassword(handle, "");
2339
            gPageManager->callSetPassword(handle, "", x, y);
2338
 
2340
 
2339
        delete inputLine;
2341
        delete inputLine;
2340
        return;
2342
        return;
2341
    }
2343
    }
2342
 
2344
 
2343
    if (gPageManager)
2345
    if (gPageManager)
2344
        gPageManager->callSetPassword(handle, inputLine->getText());
2346
        gPageManager->callSetPassword(handle, inputLine->getText(), x, y);
2345
 
2347
 
2346
    delete inputLine;
2348
    delete inputLine;
2347
}
2349
}
2348
 
2350
 
2349
void MainWindow::fileDialog(ulong handle, const string &path, const std::string& extension, const std::string& suffix)
2351
void MainWindow::fileDialog(ulong handle, const string &path, const std::string& extension, const std::string& suffix)
Line 3305... Line 3307...
3305
 
3307
 
3306
    if (mHasFocus)
3308
    if (mHasFocus)
3307
        emit sigDisplayMessage(msg, title);
3309
        emit sigDisplayMessage(msg, title);
3308
}
3310
}
3309
 
3311
 
3310
void MainWindow::_askPassword(ulong handle, const string& msg, const string& title)
3312
void MainWindow::_askPassword(ulong handle, const string& msg, const string& title, int x, int y)
3311
{
3313
{
3312
    DECL_TRACER("MainWindow::_askPassword(ulong handle, const string& msg, const string& title)");
3314
    DECL_TRACER("MainWindow::_askPassword(ulong handle, const string& msg, const string& title, int x int y)");
3313
 
3315
 
3314
    if (mHasFocus)
3316
    if (mHasFocus)
3315
        emit sigAskPassword(handle, msg, title);
3317
        emit sigAskPassword(handle, msg, title, x, y);
3316
}
3318
}
3317
 
3319
 
3318
void MainWindow::_fileDialog(ulong handle, const string &path, const std::string& extension, const std::string& suffix)
3320
void MainWindow::_fileDialog(ulong handle, const string &path, const std::string& extension, const std::string& suffix)
3319
{
3321
{
3320
    DECL_TRACER("MainWindow::_fileDialog(ulong handle, const string &path, const std::string& extension, const std::string& suffix)");
3322
    DECL_TRACER("MainWindow::_fileDialog(ulong handle, const string &path, const std::string& extension, const std::string& suffix)");
Line 5842... Line 5844...
5842
#endif  // #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
5844
#endif  // #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
5843
 
5845
 
5844
#endif  // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
5846
#endif  // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
5845
    mMediaPlayer->play();
5847
    mMediaPlayer->play();
5846
#if TESTMODE == 1
5848
#if TESTMODE == 1
5847
    QMediaPlayer::Error err = QMediaPlayer::NoError;
-
 
5848
 
-
 
5849
    if ((err = mMediaPlayer->error()) != QMediaPlayer::NoError)
5849
    if (mMediaPlayer->error() != QMediaPlayer::NoError)
5850
    {
5850
    {
5851
        MSG_ERROR("Error playing \"" << file << "\": " << mMediaPlayer->errorString().toStdString());
5851
        MSG_ERROR("Error playing \"" << file << "\": " << mMediaPlayer->errorString().toStdString());
5852
    }
5852
    }
5853
    else
5853
    else
5854
        __success = true;
5854
        __success = true;