fix without patch

Приведение в соответствие с github
Патч делать не нужно.
This commit is contained in:
lsv 2022-04-27 16:01:13 +05:00
parent bdfca63db0
commit 9e9bfef8b8
56 changed files with 512 additions and 505 deletions

1
.gitignore vendored
View file

@ -9,3 +9,4 @@ Release/*
*.bsc
*.pdb
include/svnversion.h
build/*

74
CMakeLists.txt Normal file
View file

@ -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})

26
INSTALL.txt Normal file
View file

@ -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

View file

@ -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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,341 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="Text Compare! is an online diff tool that can find the difference between two text documents. Just paste and compare.">
<title>Compare object DateBase </title>
<body style="zoom: 1;">
&nbsp;
@Diff_EditCost=4
@Match_Threshold=0.1
@Match_Distance=300
<style type="text/css">
body {
/*font-family: monospace;*/
width : 100%;
text-align:center;
background: white;
padding: 0;
margin: 0;
}
div.logo {
background-repeat: repeat;
/*background-position: top;*/
height: 30px;
/*overflow: hidden;*/
background-color: #5CA96D;
background-image: linear-gradient(90deg, #4E905D, #6BC57F);
}
div.logocompare {
display: block;
margin-left: auto;
margin-right: auto;
color: #f9f9f9;
font-size: 20px;
font-weight: bold;
text-decoration: none;
text-shadow:1px 1px grey;
padding-top: 10px;
}
.logost {
display: block;
margin-left: auto;
margin-right: auto;
color: #f9f9f9;
font-size: 16px;
font-weight: bold;
text-decoration: none;
text-shadow:1px 1px grey;
padding-top: 5px;
}
div.logoheader {
background-repeat: repeat;
/*background-position: top;*/
height: 40px;
/*overflow: hidden;*/
background-color: #4488C7;
background-image: linear-gradient(90deg, #0B70CD, #5C90C0);
}
.logo_background {
/* background-image:url('tiny_grid-transparent.png'); */
width: 100%;
height: 100%;
}
div.logo, div.mainContent, .addThisFooter, div.logocompare {
text-align:center;
/*width: 95%;*/
margin-left: auto;
margin-right: auto;
}
.addThisFooter {
margin-bottom: 150px;
}
.logotext {
display: block;
margin-left: auto;
margin-right: auto;
color: #f9f9f9;
font-size: 25px;
font-weight: bold;
text-decoration: none;
text-shadow:1px 1px grey;
padding-top: 5px;
}
table {
font-size: 12px;
}
div.mainContent {
background: #eee;
/*background-image:url('tc-bgtop-bottom.png'); */
background-repeat: repeat-x;
background-position: top;
/*border-bottom: 2px white solid;*/
margin-bottom: 15px;
border-bottom: 1px solid #ddd;
border-top: 1px solid #ddd;
}
.lineContent {
width: 49%;
}
.lineContent pre {
/* Undoing bootstrap CSS for PRE tags */
padding: 0;
margin: 0;
background-color: white;
border: 0;
border-radius: 0;
line-height: normal;
padding-left: 2px;
padding-right: 2px;
/* Make sure really long strings are wrapped. */
background: white;
margin: 0;
-ms-word-break: break-all;
-ms-word-wrap: break-all;
-webkit-word-break: break-word;
-webkit-word-wrap: break-word;
word-break: break-word;
word-wrap: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
white-space: pre-wrap;
}
.text-compare {
font-size: 12px;
}
img {
border: none;
}
.navImage {
border:0px;
padding-left:5px;
padding-right:5px;
margin:0px;
}
.delimiter {
heigth:40px;
display: inline-block;
}
label {
font-size: 14px;
font-weight: normal !important;
margin-bottom: 0px !important;
}
h2 { font-size: 130%; padding-bottom: 0.5ex; color: #009ACE; border-bottom-style: solid; border-bottom-width: 2px; }
h3 { font-size: 110%; padding-bottom: 0.5ex; color: #000000; }
.text-compare {
border: 1px solid #ababab;
background: white;
line-height: normal;
}
.text-compare, div.sendEmail {
width: 98%;
margin-left: auto;
margin-right: auto;
}
tbody {
border: none;
}
.text-compare td {font-family: monospace;}
colgroup {border-color: #ababab;}
.link_first {
background-image:url('tc-arrow-down-green.png');
background-position: top;
background-repeat: no-repeat;
}
.link_next {
background-image:url('tc-arrow-down-blue.png');
background-position: top;
background-repeat: no-repeat;
}
.link_top {
background-image:url('tc-arrow-up-orange.png');
background-position: top;
background-repeat: no-repeat;
}
.link_top, .link_next, .link_first {
height: 12px;
width: 11px;
}
.link_section {
height: 18px;
}
.text-section {
font-size: 15px;
}
.diff_next {
width: 11px;
}
.text_next, .text_first, .text_top {visibility: hidden;}
td {
padding-left: 2px;
padding-right: 2px;
}
.diff_header { width: 1em;}
.difference {
width: 1em;
background: #A9D0F5;
}
.differencei {
width: 1em;
background: Gold;
}
.differenced {
width: 1em;
background: #A9D0F5;
}
.has_difference {
background: #97D397;
width: 1em;
user-select: none;
}
.diff_header, .diff_next {
vertical-align:top;
background: #dedede;
user-select: none;
}
.diff_next {padding-top:2px;}
.diff_remove {background: Pink;}
.diff_insert {background: SkyBlue;}
.diff_eq {background: #eeeeee;}
.diff_eqhidden {display: none;}
.diff_ne {background: LightGreen;}
.lineContent {
vertical-align:top;
text-align:left;
}
</style>
<div class="mainContent">
$titleline$
@titleline <h2 id="group-list" style="text-align: left;">$titleline$</h2>
$list$
@[list <ul type="square" style="text-align: left;">
@rowlist <li id="_@idtablecmp@" class="diff_@color@"><a href="#@idtablecmp@"> $rowlist$ </a></li>
@]list </ul>
@tableheader@
<div class="logoheader">
<div class="logo_background">
<a id="@idtablecmp@" href="#_@idtablecmp@" class="logotext">$rowlist$</a>
</div>
</div>
@tableheader@
@tableheader2 <table class="text-compare" id="t@idtablecmp@" cellspacing="0" cellpadding="0" rules="groups"> <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup> <tbody>
$tables$
</div>
<script>
function c(t)
{
console.log(t.parentNode)
console.log(t.parentNode.parentNode.parentNode)
var myTab= t.parentNode.parentNode.parentNode;
var text='';
var j=t.cellIndex;
console.log('cellIndex='+t.cellIndex);
for (i = 0; i < myTab.rows.length; i++) {
text = text + myTab.rows.item(i).cells.item(j+2).innerText +'\n';
}
var node = document.createElement('textarea');
var selection = document.getSelection();
node.textContent = text;
document.body.appendChild(node);
selection.removeAllRanges();
node.select();
document.execCommand('copy');
selection.removeAllRanges();
document.body.removeChild(node);
alert('SQL copy to clipbord Length: '+text.length);
}
function d(t)
{
console.log(t.parentNode)
var myTab= t.parentNode.parentNode.parentNode;
var text='';
var j=t.cellIndex;
console.log('cellIndex='+t.cellIndex);
for (i = 0; i < myTab.rows.length; i++) {
var sel=myTab.rows.item(i).cells.item(j+1);
// sel.setAttribute("style", "color:grey; user-select: none;");
console.log(sel.style.userSelect);
if (sel.style.userSelect=="") { sel.setAttribute("style", "color:grey; user-select: none;");}
else
{sel.style.userSelect = null; sel.style.color= null;}
//console.log(sel.style)
}
}
</script>
</body></html>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

164
config.h Normal file
View file

@ -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 <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1
/* disabled non-blocking sockets */
/* #undef HAVE_DISABLED_NONBLOCKING */
/* Define to 1 if you have the <errno.h> 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 <fcntl.h> 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 <inttypes.h> 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 <memory.h> 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 <netdb.h> header file. */
#define HAVE_NETDB_H 1
/* Define to 1 if you have the <netinet/in.h> 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 <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdio.h> header file. */
#define HAVE_STDIO_H 1
/* Define to 1 if you have the <stdlib.h> 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 <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1
/* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/uio.h> header file. */
#define HAVE_SYS_UIO_H 1
/* Define to 1 if you have the <sys/un.h> header file. */
#define HAVE_SYS_UN_H 1
/* Define to 1 if you have the <unistd.h> 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 <sys/time.h> and <time.h>. */
#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 <sys/types.h> does not define. */
/* #undef size_t */

View file

@ -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
}

View file

@ -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
//<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> wx 2.8.12
if (SendMsg(2150, wxSTC_FIND_REGEXP, (long)&ft) == -1)
{
ft.chrgText.cpMin = -1;

View file

@ -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("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> 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)=='-') {
// посчитаем время работы узла
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
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 (p<pos) {
// end level
// leveltime содержит время сумаррное время работы узлов этого уровня
// leveltime <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
transfer=leveltime;
return row;
} if (p>pos) {

View file

@ -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 <parser/kwlist.h>
};
const int NumScanKeywords = lengthof(ScanKeywords);

View file

@ -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("\'", "\'\'");

View file

@ -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)

View file

@ -20,7 +20,9 @@
#include "ctl/ctlSQLResult.h"
#include <wx/wx.h>
#include <wx/clipbrd.h>
#ifdef WIN32
#include <wx/msw/ole/automtn.h>
#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("<Row>\n");
for (col = 0 ; col < colCount ; col++)
{
@ -346,7 +347,7 @@ bool frmExport::ExportXls(ctlSQLResult *grid)
xmltext=wxT("<Cell ss:StyleID=\"")+style+wxT("\"><Data ss:Type=\"String\">")+xmltext+wxT("</Data></Cell>");
break;
case PGTYPCLASS_DATE:
//type=wxT("ÃÃÃÃ-ÌÌ-ÄÄ ÷÷:ìì:ññ");
//
xmltext=xmltext.BeforeFirst('+');
if (xmltext.Replace(wxT(" "),wxT("T"))==0) {
xmltext=wxT("<Cell ss:StyleID=\"")+style+wxT("\"><Data ss:Type=\"String\">")+xmltext+wxT("</Data></Cell>");
@ -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;
}

View file

@ -26,8 +26,9 @@
#include "utils/utffile.h"
#include <wx/arrimpl.cpp>
#ifdef WIN32
#include <wx/msw/ole/automtn.h>
#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", "Áàëàøîâ Èãîðü Íèêîëàåâè÷ <Balashov_IN@surgutneftegas.ru>; Èâàíîâ Àðòåì Ãåííàäüåâè÷ <Ivanov_AG13@surgutneftegas.ru>");
//
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) {

View file

@ -90,7 +90,9 @@
#include "schema/pgCheck.h"
#include "schema/pgDomain.h"
#include "schema/pgEventTrigger.h"
#ifdef WIN32
#include <wx/msw/ole/automtn.h>
#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();

View file

@ -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;i<len;i++) if (ctlSQL[i]!=NULL) ctlSQL[i]->SetConnection(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);

View file

@ -35,7 +35,7 @@
#include "schema/pgCheck.h"
#include "utils/utffile.h"
#include <wx/stdpaths.h>
#include "../utils/diff_match_patch.h"
// XML2/XSLT headers
#include <libxslt/transform.h>
#include <libxslt/xsltutils.h>
@ -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
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/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); // <EFBFBD> /<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>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;
// Загрузка шаблона
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#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<Diff> 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<Diff>::const_iterator it; // объявляем итератор
it = diffs.begin(); // присваиваем ему начало списка
std::list<Diff>::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"<span class=\"differencei\">"+t+L"</span>";
if (aDiff.operation==Operation::DELETE) cur_l+=L"<span class=\"differenced\">"+t+L"</span>";
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"<span class=\"differencei\">" + t + L"</span>";
if (aDiff.operation == Operation::DELETE) cur_l += L"<span class=\"differenced\">" + t + L"</span>";
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"<tr><td class=\"diff_next\" onclick=\"c(this)\"></td>";
tableline+= modify ? L"<td class=\"has_difference\" onclick=\"d(this)\">"+ncur_l+"</td>" : L"<td class=\"diff_header\" onclick=\"d(this)\">"+ncur_l+"</td>";
@ -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);

View file

@ -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"))

View file

@ -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 -<EFBFBD><EFBFBD><EFBFBD>, 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;
};

View file

@ -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);

View file

@ -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();

View file

@ -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()
{

View file

@ -1,5 +1,5 @@
#pragma once
#include "wx\dataview.h"
#include "wx/dataview.h"
#include "wx/wx.h"
#include "Storage.h"
class MyDataViewCtrl :

View file

@ -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<LineFilter> 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;

View file

@ -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())

View file

@ -11,8 +11,9 @@
#ifndef PGADMIN3_H
#define PGADMIN3_H
#ifdef WIN32
#include "../utils/diff_match_patch.h"
#endif
// wxWindows headers
#include <wx/wx.h>
@ -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

View file

@ -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

View file

@ -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();

View file

@ -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},

View file

@ -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;
}

View file

@ -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<std::codecvt_utf8<wchar_t>, wchar_t>
UnicodeEncoder;

View file

@ -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_

View file

@ -325,8 +325,12 @@ void MyDataViewCtrl::OnEVT_DATAVIEW_CONTEXT_MENU(wxCommandEvent& event) {
wxMenu* mi = static_cast<wxMenu*>(event.GetEventObject());
wxString label = mi->GetLabelText(id);
StorageModel* m = dynamic_cast<StorageModel*>(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;

View file

@ -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<int> 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();

View file

@ -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

View file

@ -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;

View file

@ -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;