mirror of
https://github.com/levinsv/pgadmin3.git
synced 2026-05-15 14:15:49 -06:00
Add F4 key Open object
This commit is contained in:
parent
f1acc522c5
commit
e5b88a2d09
9 changed files with 73 additions and 9 deletions
10
README.md
10
README.md
|
|
@ -25,6 +25,12 @@ This text Russian language.
|
|||
Удалено отображение узлов имеющих статус (Never execute) на закладке графического плана, но в табличном виде они присутствуют.
|
||||
|
||||
01.11.2018
|
||||
Добавлено отображение publications
|
||||
Добавлено изменение фона при при не закоммиченой транзакции
|
||||
Добавлено отображение publications.
|
||||
Добавлено изменение фона при при не закоммиченой транзакции.
|
||||
У Commit/Rollback измененены горячие клавиши
|
||||
|
||||
11.12.2018
|
||||
Добавлен поиск в дереве по F4 выделеного текста и если объект найден то его открытие.
|
||||
Если запрос длится более 2 минут то после завершения запроса окно будет мигать.
|
||||
При открытия функции фокус устанавливается сразу на закладку Код.
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -25,7 +25,7 @@ BEGIN_EVENT_TABLE(ctlTree, wxTreeCtrl)
|
|||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
wxTreeItemId ctlTree::FindItem(const wxTreeItemId &idParent, const wxString &prefixOrig)
|
||||
wxTreeItemId ctlTree::FindItem(const wxTreeItemId &idParent, const wxString &prefixOrig, const bool full )
|
||||
{
|
||||
// match is case insensitive as this is more convenient to the user: having
|
||||
// to press Shift-letter to go to the item starting with a capital letter
|
||||
|
|
@ -37,7 +37,7 @@ wxTreeItemId ctlTree::FindItem(const wxTreeItemId &idParent, const wxString &pre
|
|||
// pressing it) but we shouldn't jump to the next one if the user is
|
||||
// continuing to type as otherwise he might easily skip the item he wanted
|
||||
wxTreeItemId id = idParent;
|
||||
|
||||
int le=prefix.length();
|
||||
if ( prefix.length() == 1 )
|
||||
{
|
||||
wxCookieType cookie;
|
||||
|
|
@ -61,7 +61,11 @@ wxTreeItemId ctlTree::FindItem(const wxTreeItemId &idParent, const wxString &pre
|
|||
// look for the item starting with the given prefix after it
|
||||
while ( id.IsOk() &&
|
||||
( ( GetItemText(id) == wxT("Dummy") && !GetItemData(id) ) ||
|
||||
!GetItemText(id).Lower().StartsWith(prefix) ))
|
||||
!( (!full&&GetItemText(id).Lower().StartsWith(prefix)) ||
|
||||
(full && //GetItemText(id).Lower().StartsWith(prefix) && GetItemText(id).length()==le)
|
||||
GetObject(id)->GetName()==prefix )
|
||||
)
|
||||
))
|
||||
{
|
||||
wxCookieType cookie;
|
||||
if ( HasChildren(id) )
|
||||
|
|
@ -110,7 +114,11 @@ wxTreeItemId ctlTree::FindItem(const wxTreeItemId &idParent, const wxString &pre
|
|||
// and try all the items (stop when we get to the one we started from)
|
||||
while ( id.IsOk() && id != idParent &&
|
||||
(( GetItemText(id) == wxT("Dummy") && !GetItemData(id) ) ||
|
||||
!GetItemText(id).Lower().StartsWith(prefix) ))
|
||||
!((!full&&GetItemText(id).Lower().StartsWith(prefix)) ||
|
||||
(full && //GetItemText(id).Lower().StartsWith(prefix) && GetItemText(id).length()==le)
|
||||
GetObject(id)->GetName()==prefix )
|
||||
)
|
||||
))
|
||||
{
|
||||
wxCookieType cookie;
|
||||
if ( HasChildren(id) )
|
||||
|
|
|
|||
|
|
@ -155,7 +155,6 @@ dlgFunction::dlgFunction(pgaFactory *f, frmMain *frame, pgFunction *node, pgSche
|
|||
txtSqlBox->SetMarginType(1, wxSTC_MARGIN_NUMBER);
|
||||
txtSqlBox->SetMarginWidth(1, ConvertDialogToPixels(wxPoint(16, 0)).x);
|
||||
}
|
||||
|
||||
btnAdd->Disable();
|
||||
btnRemove->Disable();
|
||||
btnChange->Disable();
|
||||
|
|
|
|||
|
|
@ -339,6 +339,11 @@ int dlgProperty::Go(bool modal)
|
|||
|
||||
wxString typeName = factory->GetTypeName();
|
||||
SetTitle(wxString(wxGetTranslation(typeName)) + wxT(" ") + GetObject()->GetFullIdentifier());
|
||||
if (typeName==wxT("Function")) {
|
||||
if (nbNotebook)
|
||||
nbNotebook->SetSelection(4);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include "dlg/dlgAddFavourite.h"
|
||||
#include "dlg/dlgManageFavourites.h"
|
||||
#include "dlg/dlgManageMacros.h"
|
||||
#include "dlg/dlgFunction.h"
|
||||
#include "frm/frmReport.h"
|
||||
#include "gqb/gqbViewController.h"
|
||||
#include "gqb/gqbModel.h"
|
||||
|
|
@ -164,6 +165,7 @@ BEGIN_EVENT_TABLE(frmQuery, pgFrame)
|
|||
EVT_MENU(MNU_LF, frmQuery::OnSetEOLMode)
|
||||
EVT_MENU(MNU_CRLF, frmQuery::OnSetEOLMode)
|
||||
EVT_MENU(MNU_CR, frmQuery::OnSetEOLMode)
|
||||
EVT_MENU(MNU_AUTOEDITOBJECT, frmQuery::OnAutoEditObject)
|
||||
EVT_MENU_RANGE(MNU_FAVOURITES_MANAGE + 1, MNU_FAVOURITES_MANAGE + 999, frmQuery::OnSelectFavourite)
|
||||
EVT_MENU_RANGE(MNU_MACROS_MANAGE + 1, MNU_MACROS_MANAGE + 99, frmQuery::OnMacroInvoke)
|
||||
EVT_ACTIVATE( frmQuery::OnActivate)
|
||||
|
|
@ -320,6 +322,7 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w
|
|||
editMenu->AppendSubMenu(formatMenu, _("F&ormat"));
|
||||
editMenu->Append(MNU_LINEENDS, _("&Line ends"), lineEndMenu);
|
||||
editMenu->Append(MNU_AUTOREPLACE_MANAGE, _("Manage autoreplace..."), _("Edit and delete autoreplace strings"));
|
||||
editMenu->Append(MNU_AUTOEDITOBJECT, _("Open object\tF4"), _("Open object in brouser tree"));
|
||||
|
||||
autoreplace = queryMacroFileProvider::LoadAutoReplace(true);
|
||||
|
||||
|
|
@ -2116,7 +2119,47 @@ int frmQuery::GetLineEndingStyle()
|
|||
return sqlQuery->GetEOLMode();
|
||||
}
|
||||
|
||||
void frmQuery::OnAutoEditObject(wxCommandEvent &event)
|
||||
{
|
||||
//parent->SetCurrentNode(parent->GetBrowser()->GetRootItem(), path);
|
||||
pgObject *obj = mainForm->GetBrowser()->GetObject(mainForm->GetBrowser()->GetSelection());
|
||||
pgFunction *fun=(pgFunction *)obj;//obj->Show
|
||||
//mainForm.propFactory->StartDialog(mainForm, obj);
|
||||
//showMessage(obj->GetTypeName());
|
||||
//return;
|
||||
if (obj->GetTypeName()==wxT("Servers")||obj->GetTypeName()==wxT("Server")||obj->GetTypeName()==wxT("Databases")
|
||||
||obj->GetTypeName()==wxT("Tablespaces")||obj->GetTypeName()==wxT("Group Roles")
|
||||
||obj->GetTypeName()==wxT("Login Roles")
|
||||
) return;
|
||||
wxString databasePath = mainForm->GetNodePath(obj->GetDatabase()->GetId());
|
||||
//showMessage(databasePath);
|
||||
wxString selText = sqlQuery->GetSelectedText();
|
||||
if (!selText.IsNull()) {
|
||||
databasePath =databasePath +wxT("/")+ _("Schemas");
|
||||
if(!mainForm->SetCurrentNode(mainForm->GetBrowser()->GetRootItem(), databasePath))
|
||||
{
|
||||
wxMessageBox(_("The specified object couldn't be found in the tree.") + databasePath);
|
||||
}
|
||||
//int n=mainForm->GetBrowser()->GetChildrenCount(mainForm->GetBrowser()->GetSelection(),false);
|
||||
wxTreeItemId matchItem = mainForm->GetBrowser()->FindItem(obj->GetId(),selText,true);
|
||||
|
||||
if (matchItem.IsOk()) {
|
||||
wxString findtext= mainForm->GetBrowser()->GetItemText(matchItem);
|
||||
pgObject *o=mainForm->GetBrowser()->GetObject(matchItem);
|
||||
//mainForm->GetBrowser()->SelectItem(o->GetId());
|
||||
//showMessage(o->GetName().Lower());
|
||||
if (o->GetName().Lower()==selText.Lower()) {
|
||||
|
||||
//obj = mainForm->GetBrowser()->GetObject(mainForm->GetBrowser()->GetSelection());
|
||||
obj=o;
|
||||
if (!dlgProperty::EditObjectDialog(mainForm, 0, obj))
|
||||
mainForm->CheckAlive();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// User-set the current EOL mode for the form
|
||||
void frmQuery::OnSetEOLMode(wxCommandEvent &event)
|
||||
{
|
||||
|
|
@ -3360,7 +3403,7 @@ void frmQuery::completeQuery(bool done, bool explain, bool verbose)
|
|||
setTools(false);
|
||||
fileMenu->Enable(MNU_EXPORT, sqlResult->CanExport());
|
||||
|
||||
if (!IsActive() || IsIconized())
|
||||
if ((!IsActive() || IsIconized())|| (elapsedQuery>120*1000))
|
||||
RequestUserAttention();
|
||||
|
||||
if (!viewMenu->IsChecked(MNU_OUTPUTPANE))
|
||||
|
|
@ -3403,6 +3446,7 @@ void frmQuery::completeQuery(bool done, bool explain, bool verbose)
|
|||
|
||||
sqlQueryExec = NULL;
|
||||
sqlQuery->SetFocus();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public:
|
|||
pgCollection *GetParentCollection(wxTreeItemId id);
|
||||
pgObject *FindObject(pgaFactory &factory, wxTreeItemId parent);
|
||||
pgCollection *FindCollection(pgaFactory &factory, wxTreeItemId parent);
|
||||
wxTreeItemId FindItem(const wxTreeItemId &item, const wxString &str);
|
||||
wxTreeItemId FindItem(const wxTreeItemId &item, const wxString &str, bool full = false);
|
||||
void NavigateTree(int keyCode);
|
||||
virtual ~ctlTree();
|
||||
|
||||
|
|
|
|||
|
|
@ -259,6 +259,7 @@ private:
|
|||
void showMessage(const wxString &msg, const wxString &msgShort = wxT(""));
|
||||
int GetLineEndingStyle();
|
||||
void OnSetEOLMode(wxCommandEvent &event);
|
||||
void OnAutoEditObject(wxCommandEvent &event);
|
||||
void SetEOLModeDisplay(int mode);
|
||||
void OnMacroInvoke(wxCommandEvent &event);
|
||||
void OnMacroManage(wxCommandEvent &event);
|
||||
|
|
|
|||
|
|
@ -130,6 +130,7 @@ enum
|
|||
MNU_TOGGLEDDSQL,
|
||||
MNU_TOGGLEMBROWSER,
|
||||
MNU_AUTOREPLACE_MANAGE,
|
||||
MNU_AUTOEDITOBJECT,
|
||||
MNU_RECENT,
|
||||
MNU_NEW = MNU_RECENT + 15, // leave space for recent file entries
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue