public inbox for [email protected]  
help / color / mirror / Atom feed
From: Adam Scott <[email protected]>
To: Dave Page <[email protected]>
Cc: Magnus Hagander <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: Patch: New field in frmMain statusbar
Date: Thu, 17 Sep 2015 07:47:03 -0600
Message-ID: <CA+s62-M+TM-TDhUJoz5ap0D2ZLWymXGx9Lnh+cj+E8mSmcmXLA@mail.gmail.com> (raw)
In-Reply-To: <CA+OCxowaBvS3szDk4Jc0F=nSkDG52JWguFpSc1BgPZ9xgbzeXA@mail.gmail.com>
References: <CA+s62-Ous9Dr7EFGfwEh-N7xZGh8f173uUU=VbzzgV9crVD4NQ@mail.gmail.com>
	<CA+OCxoxnayiMBczvgwCSvd8vLdJ6zjjAU+Sb68bE+h5JbYH5CA@mail.gmail.com>
	<CABUevEwiW5FJuOp2-eBBWvAURnRV5xDiR6N8ET4juWatLPWsdA@mail.gmail.com>
	<CA+s62-PDmPApuCvzAziewCtZnDD1sAkOwnnwW6odhWaXE2hF+w@mail.gmail.com>
	<CABUevEzVwKWKwOajTSWnC2+8CpcOtp-dYPyYOMEj31eaUXNkAg@mail.gmail.com>
	<CA+OCxox1Ky8VXLEzLNoFj77_V5u=hbjnnvffELk1dicazm=s2A@mail.gmail.com>
	<CABUevEwmoneWk9-n1uJeTxtr7KYzHBmbWEfGwN0Uwx+fR0T4=A@mail.gmail.com>
	<CA+OCxoyL_OaiDW8s+6znck8mYJPzpt95ruqZgz2kA3ZxUdXzMQ@mail.gmail.com>
	<CA+s62-Ndv0B8hDkXMVyhr0o_wHmc3R3HyKfx9nGhXSZNTQgY0w@mail.gmail.com>
	<CA+s62-PP_6ZQmnbzrn2Vb0iLiVHdp6jYsUb33jAYjTqRV93tUw@mail.gmail.com>
	<CA+OCxowaBvS3szDk4Jc0F=nSkDG52JWguFpSc1BgPZ9xgbzeXA@mail.gmail.com>
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

Being consistent with the frmQuery probably helps the user as well.  Here's
the patch to display the connection name as it is displayed in the frmQuery.

Thank you,
Adam


On Wed, Sep 16, 2015 at 9:30 AM, Dave Page <[email protected]> wrote:

> I think so - I realise it's not the display name (which would be
> ideal), but it is a condensed name that fully describes the
> connection.
>
> On Tue, Sep 15, 2015 at 4:01 PM, Adam Scott <[email protected]>
> wrote:
> > If it displayed what's displayed in the Query editor would that be
> better?
> >
> > Thank you,
> > Adam
> >
> >
> > On Tue, Sep 15, 2015 at 8:41 AM, Adam Scott <[email protected]>
> wrote:
> >>
> >> If you have a development host and a production host, the database names
> >> will be the same.  I think the value of the having the new field goes
> away
> >> if you exclude the hostname.  You won't know what host the object you
> are
> >> selecting belongs to.  That could be the difference between modifying an
> >> object in development and production.
> >>
> >> It seems to me that what you could say about the display name is what
> >> could be said about the connection's display name in the tree control
> since
> >> this is what is displayed (plus the database name).
> >>
> >> What the patch displays answers the questions, "What connection am I
> on?"
> >> "What database am I on?"
> >>
> >> I guess I can work on adding another patch that allows you to customize
> >> what is displayed using frmOptions...?
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> On Tue, Sep 15, 2015 at 5:20 AM, Dave Page <[email protected]> wrote:
> >>>
> >>> On Tue, Sep 15, 2015 at 12:14 PM, Magnus Hagander <[email protected]
> >
> >>> wrote:
> >>> > On Tue, Sep 15, 2015 at 10:55 AM, Dave Page <[email protected]>
> wrote:
> >>> >>
> >>> >> On Mon, Sep 14, 2015 at 5:11 PM, Magnus Hagander <
> [email protected]>
> >>> >> wrote:
> >>> >> > The part that changed is just the one that added db1 and db2,
> right?
> >>> >>
> >>> >> It's the server display name *and* the database name, so to give a
> >>> >> (redacted) example from my machine, I would have:
> >>> >>
> >>> >> aws-ap-southeast-1b.xxxxxxxxxxxxxxxx.com (aws-ap-southeast-1b.
> >>> >> xxxxxxxxxxxxxxxx.com:5432):postgres
> >>> >>
> >>> >> Which as you can see is quite long.
> >>> >
> >>> >
> >>> > I thought the point of display names was to have them nice and short
> :)
> >>> > I've
> >>> > certainly never used displaynames that are that long.
> >>>
> >>> I generally use the full hostnames (as I have machines in multiple
> >>> domains) - and in the places that you currently see them, that length
> >>> is actually fine.
> >>>
> >>> > Yes, I totally see with names like that it becomes annoying, and
> >>> > certainly
> >>> > not easy to parse. Perhaps what we really shoul dhave is just
> >>> > displayname +
> >>> > databasename, and exclude the actual hostname?
> >>>
> >>> That would be an improvement, certainly.
> >>>
> >>>
> >>> --
> >>> Dave Page
> >>> Blog: http://pgsnake.blogspot.com
> >>> Twitter: @pgsnake
> >>>
> >>> EnterpriseDB UK: http://www.enterprisedb.com
> >>> The Enterprise PostgreSQL Company
> >>
> >>
> >
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [application/octet-stream] 0001-Display-Connection-and-Database-in-Statusbar-Add-ano.patch (1.3K, 3-0001-Display-Connection-and-Database-in-Statusbar-Add-ano.patch)
  download | inline diff:
From aedfab6416e760fef73182379acd70072c6b5de3 Mon Sep 17 00:00:00 2001
From: Adam C Scott <[email protected]>
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



view thread (20+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Patch: New field in frmMain statusbar
  In-Reply-To: <CA+s62-M+TM-TDhUJoz5ap0D2ZLWymXGx9Lnh+cj+E8mSmcmXLA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox