From 892a5a6afc0ad1f97e31c5302aa870e509c8bae0 Mon Sep 17 00:00:00 2001 From: Adam C Scott Date: Mon, 14 Sep 2015 13:16:46 -0600 Subject: [PATCH] Display Connection and Database in Statusbar: Add another field in frmMain's statusbar to get the current object's connection and database and display in the field in the status bar. --- pgadmin/frm/frmMain.cpp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/pgadmin/frm/frmMain.cpp b/pgadmin/frm/frmMain.cpp index 12a9e1e..d13a9a8 100644 --- a/pgadmin/frm/frmMain.cpp +++ b/pgadmin/frm/frmMain.cpp @@ -492,13 +492,13 @@ void frmMain::CreateMenus() treeContextMenu = 0; // Status bar - statusBar = CreateStatusBar(3); - int iWidths[3] = {0, -1, 100}; - SetStatusWidths(3, iWidths); + statusBar = CreateStatusBar(4); + int iWidths[4] = {0, -1, 400, 100}; + SetStatusWidths(4, iWidths); SetStatusBarPane(-1); statusBar->SetStatusText(wxT(""), 0); statusBar->SetStatusText(_("Ready."), 1); - statusBar->SetStatusText(_("0 Secs"), 2); + statusBar->SetStatusText(_("0 Secs"), 3); wxAcceleratorEntry entries[4]; entries[0].Set(wxACCEL_NORMAL, WXK_F5, refFact->GetId()); @@ -1307,7 +1307,24 @@ void frmMain::EndMsg(bool done) float timeval = stopwatch.Time(); wxString time; time.Printf(_("%.2f secs"), (timeval / 1000)); - statusBar->SetStatusText(time, 2); + statusBar->SetStatusText(time, 3); + + wxString connection; + if (currentObject) + { + pgDatabase *db = currentObject->GetDatabase(); + + if (db) + connection = db->GetServer()->GetDisplayName() + wxT(":") + db->GetDisplayName(); + else + { + pgServer *srv = currentObject->GetServer(); + if (srv) + connection = srv->GetDisplayName(); + } + } + + statusBar->SetStatusText(connection,2); // Display the 'Done' message if (done) -- 2.5.2.windows.1