Connection manager can now open a query window for selected connection.

Query window has now buttons with icons made in the designer for better looks.
Depending on received responses from the database the tabcontrol with the message, data and explain tab
now switches to the appropriate tab.
This commit is contained in:
Eelke Klein 2017-01-15 21:01:40 +01:00
parent 88fcc0338d
commit d19741f111
26 changed files with 408 additions and 116 deletions

View file

@ -53,7 +53,6 @@ std::vector<const char*> ConnectionConfig::s_keywords = {
ConnectionConfig::ConnectionConfig()
: m_applicationName(QCoreApplication::applicationName().toUtf8().data())
, m_values(s_keywords.size(), nullptr)
{}
void ConnectionConfig::setName(std::string desc)
@ -69,7 +68,6 @@ const std::string& ConnectionConfig::name() const
void ConnectionConfig::setHost(std::string host)
{
m_host = std::move(host);
m_values[0] = valuePtr(m_host);
}
const std::string& ConnectionConfig::host() const
@ -80,7 +78,6 @@ const std::string& ConnectionConfig::host() const
void ConnectionConfig::setHostAddr(std::string v)
{
m_hostaddr = std::move(v);
m_values[1] = valuePtr(m_hostaddr);
}
const std::string& ConnectionConfig::hostAddr() const
@ -91,7 +88,6 @@ const std::string& ConnectionConfig::hostAddr() const
void ConnectionConfig::setPort(unsigned short port)
{
m_port = std::to_string(port);
m_values[2] = valuePtr(m_port);
}
unsigned short ConnectionConfig::port() const
@ -102,7 +98,6 @@ unsigned short ConnectionConfig::port() const
void ConnectionConfig::setUser(std::string v)
{
m_user = std::move(v);
m_values[3] = valuePtr(m_user);
}
const std::string& ConnectionConfig::user() const
@ -113,7 +108,6 @@ const std::string& ConnectionConfig::user() const
void ConnectionConfig::setPassword(std::string v)
{
m_password = std::move(v);
m_values[4] = valuePtr(m_password);
}
const std::string& ConnectionConfig::password() const
@ -124,7 +118,6 @@ const std::string& ConnectionConfig::password() const
void ConnectionConfig::setDbname(std::string v)
{
m_dbname = std::move(v);
m_values[5] = valuePtr(m_dbname);
}
const std::string& ConnectionConfig::dbname() const
@ -135,7 +128,6 @@ const std::string& ConnectionConfig::dbname() const
void ConnectionConfig::setSslMode(SslMode m)
{
m_sslMode = SslModeToString(m);
m_values[6] = valuePtr(m_sslMode);
}
SslMode ConnectionConfig::sslMode() const
@ -146,7 +138,6 @@ SslMode ConnectionConfig::sslMode() const
void ConnectionConfig::setSslCert(std::string v)
{
m_sslCert = std::move(v);
m_values[7] = valuePtr(m_sslCert);
}
const std::string& ConnectionConfig::sslCert() const
@ -157,7 +148,6 @@ const std::string& ConnectionConfig::sslCert() const
void ConnectionConfig::setSslKey(std::string v)
{
m_sslKey = std::move(v);
m_values[8] = valuePtr(m_sslKey);
}
const std::string& ConnectionConfig::sslKey() const
@ -168,7 +158,6 @@ const std::string& ConnectionConfig::sslKey() const
void ConnectionConfig::setSslRootCert(std::string v)
{
m_sslRootCert = std::move(v);
m_values[9] = valuePtr(m_sslRootCert);
}
const std::string& ConnectionConfig::sslRootCert() const
@ -179,7 +168,6 @@ const std::string& ConnectionConfig::sslRootCert() const
void ConnectionConfig::setSslCrl(std::string v)
{
m_sslCrl = std::move(v);
m_values[10] = valuePtr(m_sslCrl);
}
const std::string& ConnectionConfig::sslCrl() const
@ -195,6 +183,18 @@ const char * const * ConnectionConfig::getKeywords() const
const char * const * ConnectionConfig::getValues() const
{
m_values.resize(s_keywords.size(), nullptr);
m_values[0] = valuePtr(m_host);
m_values[1] = valuePtr(m_hostaddr);
m_values[2] = valuePtr(m_port);
m_values[3] = valuePtr(m_user);
m_values[4] = valuePtr(m_password);
m_values[5] = valuePtr(m_dbname);
m_values[6] = valuePtr(m_sslMode);
m_values[7] = valuePtr(m_sslCert);
m_values[8] = valuePtr(m_sslKey);
m_values[9] = valuePtr(m_sslRootCert);
m_values[10] = valuePtr(m_sslCrl);
m_values[11] = "utf8";
m_values[12] = valuePtr(m_applicationName);