mirror of
https://github.com/levinsv/pgadmin3.git
synced 2026-05-15 14:15:49 -06:00
merge
This commit is contained in:
commit
de7685d5cc
3 changed files with 39 additions and 31 deletions
|
|
@ -463,12 +463,17 @@ void MyThread::readLogFile(info_files &inf,
|
|||
//statusBar->SetStatusText(_("Reading log from server..."));
|
||||
if (m_exit) return;
|
||||
pgSet* set = conn->ExecuteSet(wxT("SELECT ") + funcname +
|
||||
conn->qtDbString(logfileName) + wxT(", ") + NumToStr(logfileLength) + wxT(", 50000)"));
|
||||
conn->qtDbString(logfileName) + wxT(", ") + NumToStr(logfileLength) + wxT(", 50000,true)"));
|
||||
if (!set)
|
||||
{
|
||||
conn->IsAlive();
|
||||
return;
|
||||
}
|
||||
if (set->NumRows() == 0 || set->NumCols() ==0 || set->GetVal(0).IsNull()) {
|
||||
delete set;
|
||||
return;
|
||||
}
|
||||
|
||||
char* raw1 = set->GetCharPtr(0);
|
||||
|
||||
if (!raw1 || !*raw1)
|
||||
|
|
|
|||
|
|
@ -600,36 +600,36 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w
|
|||
SetStatusText(_("ready"), STATUSPOS_MSGS);
|
||||
|
||||
toolBar = new ctlMenuToolbar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxTB_NODIVIDER);
|
||||
|
||||
wxSize tbsz(32,32);
|
||||
//toolBar->SetToolBitmapSize(wxSize(22, 22));
|
||||
wxLogInfo(wxT("frmQuery::Create tool bar .."));
|
||||
toolBar->AddTool(MNU_NEWSQLTAB, wxEmptyString, GetBundleSVG(file_new_png_bmp, "file_new.svg", wxSize(16, 16)), _("New SQL tab"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_OPEN, wxEmptyString, GetBundleSVG(file_open_png_bmp, "file_open.svg", wxSize(16, 16)) , _("Open file"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_SAVE, wxEmptyString, GetBundleSVG(file_save_png_bmp, "file_save.svg", wxSize(16, 16)) , _("Save file"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_NEWSQLTAB, wxEmptyString, GetBundleSVG(file_new_png_bmp, "file_new.svg", tbsz), _("New SQL tab"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_OPEN, wxEmptyString, GetBundleSVG(file_open_png_bmp, "file_open.svg", tbsz) , _("Open file"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_SAVE, wxEmptyString, GetBundleSVG(file_save_png_bmp, "file_save.svg", tbsz) , _("Save file"), wxITEM_NORMAL);
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(MNU_CUT, wxEmptyString, GetBundleSVG(clip_cut_png_bmp, "clip_cut.svg", wxSize(16, 16)) , _("Cut selected text to clipboard"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_COPY, wxEmptyString, GetBundleSVG(clip_copy_png_bmp, "clip_copy.svg", wxSize(16, 16)), _("Copy selected text to clipboard"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_PASTE, wxEmptyString, GetBundleSVG(clip_paste_png_bmp, "clip_paste.svg", wxSize(16, 16)), _("Paste selected text from clipboard"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_CLEAR, wxEmptyString, GetBundleSVG(edit_clear_png_bmp, "edit_clear.svg", wxSize(16, 16)), _("Clear edit window"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_CUT, wxEmptyString, GetBundleSVG(clip_cut_png_bmp, "clip_cut.svg", tbsz) , _("Cut selected text to clipboard"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_COPY, wxEmptyString, GetBundleSVG(clip_copy_png_bmp, "clip_copy.svg", tbsz), _("Copy selected text to clipboard"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_PASTE, wxEmptyString, GetBundleSVG(clip_paste_png_bmp, "clip_paste.svg", tbsz), _("Paste selected text from clipboard"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_CLEAR, wxEmptyString, GetBundleSVG(edit_clear_png_bmp, "edit_clear.svg", tbsz), _("Clear edit window"), wxITEM_NORMAL);
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(MNU_UNDO, wxEmptyString, GetBundleSVG(edit_undo_png_bmp, "edit_undo.svg", wxSize(16, 16)), _("Undo last action"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_REDO, wxEmptyString, GetBundleSVG(edit_redo_png_bmp, "edit_redo.svg", wxSize(16, 16)), _("Redo last action"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_UNDO, wxEmptyString, GetBundleSVG(edit_undo_png_bmp, "edit_undo.svg", tbsz), _("Undo last action"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_REDO, wxEmptyString, GetBundleSVG(edit_redo_png_bmp, "edit_redo.svg", tbsz), _("Redo last action"), wxITEM_NORMAL);
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(MNU_FIND, wxEmptyString, GetBundleSVG(edit_find_png_bmp, "edit_find.svg", wxSize(16, 16)), _("Find and replace text"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_FIND, wxEmptyString, GetBundleSVG(edit_find_png_bmp, "edit_find.svg", tbsz), _("Find and replace text"), wxITEM_NORMAL);
|
||||
toolBar->AddSeparator();
|
||||
|
||||
toolBar->AddTool(MNU_EXECUTE, wxEmptyString, GetBundleSVG(query_execute_png_bmp, "query_execute.svg", wxSize(16, 16)), _("Execute query"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_EXECPGS, wxEmptyString, GetBundleSVG(query_pgscript_png_bmp, "query_pgscript.svg", wxSize(16, 16)), _("Execute pgScript"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_EXECFILE, wxEmptyString, GetBundleSVG(query_execfile_png_bmp, "query_execfile.svg", wxSize(16, 16)), _("Execute query, write result to file"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_EXPLAIN, wxEmptyString, GetBundleSVG(query_explain_png_bmp, "query_explain.svg", wxSize(16, 16)), _("Explain query"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_CANCEL, wxEmptyString, GetBundleSVG(query_cancel_png_bmp, "query_cancel.svg", wxSize(16, 16)), _("Cancel query"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_EXECUTE, wxEmptyString, GetBundleSVG(query_execute_png_bmp, "query_execute.svg", tbsz), _("Execute query"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_EXECPGS, wxEmptyString, GetBundleSVG(query_pgscript_png_bmp, "query_pgscript.svg", tbsz), _("Execute pgScript"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_EXECFILE, wxEmptyString, GetBundleSVG(query_execfile_png_bmp, "query_execfile.svg", tbsz), _("Execute query, write result to file"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_EXPLAIN, wxEmptyString, GetBundleSVG(query_explain_png_bmp, "query_explain.svg", tbsz), _("Explain query"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_CANCEL, wxEmptyString, GetBundleSVG(query_cancel_png_bmp, "query_cancel.svg", tbsz), _("Cancel query"), wxITEM_NORMAL);
|
||||
toolBar->AddSeparator();
|
||||
|
||||
toolBar->AddTool(MNU_DOCOMMIT, wxEmptyString, GetBundleSVG(query_commit_png_bmp, "query_commit.svg", wxSize(16, 16)), _("Commit"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_DOROLLBACK, wxEmptyString, GetBundleSVG(query_rollback_png_bmp, "query_rollback.svg", wxSize(16, 16)), _("Rollback"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_DOCOMMIT, wxEmptyString, GetBundleSVG(query_commit_png_bmp, "query_commit.svg", tbsz), _("Commit"), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_DOROLLBACK, wxEmptyString, GetBundleSVG(query_rollback_png_bmp, "query_rollback.svg", tbsz), _("Rollback"), wxITEM_NORMAL);
|
||||
toolBar->AddSeparator();
|
||||
|
||||
toolBar->AddTool(MNU_HELP, wxEmptyString, GetBundleSVG(help_png_bmp, "help.svg", wxSize(16, 16)), _("Display help on SQL commands."), wxITEM_NORMAL);
|
||||
toolBar->AddTool(MNU_HELP, wxEmptyString, GetBundleSVG(help_png_bmp, "help.svg", tbsz), _("Display help on SQL commands."), wxITEM_NORMAL);
|
||||
toolBar->Realize();
|
||||
wxLogInfo(wxT("frmQuery::Create tool bar Ok"));
|
||||
wxSize toolw = toolBar->GetBestSize();
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ public:
|
|||
text->Update();
|
||||
}
|
||||
}
|
||||
ctlSQLBox* createSTC()
|
||||
ctlSQLBox* createSTC(wxPanel *parent)
|
||||
{
|
||||
ctlSQLBox* text = new ctlSQLBox(this, wxID_ANY);
|
||||
ctlSQLBox* text = new ctlSQLBox(parent, wxID_ANY);
|
||||
|
||||
// text->SetMarginWidth(MARGIN_LINE_NUMBERS, 20);
|
||||
// text->StyleSetForeground(wxSTC_STYLE_LINENUMBER, wxColour(75, 75, 75));
|
||||
|
|
@ -64,10 +64,11 @@ public:
|
|||
}
|
||||
void addIndicText(ctlSQLBox* ctl, std::wstring tex, int indic) {
|
||||
wxString t(tex);
|
||||
|
||||
int start=ctl->GetLength();
|
||||
ctl->AddText(t);
|
||||
if (indic > 0) {
|
||||
ctl->IndicatorFillRange(ctl->GetLength() - t.Len(), t.Len());
|
||||
|
||||
ctl->IndicatorFillRange(start, ctl->GetLength()-start);
|
||||
}
|
||||
};
|
||||
void difftext(ctlSQLBox* ctlL, ctlSQLBox* ctlR, wxString sL, wxString sR) {
|
||||
|
|
@ -203,13 +204,6 @@ public:
|
|||
wxFrame(parent, wxID_ANY, title, wxDefaultPosition, wxSize(1200, 700))
|
||||
{
|
||||
m_changing_values = false;
|
||||
m_text1 = createSTC();
|
||||
//m_text1->SetText(sqlL);
|
||||
|
||||
m_text2 = createSTC();
|
||||
//m_text2->SetText(sqlR);
|
||||
|
||||
difftext(m_text1, m_text2, sqlL, sqlR);
|
||||
|
||||
|
||||
|
||||
|
|
@ -219,6 +213,13 @@ public:
|
|||
wxPanel* m_panelSql = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
|
||||
wxBoxSizer* bSizer2;
|
||||
bSizer2 = new wxBoxSizer(wxHORIZONTAL);
|
||||
m_text1 = createSTC(m_panelSql);
|
||||
//m_text1->SetText(sqlL);
|
||||
|
||||
m_text2 = createSTC(m_panelSql);
|
||||
//m_text2->SetText(sqlR);
|
||||
|
||||
difftext(m_text1, m_text2, sqlL, sqlR);
|
||||
|
||||
bSizer2->Add(m_text1, 1, wxEXPAND, 5);
|
||||
|
||||
|
|
@ -320,6 +321,8 @@ public:
|
|||
}
|
||||
t->SetSelection(start,pos-1);
|
||||
t->SetFirstVisibleLine(l);
|
||||
int cl=t->GetColumn(start);
|
||||
t->ScrollToColumn(cl);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue