diff --git a/INSTALL.txt b/INSTALL.txt index ebeb76a..d25e28a 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -20,6 +20,14 @@ cmake --build . --config Release --target all -j 3 -- Могут быть проблемы с отсутствующем файлом файлом kwlist.h Его можно взять в исходниках Postgresql 15 и положить в include/parser/ +Особенности/проблемы Linux + +Некоторых комбинации могут быть перехвачены оконными менеджерами: +F10. Отключение в настройках комбинаций клавиш оконного менеджера. +ALT+Левая кнопка мыши на колонке результата. Отключение: + Для XFCE: xfconf-query -c xfwm4 -p /general/easy_click -s none + + ОС для сборки использовал «Альт Рабочая станция» 10 https://www.basealt.ru/alt-workstation/download#c1211 diff --git a/ctl/ctlSQLBox.cpp b/ctl/ctlSQLBox.cpp index 975f8a0..806a1d8 100644 --- a/ctl/ctlSQLBox.cpp +++ b/ctl/ctlSQLBox.cpp @@ -381,6 +381,7 @@ void ctlSQLBox::OnDiff(wxCommandEvent& ev) { if (wxTheClipboard->GetData(textData)) { sql_1 = textData.GetText(); } else { + wxTheClipboard->Close(); return; } @@ -1911,7 +1912,8 @@ wxString ctlSQLBox::TextToHtml(int start, int end,bool isAddNewLine, const std:: refreshgbcolor=true; bgclr="#ffff00"; tmppos=IndicatorEnd(indic,epos); - if (tmppos==textlen) spos=-1; + if (tmppos==textlen) + spos=-1; else spos=tmppos; } else if (startp>=epos && epos!=-1) { bgclr=""; @@ -1919,6 +1921,12 @@ wxString ctlSQLBox::TextToHtml(int start, int end,bool isAddNewLine, const std:: tmppos=IndicatorEnd(indic,spos); if (tmppos==textlen) epos=-1; else epos=tmppos; + if (spos==-1) epos=-1; + if (newlineadd) + { + // if add only \n + str+=lstr; lstr=""; newlineadd=false; + } } if (prevColor != tColor || refreshgbcolor) { str+= wxT(" #include @@ -927,3 +927,4 @@ wxWindow *databaseDesignerFactory::StartDialog(frmMain *form, pgObject *obj) qry = obj->GetSql(form->GetBrowser()); return StartDialogDesigner(form, obj, qry); } +#endif \ No newline at end of file diff --git a/frm/frmQuery.cpp b/frm/frmQuery.cpp index 538429d..b9d8915 100644 --- a/frm/frmQuery.cpp +++ b/frm/frmQuery.cpp @@ -3138,6 +3138,10 @@ void frmQuery::OnExecute(wxCommandEvent &event) void frmQuery::OnExecScript(wxCommandEvent &event) { + #ifdef NO_PGSCRIPT + wxMessageBox(("pgScript disable."), ("Disable compile support pgScript."), wxICON_WARNING | wxOK); + return; + #endif // Get the script wxString query = sqlQuery->GetSelectedText(); if (query.IsNull()) diff --git a/include/ctl/SourceViewDialog.h b/include/ctl/SourceViewDialog.h index 59b7841..cd8dc4a 100644 --- a/include/ctl/SourceViewDialog.h +++ b/include/ctl/SourceViewDialog.h @@ -134,7 +134,6 @@ public: ctlR->IndicatorSetAlpha(s_indicHighlight, 50); ctlR->IndicatorSetStyle(s_indicHighlight, wxSTC_INDIC_ROUNDBOX); ctlR->SetIndicatorCurrent(s_indicHighlight); - while (it != diffs.end()) // ���� �������� �� ��������� ����� { aDiff = *it; @@ -154,7 +153,8 @@ public: cl.table=escapeHtml(t,false); cl.table.Replace("\t","     "); cl.level=s_indicHighlight; - cl.startIndex=ctlR->GetTextLength(); + // Scintillia not support length text in chars + cl.startIndex=ctlR->GetText().Length(); FSQL::complite_element prev; if (listdelete.size()>0) { prev=listdelete[listdelete.size()-1]; @@ -192,7 +192,7 @@ public: FSQL::complite_element cl={}; cl.table=escapeHtml("\n",false); cl.level=s_indicHighlight; - cl.startIndex=ctlR->GetTextLength(); + cl.startIndex=ctlR->GetText().Length(); FSQL::complite_element prev; if (listdelete.size()>0) { prev=listdelete[listdelete.size()-1]; @@ -400,6 +400,9 @@ public: t->SetFirstVisibleLine(l); int cl=t->GetColumn(start); t->ScrollToColumn(cl); + // sync line visible position other window + if (t!=m_text2) m_text2->SetFirstVisibleLine(l); + if (t!=m_text1) m_text1->SetFirstVisibleLine(l); break; } else { @@ -470,10 +473,14 @@ public: } void onHtmlDiff(wxCommandEvent& evt) { if (m_text2->GetLength()>0) { + m_text2->Colourise(0,m_text2->GetLastPosition()); wxString html=m_text2->TextToHtml(0,m_text2->GetLength(),false,listdelete); if (wxTheClipboard->Open()) { - wxTheClipboard->SetData(new wxHTMLDataObject(html)); + wxDataObjectComposite* dataobj = new wxDataObjectComposite(); + dataobj->Add(new wxTextDataObject(html)); + dataobj->Add(new wxHTMLDataObject(html)); + wxTheClipboard->SetData(dataobj); wxTheClipboard->Close(); } @@ -484,6 +491,8 @@ public: wxWindow *wnd = lastfocus; wxString html; if (wnd) { + m_text2->Colourise(0,m_text2->GetLastPosition()); + m_text1->Colourise(0,m_text1->GetLastPosition()); if (m_text2==wnd) html=m_text2->TextToHtml(0,m_text2->GetLength(),false); if (m_text1==wnd) html=m_text1->TextToHtml(0,m_text1->GetLength(),false); if (html.Length()>0 && wxTheClipboard->Open()) diff --git a/include/pgscript/pgsApplication.h b/include/pgscript/pgsApplication.h index 7e3e950..4056195 100644 --- a/include/pgscript/pgsApplication.h +++ b/include/pgscript/pgsApplication.h @@ -11,6 +11,7 @@ #ifndef PGSAPP_H_ #define PGSAPP_H_ +#ifndef NO_PGSCRIPT #include "pgscript/pgScript.h" #include "pgscript/utilities/pgsThread.h" @@ -124,5 +125,68 @@ private: pgsApplication &operator=(const pgsApplication &that); }; +#else + //NO_PGSCRIPT + #define pgsOutputStream wxTextOutputStream +class pgsApplication +{ +public: + static const int default_port = 5432; + pgsApplication(pgConn *connection) {}; + + /** Deletes custom connection if one was created (first constructor). */ + + /** Parses a file by creating a new thread. */ + bool ParseFile(const wxString &file, pgsOutputStream &out, + wxMBConv *conv = &wxConvLocal) {return false;}; + + /** Parses a string by creating a new thread. */ + bool ParseString(const wxString &string, pgsOutputStream &out) {return false;}; + + /** Is m_thread running? */ + bool IsRunning() {return false;}; + + /** If m_thread is running then wait for it to terminate. */ + void Wait(); + + /** If m_thread is running then delete it. */ + void Terminate() {}; + + /** Called by m_thread when the thread is finished: IsRunning() becomes + * false and m_event_id is pushed into the event queue if m_caller exists. */ + void Complete() {}; + + /** Uses a new database connection instead of the previous one. If the + * previous one was user-defined then it is deleted otherwise it is just + * replaced with the new one. */ + void SetConnection(pgConn *conn) {}; + + /** Deletes everything in the symbol table. */ + void ClearSymbols() {}; + +#if !defined(PGSCLI) + /** Used in pgAdmin integration for sending an event to the caller when the + * thread is finishing its task. */ + void SetCaller(wxWindow *caller, long event_id) {}; +#endif // PGSCLI + + /** Tells whether the database connection is valid. */ + bool IsConnectionValid() const { return true;}; + + /** Gets a lock on the output stream. */ + void LockOutput() {}; + + /** Releases the lock on the output stream. */ + void UnlockOutput() {}; + + /** Was there an error? */ + bool errorOccurred() const {return false;}; + + /** Get the position (line) of the last error. */ + int errorLine() const {return 0;}; + +private: +}; +#endif #endif /*PGSAPP_H_*/