Better error reporting of problems during catalog load.
This commit is contained in:
parent
2a29bed75e
commit
c37e9eccb8
2 changed files with 24 additions and 15 deletions
|
|
@ -55,20 +55,26 @@ QueryTab *MainWindow::GetActiveQueryTab()
|
|||
void MainWindow::setConfig(const ConnectionConfig &config)
|
||||
{
|
||||
m_config = config;
|
||||
auto res = OpenDatabase::createOpenDatabase(config);
|
||||
if (res.valid()) {
|
||||
m_database = res.get();
|
||||
try {
|
||||
auto res = OpenDatabase::createOpenDatabase(config);
|
||||
if (res.valid()) {
|
||||
m_database = res.get();
|
||||
}
|
||||
QString title = "pglab - ";
|
||||
title += m_config.name().c_str();
|
||||
setWindowTitle(title);
|
||||
|
||||
auto tt = new TablesPage(this);
|
||||
tt->setCatalog(m_database->catalogue());
|
||||
ui->tabWidget->addTab(tt, "Tables");
|
||||
ui->tabWidget->setCurrentWidget(tt);
|
||||
|
||||
newSqlPage();
|
||||
} catch (std::runtime_error &ex) {
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(QString::fromUtf8(ex.what()));
|
||||
msgBox.exec();
|
||||
}
|
||||
QString title = "pglab - ";
|
||||
title += m_config.name().c_str();
|
||||
setWindowTitle(title);
|
||||
|
||||
auto tt = new TablesPage(this);
|
||||
tt->setCatalog(m_database->catalogue());
|
||||
ui->tabWidget->addTab(tt, "Tables");
|
||||
ui->tabWidget->setCurrentWidget(tt);
|
||||
|
||||
newSqlPage();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionLoad_SQL_triggered()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue