Skip to content
Permalink
Browse files
use messagebar to report test connection results in the Add new Oracle
connection dialog
  • Loading branch information
alexbruy committed May 23, 2017
1 parent 1f8d1e7 commit a49c17538c984b394161998bbca0ae0b9d5ad554
Showing with 17 additions and 10 deletions.
  1. +5 −7 src/providers/oracle/qgsoraclenewconnection.cpp
  2. +12 −3 src/ui/qgsoraclenewconnectionbase.ui
@@ -150,23 +150,21 @@ void QgsOracleNewConnection::on_btnConnect_clicked()
if ( conn )
{
// Database successfully opened; we can now issue SQL commands.
QMessageBox::information( this,
tr( "Test connection" ),
tr( "Connection to %1 was successful" ).arg( txtDatabase->text() ) );

bar->pushMessage( tr( "Connection to %1 was successful" ).arg( txtDatabase->text() ),
QgsMessageBar::INFO );
// free connection resources
QgsOracleConnPool::instance()->releaseConnection( conn );
}
else
{
QMessageBox::information( this,
tr( "Test connection" ),
tr( "Connection failed - consult message log for details.\n\n" ) );
bar->pushMessage( tr( "Connection failed - consult message log for details." ),
QgsMessageBar::WARNING );
}
}

//! End Autoconnected SLOTS *

QgsOracleNewConnection::~QgsOracleNewConnection()
{
delete bar;
}
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>400</width>
<height>513</height>
<height>529</height>
</rect>
</property>
<property name="sizePolicy">
@@ -41,14 +41,14 @@
<property name="spacing">
<number>6</number>
</property>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="0" column="0">
<item row="1" column="0">
<widget class="QGroupBox" name="GroupBox1">
<property name="title">
<string>Connection Information</string>
@@ -277,6 +277,9 @@
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QgsMessageBar" name="bar" native="true"/>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
@@ -286,6 +289,12 @@
<extends>QLineEdit</extends>
<header>qgspasswordlineedit.h</header>
</customwidget>
<customwidget>
<class>QgsMessageBar</class>
<extends>QWidget</extends>
<header>qgsmessagebar.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>txtName</tabstop>

0 comments on commit a49c175

Please sign in to comment.