// 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); }
// 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); }
// 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()); }
void SettingsForm::on_addButton_clicked() { Realm realm; realm.realmName = ""; realm.realmUrl = ""; settings->addRealm(realm); settings->SaveSettings(); UpdateRealms(); emit RealmsChanged(); }
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(); }
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(); }
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(); }
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(); }