// Load the realm list from the database
void RealmList::Initialize(uint32 updateInterval)
{
    m_UpdateInterval = updateInterval;

    // Get the content of the realmlist table in the database
    UpdateRealms(true);
}
Example #2
0
// Load the realm list from the database
void RealmList::Initialize(boost::asio::io_service& ioService, uint32 updateInterval)
{
    _resolver = new boost::asio::ip::tcp::resolver(ioService);
    m_UpdateInterval = updateInterval;

    // Get the content of the realmlist table in the database
    UpdateRealms(true);
}
Example #3
0
// Load the realm list from the database
void RealmList::Initialize(boost::asio::io_service& ioService, uint32 updateInterval)
{
	_updateInterval = updateInterval;
	_updateTimer = new boost::asio::deadline_timer(ioService);
	_resolver = new boost::asio::ip::tcp::resolver(ioService);

	// Get the content of the realmlist table in the database
	UpdateRealms(true, boost::system::error_code());
}
Example #4
0
void SettingsForm::on_addButton_clicked()
{
    Realm realm;
    realm.realmName = "";
    realm.realmUrl  = "";

    settings->addRealm(realm);
    settings->SaveSettings();
    UpdateRealms();
    emit RealmsChanged();
}
Example #5
0
void SettingsForm::on_deleteButton_clicked()
{
    int index = ui->realmsTable->currentRow();
    if (index < 0 || index >= settings->getRealms().size())
        return;

    settings->removeRealm(index);
    settings->SaveSettings();

    UpdateRealms();
    emit RealmsChanged();
}
Example #6
0
void RealmList::UpdateIfNeed() {
	// maybe disabled or updated recently
	if (!m_UpdateInterval || m_NextUpdateTime > time(NULL))
		return;

	m_NextUpdateTime = time(NULL) + m_UpdateInterval;

	// Clears Realm list
	m_realms.clear();

	// Get the content of the realmlist table in the database
	UpdateRealms();
}
Example #7
0
void SettingsForm::on_realmsTable_cellChanged(int row, int column)
{
    QString checkingText = (column) ? settings->getRealms().at(row).realmUrl :
                                      settings->getRealms().at(row).realmName;
    if (ui->realmsTable->item(row, column)->text() == checkingText)
        return;

    Realm realm;
    realm.realmName = ui->realmsTable->item(row,0)->text();
    realm.realmUrl  = ui->realmsTable->item(row,1)->text();
    settings->setRealmAt(realm, row);
    settings->SaveSettings();
    UpdateRealms();
    emit RealmsChanged();
}
Example #8
0
void SettingsForm::LoadSettings()
{
    if (!haveSettings)
        return;

    ui->gamePath->setText(settings->getGamePath());

    ui->cacheCheck->setChecked(settings->getIsCleanCache());
    ui->wtfCheck->setChecked(settings->getIsCleanWtf());
    ui->exitCheck->setChecked(settings->getExitAfterStart());

    ui->forum1->setText(settings->getForumView1());
    ui->forum2->setText(settings->getForumView2());
    ui->forum3->setText(settings->getForumView3());

    ui->updateTime->setValue(settings->getUpdateTime());
    UpdateRealms();
}