Beispiel #1
0
SEGSAdminTool::SEGSAdminTool(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::SEGSAdminTool)
{
    ui->setupUi(this);
    QFont dejavu_font;
    dejavu_font.setFamily("DejaVu Sans Condensed");
    dejavu_font.setPointSize(12);
    ui->output->setFont(dejavu_font);
    ui->output->appendPlainText("*** Welcome to SEGSAdmin ***");
    m_add_user_dialog = new AddNewUserDialog(this);
    m_set_up_data = new SetUpData(this);
    m_settings_dialog = new SettingsDialog(this);
    m_generate_config_dialog = new GenerateConfigFileDialog(this);

    // SEGSAdminTool Signals
    connect(this,&SEGSAdminTool::checkForDB,this,&SEGSAdminTool::check_db_exist);
    connect(this,&SEGSAdminTool::addAdminUser,m_add_user_dialog,&AddNewUserDialog::on_add_admin_user);
    connect(this,&SEGSAdminTool::checkForConfigFile,this,&SEGSAdminTool::check_for_config_file);
    connect(this,&SEGSAdminTool::getMapsDirConfigCheck,m_settings_dialog,&SettingsDialog::send_maps_dir_config_check); // May be a much better way to do this, but this works for now
    connect(this,&SEGSAdminTool::readyToRead,m_settings_dialog,&SettingsDialog::read_config_file);
    connect(ui->createUser,&QPushButton::clicked,m_add_user_dialog,&AddNewUserDialog::on_add_user);
    connect(ui->runDBTool,&QPushButton::clicked,this,&SEGSAdminTool::check_db_exist);
    connect(ui->set_up_data_button,&QPushButton::clicked,m_set_up_data,&SetUpData::open_data_dialog);
    connect(ui->settings_button,&QPushButton::clicked,m_settings_dialog,&SettingsDialog::open_settings_dialog);
    connect(ui->gen_config_file,&QPushButton::clicked,m_generate_config_dialog,&GenerateConfigFileDialog::on_generate_config_file);
    connect(ui->authserver_start,&QPushButton::clicked,this,&SEGSAdminTool::is_server_running);

    // GenerateConfigFileDialog Signals
    connect(m_generate_config_dialog,&GenerateConfigFileDialog::sendInputConfigFile,m_settings_dialog,&SettingsDialog::generate_default_config_file);

    // AddNewUserDialog Signals
    connect(m_add_user_dialog,&AddNewUserDialog::sendInput,this,&SEGSAdminTool::commit_user);

    // SetUpData Signals
    connect(m_set_up_data,&SetUpData::dataSetupComplete,this,&SEGSAdminTool::check_data_and_dir);
    connect(m_set_up_data,&SetUpData::getMapsDir,m_settings_dialog,&SettingsDialog::send_maps_dir);

    // SettingsDialog Signals
    connect(m_settings_dialog,&SettingsDialog::checkForConfigFile,this,&SEGSAdminTool::check_for_config_file);
    connect(m_settings_dialog,&SettingsDialog::check_data_and_dir,this,&SEGSAdminTool::check_data_and_dir);
    connect(m_settings_dialog,&SettingsDialog::sendMapsDirConfigCheck,this,&SEGSAdminTool::check_data_and_dir);
    connect(m_settings_dialog,&SettingsDialog::sendMapsDir,m_set_up_data,&SetUpData::create_default_directory);

    // Send startup signals
    emit checkForConfigFile();
    emit check_db_exist(true);
    emit getMapsDirConfigCheck();
}
Beispiel #2
0
SEGSAdminTool::SEGSAdminTool(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::SEGSAdminTool)
{
    ui->setupUi(this);
    ui->update_detail->setEnabled(false);
    QFont dejavu_font;
    dejavu_font.setFamily("DejaVu Sans Condensed");
    dejavu_font.setPointSize(12);
    ui->output->setFont(dejavu_font);
    ui->update_detail->setFont(dejavu_font);
    ui->output->appendPlainText("*** Welcome to SEGSAdmin ***");
    ui->segs_admin_version->setText(QString("v") + VersionInfo::getAuthVersionNumber());
    m_add_user_dialog = new AddNewUserDialog(this);
    m_set_up_data = new SetUpData(this);
    m_settings_dialog = new SettingsDialog(this);
    m_generate_config_dialog = new GenerateConfigFileDialog(this);
    m_network_manager = new NetworkManager();
    m_update_dialog = new UpdateDetailDialog(this);
    m_about_dialog = new AboutDialog(this);
    m_script_dialog = new SelectScriptDialog(this);

    // SEGSAdminTool Signals
    connect(this,&SEGSAdminTool::checkForDB,this,&SEGSAdminTool::check_db_exist);
    connect(this,&SEGSAdminTool::addAdminUser,m_add_user_dialog,&AddNewUserDialog::on_add_admin_user);
    connect(this,&SEGSAdminTool::checkForConfigFile,this,&SEGSAdminTool::check_for_config_file);
    connect(this,&SEGSAdminTool::getMapsDirConfigCheck,m_settings_dialog,&SettingsDialog::send_maps_dir_config_check); // May be a much better way to do this, but this works for now
    connect(this,&SEGSAdminTool::readyToRead,m_settings_dialog,&SettingsDialog::read_config_file);
    connect(this,&SEGSAdminTool::checkConfigVersion,this,&SEGSAdminTool::check_config_version);
    connect(this,&SEGSAdminTool::recreateConfig,m_generate_config_dialog,&GenerateConfigFileDialog::on_generate_config_file);
    connect(ui->actionAbout,&QAction::triggered,m_about_dialog,&AboutDialog::show_ui);
    connect(ui->update_detail,&QPushButton::clicked,m_update_dialog,&UpdateDetailDialog::show_update);
    connect(ui->createUser,&QPushButton::clicked,m_add_user_dialog,&AddNewUserDialog::on_add_user);
    connect(ui->runDBTool,&QPushButton::clicked,this,&SEGSAdminTool::check_db_exist);
    connect(ui->set_up_data_button,&QPushButton::clicked,m_set_up_data,&SetUpData::open_data_dialog);
    connect(ui->settings_button,&QPushButton::clicked,m_settings_dialog,&SettingsDialog::open_settings_dialog);
    connect(ui->gen_config_file,&QPushButton::clicked,m_generate_config_dialog,&GenerateConfigFileDialog::on_generate_config_file);
    connect(ui->authserver_start,&QPushButton::clicked,this,&SEGSAdminTool::is_server_running);
    connect(ui->motd_editor,&QPushButton::clicked,m_script_dialog,&SelectScriptDialog::show_dialog);

    // GenerateConfigFileDialog Signals
    connect(m_generate_config_dialog,&GenerateConfigFileDialog::sendInputConfigFile,m_settings_dialog,&SettingsDialog::generate_default_config_file);

    // AddNewUserDialog Signals
    connect(m_add_user_dialog,&AddNewUserDialog::sendInput,this,&SEGSAdminTool::commit_user);

    // SetUpData Signals
    connect(m_set_up_data,&SetUpData::dataSetupComplete,this,&SEGSAdminTool::check_data_and_dir);
    connect(m_set_up_data,&SetUpData::getMapsDir,m_settings_dialog,&SettingsDialog::send_maps_dir);

    // SettingsDialog Signals
    connect(m_settings_dialog,&SettingsDialog::checkForConfigFile,this,&SEGSAdminTool::check_for_config_file);
    connect(m_settings_dialog,&SettingsDialog::check_data_and_dir,this,&SEGSAdminTool::check_data_and_dir);
    connect(m_settings_dialog,&SettingsDialog::sendMapsDirConfigCheck,this,&SEGSAdminTool::check_data_and_dir);
    connect(m_settings_dialog,&SettingsDialog::sendMapsDir,m_set_up_data,&SetUpData::create_default_directory);

    // Network Manager Signals
    connect(this,&SEGSAdminTool::getLatestReleases,m_network_manager,&NetworkManager::get_latest_releases);
    connect(m_network_manager,&NetworkManager::releasesReadyToRead,this,&SEGSAdminTool::read_release_info);

    // Send startup signals
    emit checkForConfigFile();
    emit check_db_exist(true);
    emit getMapsDirConfigCheck();
    emit getLatestReleases();

}