Adding owner to objects' lists
Adding owner to objects' lists
От:
Guillaume Lelarge <guillaume@lelarge.info>
Дата:
Hi,
The attached patch adds an Owner column to an object's list (for example
"Aggregates" node, "Functions" node, "Tables" node, etc.). So, there's
now three columns : Name, Owner and Comment.
Regards.
--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com
Index: pgadmin/include/schema/pgObject.h
===================================================================
--- pgadmin/include/schema/pgObject.h (révision 7274)
+++ pgadmin/include/schema/pgObject.h (copie de travail)
@@ -134,6 +134,7 @@
wxString qtDbString(const wxString &str);
protected:
+ void CreateList3Columns(ctlListView *properties, const wxString &left=_("Object"), const wxString &middle=_("Owner"), const wxString &right=_("Value"));
void CreateListColumns(ctlListView *properties, const wxString &left=_("Property"), const wxString &right=_("Value"));
void AppendMenu(wxMenu *menu, int type=-1);
Index: pgadmin/schema/pgObject.cpp
===================================================================
--- pgadmin/schema/pgObject.cpp (révision 7274)
+++ pgadmin/schema/pgObject.cpp (copie de travail)
@@ -310,6 +310,15 @@
}
}
+void pgObject::CreateList3Columns(ctlListView *list, const wxString &left, const wxString &middle, const wxString &right)
+{
+ list->ClearAll();
+ list->AddColumn(left, 90);
+ list->AddColumn(middle, 50);
+ list->AddColumn(right, 400);
+}
+
+
void pgObject::CreateListColumns(ctlListView *list, const wxString &left, const wxString &right)
{
list->ClearAll();
Index: pgadmin/schema/pgCollection.cpp
===================================================================
--- pgadmin/schema/pgCollection.cpp (révision 7274)
+++ pgadmin/schema/pgCollection.cpp (copie de travail)
@@ -67,7 +67,7 @@
pgObject *data;
// Setup listview
- CreateListColumns(properties, wxGetTranslation(name), _("Comment"));
+ CreateList3Columns(properties, wxGetTranslation(name), _("Owner"), _("Comment"));
wxTreeItemId item = browser->GetFirstChild(GetId(), cookie);
long pos=0;
@@ -77,7 +77,8 @@
if (IsCollectionFor(data))
{
properties->InsertItem(pos, data->GetFullName(), data->GetIconId());
- properties->SetItem(pos, 1, firstLineOnly(data->GetComment()));
+ properties->SetItem(pos, 1, data->GetOwner());
+ properties->SetItem(pos, 2, firstLineOnly(data->GetComment()));
pos++;
}
// Get the next item
Re: Adding owner to objects' lists
От:
Guillaume Lelarge <guillaume@lelarge.info>
Дата:
Dave Page a écrit : > On Mon, May 5, 2008 at 1:25 PM, Guillaume Lelarge > wrote: >> The attached patch adds an Owner column to an object's list (for example >> "Aggregates" node, "Functions" node, "Tables" node, etc.). So, there's now >> three columns : Name, Owner and Comment. > > Looks OK to me, though if memory serves the main reason we didn't do > this originally was because it was awkward getting the column sizing > correct. We should keep an eye on it after you've applied the patch to > make sure we don't see anything that looks odd. > Applied, thanks. -- Guillaume. http://www.postgresqlfr.org http://dalibo.com
Re: Adding owner to objects' lists
От:
"Dave Page" <dpage@pgadmin.org>
Дата:
On Mon, May 5, 2008 at 1:25 PM, Guillaume Lelarge wrote: > Hi, > > The attached patch adds an Owner column to an object's list (for example > "Aggregates" node, "Functions" node, "Tables" node, etc.). So, there's now > three columns : Name, Owner and Comment. Looks OK to me, though if memory serves the main reason we didn't do this originally was because it was awkward getting the column sizing correct. We should keep an eye on it after you've applied the patch to make sure we don't see anything that looks odd. -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com