public inbox for [email protected]
help / color / mirror / Atom feedFrom: Adam Scott <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: Patch: New field in frmMain statusbar
Date: Sun, 13 Sep 2015 09:19:35 -0600
Message-ID: <CA+s62-Ous9Dr7EFGfwEh-N7xZGh8f173uUU=VbzzgV9crVD4NQ@mail.gmail.com> (raw)
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgadmin-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
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]
Subject: Re: Patch: New field in frmMain statusbar
In-Reply-To: <CA+s62-Ous9Dr7EFGfwEh-N7xZGh8f173uUU=VbzzgV9crVD4NQ@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