Unix Technical Forum

SVN Commit by andreas: r4586 - in trunk/pgadmin3: . src/dlg src/include src/main src/schema

This is a discussion on SVN Commit by andreas: r4586 - in trunk/pgadmin3: . src/dlg src/include src/main src/schema within the pgsql Interfaces Pgadmin Hackers forums, part of the PostgreSQL category; --> Author: andreas Date: 2005-10-21 17:34:10 +0100 (Fri, 21 Oct 2005) New Revision: 4586 Modified: trunk/pgadmin3/BUGS.txt trunk/pgadmin3/CHANGELOG.txt trunk/pgadmin3/src/dlg/dlgIndexConstraint.cpp trunk/pgadmin3/src/dlg/dlgProperty.cpp trunk/pgadmin3/src/include/dlgProperty.h ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces Pgadmin Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 05:37 PM
svn@pgadmin.org
 
Posts: n/a
Default SVN Commit by andreas: r4586 - in trunk/pgadmin3: . src/dlg src/include src/main src/schema

Author: andreas
Date: 2005-10-21 17:34:10 +0100 (Fri, 21 Oct 2005)
New Revision: 4586

Modified:
trunk/pgadmin3/BUGS.txt
trunk/pgadmin3/CHANGELOG.txt
trunk/pgadmin3/src/dlg/dlgIndexConstraint.cpp
trunk/pgadmin3/src/dlg/dlgProperty.cpp
trunk/pgadmin3/src/include/dlgProperty.h
trunk/pgadmin3/src/include/pgConstraints.h
trunk/pgadmin3/src/main/events.cpp
trunk/pgadmin3/src/schema/pgConstraints.cpp
trunk/pgadmin3/src/schema/pgFunction.cpp
Log:
Fix Create a.. toolbar button on collection

Modified: trunk/pgadmin3/BUGS.txt
================================================== =================
--- trunk/pgadmin3/BUGS.txt 2005-10-20 15:35:27 UTC (rev 4585)
+++ trunk/pgadmin3/BUGS.txt 2005-10-21 16:34:10 UTC (rev 4586)
@@ -1,5 +1,6 @@
<b>Known issues</b>
<ul>
+ <li>[Property] Working with property dialog after the corresponding node is refreshed crashes
<li>[Edit grid] Editing very large columns freezes (might be restricted to bytea)
<li>[Edit grid] bool editing doesn't know NULL; major redesign needed
<li>[Edit grid] sqlGridTextEditor is broken on Mac. We're currently using wxGridCellAutoWrapStringEditor which works but isn't overly user friendly

Modified: trunk/pgadmin3/CHANGELOG.txt
================================================== =================
--- trunk/pgadmin3/CHANGELOG.txt 2005-10-20 15:35:27 UTC (rev 4585)
+++ trunk/pgadmin3/CHANGELOG.txt 2005-10-21 16:34:10 UTC (rev 4586)
@@ -17,6 +17,7 @@
</ul>
<br>
<ul>
+ <li>2005-10-21 AP 1.4B4 Fix Create a.. toolbar button on collection (r: Li Fei)
<li>2005-10-20 AP 1.4B4 Fix Maintenance crash of disconnected DBs (r: A.J.Langereis)
<li>2005-10-20 AP 1.4B4 Fix Unicode/pgsql80win32 hint (r: Oryza Triznyak)
<li>2005-10-20 DP 1.4B4 Ensure the user can cancel the maintenance dialogue when it is running.

Modified: trunk/pgadmin3/src/dlg/dlgIndexConstraint.cpp
================================================== =================
--- trunk/pgadmin3/src/dlg/dlgIndexConstraint.cpp 2005-10-20 15:35:27 UTC (rev 4585)
+++ trunk/pgadmin3/src/dlg/dlgIndexConstraint.cpp 2005-10-21 16:34:10 UTC (rev 4586)
@@ -119,8 +119,8 @@
sql = wxT("ALTER TABLE ") + table->GetQuotedFullIdentifier()
+ wxT(" ADD");
AppendIfFilled(sql, wxT(" CONSTRAINT "), qtIdent(name));
- pgaFactory *f=pgaFactory::GetFactory(objectType);
- sql +=wxT(" ") + wxString(f->GetTypeName()).Upper() + wxT(" ") + GetDefinition()
+
+ sql +=wxT(" ") + wxString(factory->GetTypeName()).Upper() + wxT(" ") + GetDefinition()
+ wxT(";\n");
}


Modified: trunk/pgadmin3/src/dlg/dlgProperty.cpp
================================================== =================
--- trunk/pgadmin3/src/dlg/dlgProperty.cpp 2005-10-20 15:35:27 UTC (rev 4585)
+++ trunk/pgadmin3/src/dlg/dlgProperty.cpp 2005-10-21 16:34:10 UTC (rev 4586)
@@ -86,7 +86,6 @@
dlgProperty::dlgProperty(pgaFactory *f, frmMain *frame, const wxString &resName) : DialogWithHelp(frame)
{
readOnly=false;
- objectType=-1;
sqlPane=0;
processing=false;
mainForm=frame;
@@ -106,7 +105,6 @@
wxMessageBox(wxString::Format(_("Problem with resource %s: Notebook not found.\nPrepare to crash!"), resName.c_str()));
return;
}
- objectType = factory->GetId();
SetIcon(wxIcon(factory->GetImage()));

txtName = CTRL_TEXT("txtName");
@@ -272,7 +270,7 @@
wxButton *btn=btnApply;
if (btn)
btn->Hide();
- if (objectType >= 0)
+ if (factory)
SetTitle(wxGetTranslation(factory->GetNewString()));
}
if (statusBar)
@@ -451,7 +449,7 @@
{
ctlTree *browser=mainForm->GetBrowser();
pgCollection *collection = (pgCollection*)browser->GetObject(collectionItem);
- if (collection && collection->IsCollection() && collection->IsCollectionForType(objectType))
+ if (collection && collection->IsCollection() && factory->GetCollectionFactory() == collection->GetFactory())
{
pgObject *data = CreateObject(collection);
if (data)
@@ -647,14 +645,14 @@
connection=node->GetConnection();
database=node->GetDatabase();

- if (objectType != node->GetType() && !node->IsCollection())
+ if (factory != node->GetFactory() && !node->IsCollection())
{
wxCookieType cookie;
wxTreeItemId collectionItem=frame->GetBrowser()->GetFirstChild(node->GetId(), cookie);
while (collectionItem)
{
pgCollection *collection=(pgCollection*)frame->GetBrowser()->GetObject(collectionItem);
- if (collection && collection->IsCollection() && collection->IsCollectionForType(objectType))
+ if (collection && collection->IsCollection() && collection->IsCollectionFor(node))
break;

collectionItem=frame->GetBrowser()->GetNextChild(node->GetId(), cookie);
@@ -666,13 +664,13 @@
}


-dlgProperty *dlgProperty::CreateDlg(frmMain *frame, pgObject *node, bool asNew, int type)
+dlgProperty *dlgProperty::CreateDlg(frmMain *frame, pgObject *node, bool asNew, pgaFactory *factory)
{
- if (type < 0)
+ if (!factory)
{
- type=node->GetType();
+ factory=node->GetFactory();
if (node->IsCollection())
- type++;
+ factory = ((pgaCollectionFactory*)factory)->GetItemFactory();
}

pgObject *currentNode, *parentNode;
@@ -681,7 +679,7 @@
else
currentNode=node;

- if (type != node->GetType())
+ if (factory != node->GetFactory())
parentNode = node;
else
parentNode = frame->GetBrowser()->GetObject(
@@ -693,8 +691,6 @@

dlgProperty *dlg=0;

- pgaFactory *factory=pgaFactory::GetFactory(type);
-
if (factory)
{
dlg = factory->CreateDialog(frame, currentNode, parentNode);
@@ -711,7 +707,7 @@
}


-bool dlgProperty::CreateObjectDialog(frmMain *frame, pgObject *node, int type)
+bool dlgProperty::CreateObjectDialog(frmMain *frame, pgObject *node, pgaFactory *factory)
{
if (node->GetMetaType() != PGM_SERVER)
{
@@ -719,7 +715,7 @@
if (!conn || conn->GetStatus() != PGCONN_OK || !conn->IsAlive())
return false;
}
- dlgProperty *dlg=CreateDlg(frame, node, true, type);
+ dlgProperty *dlg=CreateDlg(frame, node, true, factory);

if (dlg)
{
@@ -1344,7 +1340,7 @@

wxWindow *createFactory::StartDialog(frmMain *form, pgObject *obj)
{
- if (!dlgProperty::CreateObjectDialog(form, obj, -1))
+ if (!dlgProperty::CreateObjectDialog(form, obj, 0))
form->CheckAlive();

return 0;

Modified: trunk/pgadmin3/src/include/dlgProperty.h
================================================== =================
--- trunk/pgadmin3/src/include/dlgProperty.h 2005-10-20 15:35:27 UTC (rev 4585)
+++ trunk/pgadmin3/src/include/dlgProperty.h 2005-10-21 16:34:10 UTC (rev 4586)
@@ -31,7 +31,7 @@
class dlgProperty : public DialogWithHelp
{
public:
- static bool CreateObjectDialog(frmMain *frame, pgObject *node, int type);
+ static bool CreateObjectDialog(frmMain *frame, pgObject *node, pgaFactory *factory=0);
static bool EditObjectDialog(frmMain *frame, ctlSQLBox *sqlbox, pgObject *node);
void InitDialog(frmMain *frame, pgObject *node);

@@ -57,7 +57,7 @@
void ShowObject();

void CheckValid(bool &enable, const bool condition, const wxString &msg);
- static dlgProperty *CreateDlg(frmMain *frame, pgObject *node, bool asNew, int type=-1);
+ static dlgProperty *CreateDlg(frmMain *frame, pgObject *node, bool asNew, pgaFactory *factory=0);
void AppendNameChange(wxString &sql, const wxString &objname=wxEmptyString);
void AppendOwnerChange(wxString &sql, const wxString &objName=wxEmptyString);
void AppendOwnerNew(wxString &sql, const wxString &objname);
@@ -101,7 +101,6 @@

int width, height;
wxTreeItemId item;
- int objectType;
bool readOnly;
bool processing;
pgaFactory *factory;

Modified: trunk/pgadmin3/src/include/pgConstraints.h
================================================== =================
--- trunk/pgadmin3/src/include/pgConstraints.h 2005-10-20 15:35:27 UTC (rev 4585)
+++ trunk/pgadmin3/src/include/pgConstraints.h 2005-10-21 16:34:10 UTC (rev 4586)
@@ -22,6 +22,7 @@
pgConstraintCollection(pgaFactory *factory, pgTable *table);
~pgConstraintCollection();
wxString GetHelpPage(bool forCreate) const { return wxT("pg/sql-altertable"); }
+ bool CanCreate() { return false; }
wxMenu *GetNewMenu();

void ShowTreeDetail(ctlTree *browser, frmMain *form, ctlListView *properties, ctlSQLBox *sqlPane);

Modified: trunk/pgadmin3/src/main/events.cpp
================================================== =================
--- trunk/pgadmin3/src/main/events.cpp 2005-10-20 15:35:27 UTC (rev 4585)
+++ trunk/pgadmin3/src/main/events.cpp 2005-10-21 16:34:10 UTC (rev 4586)
@@ -692,7 +692,7 @@
if (nextItem)
browser->SelectItem(nextItem);
}
- int droppedType = data->GetType();
+ pgaFactory *droppedCollFactory = data->GetFactory()->GetCollectionFactory();
browser->Delete(data->GetId());
// data is invalid now

@@ -704,7 +704,7 @@
while (parentItem)
{
collection = (pgCollection*)browser->GetObject(parentItem);
- if (collection && collection->IsCollection() && collection->IsCollectionForType(droppedType))
+ if (collection && collection->IsCollection() && collection->GetFactory() == droppedCollFactory)
{
collection->UpdateChildCount(browser);
break;
@@ -733,7 +733,7 @@

if (currentObject)
{
- if (!dlgProperty::CreateObjectDialog(this, currentObject, type))
+ if (!dlgProperty::CreateObjectDialog(this, currentObject, 0))
CheckAlive();
}
}

Modified: trunk/pgadmin3/src/schema/pgConstraints.cpp
================================================== =================
--- trunk/pgadmin3/src/schema/pgConstraints.cpp 2005-10-20 15:35:27 UTC (rev 4585)
+++ trunk/pgadmin3/src/schema/pgConstraints.cpp 2005-10-21 16:34:10 UTC (rev 4586)
@@ -77,7 +77,6 @@
pgConstraintFactory:gConstraintFactory()
: pgTableObjFactory(__("Constraint"), 0, 0, 0)
{
- metaType = PGM_CHECK;
}

pgCollection *pgConstraintFactory::CreateCollection(pgObject *obj)

Modified: trunk/pgadmin3/src/schema/pgFunction.cpp
================================================== =================
--- trunk/pgadmin3/src/schema/pgFunction.cpp 2005-10-20 15:35:27 UTC (rev 4585)
+++ trunk/pgadmin3/src/schema/pgFunction.cpp 2005-10-21 16:34:10 UTC (rev 4586)
@@ -388,8 +388,6 @@
return AppendFunctions(collection, collection->GetSchema(), browser, funcRestriction);
}

-// if (parentNode->GetType() == PG_TRIGGER)
-// parentNode = ((pgTrigger*)parentNode)->GetSchema();

pgObject *pgProcedureFactory::CreateObjects(pgCollection *collection, ctlTree *browser, const wxString &restr)
{


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:21 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com