Re: Patch: view data for tables/views on double - Mailing list pgadmin-support
From | Diego A. Gil |
---|---|
Subject | Re: Patch: view data for tables/views on double |
Date | |
Msg-id | 1095328522.3407.11.camel@roadwarrior.adminsa.com Whole thread Raw |
In response to | Patch: view data for tables/views on double click (Ivan Nejgebauer <ian-pgasup@uns.ns.ac.yu>) |
List | pgadmin-support |
I guess it depends on user type. If user is a developer or database designer, showing properties could be the desired default action. If user is a more like a final user, viewing data maybe is the right choice. Couldn 't be this behavoir be an option ?. Something like "Show object properties on double click in treeview" under Options -> Preferences. Diego. El jue, 16-09-2004 a las 06:42, Ivan Nejgebauer escribió: > The attached patch a) defines a double click handler for the list in the > properties pane, so that a double click on an item in the list launches > the properties editor for the item (or the data view if the item is a > table or a view); and b) modifies the tree view double click handler so > that a double click on a table or a view launches the data view for the > corresponding table/view. > > Rationale for different behavior with tables/views: most of the time, it > is expected that the user is interested in table/view _data_, not > properties, so the default action on a table/view shoud be to display > its data. > > Comments? > > i. > > ______________________________________________________________________ > --- src/include/frmMain.h.old Tue Aug 10 22:51:45 2004 > +++ src/include/frmMain.h Wed Sep 15 11:56:51 2004 > @@ -110,6 +110,7 @@ > > void OnPageChange(wxNotebookEvent& event); > void OnPropSelChanged(wxListEvent& event); > + void OnPropSelActivated(wxListEvent& event); > void OnTreeSelChanged(wxTreeEvent &event); > void OnTreeKeyDown(wxTreeEvent& event); > void OnConnect(wxCommandEvent &ev); > --- src/ui/events.cpp.old Tue Sep 7 10:34:34 2004 > +++ src/ui/events.cpp Wed Sep 15 15:12:51 2004 > @@ -122,6 +122,7 @@ > EVT_MENU(MNU_CONTEXTMENU, frmMain::OnContextMenu) > EVT_NOTEBOOK_PAGE_CHANGED(CTL_NOTEBOOK, frmMain::OnPageChange) > EVT_LIST_ITEM_SELECTED(CTL_PROPVIEW, frmMain::OnPropSelChanged) > + EVT_LIST_ITEM_ACTIVATED(CTL_PROPVIEW, frmMain::OnPropSelActivated) > EVT_TREE_SEL_CHANGED(CTL_BROWSER, frmMain::OnTreeSelChanged) > EVT_TREE_ITEM_EXPANDING(CTL_BROWSER, frmMain::OnExpand) > EVT_TREE_ITEM_COLLAPSING(CTL_BROWSER, frmMain::OnCollapse) > @@ -684,6 +685,30 @@ > } > > > +void frmMain::OnPropSelActivated(wxListEvent& event) > +{ > + wxTreeItemId item=browser->GetSelection(); > + pgObject *data=(pgObject*)browser->GetItemData(item); > + wxCommandEvent nullEvent; > + > + if (!settings->GetDoubleClickProperties()) > + return; > + if (data && data->IsCollection()) > + { > + data=((pgCollection*)data)->FindChild(browser, event.GetIndex()); > + if (data) > + { > + int type = data->GetType(); > + if (type == PG_TABLE || type == PG_VIEW) > + ViewData(false); > + else if (data->CanEdit()) > + if (!dlgProperty::EditObjectDialog(this, sqlPane, data)) > + checkAlive(); > + } > + } > +} > + > + > void frmMain::OnTreeSelChanged(wxTreeEvent& event) > { > denyCollapseItem=wxTreeItemId(); > @@ -958,13 +983,22 @@ > } > break; > > + case PG_TABLE: > + case PG_VIEW: > + if (settings->GetDoubleClickProperties()) { > + denyCollapseItem=item; > + ViewData(false); > + return; > + } > + break; > + > default: > if (settings->GetDoubleClickProperties()) > { > if (data->CanEdit()) > { > + denyCollapseItem=item; > OnProperties(nullEvent); > - event.Skip(); > return; > } > } > > ______________________________________________________________________ > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match
pgadmin-support by date: