MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / on_pbTest_clicked

Method on_pbTest_clicked

Src/Database/ParameterDatabaseUI.cpp:207–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207void CParameterDatabaseUI::on_pbTest_clicked()
208{
209 CParameterDatabase dbPara;
210 dbPara.SetType(ui->cbType->currentText());
211 dbPara.SetDatabaseName(ui->leDatabaseName->text());
212 dbPara.SetOptions(ui->leOptions->text());
213 if(!CheckValidity(true))
214 return;
215 ui->wNet->Accept();
216 dbPara.m_Net = m_Net;
217 CDatabase db;
218 bool bRet = db.OpenDatabase(&dbPara);
219 if(bRet) {
220 bRet = db.IsOpen();
221 }
222 if(bRet)
223 QMessageBox::information(this, tr("Test"), tr("Test is successfully!"));
224 else
225 QMessageBox::critical(this, tr("Test"),
226 tr("Test is failed!") + "\n\n"
227 + db.GetError());
228 db.CloseDatabase();
229}
230

Callers

nothing calls this directly

Calls 8

SetDatabaseNameMethod · 0.80
SetOptionsMethod · 0.80
OpenDatabaseMethod · 0.80
GetErrorMethod · 0.80
CloseDatabaseMethod · 0.80
SetTypeMethod · 0.45
AcceptMethod · 0.45
IsOpenMethod · 0.45

Tested by

no test coverage detected