Re: [pgadmin-hackers] pgAdmin III: Muliple SQL tabs

2016-02-02 Thread John Obaterspok
2016-02-02 12:08 GMT+01:00 Dave Page :

> On Tue, Feb 2, 2016 at 3:17 AM, Sergey Busel  wrote:
> > Patch file for multiple SQL tabs is attached.
>
> Thanks - I see how this could be useful. I think it needs a little
> work before it could be included:
>
> - Unused code should be removed, not commented out.
> - I think the tab names should reflect the file name (where there is
> one) - e.g. "Query 2" should become "foo.sql" (without the path) if
> you save the query.
> - There should be some way for the user to see which tab the results
> are related to. Maybe the output pane title should read "Output Pane
> (Query 2)" or "Output Pane (foo.sql)" as appropriate? I'm not sure if
> that will do weird things with the perspective though - they used to
> include panel titles.
> - Instead of the "Close Tab" menu option, perhaps an X button should
> be added to the right-hand end of the active tab?
>
>
I haven't tested this but I agree with the above comments. Regarding the
results pane I assume the output window, results window, query time, etc
all reflect the current SQL query tab? So if you have two tabs with
different queries you can switch between them and see their result window.

-- john


Re: [pgadmin-hackers] pgAdmin III: Muliple SQL tabs

2016-02-01 Thread John Obaterspok
Nice! This is something I wanted to work on myself but have not had the
time to yet.

-- john

2016-01-31 20:03 GMT+01:00 Sergey Busel :

> Hello,
> It's my first time here and I hope I am sending this to the right mailing
> list.
>
> I am starting to use pgAdmin 3 more and more nowadays and thought that
> having a multi tabbed interface would be beneficial especially that most
> (if not all) similar tools go that route. Somewhere in the mail archives
> I've read that tabs are not being implemented because too much code would
> need to be changed. But I thought I'd give it a try anyway.
>
> I have implemented SQL tabs in the 1.22.0 version and have been using it
> for a week. Works just fine for me, so I wonder if there is any interest in
> adding this feature to pgAdmin 3.
>
> Brief overview:
> The changes to existing code were kept to a minimum.
> All SQL tabs still operate on the same connection and share the same
> result pane.
> Each tab has it's own dirty flag, EOL style, and file from/to which it was
> loaded/saved.
>
> Let me know if anybody is interested.
>
> Thanks.
>
>


Re: [pgadmin-hackers] [PATCH] Add Commit/Rollback toolbar action version 2

2015-09-22 Thread John Obaterspok
Hi Sanket,

Did you give the patch a try? I would really like it to for the next
release :)

-- john

2015-09-16 20:27 GMT+02:00 John Obaterspok <john.obaters...@gmail.com>:

> Hi Sanket,
>
> Attached patch is rebased now.
>
> Regards,
>
> -- john
>
>
> 2015-09-16 11:20 GMT+02:00 Sanket Mehta <sanket.me...@enterprisedb.com>:
>
>> Hi John,
>>
>> Patch is not proper.
>> I got below error when I try to apply the patch:
>>
>> error: patch failed: pgadmin/frm/frmQuery.cpp:2435
>> error: pgadmin/frm/frmQuery.cpp: patch does not apply
>>
>> Please do provide the proper patch.
>>
>>
>> Regards,
>> Sanket Mehta
>> Sr Software engineer
>> Enterprisedb
>>
>> On Mon, Sep 14, 2015 at 10:51 AM, Sanket Mehta <
>> sanket.me...@enterprisedb.com> wrote:
>>
>>> Sure Ashesh,
>>>
>>> I will review the patch.
>>>
>>> Regards,
>>> Sanket Mehta
>>> Sr Software engineer
>>> Enterprisedb
>>>
>>> On Mon, Sep 14, 2015 at 1:12 PM, Ashesh Vashi <
>>> ashesh.va...@enterprisedb.com> wrote:
>>>
>>>> Sanket,
>>>>
>>>> Can you please take a look at it?
>>>>
>>>> --
>>>>
>>>> Thanks & Regards,
>>>>
>>>> Ashesh Vashi
>>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>>>> <http://www.enterprisedb.com>
>>>>
>>>>
>>>> *http://www.linkedin.com/in/asheshvashi*
>>>> <http://www.linkedin.com/in/asheshvashi>
>>>>
>>>> On Mon, Sep 14, 2015 at 1:07 AM, John Obaterspok <
>>>> john.obaters...@gmail.com> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> I'm updated the patch to add commit/rollback actions in the toolbar
>>>>> with the following:
>>>>> 1) updated icons (based on existing pgadmin icon with arrows drawn by
>>>>> me)
>>>>> 2) add entry to menu as well
>>>>> 3) disable icons when not in a transaction
>>>>> 4) Ctrl+Shift C|R shortcut
>>>>>
>>>>> Hopefully all issues are resolved now!
>>>>>
>>>>> Regards,
>>>>>
>>>>>   John
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>>>>> To make changes to your subscription:
>>>>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>>>>
>>>>>
>>>>
>>>
>>
>


Re: [pgadmin-hackers] [PATCH] Add Commit/Rollback toolbar action version 2

2015-09-16 Thread John Obaterspok
Hi Sanket,

Attached patch is rebased now.

Regards,

-- john


2015-09-16 11:20 GMT+02:00 Sanket Mehta <sanket.me...@enterprisedb.com>:

> Hi John,
>
> Patch is not proper.
> I got below error when I try to apply the patch:
>
> error: patch failed: pgadmin/frm/frmQuery.cpp:2435
> error: pgadmin/frm/frmQuery.cpp: patch does not apply
>
> Please do provide the proper patch.
>
>
> Regards,
> Sanket Mehta
> Sr Software engineer
> Enterprisedb
>
> On Mon, Sep 14, 2015 at 10:51 AM, Sanket Mehta <
> sanket.me...@enterprisedb.com> wrote:
>
>> Sure Ashesh,
>>
>> I will review the patch.
>>
>> Regards,
>> Sanket Mehta
>> Sr Software engineer
>> Enterprisedb
>>
>> On Mon, Sep 14, 2015 at 1:12 PM, Ashesh Vashi <
>> ashesh.va...@enterprisedb.com> wrote:
>>
>>> Sanket,
>>>
>>> Can you please take a look at it?
>>>
>>> --
>>>
>>> Thanks & Regards,
>>>
>>> Ashesh Vashi
>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>>> <http://www.enterprisedb.com>
>>>
>>>
>>> *http://www.linkedin.com/in/asheshvashi*
>>> <http://www.linkedin.com/in/asheshvashi>
>>>
>>> On Mon, Sep 14, 2015 at 1:07 AM, John Obaterspok <
>>> john.obaters...@gmail.com> wrote:
>>>
>>>> Hello,
>>>>
>>>> I'm updated the patch to add commit/rollback actions in the toolbar
>>>> with the following:
>>>> 1) updated icons (based on existing pgadmin icon with arrows drawn by
>>>> me)
>>>> 2) add entry to menu as well
>>>> 3) disable icons when not in a transaction
>>>> 4) Ctrl+Shift C|R shortcut
>>>>
>>>> Hopefully all issues are resolved now!
>>>>
>>>> Regards,
>>>>
>>>>   John
>>>>
>>>>
>>>>
>>>> --
>>>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>>>> To make changes to your subscription:
>>>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>>>
>>>>
>>>
>>
>


0001-Add-Commit-Rollback-toolbar-action.patch
Description: Binary data


0002-Add-Commit-Rollback-to-query-menu-disable-when-not-i.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [PATCH] Add ElapsedTimeToString to format execution time in a more readable manner (instead of showing everything as msec)

2015-09-13 Thread John Obaterspok
Hi,

Was the patch to format execution time in a more readable manner okay?
Never got any feedback from the updated version.

Regards,

John


2015-06-15 21:28 GMT+02:00 John Obaterspok <john.obaters...@gmail.com>:

> Hi,
>
> Attached is an updated patch.
>
> -- john
>
> 2015-06-12 6:50 GMT+02:00 Ashesh Vashi <ashesh.va...@enterprisedb.com>:
>
>> Hi John,
>>
>> Can you please add comments for the below piece of code for explanation?
>> -
>> *@@ -3088,13 +3090,22 @@ void frmQuery::OnTimer(wxTimerEvent )*
>> *  }*
>>
>> *  // Increase the granularity for longer running queries*
>> *- if (elapsedQuery > 200 && timer.GetInterval() == 10 &&
>> timer.IsRunning())*
>> *+ if (timer.IsRunning())*
>> *  {*
>> *- timer.Stop();*
>> *- timer.Start(100);*
>> *+ if (elapsedQuery > 200 && timer.GetInterval() < 100)*
>> *+ {*
>> *+ timer.Stop();*
>> *+ timer.Start(100);*
>> *+ }*
>> *+ else if (elapsedQuery > 60 * 1000 && timer.GetInterval() < 1000)*
>> *+ {*
>> *+ timer.Stop();*
>> *+ timer.Start(1000);*
>> *+ }*
>>
>> -
>>
>> And, please send patch as an attachment.
>>
>> --
>>
>> Thanks & Regards,
>>
>> Ashesh Vashi
>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>> <http://www.enterprisedb.com>
>>
>>
>> *http://www.linkedin.com/in/asheshvashi*
>> <http://www.linkedin.com/in/asheshvashi>
>>
>> On Fri, Jun 12, 2015 at 1:50 AM, John Obaterspok <
>> john.obaters...@gmail.com> wrote:
>>
>>> Add ElapsedTimeToString to format execution time in a more readable
>>> manner (instead of showing everything as msec)
>>>
>>> Signed-off-by: John Obaterspok <john.obaters...@gmail.com>
>>>
>>> diff --git a/pgadmin/dlg/dlgClasses.cpp b/pgadmin/dlg/dlgClasses.cpp
>>> index 9a3e473..e6fa488 100644
>>> --- a/pgadmin/dlg/dlgClasses.cpp
>>> +++ b/pgadmin/dlg/dlgClasses.cpp
>>> @@ -562,7 +562,7 @@ void ExecutionDialog::OnOK(wxCommandEvent )
>>>   {
>>>   if (txtMessages)
>>>   txtMessages->AppendText(_("Total query runtime: ")
>>> -+ (wxGetLocalTimeMillis() -
>>> startTime).ToString() + wxT(" ms."));
>>> ++ ElapsedTimeToString(wxGetLocalTimeMillis() -
>>> startTime));
>>>
>>>   btnOK->SetLabel(_("Done"));
>>>   btnCancel->Disable();
>>> diff --git a/pgadmin/frm/frmMain.cpp b/pgadmin/frm/frmMain.cpp
>>> index 8629dda..94528e8 100644
>>> --- a/pgadmin/frm/frmMain.cpp
>>> +++ b/pgadmin/frm/frmMain.cpp
>>> @@ -1352,9 +1352,7 @@ void frmMain::EndMsg(bool done)
>>>   {
>>>   // Get the execution time & display it
>>>   float timeval = stopwatch.Time();
>>> - wxString time;
>>> - time.Printf(_("%.2f secs"), (timeval / 1000));
>>> - statusBar->SetStatusText(time, 2);
>>> + statusBar->SetStatusText(ElapsedTimeToString(timeval), 2);
>>>
>>>   // Display the 'Done' message
>>>   if (done)
>>> @@ -1362,7 +1360,7 @@ void frmMain::EndMsg(bool done)
>>>   else
>>>   statusBar->SetStatusText(timermsg + _(" Failed."), 1);
>>>
>>> - wxLogStatus(wxT("%s (%s)"), timermsg.c_str(), time.c_str());
>>> + wxLogStatus(wxT("%s (%s)"), timermsg.c_str(),
>>> ElapsedTimeToString(timeval).c_str());
>>>   wxEndBusyCursor();
>>>   }
>>>  }
>>> diff --git a/pgadmin/frm/frmQuery.cpp b/pgadmin/frm/frmQuery.cpp
>>> index 110bbc7..6198c83 100644
>>> --- a/pgadmin/frm/frmQuery.cpp
>>> +++ b/pgadmin/frm/frmQuery.cpp
>>> @@ -55,6 +55,7 @@
>>>  #include "utils/sysLogger.h"
>>>  #include "utils/sysSettings.h"
>>>  #include "utils/utffile.h"
>>> +#include "utils/misc.h"
>>>  #include "pgscript/pgsApplication.h"
>>>
>>>  // Icons
>>> @@ -2711,7 +2712,7 @@ void frmQuery::OnQueryComplete(pgQueryResultEvent
>>> )
>>>   msgHistory->AppendText(str);
>>>
>>>   elapsedQuery = wxGetLocalTimeMillis() - startTimeQuery;
>>> - SetStatusText(elapsedQuery.ToString() + wxT(" ms"), STATUSPOS_SECS);
>>> + SetStatusText(ElapsedTimeToString(elapsedQuery), STATUSPOS_SECS);
>>>
>>>   if (sqlResult->RunStatus() != P

[pgadmin-hackers] [PATCH] Add Commit/Rollback toolbar action version 2

2015-09-13 Thread John Obaterspok
Hello,

I'm updated the patch to add commit/rollback actions in the toolbar with
the following:
1) updated icons (based on existing pgadmin icon with arrows drawn by me)
2) add entry to menu as well
3) disable icons when not in a transaction
4) Ctrl+Shift C|R shortcut

Hopefully all issues are resolved now!

Regards,

  John


0001-Add-Commit-Rollback-toolbar-action.patch
Description: Binary data


0002-Add-Commit-Rollback-to-query-menu-disable-when-not-i.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [PATCH] Add Commit/Rollback toolbar action

2015-06-24 Thread John Obaterspok
Hi,

I'm going to redo the patch with:
1) updated icons
2) add entry to menu as well
3) disable icons when not in a transaction

Regarding the shortcut for commit/rollback. I'm not very found of keyboard
shortcuts for commit/rollback when disabling auto commit. But I'll add it
if you want it. Any recommendation on key combination? (like Ctrl+Shift C|R)

I haven't checked, but can user change shortcuts in some settings menu?

-- john

2015-06-24 8:54 GMT+02:00 Sanket Mehta sanket.me...@enterprisedb.com:

 Hi John,

 are you sending any other icons for the same?

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Jun 23, 2015 at 1:47 PM, Dave Page dp...@pgadmin.org wrote:

 Hi

 On Mon, Jun 22, 2015 at 2:02 PM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Dave,

 Regarding I don't think there is..., was it the width, style or
 something else that you didn't like? The total width with commit/rollback
 icon + the connection drop down is less than 790 px.
 I've changed the arrows so they point to the data store icon (ie commit)
 and from the data store (rollback).


 It's the overall width of the window. I just measured it on OS X here,
 and it's currently ~740px, so two more buttons shouldn't be an issue. I
 don't think we want any more though.



 I could change it to only show the icons when using auto commit off.
 Would that be better?


 No, the buttons should always be visible to avoid user confusion.



 -- john

 2015-06-19 14:24 GMT+02:00 Dave Page dp...@pgadmin.org:

 Just that whatever we add needs to match the style of what's there
 already, and it should convey the purpose of the buttons as clearly as
 possible. Finally, we only add them if there's physical room when
 displaying the window on a screen of ~1000px wide. Personally, I don't
 think there is...

 On Fri, Jun 19, 2015 at 1:38 AM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi Dave,

 Do you have any comments on the same?

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Wed, Jun 17, 2015 at 5:52 PM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Thanks,

 I can try to look at disabling when not in transaction mode + the
 short cuts.

 Regarding the icons, toad for oracle uses a database icon which the
 arrows point to/from. Perhaps we should add something *similar*?

 [image: Infogad bild 1]

 -- john

 2015-06-17 13:44 GMT+02:00 Sanket Mehta 
 sanket.me...@enterprisedb.com:

 Hi John,

 I have applied the patch and below are my suggestions:

 1. Rollback and commit icons should be disabled session is not in
 transaction mode
 2. Rollback and Commit should also be included in Query menu and
 individual short cut should be assigned to them.

 Dave,

 Can we have any other icons for both the functionality as these
 icons looks odd to me.



 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Jun 16, 2015 at 5:03 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Sure Dave.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Jun 16, 2015 at 4:55 PM, Dave Page dp...@pgadmin.org
 wrote:

 Sanket, can you look at this please?

 Sent from my iPad

  On 15 Jun 2015, at 16:33, John Obaterspok 
 john.obaters...@gmail.com wrote:
 
  Hello,
 
  With the newly added option to disable auto commit (hurray) I
 really missed commit/rollback toolbar buttons. Attached patch adds 
 this.
 
  -- john
 
  0001-Add-Commit-Rollback-toolbar-action.patch
 
  --
  Sent via pgadmin-hackers mailing list (
 pgadmin-hackers@postgresql.org)
  To make changes to your subscription:
  http://www.postgresql.org/mailpref/pgadmin-hackers








 --
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake

 EnterpriseDB UK: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company





 --
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake

 EnterpriseDB UK: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company





Re: [pgadmin-hackers] [PATCH] Fix crash when disabling auto commit

2015-06-22 Thread John Obaterspok
Hello,

It still crashes on the wxIsalpha. Uncommenting the /* (size_t)wordlen 
queryLen  */ makes it not crash.

-- john

2015-06-18 11:24 GMT+02:00 Sanket Mehta sanket.me...@enterprisedb.com:

 Hi,

 we had found some other issues in autocommit code and resolved it.
 Here is the patch attached with this mail.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Jun 16, 2015 at 12:59 PM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Hello,

 I forgot to mention that yesterday I did a search for GetChar() and there
 was another place that also checked the length prior to calling GetChar().
 But perhaps that case was different.

 Might be wx 3 related. (It has works fine except for an assert that pops
 up after connecting to a db + the GetChar() issue)

 -- john

 2015-06-16 8:40 GMT+02:00 Sanket Mehta sanket.me...@enterprisedb.com:

 Hi,

 We were using wxWidgets 2.8.12 so that may be the issue.
 I will now try with wxwidgets 3.0.2 and let you know.

 Btw apart from this issue, we have also resolved other issues in the
 code, i will soon send a new patch for the same.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Mon, Jun 15, 2015 at 11:33 PM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 I'm using Visual Studio 2010 on Windows 7 x64. wxWidgets is wxMSW-3.0.2.
 It might be an assert that triggers in wxwidgets, but ignoring it just
 causes pgadmin to terminate.

 -- john

 2015-06-14 18:44 GMT+02:00 Ashesh Vashi ashesh.va...@enterprisedb.com
 :

 John,

 As I understand correctly, 8th character will be '\0' (null
 character). Hence - wxIsAlpha() will come out of the loop in general.

 But - it is possible every platform has different behaviour for
 wxWidgets. Can you please be specific about the operating system?

 --
 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB (Software Architect)

 [Sent through mobile]
 On Jun 14, 2015 2:41 PM, Sanket Mehta sanket.me...@enterprisedb.com
 wrote:

 Hi John,

 I have tried the same, I am not getting any out of the bounds error,
 it simply comes out of the while loop.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Sun, Jun 14, 2015 at 2:00 PM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Hello Sanket,

 Just enter rollback and exec

 The
  while(wxIsalpha(query.GetChar(wordlen)))
   wordlen++;

 As the 'k' in rollback is a char it also tries the next character
 (worklen = 8) which causes out of bounds check.

 -- john


 2015-06-12 13:25 GMT+02:00 Sanket Mehta 
 sanket.me...@enterprisedb.com:

 Hi John,

 I have tried to reproduce the scenario but not able to reproduce
 the crash in my system.
 can you please provide your steps which causes crash on your
 machine?

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Fri, Jun 12, 2015 at 11:50 AM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 I am looking into the same and few other issues in code and will
 send the patch soon.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Fri, Jun 12, 2015 at 1:49 AM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Fix crash when string has only alphas (like 'rollback')

 diff --git a/pgadmin/frm/frmQuery.cpp b/pgadmin/frm/frmQuery.cpp
 index b5a2f56..110bbc7 100644
 --- a/pgadmin/frm/frmQuery.cpp
 +++ b/pgadmin/frm/frmQuery.cpp
 @@ -2522,7 +2522,7 @@ bool frmQuery::isBeginNotRequired(wxString
 query)
   /*
   * Check word length (since beginx is not begin).
   */
 - while(wxIsalpha(query.GetChar(wordlen)))
 + while(wordlen  query.Length() 
 wxIsalpha(query.GetChar(wordlen)))
   wordlen++;

   /*












Re: [pgadmin-hackers] [PATCH] Add Commit/Rollback toolbar action

2015-06-22 Thread John Obaterspok
Dave,

Regarding I don't think there is..., was it the width, style or something
else that you didn't like? The total width with commit/rollback icon + the
connection drop down is less than 790 px.
I've changed the arrows so they point to the data store icon (ie commit)
and from the data store (rollback).

I could change it to only show the icons when using auto commit off. Would
that be better?

-- john

2015-06-19 14:24 GMT+02:00 Dave Page dp...@pgadmin.org:

 Just that whatever we add needs to match the style of what's there
 already, and it should convey the purpose of the buttons as clearly as
 possible. Finally, we only add them if there's physical room when
 displaying the window on a screen of ~1000px wide. Personally, I don't
 think there is...

 On Fri, Jun 19, 2015 at 1:38 AM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi Dave,

 Do you have any comments on the same?

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Wed, Jun 17, 2015 at 5:52 PM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Thanks,

 I can try to look at disabling when not in transaction mode + the short
 cuts.

 Regarding the icons, toad for oracle uses a database icon which the
 arrows point to/from. Perhaps we should add something *similar*?

 [image: Infogad bild 1]

 -- john

 2015-06-17 13:44 GMT+02:00 Sanket Mehta sanket.me...@enterprisedb.com:

 Hi John,

 I have applied the patch and below are my suggestions:

 1. Rollback and commit icons should be disabled session is not in
 transaction mode
 2. Rollback and Commit should also be included in Query menu and
 individual short cut should be assigned to them.

 Dave,

 Can we have any other icons for both the functionality as these icons
 looks odd to me.



 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Jun 16, 2015 at 5:03 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Sure Dave.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Jun 16, 2015 at 4:55 PM, Dave Page dp...@pgadmin.org wrote:

 Sanket, can you look at this please?

 Sent from my iPad

  On 15 Jun 2015, at 16:33, John Obaterspok 
 john.obaters...@gmail.com wrote:
 
  Hello,
 
  With the newly added option to disable auto commit (hurray) I
 really missed commit/rollback toolbar buttons. Attached patch adds this.
 
  -- john
 
  0001-Add-Commit-Rollback-toolbar-action.patch
 
  --
  Sent via pgadmin-hackers mailing list (
 pgadmin-hackers@postgresql.org)
  To make changes to your subscription:
  http://www.postgresql.org/mailpref/pgadmin-hackers








 --
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake

 EnterpriseDB UK: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [PATCH] Add Commit/Rollback toolbar action

2015-06-17 Thread John Obaterspok
Thanks,

I can try to look at disabling when not in transaction mode + the short
cuts.

Regarding the icons, toad for oracle uses a database icon which the arrows
point to/from. Perhaps we should add something *similar*?

[image: Infogad bild 1]

-- john

2015-06-17 13:44 GMT+02:00 Sanket Mehta sanket.me...@enterprisedb.com:

 Hi John,

 I have applied the patch and below are my suggestions:

 1. Rollback and commit icons should be disabled session is not in
 transaction mode
 2. Rollback and Commit should also be included in Query menu and
 individual short cut should be assigned to them.

 Dave,

 Can we have any other icons for both the functionality as these icons
 looks odd to me.



 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Jun 16, 2015 at 5:03 PM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Sure Dave.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Tue, Jun 16, 2015 at 4:55 PM, Dave Page dp...@pgadmin.org wrote:

 Sanket, can you look at this please?

 Sent from my iPad

  On 15 Jun 2015, at 16:33, John Obaterspok john.obaters...@gmail.com
 wrote:
 
  Hello,
 
  With the newly added option to disable auto commit (hurray) I really
 missed commit/rollback toolbar buttons. Attached patch adds this.
 
  -- john
 
  0001-Add-Commit-Rollback-toolbar-action.patch
 
  --
  Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
  To make changes to your subscription:
  http://www.postgresql.org/mailpref/pgadmin-hackers






Re: [pgadmin-hackers] [PATCH] Fix crash when disabling auto commit

2015-06-16 Thread John Obaterspok
Hello,

I forgot to mention that yesterday I did a search for GetChar() and there
was another place that also checked the length prior to calling GetChar().
But perhaps that case was different.

Might be wx 3 related. (It has works fine except for an assert that pops up
after connecting to a db + the GetChar() issue)

-- john

2015-06-16 8:40 GMT+02:00 Sanket Mehta sanket.me...@enterprisedb.com:

 Hi,

 We were using wxWidgets 2.8.12 so that may be the issue.
 I will now try with wxwidgets 3.0.2 and let you know.

 Btw apart from this issue, we have also resolved other issues in the code,
 i will soon send a new patch for the same.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Mon, Jun 15, 2015 at 11:33 PM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 I'm using Visual Studio 2010 on Windows 7 x64. wxWidgets is wxMSW-3.0.2.
 It might be an assert that triggers in wxwidgets, but ignoring it just
 causes pgadmin to terminate.

 -- john

 2015-06-14 18:44 GMT+02:00 Ashesh Vashi ashesh.va...@enterprisedb.com:

 John,

 As I understand correctly, 8th character will be '\0' (null character).
 Hence - wxIsAlpha() will come out of the loop in general.

 But - it is possible every platform has different behaviour for
 wxWidgets. Can you please be specific about the operating system?

 --
 Thanks  Regards,

 Ashesh Vashi
 EnterpriseDB (Software Architect)

 [Sent through mobile]
 On Jun 14, 2015 2:41 PM, Sanket Mehta sanket.me...@enterprisedb.com
 wrote:

 Hi John,

 I have tried the same, I am not getting any out of the bounds error, it
 simply comes out of the while loop.

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Sun, Jun 14, 2015 at 2:00 PM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Hello Sanket,

 Just enter rollback and exec

 The
  while(wxIsalpha(query.GetChar(wordlen)))
   wordlen++;

 As the 'k' in rollback is a char it also tries the next character
 (worklen = 8) which causes out of bounds check.

 -- john


 2015-06-12 13:25 GMT+02:00 Sanket Mehta sanket.me...@enterprisedb.com
 :

 Hi John,

 I have tried to reproduce the scenario but not able to reproduce the
 crash in my system.
 can you please provide your steps which causes crash on your machine?

 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Fri, Jun 12, 2015 at 11:50 AM, Sanket Mehta 
 sanket.me...@enterprisedb.com wrote:

 Hi,

 I am looking into the same and few other issues in code and will
 send the patch soon.


 Regards,
 Sanket Mehta
 Sr Software engineer
 Enterprisedb

 On Fri, Jun 12, 2015 at 1:49 AM, John Obaterspok 
 john.obaters...@gmail.com wrote:

 Fix crash when string has only alphas (like 'rollback')

 diff --git a/pgadmin/frm/frmQuery.cpp b/pgadmin/frm/frmQuery.cpp
 index b5a2f56..110bbc7 100644
 --- a/pgadmin/frm/frmQuery.cpp
 +++ b/pgadmin/frm/frmQuery.cpp
 @@ -2522,7 +2522,7 @@ bool frmQuery::isBeginNotRequired(wxString
 query)
   /*
   * Check word length (since beginx is not begin).
   */
 - while(wxIsalpha(query.GetChar(wordlen)))
 + while(wordlen  query.Length() 
 wxIsalpha(query.GetChar(wordlen)))
   wordlen++;

   /*










[pgadmin-hackers] [PATCH] Add Commit/Rollback toolbar action

2015-06-15 Thread John Obaterspok
Hello,

With the newly added option to disable auto commit (hurray) I really missed
commit/rollback toolbar buttons. Attached patch adds this.

-- john


0001-Add-Commit-Rollback-toolbar-action.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers