From aedfab6416e760fef73182379acd70072c6b5de3 Mon Sep 17 00:00:00 2001
From: Adam C Scott <adam.c.scott@gmail.com>
Date: Thu, 17 Sep 2015 07:39:56 -0600
Subject: [PATCH] Display Connection name in Statusbar: Add another
 field in frmMain's statusbar to get the current object's connection
 and display in the field in the status bar.

---
 pgadmin/frm/frmMain.cpp | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/pgadmin/frm/frmMain.cpp b/pgadmin/frm/frmMain.cpp
index d13a9a8..3e77177 100644
--- a/pgadmin/frm/frmMain.cpp
+++ b/pgadmin/frm/frmMain.cpp
@@ -1309,21 +1309,15 @@ void frmMain::EndMsg(bool done)
 		time.Printf(_("%.2f secs"), (timeval / 1000));
 		statusBar->SetStatusText(time, 3);
 
+		// Display the name of the connection for currently selected object
 		wxString connection;
 		if (currentObject)
 		{
-			pgDatabase *db = currentObject->GetDatabase();
+			pgConn *conn = currentObject->GetConnection();
 	   
-			if (db)
-				connection = db->GetServer()->GetDisplayName() + wxT(":") + db->GetDisplayName();
-			else
-			{
-				pgServer *srv = currentObject->GetServer();
-				if (srv)
-					connection = srv->GetDisplayName();
-			}
+			if (conn)
+				connection = conn->GetName();
 		}
-
 		statusBar->SetStatusText(connection,2);
 
 		// Display the 'Done' message
-- 
2.5.2.windows.1

