public inbox for [email protected]
help / color / mirror / Atom feedPatch: New field in frmMain statusbar
20+ messages / 4 participants
[nested] [flat]
* Patch: New field in frmMain statusbar
@ 2015-09-13 15:19 Adam Scott <[email protected]>
0 siblings, 1 reply; 20+ messages in thread
From: Adam Scott @ 2015-09-13 15:19 UTC (permalink / raw)
To: pgadmin-hackers
Hi,
please consider this patch to frmMain.
Situation: When a user has a large number of databases and connections,
when they select a table or other object in the Object browser tree, they
can lose track of which connection and database the object belongs too.
This makes it really easy for the user to make a mistake and drop an object
on the wrong connection (such as on a Production server instead of a
Development server). Also as a user is browsing multiple databases and
connections they can lose track of which object they are working on.
Solution: This patch adds a new field in the status bar of the main window
(frmMain), between the two other fields, keeping them the same. If there's
a currently selected object the field will display it's connection and
database. If there's no currently selected object, it will be blank.
Here's the danger, if we display the wrong connection and database, the
user could drop the wrong object. So it's imperative this never has a
bug. This code change is so small with so little dependencies, it relies
on already used code for such a long time that if it had a bug, then there
are other bigger bugs in the code that would have already shown up.
Regards,
Adam C. Scott
patch generated using Tortoise Git Create Patch Serial
--
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-Adds-new-field-in-frmMain-statusbar-used-to-display-.patch (1.7K, 3-0001-Adds-new-field-in-frmMain-statusbar-used-to-display-.patch)
download | inline diff:
From 3d0da5ba7914b69c0641bb8f6a85f2153613de8b Mon Sep 17 00:00:00 2001
From: Adam C Scott <[email protected]>
Date: Sun, 13 Sep 2015 09:07:25 -0600
Subject: [PATCH] Adds new field in frmMain statusbar used to display current
connection name and database for currently selected object in tree control.
---
pgadmin/frm/frmMain.cpp | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/pgadmin/frm/frmMain.cpp b/pgadmin/frm/frmMain.cpp
index 12a9e1e..b80e682 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,18 @@ 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();
+ }
+
+ statusBar->SetStatusText(connection,2);
// Display the 'Done' message
if (done)
--
2.5.2.windows.1
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-14 08:57 Dave Page <[email protected]>
parent: Adam Scott <[email protected]>
0 siblings, 1 reply; 20+ messages in thread
From: Dave Page @ 2015-09-14 08:57 UTC (permalink / raw)
To: Adam Scott <[email protected]>; +Cc: pgadmin-hackers
Thanks Adam.
What do others feel about this proposed patch? I can see how it might
be useful, however I'm also concerned about overloading the UI with
more info - and in over a decade I don't recall anyone ever asking for
this feature or complaining of the issue Adam describes (though, it is
clearly feasible).
On Sun, Sep 13, 2015 at 4:19 PM, Adam Scott <[email protected]> wrote:
> Hi,
>
> please consider this patch to frmMain.
>
> Situation: When a user has a large number of databases and connections,
> when they select a table or other object in the Object browser tree, they
> can lose track of which connection and database the object belongs too.
> This makes it really easy for the user to make a mistake and drop an object
> on the wrong connection (such as on a Production server instead of a
> Development server). Also as a user is browsing multiple databases and
> connections they can lose track of which object they are working on.
>
> Solution: This patch adds a new field in the status bar of the main window
> (frmMain), between the two other fields, keeping them the same. If there's
> a currently selected object the field will display it's connection and
> database. If there's no currently selected object, it will be blank.
>
> Here's the danger, if we display the wrong connection and database, the user
> could drop the wrong object. So it's imperative this never has a bug. This
> code change is so small with so little dependencies, it relies on already
> used code for such a long time that if it had a bug, then there are other
> bigger bugs in the code that would have already shown up.
>
> Regards,
> Adam C. Scott
>
> patch generated using Tortoise Git Create Patch Serial
>
>
>
> --
> Sent via pgadmin-hackers mailing list ([email protected])
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
--
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
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-14 10:43 Magnus Hagander <[email protected]>
parent: Dave Page <[email protected]>
0 siblings, 1 reply; 20+ messages in thread
From: Magnus Hagander @ 2015-09-14 10:43 UTC (permalink / raw)
To: Dave Page <[email protected]>; +Cc: Adam Scott <[email protected]>; pgadmin-hackers
I don't have a working pgadmin env at the moment - any chance someone who
has built it could show a screenshot?
I've certainly had customers complain about pgadmin in the case of many
databases, though it's generally been on account of performance, and not
something like this.
//Magnus
On Mon, Sep 14, 2015 at 10:57 AM, Dave Page <[email protected]> wrote:
> Thanks Adam.
>
> What do others feel about this proposed patch? I can see how it might
> be useful, however I'm also concerned about overloading the UI with
> more info - and in over a decade I don't recall anyone ever asking for
> this feature or complaining of the issue Adam describes (though, it is
> clearly feasible).
>
> On Sun, Sep 13, 2015 at 4:19 PM, Adam Scott <[email protected]>
> wrote:
> > Hi,
> >
> > please consider this patch to frmMain.
> >
> > Situation: When a user has a large number of databases and connections,
> > when they select a table or other object in the Object browser tree, they
> > can lose track of which connection and database the object belongs too.
> > This makes it really easy for the user to make a mistake and drop an
> object
> > on the wrong connection (such as on a Production server instead of a
> > Development server). Also as a user is browsing multiple databases and
> > connections they can lose track of which object they are working on.
> >
> > Solution: This patch adds a new field in the status bar of the main
> window
> > (frmMain), between the two other fields, keeping them the same. If
> there's
> > a currently selected object the field will display it's connection and
> > database. If there's no currently selected object, it will be blank.
> >
> > Here's the danger, if we display the wrong connection and database, the
> user
> > could drop the wrong object. So it's imperative this never has a bug.
> This
> > code change is so small with so little dependencies, it relies on already
> > used code for such a long time that if it had a bug, then there are other
> > bigger bugs in the code that would have already shown up.
> >
> > Regards,
> > Adam C. Scott
> >
> > patch generated using Tortoise Git Create Patch Serial
> >
> >
> >
> > --
> > Sent via pgadmin-hackers mailing list ([email protected])
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgadmin-hackers
> >
>
>
>
> --
> 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
>
--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-14 13:34 Adam Scott <[email protected]>
parent: Magnus Hagander <[email protected]>
0 siblings, 1 reply; 20+ messages in thread
From: Adam Scott @ 2015-09-14 13:34 UTC (permalink / raw)
To: Magnus Hagander <[email protected]>; +Cc: Dave Page <[email protected]>; pgadmin-hackers
Hi,
thank you for your time to consider this patch.
Here's a few screenshots on my Windows 7 desktop. Let me know if you want
to see anything else.
A few observations:
[image: Inline image 1]
[image: Inline image 2]
On Mon, Sep 14, 2015 at 4:43 AM, Magnus Hagander <[email protected]>
wrote:
> I don't have a working pgadmin env at the moment - any chance someone who
> has built it could show a screenshot?
>
> I've certainly had customers complain about pgadmin in the case of many
> databases, though it's generally been on account of performance, and not
> something like this.
>
> //Magnus
>
>
> On Mon, Sep 14, 2015 at 10:57 AM, Dave Page <[email protected]> wrote:
>
>> Thanks Adam.
>>
>> What do others feel about this proposed patch? I can see how it might
>> be useful, however I'm also concerned about overloading the UI with
>> more info - and in over a decade I don't recall anyone ever asking for
>> this feature or complaining of the issue Adam describes (though, it is
>> clearly feasible).
>>
>> On Sun, Sep 13, 2015 at 4:19 PM, Adam Scott <[email protected]>
>> wrote:
>> > Hi,
>> >
>> > please consider this patch to frmMain.
>> >
>> > Situation: When a user has a large number of databases and connections,
>> > when they select a table or other object in the Object browser tree,
>> they
>> > can lose track of which connection and database the object belongs too.
>> > This makes it really easy for the user to make a mistake and drop an
>> object
>> > on the wrong connection (such as on a Production server instead of a
>> > Development server). Also as a user is browsing multiple databases and
>> > connections they can lose track of which object they are working on.
>> >
>> > Solution: This patch adds a new field in the status bar of the main
>> window
>> > (frmMain), between the two other fields, keeping them the same. If
>> there's
>> > a currently selected object the field will display it's connection and
>> > database. If there's no currently selected object, it will be blank.
>> >
>> > Here's the danger, if we display the wrong connection and database, the
>> user
>> > could drop the wrong object. So it's imperative this never has a bug.
>> This
>> > code change is so small with so little dependencies, it relies on
>> already
>> > used code for such a long time that if it had a bug, then there are
>> other
>> > bigger bugs in the code that would have already shown up.
>> >
>> > Regards,
>> > Adam C. Scott
>> >
>> > patch generated using Tortoise Git Create Patch Serial
>> >
>> >
>> >
>> > --
>> > Sent via pgadmin-hackers mailing list ([email protected])
>> > To make changes to your subscription:
>> > http://www.postgresql.org/mailpref/pgadmin-hackers
>> >
>>
>>
>>
>> --
>> 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
>>
>
>
>
> --
> Magnus Hagander
> Me: http://www.hagander.net/
> Work: http://www.redpill-linpro.com/
>
Attachments:
[image/png] image.png (104.9K, 3-image.png)
download | view image
[image/png] image.png (109.2K, 4-image.png)
download | view image
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-14 16:11 Magnus Hagander <[email protected]>
parent: Adam Scott <[email protected]>
0 siblings, 2 replies; 20+ messages in thread
From: Magnus Hagander @ 2015-09-14 16:11 UTC (permalink / raw)
To: Adam Scott <[email protected]>; +Cc: Dave Page <[email protected]>; pgadmin-hackers
The part that changed is just the one that added db1 and db2, right?
If so I definitely don't think it's a problem with too much info,and think
this patch is good. (I haven't reviewed the code)
//Magnus
On Mon, Sep 14, 2015 at 3:34 PM, Adam Scott <[email protected]> wrote:
> Hi,
>
> thank you for your time to consider this patch.
>
> Here's a few screenshots on my Windows 7 desktop. Let me know if you want
> to see anything else.
> A few observations:
>
>
>
>
>
>
> On Mon, Sep 14, 2015 at 4:43 AM, Magnus Hagander <[email protected]>
> wrote:
>
>> I don't have a working pgadmin env at the moment - any chance someone who
>> has built it could show a screenshot?
>>
>> I've certainly had customers complain about pgadmin in the case of many
>> databases, though it's generally been on account of performance, and not
>> something like this.
>>
>> //Magnus
>>
>>
>> On Mon, Sep 14, 2015 at 10:57 AM, Dave Page <[email protected]> wrote:
>>
>>> Thanks Adam.
>>>
>>> What do others feel about this proposed patch? I can see how it might
>>> be useful, however I'm also concerned about overloading the UI with
>>> more info - and in over a decade I don't recall anyone ever asking for
>>> this feature or complaining of the issue Adam describes (though, it is
>>> clearly feasible).
>>>
>>> On Sun, Sep 13, 2015 at 4:19 PM, Adam Scott <[email protected]>
>>> wrote:
>>> > Hi,
>>> >
>>> > please consider this patch to frmMain.
>>> >
>>> > Situation: When a user has a large number of databases and
>>> connections,
>>> > when they select a table or other object in the Object browser tree,
>>> they
>>> > can lose track of which connection and database the object belongs too.
>>> > This makes it really easy for the user to make a mistake and drop an
>>> object
>>> > on the wrong connection (such as on a Production server instead of a
>>> > Development server). Also as a user is browsing multiple databases and
>>> > connections they can lose track of which object they are working on.
>>> >
>>> > Solution: This patch adds a new field in the status bar of the main
>>> window
>>> > (frmMain), between the two other fields, keeping them the same. If
>>> there's
>>> > a currently selected object the field will display it's connection and
>>> > database. If there's no currently selected object, it will be blank.
>>> >
>>> > Here's the danger, if we display the wrong connection and database,
>>> the user
>>> > could drop the wrong object. So it's imperative this never has a
>>> bug. This
>>> > code change is so small with so little dependencies, it relies on
>>> already
>>> > used code for such a long time that if it had a bug, then there are
>>> other
>>> > bigger bugs in the code that would have already shown up.
>>> >
>>> > Regards,
>>> > Adam C. Scott
>>> >
>>> > patch generated using Tortoise Git Create Patch Serial
>>> >
>>> >
>>> >
>>> > --
>>> > Sent via pgadmin-hackers mailing list ([email protected])
>>> > To make changes to your subscription:
>>> > http://www.postgresql.org/mailpref/pgadmin-hackers
>>> >
>>>
>>>
>>>
--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-14 19:04 Adam Scott <[email protected]>
parent: Magnus Hagander <[email protected]>
1 sibling, 1 reply; 20+ messages in thread
From: Adam Scott @ 2015-09-14 19:04 UTC (permalink / raw)
To: Magnus Hagander <[email protected]>; +Cc: Dave Page <[email protected]>; pgadmin-hackers
The part that changed was just the database name since I clicked on an
object in a different database on the same conneciton. If I had selected
an object in a different connection, the connection name would change as
well.
For convenience, in green below, is the additional code to make this happen
(there's other stuff in the patch to add the field in the statusbar not
shown below).
Thank you,
Adam
void frmMain::EndMsg(bool done)
{
msgLevel--;
if (!msgLevel)
{
// Get the execution time & display it
float timeval = stopwatch.Time();
wxString time;
time.Printf(_("%.2f secs"), (timeval / 1000));
statusBar->SetStatusText(time, 3);
wxString connection;
if (currentObject)
{
pgDatabase *db = currentObject->GetDatabase();
if (db)
connection = db->GetServer()->GetDisplayName() + wxT(":") +
db->GetDisplayName();
}
statusBar->SetStatusText(connection,2);
// Display the 'Done' message
if (done)
statusBar->SetStatusText(timermsg + _(" Done."), 1);
else
statusBar->SetStatusText(timermsg + _(" Failed."), 1);
On Mon, Sep 14, 2015 at 10:11 AM, Magnus Hagander <[email protected]>
wrote:
> The part that changed is just the one that added db1 and db2, right?
>
> If so I definitely don't think it's a problem with too much info,and think
> this patch is good. (I haven't reviewed the code)
>
> //Magnus
>
>
> On Mon, Sep 14, 2015 at 3:34 PM, Adam Scott <[email protected]>
> wrote:
>
>> Hi,
>>
>> thank you for your time to consider this patch.
>>
>> Here's a few screenshots on my Windows 7 desktop. Let me know if you
>> want to see anything else.
>> A few observations:
>>
>>
>>
>>
>>
>>
>> On Mon, Sep 14, 2015 at 4:43 AM, Magnus Hagander <[email protected]>
>> wrote:
>>
>>> I don't have a working pgadmin env at the moment - any chance someone
>>> who has built it could show a screenshot?
>>>
>>> I've certainly had customers complain about pgadmin in the case of many
>>> databases, though it's generally been on account of performance, and not
>>> something like this.
>>>
>>> //Magnus
>>>
>>>
>>> On Mon, Sep 14, 2015 at 10:57 AM, Dave Page <[email protected]> wrote:
>>>
>>>> Thanks Adam.
>>>>
>>>> What do others feel about this proposed patch? I can see how it might
>>>> be useful, however I'm also concerned about overloading the UI with
>>>> more info - and in over a decade I don't recall anyone ever asking for
>>>> this feature or complaining of the issue Adam describes (though, it is
>>>> clearly feasible).
>>>>
>>>> On Sun, Sep 13, 2015 at 4:19 PM, Adam Scott <[email protected]>
>>>> wrote:
>>>> > Hi,
>>>> >
>>>> > please consider this patch to frmMain.
>>>> >
>>>> > Situation: When a user has a large number of databases and
>>>> connections,
>>>> > when they select a table or other object in the Object browser tree,
>>>> they
>>>> > can lose track of which connection and database the object belongs
>>>> too.
>>>> > This makes it really easy for the user to make a mistake and drop an
>>>> object
>>>> > on the wrong connection (such as on a Production server instead of a
>>>> > Development server). Also as a user is browsing multiple databases
>>>> and
>>>> > connections they can lose track of which object they are working on.
>>>> >
>>>> > Solution: This patch adds a new field in the status bar of the main
>>>> window
>>>> > (frmMain), between the two other fields, keeping them the same. If
>>>> there's
>>>> > a currently selected object the field will display it's connection and
>>>> > database. If there's no currently selected object, it will be blank.
>>>> >
>>>> > Here's the danger, if we display the wrong connection and database,
>>>> the user
>>>> > could drop the wrong object. So it's imperative this never has a
>>>> bug. This
>>>> > code change is so small with so little dependencies, it relies on
>>>> already
>>>> > used code for such a long time that if it had a bug, then there are
>>>> other
>>>> > bigger bugs in the code that would have already shown up.
>>>> >
>>>> > Regards,
>>>> > Adam C. Scott
>>>> >
>>>> > patch generated using Tortoise Git Create Patch Serial
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> > Sent via pgadmin-hackers mailing list ([email protected]
>>>> )
>>>> > To make changes to your subscription:
>>>> > http://www.postgresql.org/mailpref/pgadmin-hackers
>>>> >
>>>>
>>>>
>>>>
> --
> Magnus Hagander
> Me: http://www.hagander.net/
> Work: http://www.redpill-linpro.com/
>
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-14 19:22 Adam Scott <[email protected]>
parent: Adam Scott <[email protected]>
0 siblings, 0 replies; 20+ messages in thread
From: Adam Scott @ 2015-09-14 19:22 UTC (permalink / raw)
To: Magnus Hagander <[email protected]>; +Cc: Dave Page <[email protected]>; pgadmin-hackers
Apologies all. I have an updated patch that corrects the previous one.
Before, if you you selected Tablespaces, Group Roles, or Login Roles, it
wouldn't show the connection they are associated with. The attached patch
supersedes the previous one and corrects the flaw.
Thank you,
Adam
On Mon, Sep 14, 2015 at 1:04 PM, Adam Scott <[email protected]> wrote:
> The part that changed was just the database name since I clicked on an
> object in a different database on the same conneciton. If I had selected
> an object in a different connection, the connection name would change as
> well.
>
> For convenience, in green below, is the additional code to make this
> happen (there's other stuff in the patch to add the field in the statusbar
> not shown below).
>
> Thank you,
> Adam
>
> void frmMain::EndMsg(bool done)
> {
> msgLevel--;
>
> if (!msgLevel)
> {
> // Get the execution time & display it
> float timeval = stopwatch.Time();
> wxString time;
> time.Printf(_("%.2f secs"), (timeval / 1000));
> statusBar->SetStatusText(time, 3);
>
> wxString connection;
> if (currentObject)
> {
> pgDatabase *db = currentObject->GetDatabase();
>
> if (db)
> connection = db->GetServer()->GetDisplayName() + wxT(":")
> + db->GetDisplayName();
> }
>
> statusBar->SetStatusText(connection,2);
>
> // Display the 'Done' message
> if (done)
> statusBar->SetStatusText(timermsg + _(" Done."), 1);
> else
> statusBar->SetStatusText(timermsg + _(" Failed."), 1);
>
> On Mon, Sep 14, 2015 at 10:11 AM, Magnus Hagander <[email protected]>
> wrote:
>
>> The part that changed is just the one that added db1 and db2, right?
>>
>> If so I definitely don't think it's a problem with too much info,and
>> think this patch is good. (I haven't reviewed the code)
>>
>> //Magnus
>>
>>
>> On Mon, Sep 14, 2015 at 3:34 PM, Adam Scott <[email protected]>
>> wrote:
>>
>>> Hi,
>>>
>>> thank you for your time to consider this patch.
>>>
>>> Here's a few screenshots on my Windows 7 desktop. Let me know if you
>>> want to see anything else.
>>> A few observations:
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Mon, Sep 14, 2015 at 4:43 AM, Magnus Hagander <[email protected]>
>>> wrote:
>>>
>>>> I don't have a working pgadmin env at the moment - any chance someone
>>>> who has built it could show a screenshot?
>>>>
>>>> I've certainly had customers complain about pgadmin in the case of many
>>>> databases, though it's generally been on account of performance, and not
>>>> something like this.
>>>>
>>>> //Magnus
>>>>
>>>>
>>>> On Mon, Sep 14, 2015 at 10:57 AM, Dave Page <[email protected]> wrote:
>>>>
>>>>> Thanks Adam.
>>>>>
>>>>> What do others feel about this proposed patch? I can see how it might
>>>>> be useful, however I'm also concerned about overloading the UI with
>>>>> more info - and in over a decade I don't recall anyone ever asking for
>>>>> this feature or complaining of the issue Adam describes (though, it is
>>>>> clearly feasible).
>>>>>
>>>>> On Sun, Sep 13, 2015 at 4:19 PM, Adam Scott <[email protected]>
>>>>> wrote:
>>>>> > Hi,
>>>>> >
>>>>> > please consider this patch to frmMain.
>>>>> >
>>>>> > Situation: When a user has a large number of databases and
>>>>> connections,
>>>>> > when they select a table or other object in the Object browser tree,
>>>>> they
>>>>> > can lose track of which connection and database the object belongs
>>>>> too.
>>>>> > This makes it really easy for the user to make a mistake and drop an
>>>>> object
>>>>> > on the wrong connection (such as on a Production server instead of a
>>>>> > Development server). Also as a user is browsing multiple databases
>>>>> and
>>>>> > connections they can lose track of which object they are working on.
>>>>> >
>>>>> > Solution: This patch adds a new field in the status bar of the main
>>>>> window
>>>>> > (frmMain), between the two other fields, keeping them the same. If
>>>>> there's
>>>>> > a currently selected object the field will display it's connection
>>>>> and
>>>>> > database. If there's no currently selected object, it will be blank.
>>>>> >
>>>>> > Here's the danger, if we display the wrong connection and database,
>>>>> the user
>>>>> > could drop the wrong object. So it's imperative this never has a
>>>>> bug. This
>>>>> > code change is so small with so little dependencies, it relies on
>>>>> already
>>>>> > used code for such a long time that if it had a bug, then there are
>>>>> other
>>>>> > bigger bugs in the code that would have already shown up.
>>>>> >
>>>>> > Regards,
>>>>> > Adam C. Scott
>>>>> >
>>>>> > patch generated using Tortoise Git Create Patch Serial
>>>>> >
>>>>> >
>>>>> >
>>>>> > --
>>>>> > Sent via pgadmin-hackers mailing list (
>>>>> [email protected])
>>>>> > To make changes to your subscription:
>>>>> > http://www.postgresql.org/mailpref/pgadmin-hackers
>>>>> >
>>>>>
>>>>>
>>>>>
>> --
>> Magnus Hagander
>> Me: http://www.hagander.net/
>> Work: http://www.redpill-linpro.com/
>>
>
>
--
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.9K, 3-0001-Display-Connection-and-Database-in-Statusbar-Add-ano.patch)
download | inline diff:
From 892a5a6afc0ad1f97e31c5302aa870e509c8bae0 Mon Sep 17 00:00:00 2001
From: Adam C Scott <[email protected]>
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
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-15 08:55 Dave Page <[email protected]>
parent: Magnus Hagander <[email protected]>
1 sibling, 1 reply; 20+ messages in thread
From: Dave Page @ 2015-09-15 08:55 UTC (permalink / raw)
To: Magnus Hagander <[email protected]>; +Cc: Adam Scott <[email protected]>; pgadmin-hackers
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.
> If so I definitely don't think it's a problem with too much info,and think
> this patch is good. (I haven't reviewed the code)
>
> //Magnus
>
>
> On Mon, Sep 14, 2015 at 3:34 PM, Adam Scott <[email protected]> wrote:
>>
>> Hi,
>>
>> thank you for your time to consider this patch.
>>
>> Here's a few screenshots on my Windows 7 desktop. Let me know if you want
>> to see anything else.
>> A few observations:
>>
>>
>>
>>
>>
>>
>> On Mon, Sep 14, 2015 at 4:43 AM, Magnus Hagander <[email protected]>
>> wrote:
>>>
>>> I don't have a working pgadmin env at the moment - any chance someone who
>>> has built it could show a screenshot?
>>>
>>> I've certainly had customers complain about pgadmin in the case of many
>>> databases, though it's generally been on account of performance, and not
>>> something like this.
>>>
>>> //Magnus
>>>
>>>
>>> On Mon, Sep 14, 2015 at 10:57 AM, Dave Page <[email protected]> wrote:
>>>>
>>>> Thanks Adam.
>>>>
>>>> What do others feel about this proposed patch? I can see how it might
>>>> be useful, however I'm also concerned about overloading the UI with
>>>> more info - and in over a decade I don't recall anyone ever asking for
>>>> this feature or complaining of the issue Adam describes (though, it is
>>>> clearly feasible).
>>>>
>>>> On Sun, Sep 13, 2015 at 4:19 PM, Adam Scott <[email protected]>
>>>> wrote:
>>>> > Hi,
>>>> >
>>>> > please consider this patch to frmMain.
>>>> >
>>>> > Situation: When a user has a large number of databases and
>>>> > connections,
>>>> > when they select a table or other object in the Object browser tree,
>>>> > they
>>>> > can lose track of which connection and database the object belongs
>>>> > too.
>>>> > This makes it really easy for the user to make a mistake and drop an
>>>> > object
>>>> > on the wrong connection (such as on a Production server instead of a
>>>> > Development server). Also as a user is browsing multiple databases
>>>> > and
>>>> > connections they can lose track of which object they are working on.
>>>> >
>>>> > Solution: This patch adds a new field in the status bar of the main
>>>> > window
>>>> > (frmMain), between the two other fields, keeping them the same. If
>>>> > there's
>>>> > a currently selected object the field will display it's connection and
>>>> > database. If there's no currently selected object, it will be blank.
>>>> >
>>>> > Here's the danger, if we display the wrong connection and database,
>>>> > the user
>>>> > could drop the wrong object. So it's imperative this never has a bug.
>>>> > This
>>>> > code change is so small with so little dependencies, it relies on
>>>> > already
>>>> > used code for such a long time that if it had a bug, then there are
>>>> > other
>>>> > bigger bugs in the code that would have already shown up.
>>>> >
>>>> > Regards,
>>>> > Adam C. Scott
>>>> >
>>>> > patch generated using Tortoise Git Create Patch Serial
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> > Sent via pgadmin-hackers mailing list ([email protected])
>>>> > To make changes to your subscription:
>>>> > http://www.postgresql.org/mailpref/pgadmin-hackers
>>>> >
>>>>
>>>>
>
> --
> Magnus Hagander
> Me: http://www.hagander.net/
> Work: http://www.redpill-linpro.com/
--
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
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-15 11:14 Magnus Hagander <[email protected]>
parent: Dave Page <[email protected]>
0 siblings, 1 reply; 20+ messages in thread
From: Magnus Hagander @ 2015-09-15 11:14 UTC (permalink / raw)
To: Dave Page <[email protected]>; +Cc: Adam Scott <[email protected]>; pgadmin-hackers
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.
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?
--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-15 11:20 Dave Page <[email protected]>
parent: Magnus Hagander <[email protected]>
0 siblings, 1 reply; 20+ messages in thread
From: Dave Page @ 2015-09-15 11:20 UTC (permalink / raw)
To: Magnus Hagander <[email protected]>; +Cc: Adam Scott <[email protected]>; pgadmin-hackers
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
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-15 14:41 Adam Scott <[email protected]>
parent: Dave Page <[email protected]>
0 siblings, 1 reply; 20+ messages in thread
From: Adam Scott @ 2015-09-15 14:41 UTC (permalink / raw)
To: Dave Page <[email protected]>; +Cc: Magnus Hagander <[email protected]>; pgadmin-hackers
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
>
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-15 15:01 Adam Scott <[email protected]>
parent: Adam Scott <[email protected]>
0 siblings, 1 reply; 20+ messages in thread
From: Adam Scott @ 2015-09-15 15:01 UTC (permalink / raw)
To: Dave Page <[email protected]>; +Cc: Magnus Hagander <[email protected]>; pgadmin-hackers
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
>>
>
>
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-16 15:30 Dave Page <[email protected]>
parent: Adam Scott <[email protected]>
0 siblings, 1 reply; 20+ messages in thread
From: Dave Page @ 2015-09-16 15:30 UTC (permalink / raw)
To: Adam Scott <[email protected]>; +Cc: Magnus Hagander <[email protected]>; pgadmin-hackers
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
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-17 13:47 Adam Scott <[email protected]>
parent: Dave Page <[email protected]>
0 siblings, 1 reply; 20+ messages in thread
From: Adam Scott @ 2015-09-17 13:47 UTC (permalink / raw)
To: Dave Page <[email protected]>; +Cc: Magnus Hagander <[email protected]>; pgadmin-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
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-23 13:55 Adam Scott <[email protected]>
parent: Adam Scott <[email protected]>
0 siblings, 1 reply; 20+ messages in thread
From: Adam Scott @ 2015-09-23 13:55 UTC (permalink / raw)
To: Dave Page <[email protected]>; +Cc: Magnus Hagander <[email protected]>; pgadmin-hackers
Is the last patch okay? If there's something more required or anything
please let me know.
Thank you,
Adam
On Thu, Sep 17, 2015 at 7:47 AM, Adam Scott <[email protected]> wrote:
> 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
>>
>
>
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-23 14:35 Dave Page <[email protected]>
parent: Adam Scott <[email protected]>
0 siblings, 1 reply; 20+ messages in thread
From: Dave Page @ 2015-09-23 14:35 UTC (permalink / raw)
To: Adam Scott <[email protected]>; +Cc: Magnus Hagander <[email protected]>; pgadmin-hackers
On Wed, Sep 23, 2015 at 2:55 PM, Adam Scott <[email protected]> wrote:
> Is the last patch okay? If there's something more required or anything
> please let me know.
Hi
The patch does not apply for me. Can you rebase it against master please?
Thanks.
--
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
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-23 19:15 Adam Scott <[email protected]>
parent: Dave Page <[email protected]>
0 siblings, 2 replies; 20+ messages in thread
From: Adam Scott @ 2015-09-23 19:15 UTC (permalink / raw)
To: Dave Page <[email protected]>; +Cc: Magnus Hagander <[email protected]>; pgadmin-hackers
Thank you Dave! I rebased from master. To get it to build is going to
take some research. It looks like it wants openssl, which I grabbed and
configured for WIN32, but it's not happy. First error is below. But this
patch is so straightforward, I'm sharing anyway for the sake of time, as it
was working before.
2>c:\pgadmin3\pgadmin\libssh2\openssl.c(71): error C2037: left of 'e'
specifies undefined struct/union 'rsa_st'
Thanks again!
Adam
On Wed, Sep 23, 2015 at 8:35 AM, Dave Page <[email protected]> wrote:
> On Wed, Sep 23, 2015 at 2:55 PM, Adam Scott <[email protected]>
> wrote:
> > Is the last patch okay? If there's something more required or anything
> > please let me know.
>
> Hi
>
> The patch does not apply for me. Can you rebase it against master please?
>
> Thanks.
>
> --
> 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.7K, 3-0001-Display-Connection-and-Database-in-Statusbar-Add-ano.patch)
download | inline diff:
From 0ea56367c51422329ed761e04f314451d6777a48 Mon Sep 17 00:00:00 2001
From: Adam C Scott <[email protected]>
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 | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/pgadmin/frm/frmMain.cpp b/pgadmin/frm/frmMain.cpp
index 8629dda..570701b 100644
--- a/pgadmin/frm/frmMain.cpp
+++ b/pgadmin/frm/frmMain.cpp
@@ -516,13 +516,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());
@@ -1354,7 +1354,18 @@ 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);
+
+ // Display the name of the connection for currently selected object
+ wxString connection;
+ if (currentObject)
+ {
+ pgConn *conn = currentObject->GetConnection();
+
+ if (conn)
+ connection = conn->GetName();
+ }
+ statusBar->SetStatusText(connection,2);
// Display the 'Done' message
if (done)
--
2.5.2.windows.1
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-24 01:58 Ashesh Vashi <[email protected]>
parent: Adam Scott <[email protected]>
1 sibling, 1 reply; 20+ messages in thread
From: Ashesh Vashi @ 2015-09-24 01:58 UTC (permalink / raw)
To: Adam Scott <[email protected]>; +Cc: Dave Page <[email protected]>; Magnus Hagander <[email protected]>; pgadmin-hackers
I created batch script to set the environment variable for setting OPENSSL,
WXWIN (wxWidgets).
And, use that batch script in command prompt, and start the devenv (Visual
Studio Development Environment IDE) from there.
Between - you will also require libxml2, libxslt, iconv (binaries of them
kept in a same directory), and environment variable PGBUILD is set for it.
i.e.
c:\pgBuild\iconv\
c:\pgBuild\libxml2
c:\pgBuild\libxslt
And, PGBUILD environment variable is set to "c:\pgBuild".
Hope this helps.
--
Thanks & Regards,
Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company
<http://www.enterprisedb.com;
*http://www.linkedin.com/in/asheshvashi*
<http://www.linkedin.com/in/asheshvashi;
On Thu, Sep 24, 2015 at 12:45 AM, Adam Scott <[email protected]> wrote:
> Thank you Dave! I rebased from master. To get it to build is going to
> take some research. It looks like it wants openssl, which I grabbed and
> configured for WIN32, but it's not happy. First error is below. But this
> patch is so straightforward, I'm sharing anyway for the sake of time, as it
> was working before.
>
> 2>c:\pgadmin3\pgadmin\libssh2\openssl.c(71): error C2037: left of 'e'
> specifies undefined struct/union 'rsa_st'
>
> Thanks again!
>
> Adam
>
>
> On Wed, Sep 23, 2015 at 8:35 AM, Dave Page <[email protected]> wrote:
>
>> On Wed, Sep 23, 2015 at 2:55 PM, Adam Scott <[email protected]>
>> wrote:
>> > Is the last patch okay? If there's something more required or anything
>> > please let me know.
>>
>> Hi
>>
>> The patch does not apply for me. Can you rebase it against master please?
>>
>> Thanks.
>>
>> --
>> 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
>
>
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-24 15:25 Dave Page <[email protected]>
parent: Adam Scott <[email protected]>
1 sibling, 0 replies; 20+ messages in thread
From: Dave Page @ 2015-09-24 15:25 UTC (permalink / raw)
To: Adam Scott <[email protected]>; +Cc: Magnus Hagander <[email protected]>; pgadmin-hackers
Thanks - patch applied!
On Wed, Sep 23, 2015 at 8:15 PM, Adam Scott <[email protected]> wrote:
> Thank you Dave! I rebased from master. To get it to build is going to
> take some research. It looks like it wants openssl, which I grabbed and
> configured for WIN32, but it's not happy. First error is below. But this
> patch is so straightforward, I'm sharing anyway for the sake of time, as it
> was working before.
>
> 2>c:\pgadmin3\pgadmin\libssh2\openssl.c(71): error C2037: left of 'e'
> specifies undefined struct/union 'rsa_st'
>
> Thanks again!
>
> Adam
>
>
> On Wed, Sep 23, 2015 at 8:35 AM, Dave Page <[email protected]> wrote:
>>
>> On Wed, Sep 23, 2015 at 2:55 PM, Adam Scott <[email protected]>
>> wrote:
>> > Is the last patch okay? If there's something more required or anything
>> > please let me know.
>>
>> Hi
>>
>> The patch does not apply for me. Can you rebase it against master please?
>>
>> Thanks.
>>
>> --
>> 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
^ permalink raw reply [nested|flat] 20+ messages in thread
* Re: Patch: New field in frmMain statusbar
@ 2015-09-25 00:30 Adam Scott <[email protected]>
parent: Ashesh Vashi <[email protected]>
0 siblings, 0 replies; 20+ messages in thread
From: Adam Scott @ 2015-09-25 00:30 UTC (permalink / raw)
To: Ashesh Vashi <[email protected]>; +Cc: Dave Page <[email protected]>; Magnus Hagander <[email protected]>; pgadmin-hackers
--001a11c0e88675971705208774fb
Content-Type: text/plain; charset=UTF-8
Thank you Ashesh. I have the pgBuild directory from before when i was
using VS 2008.
It seems once i used VS 2010 the error appears.
I did add the environment variable for OPENSSL (c:\openssl) and added
C:\openssl\out32dll to the VC++ Directories->Library Directories.
Right now RSA_new() is just an unresolvable identifier in
pgadmin\libssh2\openssl.c on line 69.
^ permalink raw reply [nested|flat] 20+ messages in thread
end of thread, other threads:[~2015-09-25 00:30 UTC | newest]
Thread overview: 20+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-09-13 15:19 Patch: New field in frmMain statusbar Adam Scott <[email protected]>
2015-09-14 08:57 ` Dave Page <[email protected]>
2015-09-14 10:43 ` Magnus Hagander <[email protected]>
2015-09-14 13:34 ` Adam Scott <[email protected]>
2015-09-14 16:11 ` Magnus Hagander <[email protected]>
2015-09-14 19:04 ` Adam Scott <[email protected]>
2015-09-14 19:22 ` Adam Scott <[email protected]>
2015-09-15 08:55 ` Dave Page <[email protected]>
2015-09-15 11:14 ` Magnus Hagander <[email protected]>
2015-09-15 11:20 ` Dave Page <[email protected]>
2015-09-15 14:41 ` Adam Scott <[email protected]>
2015-09-15 15:01 ` Adam Scott <[email protected]>
2015-09-16 15:30 ` Dave Page <[email protected]>
2015-09-17 13:47 ` Adam Scott <[email protected]>
2015-09-23 13:55 ` Adam Scott <[email protected]>
2015-09-23 14:35 ` Dave Page <[email protected]>
2015-09-23 19:15 ` Adam Scott <[email protected]>
2015-09-24 01:58 ` Ashesh Vashi <[email protected]>
2015-09-25 00:30 ` Adam Scott <[email protected]>
2015-09-24 15:25 ` Dave Page <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox