xpam/mainwindow.cpp
/**
 * @brief MainWindow::checkModeAvailability
 *
 * @param mode_key The mode key to check
 * @param should_warn_user Will redirect user to Warcraft page and show the alert
 * @return
 */


@param mode_key The mode key to check
@param should_warn_user Will redirect user to Warcraft page and show the alert
@return
@param mode_key The mode key to check @param should_warn_user Will redirect user to Warcraft page and show the alert @return
bool MainWindow::checkModeAvailability(QString modeKey, bool shouldWarnUser) {
    if ((modeKey == config->W3_KEY_126 && config->W3PATH_126 != "") ||
        (modeKey == config->W3_KEY_LATEST && config->W3PATH_LATEST != "")) {
        return true;
    }
    if (shouldWarnUser) {
        QString version = config->getW3Version(modeKey);
        status("Please, select the Warcraft " + version + " directory path in order to use this gateway");
        QMessageBox mb(QMessageBox::Critical, "W3 path not set!",
           "Please, select the Warcraft " + version + " directory path in order to use this gateway", QMessageBox::Ok);
        mb.exec();
        ui->tabWidget->setCurrentIndex(2);
        if (modeKey == config->W3_KEY_126) {
            ui->pushButton_war126Path->setFocus();
        } else {
            ui->pushButton_warLatestPath->setFocus();
        }
    }
    return false;
}
bool MainWindow :: checkModeAvailability ( QString modeKey , bool shouldWarnUser ) { if ( ( modeKey == config -> W3_KEY_126 && config -> W3PATH_126 != " " ) || ( modeKey == config -> W3_KEY_LATEST && config -> W3PATH_LATEST != " " ) ) { return true ; } if ( shouldWarnUser ) { QString version = config -> getW3Version ( modeKey ) ; status ( " " + version + " " ) ; QMessageBox mb ( QMessageBox :: Critical , " " , " " + version + " " , QMessageBox :: Ok ) ; mb . exec ( ) ; ui -> tabWidget -> setCurrentIndex ( 2 ) ; if ( modeKey == config -> W3_KEY_126 ) { ui -> pushButton_war126Path -> setFocus ( ) ; } else { ui -> pushButton_warLatestPath -> setFocus ( ) ; } } return false ; }
@brief MainWindow::checkModeAvailability
@brief MainWindow :: checkModeAvailability
// Go to W3 tab
