Finish 1.5.51

This commit is contained in:
Arin Alexander 2020-05-08 14:19:13 +03:00
commit 88df43bc77
10 changed files with 77 additions and 23 deletions

View File

@ -133,7 +133,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MAJOR = 1
LIMEREPORT_VERSION_MINOR = 5 LIMEREPORT_VERSION_MINOR = 5
LIMEREPORT_VERSION_RELEASE = 50 LIMEREPORT_VERSION_RELEASE = 51
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

View File

@ -118,7 +118,7 @@ ConnectionDesc *ConnectionDialog::uiToConnection(LimeReport::ConnectionDesc* con
result ->setName(ConnectionDesc::connectionNameForReport(ui->leConnectionName->text())); result ->setName(ConnectionDesc::connectionNameForReport(ui->leConnectionName->text()));
result ->setHost(ui->leServerName->text()); result ->setHost(ui->leServerName->text());
if (!ui->lePort->text().isEmpty()) if (!ui->lePort->text().isEmpty())
result->setPort(ui->lePort->text().toInt()); result->setPort(ui->lePort->text());
result ->setDriver(ui->cbbDrivers->currentText()); result ->setDriver(ui->cbbDrivers->currentText());
result ->setUserName(ui->leUserName->text()); result ->setUserName(ui->leUserName->text());
result ->setPassword(ui->lePassword->text()); result ->setPassword(ui->lePassword->text());
@ -141,7 +141,7 @@ void ConnectionDialog::connectionToUI()
ui->cbbDrivers->setCurrentIndex(ui->cbbDrivers->findText(m_connection->driver())); ui->cbbDrivers->setCurrentIndex(ui->cbbDrivers->findText(m_connection->driver()));
ui->cbAutoConnect->setChecked(m_connection->autoconnect()); ui->cbAutoConnect->setChecked(m_connection->autoconnect());
ui->cbbKeepCredentials->setChecked(!m_connection->keepDBCredentials()); ui->cbbKeepCredentials->setChecked(!m_connection->keepDBCredentials());
ui->lePort->setText(m_connection->port()!=-1?QString::number(m_connection->port()):""); ui->lePort->setText(m_connection->port());
} }
void ConnectionDialog::on_toolButton_clicked() void ConnectionDialog::on_toolButton_clicked()
@ -160,6 +160,10 @@ void ConnectionDialog::on_cbbUseDefaultConnection_toggled(bool checked)
ui->leConnectionName->setEnabled(true); ui->leConnectionName->setEnabled(true);
} }
} }
void ConnectionDialog::on_toolButton_2_toggled(bool checked)
{
ui->lePassword->setEchoMode(checked ? QLineEdit::Normal : QLineEdit::Password);
}
} // namespace LimeReport } // namespace LimeReport
@ -167,3 +171,5 @@ void ConnectionDialog::on_cbbUseDefaultConnection_toggled(bool checked)

View File

@ -60,6 +60,8 @@ private slots:
void on_toolButton_clicked(); void on_toolButton_clicked();
void on_cbbUseDefaultConnection_toggled(bool checked); void on_cbbUseDefaultConnection_toggled(bool checked);
void on_toolButton_2_toggled(bool checked);
private: private:
Ui::ConnectionDialog *ui; Ui::ConnectionDialog *ui;
ConnectionDesc* m_connection; ConnectionDesc* m_connection;

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>420</width> <width>420</width>
<height>323</height> <height>363</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -44,7 +44,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_5">
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
@ -114,14 +114,39 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="lePassword"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="text"> <property name="spacing">
<string/> <number>2</number>
</property> </property>
<property name="echoMode"> <item>
<enum>QLineEdit::Password</enum> <widget class="QLineEdit" name="lePassword">
</property> <property name="text">
</widget> <string/>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_2">
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="lrdatabrowser.qrc">
<normaloff>:/databrowser/images/closed_eye.png</normaloff>
<normalon>:/databrowser/images/eye.png</normalon>:/databrowser/images/closed_eye.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
@ -137,6 +162,9 @@
</item> </item>
<item> <item>
<widget class="QToolButton" name="toolButton"> <widget class="QToolButton" name="toolButton">
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="text"> <property name="text">
<string>...</string> <string>...</string>
</property> </property>
@ -221,8 +249,24 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<tabstops>
<tabstop>leConnectionName</tabstop>
<tabstop>cbbUseDefaultConnection</tabstop>
<tabstop>cbbDrivers</tabstop>
<tabstop>leServerName</tabstop>
<tabstop>lePort</tabstop>
<tabstop>leUserName</tabstop>
<tabstop>lePassword</tabstop>
<tabstop>leDataBase</tabstop>
<tabstop>cbAutoConnect</tabstop>
<tabstop>cbbKeepCredentials</tabstop>
<tabstop>pbCheckConnection</tabstop>
<tabstop>pbCancel</tabstop>
<tabstop>pbOk</tabstop>
</tabstops>
<resources> <resources>
<include location="lrdatabrowser.qrc"/> <include location="lrdatabrowser.qrc"/>
<include location="lrdatabrowser.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>

View File

@ -44,5 +44,7 @@
<file alias="/images/value_edit">images/value_edit2.png</file> <file alias="/images/value_edit">images/value_edit2.png</file>
<file alias="/images/value">images/value1.png</file> <file alias="/images/value">images/value1.png</file>
<file alias="/images/varToReport">images/varToReport.png</file> <file alias="/images/varToReport">images/varToReport.png</file>
<file>images/eye.png</file>
<file>images/closed_eye.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -336,13 +336,13 @@ void ModelToDataSource::slotModelDestroed()
ConnectionDesc::ConnectionDesc(QSqlDatabase db, QObject *parent) ConnectionDesc::ConnectionDesc(QSqlDatabase db, QObject *parent)
: QObject(parent), m_connectionName(db.connectionName()), m_connectionHost(db.hostName()), m_connectionDriver(db.driverName()), : QObject(parent), m_connectionName(db.connectionName()), m_connectionHost(db.hostName()), m_connectionDriver(db.driverName()),
m_databaseName(db.databaseName()), m_user(db.userName()), m_password(db.password()), m_port(-1), m_autoconnect(false), m_databaseName(db.databaseName()), m_user(db.userName()), m_password(db.password()), m_port(""), m_autoconnect(false),
m_internal(false), m_keepDBCredentials(true) m_internal(false), m_keepDBCredentials(true)
{} {}
ConnectionDesc::ConnectionDesc(QObject *parent) ConnectionDesc::ConnectionDesc(QObject *parent)
:QObject(parent),m_connectionName(""),m_connectionHost(""), m_connectionDriver(""), :QObject(parent),m_connectionName(""),m_connectionHost(""), m_connectionDriver(""),
m_databaseName(""), m_user(""), m_password(""), m_port(-1), m_autoconnect(false), m_databaseName(""), m_user(""), m_password(""), m_port(""), m_autoconnect(false),
m_internal(false), m_keepDBCredentials(true) m_internal(false), m_keepDBCredentials(true)
{} {}
@ -377,12 +377,12 @@ QString ConnectionDesc::connectionNameForReport(const QString &connectionName)
return connectionName.compare(tr("defaultConnection")) == 0 ? QSqlDatabase::defaultConnection : connectionName; return connectionName.compare(tr("defaultConnection")) == 0 ? QSqlDatabase::defaultConnection : connectionName;
} }
int ConnectionDesc::port() const QString ConnectionDesc::port() const
{ {
return m_port; return m_port;
} }
void ConnectionDesc::setPort(int port) void ConnectionDesc::setPort(QString port)
{ {
m_port = port; m_port = port;
} }

View File

@ -78,7 +78,7 @@ class ConnectionDesc : public QObject{
Q_PROPERTY(QString host READ host WRITE setHost) Q_PROPERTY(QString host READ host WRITE setHost)
Q_PROPERTY(bool autoconnect READ autoconnect WRITE setAutoconnect) Q_PROPERTY(bool autoconnect READ autoconnect WRITE setAutoconnect)
Q_PROPERTY(bool keepDBCredentials READ keepDBCredentials WRITE setKeepDBCredentials) Q_PROPERTY(bool keepDBCredentials READ keepDBCredentials WRITE setKeepDBCredentials)
Q_PROPERTY(int port READ port WRITE setPort) Q_PROPERTY(QString port READ port WRITE setPort)
public: public:
typedef QSharedPointer<ConnectionDesc> Ptr; typedef QSharedPointer<ConnectionDesc> Ptr;
ConnectionDesc(QSqlDatabase db, QObject* parent=0); ConnectionDesc(QSqlDatabase db, QObject* parent=0);
@ -103,8 +103,8 @@ public:
void setInternal(bool value) {m_internal = value;} void setInternal(bool value) {m_internal = value;}
bool keepDBCredentials() const; bool keepDBCredentials() const;
void setKeepDBCredentials(bool keepDBCredentials); void setKeepDBCredentials(bool keepDBCredentials);
int port() const; QString port() const;
void setPort(int port); void setPort(QString port);
public: public:
static QString connectionNameForUser(const QString& connectionName); static QString connectionNameForUser(const QString& connectionName);
static QString connectionNameForReport(const QString& connectionName); static QString connectionNameForReport(const QString& connectionName);
@ -117,7 +117,7 @@ private:
QString m_databaseName; QString m_databaseName;
QString m_user; QString m_user;
QString m_password; QString m_password;
int m_port; QString m_port;
bool m_autoconnect; bool m_autoconnect;
bool m_internal; bool m_internal;
bool m_keepDBCredentials; bool m_keepDBCredentials;

View File

@ -808,12 +808,12 @@ bool DataSourceManager::initAndOpenDB(QSqlDatabase& db, ConnectionDesc& connecti
bool connected = false; bool connected = false;
db.setHostName(replaceVariables(connectionDesc.host())); db.setHostName(replaceVariables(connectionDesc.host()));
db.setUserName(replaceVariables(connectionDesc.userName())); db.setUserName(replaceVariables(connectionDesc.userName()));
db.setPassword(replaceVariables(connectionDesc.password())); db.setPassword(replaceVariables(connectionDesc.password()));
if (connectionDesc.port()!=-1) db.setDatabaseName(replaceVariables(connectionDesc.databaseName()));
db.setPort(connectionDesc.port()); if (connectionDesc.port()!="")
db.setPort(replaceVariables(connectionDesc.port()).toInt());
if (!connectionDesc.keepDBCredentials() && m_dbCredentialsProvider){ if (!connectionDesc.keepDBCredentials() && m_dbCredentialsProvider){
if (!m_dbCredentialsProvider->getUserName(connectionDesc.name()).isEmpty()) if (!m_dbCredentialsProvider->getUserName(connectionDesc.name()).isEmpty())