Re: [pgadmin-hackers] [pgadmin-support] Segmentation fault in GUI

2006-05-09 Thread Raphaël Enrici

Andrew Lazarus wrote:
I'm sorry, I've never built pgadmin from source, only installed the rpm. 
  I uninstalled the wxGTK rpm and I tried to build wxGTK from source and 
slam the output libraries into /usr/lib, and I can do that, but what 
something is missing or won't link with pgadmin.


Would you like me to go through the docs and try a pgadmin build?


If you have a minute or so, maybe you can try to rebuild the RPMs from 
Source RPM?

They are available on our mirrors in the srpm directory.
(http://www.postgresql.org/ftp/pgadmin3/release/v1.4.2/fedora-core-4/srpm/)

It should be relatively straight, something like:
(as root)
rpm -i pgadmin3-1.4.2-1.src.rpm
cd /usr/src/redhat(<-or something else, I don't have FC here)/
rpm -ba ./SPECS/pgadmin3.spec



For the record, most recently I used this wxGTK although I tried others:

http://rpmfind.net/linux/RPM/fedora/extras/4/i386/wxGTK-2.6.3-2.6.3.2.1.fc4.i386.html


Ok, so we are using similar version number.

Thanks for your time.
Raphaël


---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org


Re: [pgadmin-hackers] [pgadmin-support] Segmentation fault in GUI

2006-05-09 Thread Andrew Lazarus
I'm sorry, I've never built pgadmin from source, only installed the rpm. 
 I uninstalled the wxGTK rpm and I tried to build wxGTK from source and 
slam the output libraries into /usr/lib, and I can do that, but what 
something is missing or won't link with pgadmin.


Would you like me to go through the docs and try a pgadmin build?

For the record, most recently I used this wxGTK although I tried others:

http://rpmfind.net/linux/RPM/fedora/extras/4/i386/wxGTK-2.6.3-2.6.3.2.1.fc4.i386.html


@Andrew: could you please try to rebuild the app on your system to see
if it helps?

Regards,
Raph.



begin:vcard
fn:Andrew Lazarus
n:Lazarus;Andrew
org:Pillette Investment Management;Research and Development
adr;dom:;;3028 Fillmore;San Francisco;CA;94123
email;internet:[EMAIL PROTECTED]
title:Director
tel;work:800-366-0688
tel;fax:415-440-4093
url:http://www.pillette.com
version:2.1
end:vcard


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [pgadmin-hackers] i18n online documentation

2006-05-09 Thread Dave Page
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Raphaël Enrici
> Sent: 08 May 2006 21:00
> To: PgAdmin Hackers
> Subject: [pgadmin-hackers] i18n online documentation
> 
> Dear friends,
> 
> Sorry for the noise, I need a refresh on the project I think:
> I can't find hhp files for the fr_FR and other languages, 
> what is missing in our development process to get these files 
> translated?

There lies a massive problem. The code will automatically use localised docs if 
it can find them, but that requires that the entire (ie. pgAdmin, Slony and 
PostgreSQL) docset is translated. That's not the real problem though - the real 
issue is when we do a release of pgInstaller, we have perhaps a week to bring 
everything into sync and get it out of the door. For the non-windows users, the 
pgAdmin chm/hhp file *is* the documentation for the Windows version of 
PostgreSQL.

I suppose we could only ship the English docs with pgInstaller, but that still 
leaves a potential problem bringing everything into sync for pgAdmin-only 
releases. What I think we perhaps need to look at is making the localised docs 
a runtime-downloadable component, so that we can release them seperately and 
make it clear to the user before they download what version of each set of docs 
is available to them in the set.

Thoughts?

Regards, Dave.

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [pgadmin-hackers] adminpacks / pgagent / specific version of pg?

2006-05-09 Thread Dave Page
 

> -Original Message-
> From: Raphaël Enrici [mailto:[EMAIL PROTECTED] 
> Sent: 08 May 2006 20:59
> To: Dave Page
> Cc: PgAdmin Hackers
> Subject: adminpacks / pgagent / specific version of pg?
> 
> Dave,
> 
> I've read that you are trying to make so that admin-packs 
> will be directly distributed with PostgreSQL(?). 

Yes, it's in the patch queue for 8.2, and so far no-one has objected. 

> Someone 
> asked at d.o [1] for a separate packaging of adminpacks. Do 
> you have any idea of the time it can take to get the files 
> included in PostgreSQL contrib? I'm asking about that because 
> I'm not sure it's worth doing the effort of a separate 
> packaging if it get included directly in PostgreSQL rapidly.

It will be for 8.2.

> Something else, it was also suggested that pgagent get 
> included in the adminpacks packages. I was persuaded that 
> pgagent was not related to the version of PostgreSQL used but 
> to the pgAdmin's one. Can you teach me please?
> 
> Regards,
> Raph
> [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=354731

Yes, pgAgent is technically linked to pgAdmin's version, but I hope not to have 
to make any incompatible changes to the data format so version mixing shouldn't 
be a problem. There are no known bugs in pgAgent, and no changes planned for 
1.6, so that should certainly be the case for the next release at least.

As for the packaging, normally we ship pgAgent with pgAdmin. There's a couple 
of vague reasons for that - partly that it's the easiest route, and partly that 
pgAgent is designed to run on multiple nodes if required so that you can 
schedule batch jobs on any of them, or distribute compute intensive stuff. That 
said, most people would probably run it on their server anyway for more simple 
stuff like data summarisation tasks or backups. It's really up to you how you 
ship it I guess.

Regards, Dave.

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [pgadmin-hackers] Adminpack contrib module

2006-05-09 Thread Dave Page
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Andrus
> Sent: 08 May 2006 18:16
> To: pgadmin-hackers@postgresql.org
> Subject: Re: [pgadmin-hackers] Adminpack contrib module
> 
> > There were no objections, so attached is an updated version of the 
> > adminpack, with non-version specific naming for addition to 
> the source 
> > tree.
> > The entire directory in the archive should be added to 
> /contrib, and 
> > an appropriate entry added to contrib/Makefile.
> 
> adminpack.sql.in  file contains comment
> 
> /* generic file access functions (genfile.c) */
> 
> However, there is no genfile.c file in this package.

Well spotted - update attached.

Thanks, Dave.


adminpack.tar.gz
Description: adminpack.tar.gz

---(end of broadcast)---
TIP 6: explain analyze is your friend


[pgadmin-hackers] SVN Commit by dpage: r5134 - in trunk/pgadmin3/i18n: zh_CN zh_TW

2006-05-09 Thread svn
Author: dpage

Date: 2006-05-09 08:56:48 +0100 (Tue, 09 May 2006)

New Revision: 5134

Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5134&view=rev

Log:
Update Chinese simplified and traditional translations 
(?\233?\131?\173?\230?\156?\157?\231?\155?\138Kuo.ChaoYi)


Modified:
   trunk/pgadmin3/i18n/zh_CN/pgadmin3.mo
   trunk/pgadmin3/i18n/zh_CN/pgadmin3.po
   trunk/pgadmin3/i18n/zh_TW/pgadmin3.mo
   trunk/pgadmin3/i18n/zh_TW/pgadmin3.po

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


[pgadmin-hackers] SVN Commit by dpage: r5135 - trunk/www/translation

2006-05-09 Thread svn
Author: dpage

Date: 2006-05-09 08:59:55 +0100 (Tue, 09 May 2006)

New Revision: 5135

Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5135&view=rev

Log:
Move Chinese Traditional to supported status


Modified:
   trunk/www/translation/config.php

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


[pgadmin-hackers] SVN Commit by dpage: r5136 - in trunk/pgadmin3: i18n pkg/win32/src

2006-05-09 Thread svn
Author: dpage

Date: 2006-05-09 09:01:51 +0100 (Tue, 09 May 2006)

New Revision: 5136

Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5136&view=rev

Log:



Modified:
   trunk/pgadmin3/i18n/Makefile.am
   trunk/pgadmin3/pkg/win32/src/i18ndata.wxs
   trunk/pgadmin3/pkg/win32/src/i18nrefs.wxs

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


[pgadmin-hackers] SVN Commit by dpage: r5137 - in branches/REL-1_4_0_PATCHES/pgadmin3: i18n i18n/zh_CN i18n/zh_TW pkg/win32/src

2006-05-09 Thread svn
Author: dpage

Date: 2006-05-09 09:10:04 +0100 (Tue, 09 May 2006)

New Revision: 5137

Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5137&view=rev

Log:
Update Chinese simplified and traditional translations 
(?\233?\131?\173?\230?\156?\157?\231?\155?\138Kuo.ChaoYi)


Modified:
   branches/REL-1_4_0_PATCHES/pgadmin3/i18n/Makefile.am
   branches/REL-1_4_0_PATCHES/pgadmin3/i18n/zh_CN/pgadmin3.mo
   branches/REL-1_4_0_PATCHES/pgadmin3/i18n/zh_CN/pgadmin3.po
   branches/REL-1_4_0_PATCHES/pgadmin3/i18n/zh_TW/pgadmin3.mo
   branches/REL-1_4_0_PATCHES/pgadmin3/i18n/zh_TW/pgadmin3.po
   branches/REL-1_4_0_PATCHES/pgadmin3/pkg/win32/src/i18ndata.wxs
   branches/REL-1_4_0_PATCHES/pgadmin3/pkg/win32/src/i18nrefs.wxs

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [pgadmin-hackers] Paste rows patch

2006-05-09 Thread Dave Page
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Edward Di Geronimo Jr.
> Sent: 09 May 2006 07:24
> To: pgadmin-hackers@postgresql.org
> Subject: [pgadmin-hackers] Paste rows patch
> 
> Here's a fully functional version of my row pasting patch. It 
> now always pastes into the * row, and prompts if you want to 
> skip over serial columns or not. It should be good to go.

It's looking much better, however, I still think that if the cursor is
actually active in a cell then the paste should go to that cell, and
only in other cases to the new row. On Windows, the only way to do that
is ctrl-v or right-click->paste. The paste button and ctrl-v should
always do the same thing (though I wonder if that's an issue with
Windows doing the actual paste operation in the ctrl-v case) imo.

Whaddya think?

Regards, Dave.


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [pgadmin-hackers] Paste rows patch

2006-05-09 Thread Edward Di Geronimo Jr.

Quoting Dave Page :


It's looking much better, however, I still think that if the cursor is
actually active in a cell then the paste should go to that cell, and
only in other cases to the new row. On Windows, the only way to do that
is ctrl-v or right-click->paste. The paste button and ctrl-v should
always do the same thing (though I wonder if that's an issue with
Windows doing the actual paste operation in the ctrl-v case) imo.


I forgot about that issue. I think you're right, however, I don't  
really know how to solve it. I think the solution is to detect if the  
cursor is in an edit box, and call the edit box's Paste function if  
so, however, I'm not sure how to tell if we're in an edit box or not.


Ed


This message was sent using IMP, the Internet Messaging Program.



---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


[pgadmin-hackers] SVN Commit by dpage: r5138 - in trunk/pgadmin3: . pkg/src pkg/win32/src src src/agent src/dlg src/include src/utils xtra/pgagent xtra/pgagent/pgaevent

2006-05-09 Thread svn
Author: dpage

Date: 2006-05-09 15:43:04 +0100 (Tue, 09 May 2006)

New Revision: 5138

Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5138&view=rev

Log:
Update the Windows build environment for VC++ 8.0 (now free from 
http://msdn.microsoft.com/vstudio/express/)


Added:
   trunk/pgadmin3/pgAdmin3.sln
   trunk/pgadmin3/src/pgAdmin3.vcproj
   trunk/pgadmin3/xtra/pgagent/pgaevent/pgaevent.vcproj
Removed:
   trunk/pgadmin3/src/pgAdmin3.dsp
   trunk/pgadmin3/src/pgAdmin3.dsw
   trunk/pgadmin3/xtra/pgagent/pgAgent.dsp
   trunk/pgadmin3/xtra/pgagent/pgAgent.dsw
   trunk/pgadmin3/xtra/pgagent/pgaevent/pgaevent.dsp
   trunk/pgadmin3/xtra/pgagent/pgaevent/pgaevent.dsw
Modified:
   trunk/pgadmin3/CHANGELOG
   trunk/pgadmin3/Makefile.am
   trunk/pgadmin3/pkg/src/build-tarball.in
   trunk/pgadmin3/pkg/win32/src/pgadmin3.wxs
   trunk/pgadmin3/src/Makefile.am
   trunk/pgadmin3/src/agent/dlgStep.cpp
   trunk/pgadmin3/src/dlg/dlgFunction.cpp
   trunk/pgadmin3/src/include/pgAdmin3.h
   trunk/pgadmin3/src/utils/tabcomplete.c
   trunk/pgadmin3/xtra/pgagent/Makefile.am
   trunk/pgadmin3/xtra/pgagent/pgaevent/Makefile.am
   trunk/pgadmin3/xtra/pgagent/win32.cpp

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


[pgadmin-hackers] Visual Studio 2005

2006-05-09 Thread Dave Page
Hi,

I've just commited changes to SVN trunk that update the Windows build
system for pgAdmin to VC++ 8.0 (as shipped with Visual Studio 2005).
VC++ 8.0 Express Edition is now available free from Microsoft from
http://msdn.microsoft.com/vstudio/express/.

In doing this, I have moved the workspace(now solution) file to the top
level directory, rather than leaving it tucked away in src/. 

Unfortunately, this change does mean that you'll probably need to
rebuild your wxWidgets installation - happily this appears to be fine
out of the box, with only a few warnings about functions Microsoft has
deprecated showing up during the build.

Apologies for any inconvenience this may cause - it should be worth it
though; I already found that the intellisense now seems to work properly
with the wx classes which it never did for me before in VC++ 6.0 :-)

Regards, Dave

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


[pgadmin-hackers] SVN Commit by dpage: r5139 - trunk/pgadmin3/xtra/wx-build

2006-05-09 Thread svn
Author: dpage

Date: 2006-05-09 16:10:21 +0100 (Tue, 09 May 2006)

New Revision: 5139

Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5139&view=rev

Log:
Update the debugger tips for VS 2k%


Modified:
   trunk/pgadmin3/xtra/wx-build/readme.txt

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [pgadmin-hackers] Paste rows patch

2006-05-09 Thread Dave Page
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Edward Di Geronimo Jr.
> Sent: 09 May 2006 15:00
> To: pgadmin-hackers@postgresql.org
> Subject: Re: [pgadmin-hackers] Paste rows patch
> 
> Quoting Dave Page :
> 
> > It's looking much better, however, I still think that if 
> the cursor is 
> > actually active in a cell then the paste should go to that 
> cell, and 
> > only in other cases to the new row. On Windows, the only way to do 
> > that is ctrl-v or right-click->paste. The paste button and ctrl-v 
> > should always do the same thing (though I wonder if that's an issue 
> > with Windows doing the actual paste operation in the ctrl-v 
> case) imo.
> 
> I forgot about that issue. I think you're right, however, I 
> don't really know how to solve it. I think the solution is to 
> detect if the cursor is in an edit box, and call the edit 
> box's Paste function if so, however, I'm not sure how to tell 
> if we're in an edit box or not.

We enable/disable the save button on the entry/exit of a cell - see
frmEditGrid::OnEditorShown() & frmEDitGrid::OnSave(). Does that look
robust enough to use to set a flag?

Regards, Dave. 

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [pgadmin-hackers] [pgadmin-support] Segmentation fault in GUI

2006-05-09 Thread Andrew Lazarus
I can try to find some time for this (I am the only programmer in this 
company!), but it's become a lower priority because I got pgadmin up and 
running by using an earlier rpm of wxGTK-- 
ftp://rpmfind.net/linux/fedora/extras/5/i386/wxGTK-2.6.2-5.fc5.i386.rpm


Thanks for your help.

Raphaël Enrici wrote:

Andrew Lazarus wrote:
I'm sorry, I've never built pgadmin from source, only installed the 
rpm.   I uninstalled the wxGTK rpm and I tried to build wxGTK from 
source and slam the output libraries into /usr/lib, and I can do that, 
but what something is missing or won't link with pgadmin.


Would you like me to go through the docs and try a pgadmin build?


If you have a minute or so, maybe you can try to rebuild the RPMs from 
Source RPM?

They are available on our mirrors in the srpm directory.
(http://www.postgresql.org/ftp/pgadmin3/release/v1.4.2/fedora-core-4/srpm/)

It should be relatively straight, something like:
(as root)
rpm -i pgadmin3-1.4.2-1.src.rpm
cd /usr/src/redhat(<-or something else, I don't have FC here)/
rpm -ba ./SPECS/pgadmin3.spec



For the record, most recently I used this wxGTK although I tried others:

http://rpmfind.net/linux/RPM/fedora/extras/4/i386/wxGTK-2.6.3-2.6.3.2.1.fc4.i386.html 



Ok, so we are using similar version number.

Thanks for your time.
Raphaël




begin:vcard
fn:Andrew Lazarus
n:Lazarus;Andrew
org:Pillette Investment Management;Research and Development
adr;dom:;;3028 Fillmore;San Francisco;CA;94123
email;internet:[EMAIL PROTECTED]
title:Director
tel;work:800-366-0688
tel;fax:415-440-4093
url:http://www.pillette.com
version:2.1
end:vcard


---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [pgadmin-hackers] i18n online documentation

2006-05-09 Thread Guillaume Lelarge

2006/5/9, Dave Page :

> Sorry for the noise, I need a refresh on the project I think:
> I can't find hhp files for the fr_FR and other languages,
> what is missing in our development process to get these files
> translated?

There lies a massive problem. The code will automatically use localised docs if 
it
can find them, but that requires that the entire (ie. pgAdmin, Slony and
PostgreSQL) docset is translated. That's not the real problem though - the real
issue is when we do a release of pgInstaller, we have perhaps a week to bring
everything into sync and get it out of the door. For the non-windows users, the
pgAdmin chm/hhp file *is* the documentation for the Windows version of
PostgreSQL.

I suppose we could only ship the English docs with pgInstaller, but that still
leaves a potential problem bringing everything into sync for pgAdmin-only
releases. What I think we perhaps need to look at is making the localised docs a
runtime-downloadable component, so that we can release them seperately and
make it clear to the user before they download what version of each set of docs
is available to them in the set.



Perhaps is it possible to ask the user at install time ? I mean, the
user installs pgAdmin software with the installer, the installer asks
him if he wants to get a localized help file. If the user agrees, the
installer shows him all languages available. When the user finally
choose his language, the installer downloads the files and installs
them.


--
Guillaume.

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [pgadmin-hackers] i18n online documentation

2006-05-09 Thread Dave Page
 

> -Original Message-
> From: Guillaume Lelarge [mailto:[EMAIL PROTECTED] 
> Sent: 09 May 2006 21:23
> To: Dave Page
> Cc: Raphaël Enrici; PgAdmin Hackers
> Subject: Re: [pgadmin-hackers] i18n online documentation
> 
> Perhaps is it possible to ask the user at install time ? I 
> mean, the user installs pgAdmin software with the installer, 
> the installer asks him if he wants to get a localized help 
> file. If the user agrees, the installer shows him all 
> languages available. When the user finally choose his 
> language, the installer downloads the files and installs them.

Not really feasible - the Windows installer could potentially do this, but we 
have a Mac appbundle, Debian APT distribution, FreeBSD ports distribution, 
Redhat RPM distributions, Slackware packages, source tarballs and more to deal 
with - many of which couldn't do such things.

Regards, Dave.

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [pgadmin-hackers] i18n online documentation

2006-05-09 Thread Guillaume Lelarge

2006/5/9, Dave Page :

> -Original Message-
> From: Guillaume Lelarge [mailto:[EMAIL PROTECTED]
> Sent: 09 May 2006 21:23
> To: Dave Page
> Cc: Raphaël Enrici; PgAdmin Hackers
> Subject: Re: [pgadmin-hackers] i18n online documentation
>
> Perhaps is it possible to ask the user at install time ? I
> mean, the user installs pgAdmin software with the installer,
> the installer asks him if he wants to get a localized help
> file. If the user agrees, the installer shows him all
> languages available. When the user finally choose his
> language, the installer downloads the files and installs them.

Not really feasible - the Windows installer could potentially do this, but we 
have a
Mac appbundle, Debian APT distribution, FreeBSD ports distribution, Redhat RPM
distributions, Slackware packages, source tarballs and more to deal with - many
of which couldn't do such things.



Yes, you're right. I was thinking of an old installer I used to
download nigthly builds of mozilla. It was working on windows only.
Sorry about this...


--
Guillaume.

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [pgadmin-hackers] i18n online documentation

2006-05-09 Thread Dave Page
 

> -Original Message-
> From: Guillaume Lelarge [mailto:[EMAIL PROTECTED] 
> Sent: 09 May 2006 22:00
> To: Dave Page
> Cc: Raphaël Enrici; PgAdmin Hackers
> Subject: Re: [pgadmin-hackers] i18n online documentation
> 
> Yes, you're right. I was thinking of an old installer I used 
> to download nigthly builds of mozilla. It was working on windows only.
> Sorry about this...

Don't apologise - just keep the ideas coming :-)

/D

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


[pgadmin-hackers] SVN Commit by dpage: r5140 - in trunk/pgadmin3/src: db dlg include/base schema

2006-05-09 Thread svn
Author: dpage

Date: 2006-05-09 22:10:07 +0100 (Tue, 09 May 2006)

New Revision: 5140

Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=5140&view=rev

Log:
Use escape string syntax ( E'foo' ) with internal queries that use hard coded 
escape sequences when the server is 8.1 or above.


Modified:
   trunk/pgadmin3/src/db/pgConn.cpp
   trunk/pgadmin3/src/dlg/dlgForeignKey.cpp
   trunk/pgadmin3/src/include/base/base.h
   trunk/pgadmin3/src/schema/pgSchema.cpp
   trunk/pgadmin3/src/schema/pgType.cpp

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [pgadmin-hackers] Paste rows patch

2006-05-09 Thread Edward Di Geronimo Jr.

Quoting Dave Page :


We enable/disable the save button on the entry/exit of a cell - see
frmEditGrid::OnEditorShown() & frmEDitGrid::OnSave(). Does that look
robust enough to use to set a flag?


Got a solution. I set a flag in OnEditorShown, and trapped the editor  
hidden event to clear it. Here's a new patch.


Ed


This message was sent using IMP, the Internet Messaging Program.

Index: frm/frmEditGrid.cpp
===
--- frm/frmEditGrid.cpp	(revision 5113)
+++ frm/frmEditGrid.cpp	(working copy)
@@ -44,6 +44,7 @@
 #include "images/sortfilter.xpm"
 #include "images/help.xpm"
 #include "images/clip_copy.xpm"
+#include "images/clip_paste.xpm"
 
 #define CTRLID_LIMITLABEL   4224
 #define CTRLID_LIMITSPACER  4225
@@ -58,11 +59,13 @@
 EVT_MENU(MNU_OPTIONS,   frmEditGrid::OnOptions)
 EVT_MENU(MNU_HELP,  frmEditGrid::OnHelp)
 EVT_MENU(MNU_COPY,  frmEditGrid::OnCopy)
+EVT_MENU(MNU_PASTE, frmEditGrid::OnPaste)
 EVT_CLOSE(  frmEditGrid::OnClose)
 EVT_KEY_DOWN(   frmEditGrid::OnKey)
 EVT_GRID_RANGE_SELECT(frmEditGrid::OnGridSelectCells)
 EVT_GRID_SELECT_CELL(frmEditGrid::OnCellChange)
 EVT_GRID_EDITOR_SHOWN(frmEditGrid::OnEditorShown)
+EVT_GRID_EDITOR_HIDDEN(frmEditGrid::OnEditorHidden)
 EVT_GRID_LABEL_RIGHT_CLICK(frmEditGrid::OnLabelRightClick)
 END_EVENT_TABLE()
 
@@ -81,6 +84,7 @@
 relkind=0;
 	limit=0;
 relid=(Oid)obj->GetOid();
+editorShown = false;
 
 
 CreateStatusBar();
@@ -101,6 +105,8 @@
 toolBar->AddSeparator();
 toolBar->AddTool(MNU_COPY, _("Copy"), wxBitmap(clip_copy_xpm), _("Copy selected lines to clipboard"), wxITEM_NORMAL);
 toolBar->AddSeparator();
+toolBar->AddTool(MNU_PASTE, _("Paste"), wxBitmap(clip_paste_xpm), _("Paste text from the clipboard"), wxITEM_NORMAL);
+toolBar->AddSeparator();
 toolBar->AddTool(MNU_DELETE, _("Delete"), wxBitmap(delete_xpm), _("Delete selected lines."), wxITEM_NORMAL);
 toolBar->AddSeparator();
 
@@ -128,14 +134,15 @@
 toolBar->EnableTool(MNU_COPY, true);
 toolBar->EnableTool(MNU_DELETE, false);
 
-wxAcceleratorEntry entries[6];
+wxAcceleratorEntry entries[7];
 
 entries[0].Set(wxACCEL_CTRL,(int)'S',  MNU_SAVE);
 entries[1].Set(wxACCEL_NORMAL,  WXK_F5,MNU_REFRESH);
 entries[2].Set(wxACCEL_CTRL,(int)'Z',  MNU_UNDO);
 entries[3].Set(wxACCEL_NORMAL,  WXK_F1,MNU_HELP);
 entries[4].Set(wxACCEL_CTRL,(int)'C',  MNU_COPY);
-entries[5].Set(wxACCEL_NORMAL,  WXK_DELETE,MNU_DELETE);
+entries[5].Set(wxACCEL_CTRL,(int)'V',  MNU_PASTE);
+entries[6].Set(wxACCEL_NORMAL,  WXK_DELETE,MNU_DELETE);
 
 wxAcceleratorTable accel(6, entries);
 SetAcceleratorTable(accel);
@@ -236,6 +243,18 @@
 }
 
 
+void frmEditGrid::OnPaste(wxCommandEvent &ev)
+{
+if (editorShown)
+{
+ev.Skip();
+}
+else
+{
+sqlGrid->GetTable()->Paste();
+}
+}
+
 void frmEditGrid::OnHelp(wxCommandEvent &ev)
 {
 DisplayHelp(this, wxT("editgrid"), viewdata_xpm);
@@ -453,11 +472,18 @@
 {
 toolBar->EnableTool(MNU_SAVE, true);
 toolBar->EnableTool(MNU_UNDO, true);
+editorShown = true;
 
 event.Skip();
 }
 
 
+void frmEditGrid::OnEditorHidden(wxGridEvent& event)
+{
+editorShown = false;
+}
+
+
 void frmEditGrid::OnGridSelectCells(wxGridRangeSelectEvent& event)
 {
 if (sqlGrid->GetEditable())
@@ -1722,6 +1748,112 @@
 }
 
 
+void sqlTable::Paste()
+{
+int row, col;
+int start, pos, len;
+wxArrayString data;
+wxString text, quoteChar, colSep;
+bool inQuotes, inData, skipSerial;
+
+if (wxTheClipboard->Open())
+{
+if (wxTheClipboard->IsSupported(wxDF_TEXT))
+{
+wxTextDataObject textData;
+wxTheClipboard->GetData(textData);
+text = textData.GetText();
+}
+else {
+wxTheClipboard->Close();
+return;
+}
+wxTheClipboard->Close();
+}
+else {
+return;
+}
+
+start = pos = 0;
+len = text.Len();
+quoteChar = settings->GetCopyQuoteChar();
+colSep = settings->GetCopyColSeparator();
+inQuotes = inData = false;
+
+while (pos < len && !(text[pos] == '\n' && !inQuotes))
+{
+if (!inData)
+{
+if (text[pos] == quoteChar)
+{
+inQuotes = inData = true;
+pos++;
+start++;
+continue;
+}
+else
+{
+inQuotes = false;
+}
+inData = true;
+}
+
+if (inQuotes && text[pos] == quoteChar &&
+text[pos+1] == colSep)
+{
+data.Add(text.Mid(start, pos