mirror of
https://github.com/levinsv/pgadmin3.git
synced 2026-05-15 14:15:49 -06:00
merge
This commit is contained in:
commit
b9e6f7ff99
6 changed files with 50 additions and 4 deletions
|
|
@ -35,6 +35,7 @@ ctlListView::ctlListView(wxWindow* p, int id, wxPoint pos, wxSize siz, long attr
|
|||
: wxListView(p, id, pos, siz, attr | wxLC_REPORT)
|
||||
{
|
||||
nosort = false;
|
||||
autohint=false;
|
||||
order = 1;
|
||||
prev_col = -1;
|
||||
storelongstring = false;
|
||||
|
|
|
|||
|
|
@ -75,6 +75,11 @@ void ctlNavigatePanel::Init(bool reorganization) {
|
|||
cm8["hotkey"] = wxString("F8");
|
||||
cm8["description"] = wxString(_("Find all strings content current row State."));
|
||||
cmds.Append(cm8);
|
||||
wxJSONValue cm9(wxJSONType::wxJSONTYPE_OBJECT);
|
||||
cm9["name"] = wxString("AutoHint");
|
||||
cm9["hotkey"] = wxString("F9");
|
||||
cm9["description"] = wxString(_("Enable/disable auto hint."));
|
||||
cmds.Append(cm9);
|
||||
|
||||
|
||||
|
||||
|
|
@ -164,6 +169,20 @@ void ctlNavigatePanel::Init(bool reorganization) {
|
|||
if (pr >= 0 && pr <= 100) {
|
||||
findwidth = pr;
|
||||
}
|
||||
// check
|
||||
wxJSONValue r=opt["commands"];
|
||||
bool isok=false;
|
||||
for (int j = 0; j < r.Size(); j++) {
|
||||
wxJSONValue ccm = r[j];
|
||||
if (ccm["name"].AsString()=="AutoHint") {
|
||||
isok=true;
|
||||
break;
|
||||
};
|
||||
}
|
||||
if (!isok) {
|
||||
opt["commands"].Append(cm9);
|
||||
settings->WriteJsonObect("LogNavigatePanel", opt);
|
||||
}
|
||||
}
|
||||
else opt = def;
|
||||
}
|
||||
|
|
@ -300,6 +319,11 @@ bool ctlNavigatePanel::RunKeyCommand(wxKeyEvent& event,int numCmd) {
|
|||
bool shift = false;
|
||||
bool directionUp = false;
|
||||
if (isok && cmdName == "Help") help = true;
|
||||
if (isok && cmdName == "AutoHint") {
|
||||
bool curr=ctrl->ToggleAutoHint();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isok && cmdName == "FindNext") {
|
||||
// F3
|
||||
if (logFindString.IsEmpty()) cmdName = "Find";
|
||||
|
|
|
|||
|
|
@ -265,8 +265,11 @@ frmMain::frmMain(const wxString &title)
|
|||
browser->Expand(root);
|
||||
browser->SortChildren(root);
|
||||
browser->SetFocus();
|
||||
|
||||
|
||||
wxString selServerName=settings->Read(wxT("Servers/SelectItem"), "");
|
||||
if (selServerName.Len()>0) {
|
||||
wxTreeItemId sel=browser->FindItem(root,selServerName,true);
|
||||
if (sel.IsOk()) browser->SelectItem(sel);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1287,6 +1290,15 @@ void frmMain::StoreServers()
|
|||
|
||||
wxTreeItemIdValue foldercookie;
|
||||
wxTreeItemId folderitem = browser->GetFirstChild(browser->GetRootItem(), foldercookie);
|
||||
wxTreeItemId cursoritem = browser->GetSelection();
|
||||
while (cursoritem.IsOk()) {
|
||||
server = (pgServer *)browser->GetItemData(cursoritem);
|
||||
if (server != NULL && server->IsCreatedBy(serverFactory)) {
|
||||
break;
|
||||
}
|
||||
cursoritem=browser->GetItemParent(cursoritem);
|
||||
}
|
||||
wxString selServerName;
|
||||
while (folderitem)
|
||||
{
|
||||
if (browser->ItemHasChildren(folderitem))
|
||||
|
|
@ -1300,7 +1312,7 @@ void frmMain::StoreServers()
|
|||
{
|
||||
wxString key;
|
||||
++numServers;
|
||||
|
||||
if (cursoritem==serveritem) selServerName=server->GetName();
|
||||
key.Printf(wxT("Servers/%d/"), numServers);
|
||||
settings->Write(key + wxT("Server"), server->GetName());
|
||||
settings->Write(key + wxT("HostAddr"), server->GetHostAddr());
|
||||
|
|
@ -1353,6 +1365,7 @@ void frmMain::StoreServers()
|
|||
|
||||
// Write the server count
|
||||
settings->WriteInt(wxT("Servers/Count"), numServers);
|
||||
settings->Write(wxT("Servers/SelectItem"), selServerName);
|
||||
settings->FlushChanges();
|
||||
wxLogInfo(wxT("Stored %d servers."), numServers);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4791,7 +4791,7 @@ void frmStatus::OnMoveMouseLog(wxMouseEvent& event)
|
|||
if (lastlogitem != -1 || lastlogitem != item) {
|
||||
#define DELAYHITLOGPERIOD 1000
|
||||
delayHitLog->Stop();
|
||||
delayHitLog->StartOnce(DELAYHITLOGPERIOD);
|
||||
if (logList->GetAutoHint()) delayHitLog->StartOnce(DELAYHITLOGPERIOD);
|
||||
}
|
||||
else
|
||||
delayHitLog->Stop();
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ private:
|
|||
/// <param name="resort"></param>
|
||||
void SortGrid(int colsort, bool isevent);
|
||||
bool nosort; // если кто то пользуется SetItemData то не будем сортировать такие ctlListView
|
||||
bool autohint=false;
|
||||
int order, prev_col;
|
||||
// будем сохранять длинные строки 0 колонки в этом массиве
|
||||
bool storelongstring = false;
|
||||
|
|
@ -42,6 +43,8 @@ public:
|
|||
bool ReSort();
|
||||
bool IsNumberColumn(const wxString& columnlabel);
|
||||
void SetModeStoreLongString() { storelongstring = true; }
|
||||
bool ToggleAutoHint() { autohint=!autohint; return autohint;};
|
||||
bool GetAutoHint() {return autohint;};
|
||||
bool DeleteAllItemsWithLong() {
|
||||
longstring.clear();
|
||||
return wxListView::DeleteAllItems();
|
||||
|
|
|
|||
|
|
@ -1114,6 +1114,11 @@ int FormatterSQL::ParseSql(int flags) {
|
|||
}
|
||||
// no sql command
|
||||
if (ex) break;
|
||||
#ifdef _DEBUG
|
||||
int st=items[items.size()-1].srcpos+items[items.size()-1].txt.Length();
|
||||
wxString b=sql.substr(st,100);
|
||||
wxMessageBox(wxString::Format("Bad sql syntax : %s",b));
|
||||
#endif
|
||||
errorposition=i;
|
||||
return -3;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue