Example #1
0
void MainWindow::on_actionChangeConfig_triggered()
{
    // Config manager
    ConfigManager * cmanager;
    cmanager = new ConfigManager();
    cmanager->setWindowFlags (Qt::Window | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
    cmanager->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, cmanager->size(), qApp->desktop()->availableGeometry()));
    QString configPath;
    configPath = cmanager->isPreLoaded();
    cmanager->setAskAgain(askConfigAgain);
    if(cmanager->exec()==QDialog::Accepted)
    {
        configPath = cmanager->currentConfig;
        askConfigAgain = cmanager->askAgain;
        currentConfigDir = (cmanager->askAgain)?"":configPath;
        saveSettings();
        QMessageBox::information(this, tr("Configuration changed"), tr("The Configuration was switched!\nTo start work with new configuration, please restart application."), QMessageBox::Ok);
    }
    delete cmanager;
}
void MainWindow::slot_actionConfigurations_triggered()
{
    ConfigManager *configManager = new ConfigManager(this);
    configManager->exec();
    delete configManager;
}