diff --git a/.gitignore b/.gitignore index 6347211..06b1c78 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ Release/* *.bsc *.pdb include/svnversion.h +build/* diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ce63f22 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,74 @@ +cmake_minimum_required(VERSION 3.0.0) +#set(CMAKE_CXX_SYSROOT_FLAG_CODE "list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS cc)") +project(pgAdmin3 VERSION 1.26.0) +include_directories(. include include/libssh2 +) +add_compile_definitions(WX_PRECOMP) +add_compile_definitions(WX_PRECOMP) +add_compile_definitions(wxUSE_UNICODE) +add_compile_definitions(EMBED_XRC) +#add_compile_definitions(EMBED_XRC) +add_compile_options(-Wno-narrowing +) + +#set(CMAKE_CXX_EXTENSIONS OFF) +list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS c) +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +file(GLOB_RECURSE SOURCES + agent/*.c* + ctl/*.c* + db/*.c* + dd/*.c* debugger/*.c* dlg/*.c* frm/*.c* + gqb/*.c* + hotdraw/*.c* ogl/*.c* pgscript/*.c* + pro_scheduler/*.c* schema/*.c* slony/*.c* ui/xrcDialogs.cpp utils/*.c* +) + +########################################################## +find_package(LibXslt REQUIRED) +if(NOT LIBXSLT_FOUND) + message(SEND_ERROR "Failed to find LibXslt") + return() +else() + include_directories(${LIBXSLT_INCLUDE_DIR}) + link_libraries(${LIBXSLT_LIBRARIES}) +endif() +find_package(LibXml2 REQUIRED) +if(NOT LIBXML2_FOUND) + message(SEND_ERROR "Failed to find LibXml2") + return() +else() + include_directories(${LIBXML2_INCLUDE_DIR}) + link_libraries(${LIBXML2_LIBRARIES}) +endif() +find_package(wxWidgets REQUIRED stc aui base net core xrc html xml) + if(NOT wxWidgets_FOUND) + message(SEND_ERROR "Failed to find wxWidgets ") + return() + else() + include(${wxWidgets_USE_FILE}) + include_directories(${wxWidgets_INCLUDE_DIRS}) + link_libraries(${wxWidgets_LIBRARIES}) + endif() + +find_package(PostgreSQL REQUIRED) +if(NOT PostgreSQL_FOUND) + message(SEND_ERROR "Failed to find PostgreSql") + return() +else() + include_directories(${PostgreSQL_INCLUDE_DIRS}) + include_directories(${PostgreSQL_INCLUDE_DIRS}/server) + link_libraries(${PostgreSQL_LIBRARIES}) +endif() + + +add_executable(pgAdmin3 pgAdmin3.cpp ${SOURCES}) +target_precompile_headers(pgAdmin3 PUBLIC include/precomp.h) + +set(CPACK_PROJECT_NAME ${PROJECT_NAME}) +set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) + diff --git a/INSTALL.txt b/INSTALL.txt new file mode 100644 index 0000000..0247416 --- /dev/null +++ b/INSTALL.txt @@ -0,0 +1,26 @@ + +Зависимости +-------------- +cmake 3.2 +gcc10-c++ +wxWidgets 3.1.6 (Был собран из исходников https://www.wxwidgets.org/downloads/) +Postgresql 14 +libxml2 +libxslt + +Сборка +------- +mkdir build +cd build +cmake ../ +cmake --build . --config Release --target all -j 3 -- + +Полученный исполняемый файл pgAdmin3 нужно поместить в каталог оригального pgadmin3 + + +ОС для сборки использовал «Альт Рабочая станция» 10 +https://www.basealt.ru/alt-workstation/download#c1211 + +Редактировал и собирал на Visual Studio code + + diff --git a/README.md b/README.md index ee6938a..fe95775 100644 --- a/README.md +++ b/README.md @@ -201,6 +201,18 @@ English version issue #18 13.09.2021 - Добавлено меню закрытия всех открытых серверов "Disconnect all servers" - - - +13.01.2022 + - Для Log view добавлена: подержка быстрой навигации: Shift+KeyUP,KeyDOWN + переход на запись с тем же sql_state, + Alt+KeyUP,KeyDOWN - переход на запись с другим sql_state + Добавлена колонка Server - сервер с которого получен лог. + * Ctrl+S отправка сообщения по почте Outlook. Шаблон письма в файле mail.template + В первых двух строках шаблона можно указать адреса которые будут подставляться в письмо. + - В frmLog добалены сохраняемые пользовательские фильтры. + По кнопке Add текущий фильтр сохраняется. Имя задается в ComboBox. + * В окне "Status Server" устанавливается парамер "SET statement_timeout=10000;" и "SET log_min_messages = FATAL" + чтобы избежать зависания функции pg_query_state. + * При возникновении ошибки "server closed the connection unexpectedly" + сообщение об этом теперь не выводиться на экран. Т.к. происходило падение pgAdmin3 + diff --git a/Release_(3.0)/libeay32.dll b/Release_(3.0)/libeay32.dll deleted file mode 100644 index 3573963..0000000 Binary files a/Release_(3.0)/libeay32.dll and /dev/null differ diff --git a/Release_(3.0)/libiconv-2.dll b/Release_(3.0)/libiconv-2.dll deleted file mode 100644 index f7f78fc..0000000 Binary files a/Release_(3.0)/libiconv-2.dll and /dev/null differ diff --git a/Release_(3.0)/libiconv.dll b/Release_(3.0)/libiconv.dll deleted file mode 100644 index e5694fa..0000000 Binary files a/Release_(3.0)/libiconv.dll and /dev/null differ diff --git a/Release_(3.0)/libintl-8.dll b/Release_(3.0)/libintl-8.dll deleted file mode 100644 index 4a69b7c..0000000 Binary files a/Release_(3.0)/libintl-8.dll and /dev/null differ diff --git a/Release_(3.0)/libintl.dll b/Release_(3.0)/libintl.dll deleted file mode 100644 index d2fb7d1..0000000 Binary files a/Release_(3.0)/libintl.dll and /dev/null differ diff --git a/Release_(3.0)/libpq.dll b/Release_(3.0)/libpq.dll deleted file mode 100644 index adb4818..0000000 Binary files a/Release_(3.0)/libpq.dll and /dev/null differ diff --git a/Release_(3.0)/libxml2.dll b/Release_(3.0)/libxml2.dll deleted file mode 100644 index 80ff1fd..0000000 Binary files a/Release_(3.0)/libxml2.dll and /dev/null differ diff --git a/Release_(3.0)/libxslt.dll b/Release_(3.0)/libxslt.dll deleted file mode 100644 index 03804fc..0000000 Binary files a/Release_(3.0)/libxslt.dll and /dev/null differ diff --git a/Release_(3.0)/pgAdmin3.exe b/Release_(3.0)/pgAdmin3.exe deleted file mode 100644 index 4e3e259..0000000 Binary files a/Release_(3.0)/pgAdmin3.exe and /dev/null differ diff --git a/Release_(3.0)/ssleay32.dll b/Release_(3.0)/ssleay32.dll deleted file mode 100644 index e78aa94..0000000 Binary files a/Release_(3.0)/ssleay32.dll and /dev/null differ diff --git a/Release_(3.0)/textcompare_report.template b/Release_(3.0)/textcompare_report.template deleted file mode 100644 index 5bc11ac..0000000 --- a/Release_(3.0)/textcompare_report.template +++ /dev/null @@ -1,341 +0,0 @@ - - - - - - Compare object DateBase - - - -   - - -@Diff_EditCost=4 -@Match_Threshold=0.1 -@Match_Distance=300 - - - - -
- -$titleline$ - -@titleline

$titleline$

-$list$ -@[list - -@tableheader@ -
-
- $rowlist$ -
-
-@tableheader@ - -@tableheader2 - - -$tables$ - - - - - - - - - diff --git a/Release_(3.0)/wxbase30u_net_vc110.dll b/Release_(3.0)/wxbase30u_net_vc110.dll deleted file mode 100644 index 0d5a31b..0000000 Binary files a/Release_(3.0)/wxbase30u_net_vc110.dll and /dev/null differ diff --git a/Release_(3.0)/wxbase30u_vc110.dll b/Release_(3.0)/wxbase30u_vc110.dll deleted file mode 100644 index b9dfe90..0000000 Binary files a/Release_(3.0)/wxbase30u_vc110.dll and /dev/null differ diff --git a/Release_(3.0)/wxbase30u_xml_vc110.dll b/Release_(3.0)/wxbase30u_xml_vc110.dll deleted file mode 100644 index 234afb6..0000000 Binary files a/Release_(3.0)/wxbase30u_xml_vc110.dll and /dev/null differ diff --git a/Release_(3.0)/wxmsw30u_adv_vc110.dll b/Release_(3.0)/wxmsw30u_adv_vc110.dll deleted file mode 100644 index 9306044..0000000 Binary files a/Release_(3.0)/wxmsw30u_adv_vc110.dll and /dev/null differ diff --git a/Release_(3.0)/wxmsw30u_aui_vc110.dll b/Release_(3.0)/wxmsw30u_aui_vc110.dll deleted file mode 100644 index 77bc614..0000000 Binary files a/Release_(3.0)/wxmsw30u_aui_vc110.dll and /dev/null differ diff --git a/Release_(3.0)/wxmsw30u_core_vc110.dll b/Release_(3.0)/wxmsw30u_core_vc110.dll deleted file mode 100644 index c8136ec..0000000 Binary files a/Release_(3.0)/wxmsw30u_core_vc110.dll and /dev/null differ diff --git a/Release_(3.0)/wxmsw30u_html_vc110.dll b/Release_(3.0)/wxmsw30u_html_vc110.dll deleted file mode 100644 index a3b291a..0000000 Binary files a/Release_(3.0)/wxmsw30u_html_vc110.dll and /dev/null differ diff --git a/Release_(3.0)/wxmsw30u_stc_vc110.dll b/Release_(3.0)/wxmsw30u_stc_vc110.dll deleted file mode 100644 index a42522e..0000000 Binary files a/Release_(3.0)/wxmsw30u_stc_vc110.dll and /dev/null differ diff --git a/Release_(3.0)/wxmsw30u_xrc_vc110.dll b/Release_(3.0)/wxmsw30u_xrc_vc110.dll deleted file mode 100644 index 91d708b..0000000 Binary files a/Release_(3.0)/wxmsw30u_xrc_vc110.dll and /dev/null differ diff --git a/config.h b/config.h new file mode 100644 index 0000000..2ca8670 --- /dev/null +++ b/config.h @@ -0,0 +1,164 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_INET_H 1 + +/* disabled non-blocking sockets */ +/* #undef HAVE_DISABLED_NONBLOCKING */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the `EVP_aes_128_ctr' function. */ +/* #undef HAVE_EVP_AES_128_CTR */ + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* use FIONBIO for non-blocking sockets */ +/* #undef HAVE_FIONBIO */ + +/* Define to 1 if you have the `gethostbyname' function. */ +#define HAVE_GETHOSTBYNAME 1 + +/* Define to 1 if you have the `inet_ntoa' function. */ +#define HAVE_INET_NTOA 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* use ioctlsocket() for non-blocking sockets */ +/* #undef HAVE_IOCTLSOCKET */ + +/* use Ioctlsocket() for non-blocking sockets */ +/* #undef HAVE_IOCTLSOCKET_CASE */ + +/* Define if you have the gcrypt library. */ +/* #undef HAVE_LIBGCRYPT */ + +/* Define if you have the ssl library. */ +/* #undef HAVE_LIBSSL */ + +/* Define if you have the z library. */ +/* #undef HAVE_LIBZ */ + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Compile libssh2 with OpenSSL support */ +/* #undef HAVE_OPENSSL_CRYPTO */ + +/* use O_NONBLOCK for non-blocking sockets */ +#define HAVE_O_NONBLOCK 1 + +/* use SO_NONBLOCK for non-blocking sockets */ +/* #undef HAVE_SO_NONBLOCK */ + +/* Define to 1 if stdbool.h conforms to C99. */ +#define HAVE_STDBOOL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SELECT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if the system has the type `_Bool'. */ +#define HAVE__BOOL 1 + +/* Compile in zlib support */ +/* #undef LIBSSH2_HAVE_ZLIB */ + +/* Use libgcrypt */ +/* #undef LIBSSH2_LIBGCRYPT */ + +/* Compile libssh2 with OpenSSL support */ +/* #undef LIBSSH2_OPENSSL */ + +/* Name of package */ +#define PACKAGE "pgadmin3" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "pgadmin-support@postgresql.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "pgadmin3" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "pgadmin3 1.23.0-dev" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "pgadmin3" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.23.0-dev" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if you can safely include both and . */ +#define TIME_WITH_SYS_TIME 1 + +/* Version number of package */ +#define VERSION "1.23.0-dev" + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/ctl/ctlMenuToolbar.cpp b/ctl/ctlMenuToolbar.cpp index ed35259..554b3d1 100644 --- a/ctl/ctlMenuToolbar.cpp +++ b/ctl/ctlMenuToolbar.cpp @@ -108,8 +108,15 @@ void ctlMenuButton::DoProcessLeftClick(wxMouseEvent &event) menu_pos.x = 0; menu_pos.y = button_size.GetHeight(); } - + #ifdef WIN32 DoPopupMenu(m_menu, menu_pos.x, menu_pos.y); + #else + wxMenuBar* pMenuBar = winMain->GetMenuBar(); + if(m_menu->IsAttached()) m_menu->Detach(); + PopupMenu(m_menu,wxPoint(menu_pos.x, menu_pos.y)); + m_menu->Attach(pMenuBar); + #endif + } diff --git a/ctl/ctlSQLBox.cpp b/ctl/ctlSQLBox.cpp index 4c98be1..9a75edb 100644 --- a/ctl/ctlSQLBox.cpp +++ b/ctl/ctlSQLBox.cpp @@ -1019,7 +1019,12 @@ long ctlSQLBox::SelectQuery(int startposition) pend=pos; break; } + #ifdef WIN32 int i=IsDBCSLeadByte(ch)? 2 : 1; + #else + int i=1; + if (ch>255) i=2; + #endif pos=pos+i; } @@ -1036,7 +1041,12 @@ long ctlSQLBox::SelectQuery(int startposition) break; } if (ch>' ') pstart=pos; + #ifdef WIN32 int i=IsDBCSLeadByte(ch)? 2 : 1; + #else + int i=1; + if (ch>255) i=2; + #endif pos=pos-i; } @@ -1135,7 +1145,7 @@ void ctlSQLBox::OnPositionStc(wxStyledTextEvent &event) } } } - // select + // position select pos=tmp; wxString keyword; wxString ident; @@ -1542,7 +1552,7 @@ CharacterRange ctlSQLBox::RegexFindText(int minPos, int maxPos, const wxString & wxWX2MBbuf buf = text.mb_str(wxConvUTF8); ft.lpstrText = (char *)(const char *)buf; -// wx 2.8.12 +//�� ��������������� � wx 2.8.12 if (SendMsg(2150, wxSTC_FIND_REGEXP, (long)&ft) == -1) { ft.chrgText.cpMin = -1; diff --git a/ctl/ctlSQLGrid.cpp b/ctl/ctlSQLGrid.cpp index 989f62a..aa7fbed 100644 --- a/ctl/ctlSQLGrid.cpp +++ b/ctl/ctlSQLGrid.cpp @@ -30,7 +30,7 @@ BEGIN_EVENT_TABLE(ctlSQLGrid, wxGrid) EVT_GRID_COL_SIZE(ctlSQLGrid::OnGridColSize) EVT_GRID_LABEL_LEFT_CLICK(ctlSQLGrid::OnLabelClick) EVT_GRID_CELL_RIGHT_CLICK( ctlSQLGrid::OnCellRightClick) - EVT_PAINT( ctlSQLGrid::OnPaint ) + //EVT_PAINT( ctlSQLGrid::OnPaint ) END_EVENT_TABLE() IMPLEMENT_DYNAMIC_CLASS(ctlSQLGrid, wxGrid) @@ -521,7 +521,7 @@ int ctlSQLGrid::Copy(int gensql) copied = copied + (y2 - y1 + 1); } if (generatesql > 1) { - auto &g = m.getmap(); + auto g = m.getmap(); wxArrayInt cols; int maxr = g.size(); int i = 1; @@ -557,7 +557,7 @@ int ctlSQLGrid::Copy(int gensql) { wxGridCellCoords& coords = cord[n]; //wxString msg; - //msg.Printf(wxT(" row=%d col=%d.\n"), coords.GetRow(), coords.GetCol()); + //msg.Printf(wxT("���������� �������� ����� row=%d col=%d.\n"), coords.GetRow(), coords.GetCol()); //wxMessageBox(msg, wxT("About coord"), wxOK | wxICON_INFORMATION, this); int r = coords.GetRow(); if (r == curr_row) { @@ -922,7 +922,7 @@ int recurse(ctlSQLGrid *g, int pos,int row, double &transfer) { // lastnode=0; if (text.at(p)=='-') { - // + // ��������� ����� ������ ���� double m=1; // -> Nested Loop (cost=205.13..273.44 rows=4 width=188) (actual time=13.157..13.157 rows=0 loops=1) wxRegEx foundstr(wxT("actual time=.*?\\.\\.([0-9.]+).*?loops=([0-9]+)\\)"),wxRE_ADVANCED); @@ -945,7 +945,7 @@ int recurse(ctlSQLGrid *g, int pos,int row, double &transfer) { continue; } if (ppos) { diff --git a/db/keywords.c b/db/keywords.c index f9adb83..0a14d40 100644 --- a/db/keywords.c +++ b/db/keywords.c @@ -30,6 +30,11 @@ */ #define PG_KEYWORD(a,b,c) {a,c}, const ScanKeyword ScanKeywords[] = { +#ifdef WIN32 + +#else +#define PG_KEYWORD(a,b,c,d) {a,c}, +#endif #include }; const int NumScanKeywords = lengthof(ScanKeywords); diff --git a/dlg/dlgProJob.cpp b/dlg/dlgProJob.cpp index bbb7661..9205cdc 100644 --- a/dlg/dlgProJob.cpp +++ b/dlg/dlgProJob.cpp @@ -135,7 +135,7 @@ int dlgProJob::Go(bool modal) return dlgProperty::Go(modal); } -void fillarray(wxArrayString &arr,wxString &src) +void fillarray(wxArrayString &arr,const wxString &src) { int l = src.Length(); wxUniChar ln = '\n'; @@ -226,7 +226,7 @@ void dlgProJob::CheckChange() } } -wxString dlgProJob::StrAttribute(const wxString &name,wxString &value) +wxString dlgProJob::StrAttribute(const wxString &name,const wxString &value) { wxString tmp = value; //tmp.Replace("\'", "\'\'"); diff --git a/frm/frmAbout.cpp b/frm/frmAbout.cpp index 0e88b6a..202f3f2 100644 --- a/frm/frmAbout.cpp +++ b/frm/frmAbout.cpp @@ -20,9 +20,8 @@ // Copyright text #include "copyright.h" #include "version.h" -#include "svnversion.h" -#define VERSION_WITH_DATE_AND_SVN wxT("Version ") VERSION_STR wxT(" (") __TDATE__ wxT(", rev: ") wxT(VERSION_SVN) wxT(")") +#define VERSION_WITH_DATE_AND_SVN wxT("Version ") VERSION_STR wxT(" (") __TDATE__ wxT(", rev: ") wxT("") wxT(")") BEGIN_EVENT_TABLE(frmAbout, wxFrame) diff --git a/frm/frmExport.cpp b/frm/frmExport.cpp index 16097ee..2da0a47 100644 --- a/frm/frmExport.cpp +++ b/frm/frmExport.cpp @@ -20,7 +20,9 @@ #include "ctl/ctlSQLResult.h" #include #include +#ifdef WIN32 #include +#endif #define txtFilename CTRL_TEXT("txtFilename") #define btnOK CTRL_BUTTON("wxID_OK") @@ -287,7 +289,6 @@ bool frmExport::ExportXls(ctlSQLResult *grid) colCount = grid->GetNumberCols(); rowCount = grid->NumRows(); line=InitXml(colCount,rowCount+1); - wxAutomationObject excelObject; line += wxT("\n"); for (col = 0 ; col < colCount ; col++) { @@ -346,7 +347,7 @@ bool frmExport::ExportXls(ctlSQLResult *grid) xmltext=wxT("")+xmltext+wxT(""); break; case PGTYPCLASS_DATE: - //type=wxT("-- ::"); + // xmltext=xmltext.BeforeFirst('+'); if (xmltext.Replace(wxT(" "),wxT("T"))==0) { xmltext=wxT("")+xmltext+wxT(""); @@ -385,12 +386,15 @@ bool frmExport::ExportXls(ctlSQLResult *grid) ; file.Write(line, wxConvUTF8); file.Close(); +#ifdef WIN32 + wxAutomationObject excelObject; if (excelObject.CreateInstance(wxT("Excel.Application"))) { //excelObject.GetObject(xlbook,wxT("Workbooks.Add")); excelObject.CallMethod(wxT("Workbooks.Open"), fn); excelObject.PutProperty(_T("VISIBLE"), true); return true; } +#endif return false; } diff --git a/frm/frmLog.cpp b/frm/frmLog.cpp index b3155d1..8770d56 100644 --- a/frm/frmLog.cpp +++ b/frm/frmLog.cpp @@ -26,8 +26,9 @@ #include "utils/utffile.h" #include +#ifdef WIN32 #include - +#endif WX_DEFINE_OBJARRAY(RemoteConnArray2); @@ -171,6 +172,7 @@ void frmLog::OnSendMail(wxCommandEvent& event) { } html.Append(l); } + #ifdef WIN32 wxAutomationObject oObject; if (oObject.GetInstance("Outlook.Application")) { wxAutomationObject msg; @@ -182,10 +184,10 @@ void frmLog::OnSendMail(wxCommandEvent& event) { bool rez = oObject.GetObject(msg, "CreateItem", 1, n); if (rez) { //oObject.PutProperty("Visible", true); - msg.PutProperty("Subject", " "); + msg.PutProperty("Subject", "Error "); msg.PutProperty("BodyFormat", 2); msg.PutProperty("To", to); - //msg.PutProperty("BCC", " ; "); + // msg.PutProperty("Cc", cc); msg.PutProperty("HTMLBody", html); msg.CallMethod("Display"); @@ -193,7 +195,7 @@ void frmLog::OnSendMail(wxCommandEvent& event) { //oObject.PutProperty("ActiveCell.Font.Bold", @true); } - + #endif } } void frmLog::OnFind(wxCommandEvent& event) { diff --git a/frm/frmMain.cpp b/frm/frmMain.cpp index 7466155..43c863e 100644 --- a/frm/frmMain.cpp +++ b/frm/frmMain.cpp @@ -90,7 +90,9 @@ #include "schema/pgCheck.h" #include "schema/pgDomain.h" #include "schema/pgEventTrigger.h" +#ifdef WIN32 #include +#endif #include "utils/utffile.h" #if defined(HAVE_OPENSSL_CRYPTO) || defined(HAVE_GCRYPT) @@ -239,7 +241,9 @@ frmMain::frmMain(const wxString &title) // Load servers RetrieveServers(); - +#ifndef WIN32 + if (!currentObject) currentObject=serversObj; +#endif browser->Expand(root); browser->SortChildren(root); browser->SetFocus(); diff --git a/frm/frmQuery.cpp b/frm/frmQuery.cpp index df70f35..041c37b 100644 --- a/frm/frmQuery.cpp +++ b/frm/frmQuery.cpp @@ -98,7 +98,6 @@ // a simple flag will suffice. // Required because the pgScript parser isn't currently thread-safe :-( bool frmQuery::ms_pgScriptRunning = false; - BEGIN_EVENT_TABLE(frmQuery, pgFrame) EVT_ERASE_BACKGROUND( frmQuery::OnEraseBackground) EVT_SIZE( frmQuery::OnSize) @@ -248,7 +247,7 @@ void frmQuery::seticon() wxString str; wxString filename; - wxString tempDir = wxStandardPaths::Get().GetUserConfigDir() + wxT("\\postgresql\\icons\\"); + wxString tempDir = wxStandardPaths::Get().GetUserConfigDir() + wxFileName::GetPathSeparator()+"postgresql"+wxFileName::GetPathSeparator()+"icons"+wxFileName::GetPathSeparator(); wxString db = conn->GetDbname(); wxString host = conn->GetHostName(); @@ -495,7 +494,7 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w mapping["MNU_UNCOMMENT_TEXT"] = MNU_UNCOMMENT_TEXT; mapping["MNU_DOROLLBACK"] = MNU_DOROLLBACK; mapping["MNU_DOCOMMIT"] = MNU_DOCOMMIT; - wxString tempDir = wxStandardPaths::Get().GetUserConfigDir() + wxT("\\postgresql\\keymap.txt"); + wxString tempDir = wxStandardPaths::Get().GetUserConfigDir() +wxFileName::GetPathSeparator()+"postgresql"+wxFileName::GetPathSeparator()+"keymap.txt"; int idx = 0; if (wxFileName::FileExists(tempDir) ) @@ -505,7 +504,11 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w wxString str = ""; filer.Read(str); filer.Close(); + #ifdef WIN32 wxStringTokenizer tk(str, "\n\r", wxTOKEN_DEFAULT); + #else + wxStringTokenizer tk(str, "\n", wxTOKEN_DEFAULT); + #endif int d = 0; while (tk.HasMoreTokens()) { @@ -567,7 +570,7 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w toolBar = new ctlMenuToolbar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxTB_NODIVIDER); - toolBar->SetToolBitmapSize(wxSize(16, 16)); + toolBar->SetToolBitmapSize(wxSize(20, 20)); toolBar->AddTool(MNU_NEWSQLTAB, wxEmptyString, *file_new_png_bmp, _("New SQL tab"), wxITEM_NORMAL); toolBar->AddTool(MNU_OPEN, wxEmptyString, *file_open_png_bmp, _("Open file"), wxITEM_NORMAL); @@ -827,11 +830,15 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w // load temp file wxString str; wxString filename; - tempDir = wxStandardPaths::Get().GetUserConfigDir() + wxT("\\postgresql\\recovery\\"); + tempDir = wxStandardPaths::Get().GetUserConfigDir() +wxFileName::GetPathSeparator()+"postgresql"; if (!wxDirExists(tempDir)) { - wxFileName dn = tempDir; - dn.Mkdir(); + wxMkdir(tempDir); } + tempDir=tempDir+wxFileName::GetPathSeparator()+"recovery"+wxFileName::GetPathSeparator(); + if (!wxDirExists(tempDir)) { + wxMkdir(tempDir); + } + wxString pref=_conn->GetDbname(); bool modeUnicode = settings->GetUnicodeFile(); @@ -839,7 +846,7 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w wxString f = wxFindFirstFile(tempDir + wxT("*.a")); while (!f.empty()) { - filename = f.AfterLast('\\').BeforeLast('.'); + filename = f.AfterLast(sepPath).BeforeLast('.'); if (filename.BeforeFirst('.') == "_active") { activePage.Add(filename.AfterFirst('.')); //wxLogInfo(wxT("frmQuery::_active file marker: name=[%s] pref=[%s]"), filename.AfterFirst('.'), pref); @@ -849,8 +856,8 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w f = wxFindFirstFile(tempDir+wxT("*.a")); while ( !f.empty() ) { - filename=f.AfterLast('\\').BeforeLast('.'); - if ((f.AfterLast('\\').StartsWith(pref+wxT("."))||(filename.BeforeLast('.').IsEmpty()))) { + filename=f.AfterLast(sepPath).BeforeLast('.'); + if ((f.AfterLast(sepPath).StartsWith(pref+wxT("."))||(filename.BeforeLast('.').IsEmpty()))) { wxUtfFile file(f, wxFile::read, modeUnicode ? wxFONTENCODING_UTF8 : wxFONTENCODING_DEFAULT); if (file.IsOpened()) { file.Read(str); @@ -874,13 +881,12 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w sqlQuery->EmptyUndoBuffer(); sqlQuery->GotoPos(nl); - wxSafeYield(); // needed to process sqlQuery modify event - //sqlQuery->SetFilename(lastPath); - sqlQuery->SetChanged(true); - //sqlQuery->SetTitle(filename); + //wxSafeYield(); // needed to process sqlQuery modify event + sqlQuery->SetOrigin(ORIGIN_INITIAL); + sqlQuery->SetChanged(false); + setExtendedTitle(); SqlBookUpdatePageTitle(); - //SetLineEndingStyle(); SaveTempFile(); } @@ -1407,7 +1413,7 @@ void frmQuery::OnChangeConnection(wxCommandEvent &ev) for (int i=0;iSetConnection(conn); //sqlResult->SetConnection(conn); pgScript->SetConnection(conn); - title = wxT("") + cbConnection->GetValue(); + title = wxT("Query - ") + cbConnection->GetValue(); setExtendedTitle(); seticon(); //Refresh GQB Tree if used @@ -2150,7 +2156,8 @@ void frmQuery::OnChangeStc(wxStyledTextEvent &event) { sqlQuery->SetChanged(true); setExtendedTitle(); - SqlBookUpdatePageTitle(); + //SqlBookUpdatePageTitle(); + CallAfter(&frmQuery::SqlBookUpdatePageTitle); } } // do not allow update of model size of GQB on input (key press) of each @@ -2258,8 +2265,7 @@ void frmQuery::OnSummary_Column(wxCommandEvent &ev) SetStatusText(s, STATUSPOS_POS); } } - -void frmQuery::OnPositionStc(wxStyledTextEvent &event) +void frmQuery::DoUpdatePositionStc(const wxStyledTextEvent &event) { int selFrom, selTo, selCount; sqlQuery->GetSelection(&selFrom, &selTo); @@ -2275,6 +2281,11 @@ void frmQuery::OnPositionStc(wxStyledTextEvent &event) else pos.Printf(wxPLURAL("%d char", "%d chars", selCount), selCount); SetStatusText(pos, STATUSPOS_SEL); + +} +void frmQuery::OnPositionStc(wxStyledTextEvent &event) +{ + CallAfter(&frmQuery::DoUpdatePositionStc,event); } @@ -2359,8 +2370,8 @@ void frmQuery::SaveTempFile() wxString pref=conn->GetDbname(); //if (filename.StartsWith(pref)) filename+=wxT(".a"); - wxString tempDir=wxStandardPaths::Get().GetUserConfigDir()+wxT("\\postgresql\\recovery"); - wxUtfFile file(tempDir+wxT("\\")+filename, wxFile::write, modeUnicode ? wxFONTENCODING_UTF8 : wxFONTENCODING_DEFAULT); + wxString tempDir = wxStandardPaths::Get().GetUserConfigDir() +wxFileName::GetPathSeparator()+"postgresql"+wxFileName::GetPathSeparator()+"recovery"+wxFileName::GetPathSeparator(); + wxUtfFile file(tempDir+filename, wxFile::write, modeUnicode ? wxFONTENCODING_UTF8 : wxFONTENCODING_DEFAULT); if (file.IsOpened()) { int nl=sqlQuery->GetCurrentPos(); @@ -2872,7 +2883,7 @@ void frmQuery::SelectQuery() { e=p & 65535; querys=new wxString[1]; querys[0]=sqlQuery->GetTextRange(s, e); - // + // группы серверов/Серверы/serverN/Datebases/dbname sqlQuery->SetSelection(s,e); } delete [] q; @@ -4241,8 +4252,8 @@ void frmQuery::SetOutputPaneCaption(bool update) } // Methods related to SQL tabs // -void frmQuery::fileMarkerActive(bool addOrRemove, wxString &sqlTabName) { - wxString tempDir = wxStandardPaths::Get().GetUserConfigDir() + wxT("\\postgresql\\recovery\\"); +void frmQuery::fileMarkerActive(bool addOrRemove, const wxString &sqlTabName) { + wxString tempDir = wxStandardPaths::Get().GetUserConfigDir() +wxFileName::GetPathSeparator()+"postgresql"+wxFileName::GetPathSeparator()+"recovery"+wxFileName::GetPathSeparator(); wxString tabname = sqlTabName; if (sqlTabName.Find("*")>=0) tabname = sqlTabName.BeforeLast('*'); @@ -4413,10 +4424,12 @@ void frmQuery::OnSqlBookTabRDown (wxAuiNotebookEvent &event) { pref, wxOK | wxCANCEL); //setName( dlg.GetValue().wc_str() ); if (dialog.ShowModal() == wxID_OK) { - wxString tempDir=wxStandardPaths::Get().GetUserConfigDir()+wxT("\\postgresql\\recovery\\"); + wxString tempDir = wxStandardPaths::Get().GetUserConfigDir() +wxFileName::GetPathSeparator()+"postgresql"+wxFileName::GetPathSeparator()+"recovery"+wxFileName::GetPathSeparator(); wxString filename=sqlQuery->GetTitle(false); - wxRemoveFile(tempDir+filename+wxT(".a")); - wxRemoveFile(tempDir + "_active."+filename + wxT(".a")); + wxString tf=tempDir+filename+".a"; + if (wxFileName::FileExists(tf)) wxRemoveFile(tf); + tf=tempDir + "_active."+filename + ".a"; + if (wxFileName::FileExists(tf)) wxRemoveFile(tf); wxString nt=dialog.GetValue(); sqlQuery->SetTitle(nt); SqlBookUpdatePageTitle(); @@ -4460,7 +4473,7 @@ void frmQuery::OnSqlBookPageClose(wxAuiNotebookEvent &event) SqlBookDisconnectPage(); //drop temp file - wxString tempDir=wxStandardPaths::Get().GetUserConfigDir()+wxT("\\postgresql\\recovery\\"); + wxString tempDir = wxStandardPaths::Get().GetUserConfigDir() +wxFileName::GetPathSeparator()+"postgresql"+wxFileName::GetPathSeparator()+"recovery"+wxFileName::GetPathSeparator(); wxString filename=sqlQuery->GetTitle(false)+wxT(".a"); if (wxFileName::FileExists(tempDir+filename)) wxRemoveFile(tempDir+filename); fileMarkerActive(false, sqlQuery->GetTitle(false)); @@ -4547,7 +4560,7 @@ bool frmQuery::SqlBookRemovePage() SqlBookDisconnectPage(); pageidx = sqlQueryBook->GetSelection(); - wxString tempDir=wxStandardPaths::Get().GetUserConfigDir()+wxT("\\postgresql\\recovery\\"); + wxString tempDir = wxStandardPaths::Get().GetUserConfigDir() +wxFileName::GetPathSeparator()+"postgresql"+wxFileName::GetPathSeparator()+"recovery"+wxFileName::GetPathSeparator(); ctlSQLBox *box; box = wxDynamicCast(sqlQueryBook->GetPage(pageidx), ctlSQLBox); wxString filename=box->GetTitle(false); diff --git a/frm/frmReport.cpp b/frm/frmReport.cpp index fe0c827..c3ebbcc 100644 --- a/frm/frmReport.cpp +++ b/frm/frmReport.cpp @@ -35,7 +35,7 @@ #include "schema/pgCheck.h" #include "utils/utffile.h" #include - +#include "../utils/diff_match_patch.h" // XML2/XSLT headers #include #include @@ -1322,7 +1322,7 @@ void reportCompareFactory::GetExpandedChildNodes(wxTreeItemId node, wxArrayStrin } //obj->ShowTreeDetail(browser); //obj->ShowTree(parent,browser); - // + // если надо объекто сложный и сас состоит из коллекций if ((obj->GetMetaType()==PGM_SCHEMA ||obj->GetMetaType()==PGM_DATABASE ||obj->GetMetaType()==PGM_TABLE @@ -1332,8 +1332,8 @@ void reportCompareFactory::GetExpandedChildNodes(wxTreeItemId node, wxArrayStrin //obj->ShowTree(parent,browser); } else { - if (obj->GetMetaType()==PGM_VIEW) obj->ShowTreeDetail(browser); // - if (obj->GetMetaType()==PGM_EVENTTRIGGER) // + if (obj->GetMetaType() == PGM_VIEW) obj->ShowTreeDetail(browser); // только для того чтобы получить инфу о триггерах + if (obj->GetMetaType() == PGM_EVENTTRIGGER) // получаем инфу о тригеррах по событиям obj->ShowTreeDetail(browser); } } @@ -1350,7 +1350,7 @@ void reportCompareFactory::GetExpandedChildNodes(wxTreeItemId node, wxArrayStrin wxTreeItemId Item2 = browser->GetItemParent(obj->GetId()); obj=browser->GetObject(Item2); // Schemes if (obj && obj->GetMetaType()==PGM_SCHEMA&& !obj->IsCollection()) { - rec=false; // . , + rec=false; // не собираем инфу по сек. таблицам и секциям, и во внутрь не заходим obj=browser->GetObject(child); obj->ShowTreeDetail(browser); } else obj=browser->GetObject(child); @@ -1375,7 +1375,7 @@ void reportCompareFactory::GetExpandedChildNodes(wxTreeItemId node, wxArrayStrin srcpath.Replace(expandedNodes[1],expandedNodes[3],false); MyHashSQL::iterator it=h_path.find(srcpath); if (h_path.end()==it) { - // + // не найдено в первой БД if (s!=wxEmptyString) { sq =new SQL(wxEmptyString,srcpath); @@ -1442,7 +1442,7 @@ wxWindow *reportCompareFactory::StartDialog(frmMain *form, pgObject *obj) wxTreeItemIdValue foldercookie; wxTreeItemId folderitem = browser->GetFirstChild(browser->GetRootItem(), foldercookie); wxString path(form->GetNodePath(obj->GetId())); - // //serverN/Datebases/dbname + // ������ ��������/�������/serverN/Datebases/dbname // p1 p2 p3 wxString p_db; int p1=path.Find('/'); @@ -1460,20 +1460,21 @@ wxWindow *reportCompareFactory::StartDialog(frmMain *form, pgObject *obj) p_db=obj->GetServer()->GetDatabaseName(); if (p3<0) { - // + // select server //if (wxMessageBox(wxString::Format("Path = %s ,GetName() = %s, isCollection = %d", // path.c_str(), obj->GetTypeName().c_str(), obj->IsCollection()), _("Close"), wxYES_NO | wxICON_QUESTION) != wxYES) //{ // return 0; //} -// //PostgreSQL 9.6 -// - p_server_obj=path.substr(p2); // /N/ +//Группы серверов/Серверы/PostgreSQL 9.6 +// используем первую попавшуюся открытую БД + p_server_obj = path.substr(p2); // с /серверN/ - } else + } + else { -// //PostgreSQL 9.6/ /postgres - p_server_obj=path.substr(p2,p3-p2); // /N/ + // Группы серверов/Серверы/PostgreSQL 9.6/Базы данных/postgres + p_server_obj=path.substr(p2,p3-p2); // � /������N/ } wxString p_db_replace=_("Databases")+"/"+p_db+"/"; wxString p_server_replace=_("Servers")+p_server_obj; @@ -1497,14 +1498,14 @@ wxString trg_server_replace; { trg_server_replace=browser->GetItemText(server->GetId()).BeforeFirst('(').Trim(); if (srvitem!=server->GetId() && server->GetConnected()) { - // + // наше соединение не нужно нужно другое и активное pgCollection *coll = browser->FindCollection(databaseFactory, server->GetId()); if (coll) { treeObjectIterator dbs(browser, coll); while ((db = (pgDatabase *)dbs.GetNextObject()) != 0) { - // + // есть открытая БД lastdb=db; if (db->GetConnected()) { @@ -1535,15 +1536,15 @@ if (lastdb!=NULL) { newpath.Replace(p_server_replace,trg_server_replace,false); newpath.Replace(p_db_replace,trg_db_replace,false); if (!parent->SetCurrentNode(parent->GetBrowser()->GetRootItem(),newpath)) { - msg.Printf(" %s .",newpath); + msg.Printf("Not found object %s in other DB.",newpath); wxMessageBox(msg, _("Error"), wxOK | wxICON_INFORMATION); return 0; } trgobj=browser->GetObject(browser->GetSelection()); } else { - msg=" , ."; -// msg.Printf(" %s, .",browser->GetItemText(lastdb->GetServer()->GetId()).BeforeFirst('(').Trim()); + msg="Not open connecting, compare stop."; + // msg.Printf("В установленном соединении %s, нет подходящих БД.",browser->GetItemText(lastdb->GetServer()->GetId()).BeforeFirst('(').Trim()); wxMessageBox(msg, _("Error"), wxOK | wxICON_INFORMATION); return 0; } @@ -1556,7 +1557,7 @@ time_t timer=wxDateTime::GetTimeNow(); wxWindowDisabler disableAll; { #ifndef DEBUG - wxBusyInfo waiting(wxString::Format(" Path = %s , = %s", + wxBusyInfo waiting(wxString::Format(" Reading source DB Path = %s ,Start object = %s", browser->GetItemText(obj->GetServer()->GetId()).c_str(), obj->GetName().c_str(),parent)); // Give the UI a chance to redraw wxSafeYield(); @@ -1576,7 +1577,7 @@ wxSafeYield(); // return 0; { - wxBusyInfo waiting(wxString::Format(" Path = %s\n = %s", + wxBusyInfo waiting(wxString::Format(" Reading target DB Path = %s\n, Start object = %s", browser->GetItemText(trgobj->GetId()).c_str(), trgobj->GetName().c_str(),parent)); // Give the UI a chance to redraw wxSafeYield(); @@ -1640,7 +1641,7 @@ MyListSql::iterator iter2; tableheader2=wxEmptyString; tableshtml=wxEmptyString; -// +// �������� ������� #ifndef _DEBUG wxString fDir=wxStandardPaths::Get().GetExecutablePath().BeforeLast('\\')+wxT("\\"); #else @@ -1695,7 +1696,7 @@ MyListSql::iterator iter2; } // { - wxBusyInfo waiting(wxString::Format(" ...",0)); + wxBusyInfo waiting(wxString::Format(" Search for differences ...",0)); // Give the UI a chance to redraw wxSafeYield(); wxMilliSleep(50); @@ -1764,12 +1765,15 @@ h_path.clear(); std::wstring reportCompareFactory::printdiff(std::wstring str1, std::wstring str2 ) { + Diff_EditCost = 4; + Match_Threshold = 0.5; + Match_Distance = 1000; diff_match_patch dmp(Diff_EditCost,Match_Threshold,Match_Distance); std::list diffs; if (str1==str2) { return L""; } - diffs=dmp.diff_main(str1,str2); + diffs=dmp.diff_main(str1,str2,true); int nstart=0; int pos=0; countdiffline=0; @@ -1781,14 +1785,14 @@ std::wstring reportCompareFactory::printdiff(std::wstring str1, std::wstring str std::wstring t; std::wstring tableline; int rline=1,lline=1; - std::list::const_iterator it; // - it = diffs.begin(); // + std::list::const_iterator it; // объявляем итератор + it = diffs.begin(); // присваиваем ему начало списка Diff aDiff; - bool modify=false; - bool oneline=false; - nstart=0; - while (it != diffs.end()) // - { + bool modify = false; + bool oneline = false; + nstart = 0; + while (it != diffs.end()) // пока итератор не достигнет конца + { aDiff=*it; tex=aDiff.text; nstart=0; @@ -1796,18 +1800,20 @@ std::wstring reportCompareFactory::printdiff(std::wstring str1, std::wstring str pos=tex.find('\n',nstart); if (pos==-1) {t.assign(tex,nstart,tex.length());nstart=tex.length();} else {t.assign(tex,nstart,pos-nstart);nstart=pos;} if (t.length()>0) { - // - if (aDiff.operation==Operation::INSERT) cur_r+=L""+t+L""; - if (aDiff.operation==Operation::DELETE) cur_l+=L""+t+L""; - if (aDiff.operation==Operation::EQUAL) { - cur_r+=t; - cur_l+=t; - } else modify=true; - // - oneline=true; - } else + // это всё ещё одна строка + if (aDiff.operation == Operation::INSERT) cur_r += L"" + t + L""; + if (aDiff.operation == Operation::DELETE) cur_l += L"" + t + L""; + if (aDiff.operation == Operation::EQUAL) { + cur_r += t; + cur_l += t; + } + else modify = true; + // пока не встретим перевод строки считаем что это всё одна строка + oneline = true; + } + else { - // \n + // дошли до перевода \n nstart=pos+1; ncur_l=std::to_wstring(lline); ncur_l=L""; ncur_r=L""; @@ -1835,7 +1841,7 @@ std::wstring reportCompareFactory::printdiff(std::wstring str1, std::wstring str // if (( (ncur_r.empty()&&(!ncur_l.empty())) // ||(ncur_l.empty()&&(!ncur_r.empty())) // )&&(!modify)) modify=true; - // + // create columns //left tableline+=L""; tableline+= modify ? L"" : L""; @@ -1863,7 +1869,7 @@ std::wstring reportCompareFactory::printdiff(std::wstring str1, std::wstring str modify=false; oneline=false; } - } // Diff + } // цикл по строкам внутри одного Diff ++it; } #ifdef _DEBUG @@ -1877,7 +1883,7 @@ std::wstring reportCompareFactory::printdiff(std::wstring str1, std::wstring str } wxString report; - report.Append(wxString::Format(" \n%s\n",tableline)); + report.Append(wxString::Format(" Table\n%s\n",tableline)); file.Write(report, wxConvUTF8); file.Close(); @@ -1903,10 +1909,10 @@ wxString reportCompareFactory::printlvl(int element,int lvl,ArraySQL &list, wxHa wxString tid=wxString::Format("id%d",e); wxString rlist=HtmlEntities(name); wxString cdiff=wxEmptyString; - // - countdiffline=0; - if (sq.sql.length()+sq.sql2.length()>0) { - // + // таблица различий + countdiffline = 0; + if (sq.sql.length() + sq.sql2.length() > 0) { + // для одинаковых не будем таблицу формировать std::wstring t1=sq.sql.wc_str(); std::wstring t2(sq.sql2.wc_str()); t1.erase(std::remove(t1.begin(), t1.end(), '\r'), t1.end()); @@ -1929,7 +1935,7 @@ wxString reportCompareFactory::printlvl(int element,int lvl,ArraySQL &list, wxHa } } - // + // список объектов child=(wxArrayInt *)htab.Get(key); r=rowlist; r.Replace("$rowlist$",rlist+cdiff); diff --git a/frm/frmStatus.cpp b/frm/frmStatus.cpp index 595f1ac..57f3538 100644 --- a/frm/frmStatus.cpp +++ b/frm/frmStatus.cpp @@ -226,7 +226,7 @@ frmStatus::frmStatus(frmMain *form, const wxString &_title, pgConn *conn) : pgFr } //pg_is_in_recovery() wxString v = connection->ExecuteScalar(wxT("select pg_is_in_recovery()")); - + isrecovery = (v == wxT("t")); v = connection->ExecuteScalar(wxT("select current_setting('track_commit_timestamp')")); track_commit_timestamp = (v == wxT("on")); @@ -313,7 +313,7 @@ frmStatus::frmStatus(frmMain *form, const wxString &_title, pgConn *conn) : pgFr // Set up toolbar toolBar = new ctlMenuToolbar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxTB_NODIVIDER); - toolBar->SetToolBitmapSize(wxSize(16, 16)); + toolBar->SetToolBitmapSize(FromDIP(wxSize(32, 32))); toolBar->AddTool(MNU_REFRESH, wxEmptyString, *readdata_png_bmp, _("Refresh"), wxITEM_NORMAL); toolBar->AddSeparator(); toolBar->AddTool(MNU_COPY, wxEmptyString, *clip_copy_png_bmp, _("Copy selected text to clipboard"), wxITEM_NORMAL); @@ -392,7 +392,6 @@ frmStatus::frmStatus(frmMain *form, const wxString &_title, pgConn *conn) : pgFr wxString perspective; settings->Read(wxT("frmStatus/Perspective-") + wxString(FRMSTATUS_PERSPECTIVE_VER), &perspective, FRMSTATUS_DEFAULT_PERSPECTIVE); manager.LoadPerspective(perspective, true); - // Reset the captions for the current language manager.GetPane(wxT("toolBar")).Caption(_("Tool bar")); manager.GetPane(wxT("Activity")).Caption(_("Activity")); @@ -690,7 +689,7 @@ void frmStatus::AddStatusPane() statusList->GetColumn(col, item); // Reinitialize column's width - settings->Read(wxT("frmStatus/StatusPane_") + item.GetText() + wxT("_Width"), &savedwidth, item.GetWidth()); + settings->Read(wxT("frmStatus/StatusPane_") + item.GetText() + wxT("_Width"), &savedwidth, statusList->GetColumnWidth(col)); if (savedwidth > 0) statusList->SetColumnWidth(col, savedwidth); else @@ -713,7 +712,6 @@ void frmStatus::AddStatusPane() // Initialize sort order statusSortColumn = 1; statusSortOrder = wxT("ASC"); - // Create the timer statusTimer = new wxTimer(this, TIMER_STATUS_ID); } @@ -1915,7 +1913,7 @@ void frmStatus::OnRefreshStatusTimer(wxTimerEvent &event) long item = -1; item = statusList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_FOCUSED); if (item>=row) statusList->Focus(row-1); - statusList->DeleteItem(row); + if (statusList->GetItemCount()>row) statusList->DeleteItem(row); } statusList->Thaw(); wxListEvent ev; @@ -3716,7 +3714,7 @@ void frmStatus::OnRightClickStatusItem(wxListEvent& event) { int row = event.GetIndex(); //wxString txt = event.GetText(); - + if ((row<0) || (row>=statusList->GetItemCount())) return; wxRect r; //statusList->GetItemRect(row, r); wxString ss = wxEmptyString; @@ -3724,7 +3722,7 @@ void frmStatus::OnRightClickStatusItem(wxListEvent& event) for (int cc = 0; cc < statusList->GetColumnCount();cc++) { statusList->GetSubItemRect(row, cc, r, wxLIST_RECT_BOUNDS); if (r.Contains(event.GetPoint())) { - ss = wxString::Format("\rBounding rect of item %ld column %d is (%d, %d)-(%d, %d)", row,cc, r.x, r.y, r.x + r.width, r.y + r.height); + ss = wxString::Format("\rBounding rect of item %d column %d is (%d, %d)-(%d, %d)", row,cc, r.x, r.y, r.x + r.width, r.y + r.height); col = cc; break; } @@ -3761,6 +3759,7 @@ void frmStatus::OnClearFilter(wxCommandEvent& event) { void frmStatus::OnSortStatusGrid(wxListEvent &event) { // Get the information for the SQL ORDER BY + if (event.GetColumn()<0) return; if (statusSortColumn == event.GetColumn() + 1) { if (statusSortOrder == wxT("ASC")) diff --git a/include/ctl/ctlSQLGrid.h b/include/ctl/ctlSQLGrid.h index 218d4e0..0faccee 100644 --- a/include/ctl/ctlSQLGrid.h +++ b/include/ctl/ctlSQLGrid.h @@ -55,7 +55,7 @@ public: wxString GetRowLabelValue( int row ); void SetRowGroup(int row); GroupRows *grp; - int generatesql; // 0 -, 1 - insert , 2 - in_list + int generatesql; // 0 -���, 1 - insert , 2 - in_list wxString sqlquerytext; WX_DECLARE_STRING_HASH_MAP( int, ColKeySizeHashMap ); @@ -95,7 +95,7 @@ public: // default group open rowsGroup[rowgroup]=-rowgroup; //beg[rowgroup]=rowgroup; - wxASSERT(lastrowgroup>end.Count()," out of bounds"); + wxASSERT_MSG(lastrowgroup>end.Count()," out of bounds"); end[rowgroup]=lastrowgroup; run[rowgroup]=actualtime; }; diff --git a/include/dlg/dlgProJob.h b/include/dlg/dlgProJob.h index d7fe230..d47f36f 100644 --- a/include/dlg/dlgProJob.h +++ b/include/dlg/dlgProJob.h @@ -32,7 +32,7 @@ private: pgproJob *job; wxString oldsrc; ctlComboBox* cbRunas; - wxString StrAttribute(const wxString& name, wxString& value); + wxString StrAttribute(const wxString& name, const wxString& value); void append(wxString& str, const wxString& delimiter, const wxString& what); void OnChangeName(wxCommandEvent &ev); void OnSelChangeCmds(wxListEvent& ev); diff --git a/include/frm/frmQuery.h b/include/frm/frmQuery.h index 1feb48e..c101910 100644 --- a/include/frm/frmQuery.h +++ b/include/frm/frmQuery.h @@ -185,6 +185,7 @@ private: void OnChangeStc(wxStyledTextEvent &event); void OnPositionStc(wxStyledTextEvent &event); + void DoUpdatePositionStc(const wxStyledTextEvent &event); void OnLabelRightClick(wxGridEvent &event); void OnCellLeftDClick(wxGridEvent &event); void OnClose(wxCloseEvent &event); @@ -288,7 +289,7 @@ private: wxColour GetServerColour(pgConn *connection); bool relatesToWindow(wxWindow *which, wxWindow *related); - void fileMarkerActive(bool addOrRemove, wxString& sqlTabName); + void fileMarkerActive(bool addOrRemove, const wxString& sqlTabName); // Methods related to SQL tabs void SqlBookAddPage(wxString& title); bool SqlBookRemovePage(); diff --git a/include/frm/frmReport.h b/include/frm/frmReport.h index 455178c..f592562 100644 --- a/include/frm/frmReport.h +++ b/include/frm/frmReport.h @@ -140,11 +140,11 @@ private: int Match_Distance; protected: //reportCompareFactory(menuFactoryList *list) : actionFactory(list) {} - wxString reportCompareFactory::GetNodePath(wxTreeItemId node); + wxString GetNodePath(wxTreeItemId node); wxString ApplyCompareOpts(wxString sql, int metatype); wxWindow *StartDialog(frmMain *form, pgObject *obj); - void reportCompareFactory::GetExpandedChildNodes(wxTreeItemId node, wxArrayString &expandedNodes, ArraySQL &list,time_t *t,wxBusyInfo *w, MyHashSQL &h_path,int lvl); - std::wstring reportCompareFactory::printdiff(std::wstring str1, std::wstring str2 ); + void GetExpandedChildNodes(wxTreeItemId node, wxArrayString &expandedNodes, ArraySQL &list,time_t *t,wxBusyInfo *w, MyHashSQL &h_path,int lvl); + std::wstring printdiff(std::wstring str1, std::wstring str2 ); wxString printlvl(int element,int lvl,ArraySQL &list, wxHashTable &htab); frmMain *GetFrmMain() { diff --git a/include/log/MyDataViewCtrl.h b/include/log/MyDataViewCtrl.h index f3e83cf..a2c03a5 100644 --- a/include/log/MyDataViewCtrl.h +++ b/include/log/MyDataViewCtrl.h @@ -1,5 +1,5 @@ #pragma once -#include "wx\dataview.h" +#include "wx/dataview.h" #include "wx/wx.h" #include "Storage.h" class MyDataViewCtrl : diff --git a/include/log/Storage.h b/include/log/Storage.h index 4f797a2..27d1eca 100644 --- a/include/log/Storage.h +++ b/include/log/Storage.h @@ -86,7 +86,7 @@ public: wxString GetFieldStorage(int row, MyConst::colField col, bool filter); Storage(); int GetSeverityIndex(int row); - void SetHost(wxString& host) { currhost = host; }; + void SetHost(const wxString& host) { currhost = host; }; wxString GetHost() { return currhost; }; void SetErrMsgFlag(bool flag) { err_msg = flag; }; bool GetErrMsgFlag() { return err_msg; }; @@ -99,10 +99,10 @@ public: rowsignore = 0; }; wxColor& GetBgColorLine(int row); - // + // установка фильтра на колонку int SetFilter(int colfld, wxString& val, int flags); - // - // true () + // приминить фильтр для строки или для все строк хранилища + // true если строка не отфильтровалась (видна) bool ApplyFilter(int row = -1); int SetFilterArray(std::deque arr); wxString getStrGroup(wxString source); @@ -148,7 +148,7 @@ public: void removeFilter(wxString FilterName); int getLastRowIndex() { return m_cacheIndex; } - // + // всего строк в хранилище int getCountStore(); int getCountFilter(); int getCountGroup(int row); @@ -173,9 +173,9 @@ private: wxArrayInt fCol; wxArrayInt fFlags; wxArrayString fVal; - // . + // признак ошибок. bool err_msg; - // + // режим группировки bool groupFilterUse = false; bool faddgroup = false; int prevRow = -1; diff --git a/include/log/StorageModel.h b/include/log/StorageModel.h index 7e1ecaf..cc3a0d4 100644 --- a/include/log/StorageModel.h +++ b/include/log/StorageModel.h @@ -51,7 +51,7 @@ public: ApplyFilter(); } void BuildColumns(MyDataViewCtrl* ctrl); - void IncCountFreq(int col, wxString &val) { + void IncCountFreq(int col, const wxString &val) { MyHashCount::const_iterator it = freqValues[col].find(val); int cnt=0; if (it != freqValues[col].end()) diff --git a/include/pgAdmin3.h b/include/pgAdmin3.h index 6e04195..463ab21 100644 --- a/include/pgAdmin3.h +++ b/include/pgAdmin3.h @@ -11,8 +11,9 @@ #ifndef PGADMIN3_H #define PGADMIN3_H +#ifdef WIN32 #include "../utils/diff_match_patch.h" - +#endif // wxWindows headers #include @@ -70,7 +71,10 @@ const wxString GP_MAX_VERSION_T = wxT("8.3"); // The registry file #ifndef __WXMSW__ +#define sepPath '/' #define REGISTRY_FILE wxT("/etc/postgres-reg.ini") +#else +#define sepPath '\\' #endif // Some redefines for modern Microsoft compilers diff --git a/include/precomp.h b/include/precomp.h index f8d305a..8ab4234 100644 --- a/include/precomp.h +++ b/include/precomp.h @@ -10,6 +10,7 @@ ////////////////////////////////////////////////////////////////////////// #ifdef WX_PRECOMP +#ifdef __cplusplus #include "copyright.h" #include "pgAdmin3.h" @@ -246,5 +247,5 @@ #include "utils/sysProcess.h" #include "utils/sysSettings.h" #include "utils/utffile.h" - +#endif #endif diff --git a/include/pro_scheduler/pgproJob.h b/include/pro_scheduler/pgproJob.h index 731212e..05e0316 100644 --- a/include/pro_scheduler/pgproJob.h +++ b/include/pro_scheduler/pgproJob.h @@ -50,7 +50,7 @@ public: wxString GetSql(ctlTree *browser); bool NeedRefresh(); - void iSetSched(int cron, wxString &mi, wxString& h, wxString& d, wxString& wd, wxString& mon) + void iSetSched(int cron, const wxString &mi, const wxString& h, const wxString& d, const wxString& wd,const wxString& mon) { for (int i = 0; i < 60; i++) _mi[i] = false; for (int i = 0; i < 24; i++) _h[i] = false; @@ -94,7 +94,7 @@ public: _mon[j] = true; } } - // -1 . + // получить индекс следующего элемента или -1 если его уже нет. int getnext(bool array[],int len,int pos, int direct) { //int len = sizeof(array) / sizeof(array[0]); int mi = pos; @@ -111,10 +111,10 @@ public: } } while (!array[mi]); - // -1 . + // возвращает -1 если нет слудующего элемента. return mi; } - // / + // получить индекс первый/последний элемента int getfirst(bool array[], int len, int direct) { int mi = -1; if (direct == -1) mi = len ; @@ -166,7 +166,7 @@ public: } else d = nextp; // day next - // wdays + // проверим соответствие wdays wxDateTime tmp((wxDateTime::wxDateTime_t) d + 1, (wxDateTime::Month) mon, y, (wxDateTime::wxDateTime_t)h, (wxDateTime::wxDateTime_t)mi); novalid = !tmp.IsValid(); wd = tmp.GetWeekDay(); diff --git a/pgAdmin3.cpp b/pgAdmin3.cpp index 1dfd462..fa723b8 100644 --- a/pgAdmin3.cpp +++ b/pgAdmin3.cpp @@ -276,13 +276,13 @@ bool pgAdmin3::OnInit() static const wxCmdLineEntryDesc cmdLineDesc[] = { -#if wxCHECK_VERSION(2, 9, 0) +#if wxCHECK_VERSION(3, 0, 0) // wxCmdLineEntryDesc is one of the few places in 2.9 where wxT()s have any effect...they break the build {wxCMD_LINE_SWITCH, "v", "version", _("show the version, and quit"), wxCMD_LINE_VAL_NONE}, {wxCMD_LINE_SWITCH, "h", "help", _("show this help message, and quit"), wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP }, {wxCMD_LINE_OPTION, "s", "server", _("auto-connect to specified server"), wxCMD_LINE_VAL_STRING}, {wxCMD_LINE_SWITCH, "S", "serverstatus", _("open server status window"), wxCMD_LINE_VAL_NONE}, - {wxCMD_LINE_SWITCH, "L", "log window", _("open server log window"), wxCMD_LINE_VAL_NONE}, + {wxCMD_LINE_SWITCH, "L", "logwindow", _("open server log window"), wxCMD_LINE_VAL_NONE}, {wxCMD_LINE_OPTION, "Sc", "serverstatusconnect", _("connect server status window to database"), wxCMD_LINE_VAL_STRING}, {wxCMD_LINE_SWITCH, "q", "query", _("open query tool"), wxCMD_LINE_VAL_NONE}, {wxCMD_LINE_OPTION, "qc", "queryconnect", _("connect query tool to database"), wxCMD_LINE_VAL_STRING}, diff --git a/schema/pgObject.cpp b/schema/pgObject.cpp index c91ea0e..86af4e7 100644 --- a/schema/pgObject.cpp +++ b/schema/pgObject.cpp @@ -2101,7 +2101,7 @@ wxString pgObject::GetSqlReCreate(frmMain *form, pgObject *obj) wxString line; ctlTree *browser=form->GetBrowser(); wxString databasePath = form->GetNodePath(obj->GetDatabase()->GetId()); -// + // получение правила и от него уже зависимости будем раскручивать int colcount = 0; pgSetIterator set(GetConnection(), wxT("WITH RECURSIVE t(lvl,classid,objid,type_child) AS (\n") @@ -2175,7 +2175,7 @@ if (1==0) { } } wxString findobj=wxT(","); - wxString dropblock=wxT("-- \n"); + wxString dropblock=wxT("-- \n"); wxString createblock=wxEmptyString; while (set.RowsLeft()) { @@ -2266,7 +2266,7 @@ if (1==0) { } } if ( id.IsOk() ) { - // + // найден нужный элемнт pgObject *db=(pgTable *) browser->GetItemData(id); if (kind=='r') { // "table constraint" @@ -2291,7 +2291,7 @@ if (1==0) { } } else { - // + // не найдет в дереве элемент с указанным именем } findobj=findobj+table+wxT(".")+refname+wxT(","); @@ -2330,6 +2330,6 @@ if (1==0) { } - sql+=dropblock+wxT("\n\n\n")+wxT("-- ( )\n")+createblock; + sql+=dropblock+wxT("\n\n\n")+wxT("-- Create depends objects (reverse order))\n")+createblock; return sql; } diff --git a/utils/diff_match_patch.cc b/utils/diff_match_patch.cc index 54a092e..d9b7f09 100644 --- a/utils/diff_match_patch.cc +++ b/utils/diff_match_patch.cc @@ -20,7 +20,13 @@ * http://code.google.com/p/google-diff-match-patch/ */ -#include "pgAdmin3.h" +// this line need comment for Linux +#include "pgadmin3.h" +#ifndef __WXMSW__ +#include "utils/diff_match_patch.h" +#endif + + typedef std::wstring_convert, wchar_t> UnicodeEncoder; diff --git a/utils/diff_match_patch.h b/utils/diff_match_patch.h index 1d5465a..45e0ae9 100644 --- a/utils/diff_match_patch.h +++ b/utils/diff_match_patch.h @@ -19,8 +19,6 @@ * Diff Match and Patch * http://code.google.com/p/google-diff-match-patch/ */ -#include "pgadmin3.h" - #ifndef DIFF_MATCH_PATCH_H_ #define DIFF_MATCH_PATCH_H_ diff --git a/utils/log/MyDataViewCtrl.cpp b/utils/log/MyDataViewCtrl.cpp index 605d459..faf0ef5 100644 --- a/utils/log/MyDataViewCtrl.cpp +++ b/utils/log/MyDataViewCtrl.cpp @@ -325,8 +325,12 @@ void MyDataViewCtrl::OnEVT_DATAVIEW_CONTEXT_MENU(wxCommandEvent& event) { wxMenu* mi = static_cast(event.GetEventObject()); wxString label = mi->GetLabelText(id); StorageModel* m = dynamic_cast(GetModel()); - + #ifdef WIN32 int col = (int)mi->GetClientData(); + #else + long nc=(long)mi->GetClientData(); + int col= nc & 0xFFFF; + #endif if (id > 100) { int colt = 0; bool clear = false; @@ -373,7 +377,7 @@ void MyDataViewCtrl::OnEVT_DATAVIEW_CONTEXT_MENU(wxCommandEvent& event) { } } -// +// правая кнопка на ячейке void MyDataViewCtrl::OnContextMenu(wxDataViewEvent& event) { //wxString title = m_music_model->GetTitle(event.GetItem()); //wxLogMessage("wxEVT_DATAVIEW_ITEM_CONTEXT_MENU, Item: %s", title); @@ -580,15 +584,19 @@ void MyDataViewCtrl::OnMouseMove(wxMouseEvent& event) { wxString position; //position = wxString::Format("x=%d y=%d", logPos.x, logPos.y); //wxLogMessage("Mouse pos %s", position); - wxHeaderCtrl* const header = GenericGetHeader(); int dy = 0; wxSize sz; + #ifdef WIN32 + wxHeaderCtrl* const header = GenericGetHeader(); if (header) { sz = header->GetSize(); //header->Refresh(); dy = sz.GetHeight(); } mc.y += dy; + #else + mc.y+=18; // only linux compile + #endif wxDataViewItem item; wxDataViewColumn* column; diff --git a/utils/log/Storage.cpp b/utils/log/Storage.cpp index ad8f5e8..67ae744 100644 --- a/utils/log/Storage.cpp +++ b/utils/log/Storage.cpp @@ -84,7 +84,7 @@ Storage::Storage() { // load filter - wxString tempDir = wxStandardPaths::Get().GetUserConfigDir() + wxT("\\postgresql\\"); + wxString tempDir = wxStandardPaths::Get().GetUserConfigDir() + wxFileName::GetPathSeparator()+"postgresql"+wxFileName::GetPathSeparator(); wxString f = tempDir + "filter_load.txt"; if (wxFileExists(f)) { @@ -223,7 +223,7 @@ void Storage::DropColFilter(int index) { fVal.RemoveAt(index); fFlags.RemoveAt(index); } - // storage + // оставшиеся фильтры будут применены по всему storage frows.clear(); } wxString Storage::GetStringFilterExpr(int positionArrayFilter,bool addNumCol) { @@ -267,18 +267,18 @@ bool Storage::CompareFilterLine(int row, bool filter) { return false; } } - // + // Показываем строку только если она стала новой группой if (IsGroupFilter()) { - // + // если проверяем не добавленную строку то никаих проверок if (filter) return true; - // + // в детальном режиме новые группы не показываем if (faddgroup && detailGroup != -1) return false; - // + // Если это не детальная информация то тоже не показываем if (detailGroup != -1 && detailGroup == prevRow && !filter) { - // - // + // новая строка попадает в детальную группу + // сдвинем вершину на новую строку detailGroup = row; return true; } @@ -288,7 +288,7 @@ if (!faddgroup) return false; } return true; } -// +//номер строка из из отфильтрованных void Storage::setDetailGroupRow(int rowGroup) { if (IsGroupFilter()) { // @@ -296,7 +296,7 @@ void Storage::setDetailGroupRow(int rowGroup) { } else detailGroup = -1; } -// strage ( ) +// для указанной строки проверяем из strage (без фильтра) bool Storage::ApplyFilter(int row) { //if (!IsFilter()) return true; if (row != -1) { @@ -310,9 +310,9 @@ bool Storage::ApplyFilter(int row) { } if (detailGroup != -1) return false; if (IsGroupFilter()) { - // + // подменить в фильтре строк на новую for (int i = 0; i < frows.size(); i++) { - // + // тут потенциальная проблема производительности if (frows[i] != prevRow) continue; frows[i] = row; return false; @@ -327,7 +327,7 @@ bool Storage::ApplyFilter(int row) { bool f = false; faddgroup = true; if (IsGroupFilter()) { - // GroupFilter hashKeyToRow + // при включенном GroupFilter смотрим только строки hashKeyToRow frows.clear(); MyHashToRow::iterator it; for (it = hashKeyToRow.begin(); it != hashKeyToRow.end(); ++it) @@ -354,7 +354,7 @@ bool Storage::ApplyFilter(int row) { } if (frows.size() > 0) { - // + // набор фильтра изменился перепроверим отфильтрованные строки ещё раз std::deque tmp; for (int i = 0; i < frows.size(); i++) { if (CompareFilterLine(i, true)) { @@ -369,7 +369,7 @@ bool Storage::ApplyFilter(int row) { } else { - // + // набор фильтроывнных строк пустой проверим все строки на соответствие фильтру for (int i = 0; i < storage.size(); i++) { if (CompareFilterLine(i, false)) { frows.push_back(i); @@ -582,7 +582,7 @@ Line Storage::getLineParse(const wxString& str, bool csv) { } return st; } -// +// получение обобщенной ключевой строки wxString Storage::getStrGroup(wxString source) { int i = 0; int l = source.Length(); diff --git a/utils/sshTunnel.cpp b/utils/sshTunnel.cpp index ed75f34..2475eb8 100644 --- a/utils/sshTunnel.cpp +++ b/utils/sshTunnel.cpp @@ -20,6 +20,7 @@ #include "frm/frmMain.h" #pragma comment (lib, "Ws2_32.lib") +#if defined(HAVE_OPENSSL_CRYPTO) || defined(HAVE_GCRYPT) typedef const char *(*inet_ntop_t) (int af, const void *src, char *dst, socklen_t size); @@ -628,3 +629,4 @@ void LogSSHTunnelErrors(const wxString &msg, const int &id, struct _LIBSSH2_SESS g_SSHThreadMutex.Unlock(); } +#endif \ No newline at end of file diff --git a/utils/sysSettings.cpp b/utils/sysSettings.cpp index 9fe6671..f7cdf9b 100644 --- a/utils/sysSettings.cpp +++ b/utils/sysSettings.cpp @@ -63,11 +63,13 @@ sysSettings::sysSettings(const wxString &name) : wxConfig(name) sysSettings::~sysSettings() { + #ifdef WIN32 wxRegKey key(wxRegKey::HKCU, "Software\\"+appName); wxString fn= wxStandardPaths::Get().GetUserConfigDir() + wxT("\\postgresql\\autoSaveConfig.reg"); if (wxFileName::FileExists(fn)) wxRemoveFile(fn); key.Export(fn); + #endif if(defaultSettings) { delete defaultSettings; diff --git a/utils/utffile.cpp b/utils/utffile.cpp index 55a0822..e4f37cb 100644 --- a/utils/utffile.cpp +++ b/utils/utffile.cpp @@ -15,8 +15,8 @@ wxMBConvUTF16BE wxConvUTF16BE; wxMBConvUTF16LE wxConvUTF16LE; -wxMBConvUTF32BE wxConvUTF32BE; -wxMBConvUTF32LE wxConvUTF32LE; +wxMBConvUTF32BE wxConvUTF32BE_unik; +wxMBConvUTF32LE wxConvUTF32LE_unik; // these are the magic characters identifying an Unicode file #define BOM_UTF8 "\357\273\277" @@ -275,10 +275,10 @@ void wxUtfFile::DetermineConversion(wxFontEncoding encoding) m_conversion = &wxConvUTF16LE; break; case wxFONTENCODING_UTF32BE: - m_conversion = &wxConvUTF32BE; + m_conversion = &wxConvUTF32BE_unik; break; case wxFONTENCODING_UTF32LE: - m_conversion = &wxConvUTF32LE; + m_conversion = &wxConvUTF32LE_unik; break; default: break;
"+ncur_l+""+ncur_l+"