public inbox for [email protected]
help / color / mirror / Atom feedFrom: John Obaterspok <[email protected]>
To: Sanket Mehta <[email protected]>
Cc: Ashesh Vashi <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: [PATCH] Add Commit/Rollback toolbar action version 2
Date: Wed, 16 Sep 2015 20:27:26 +0200
Message-ID: <CAOscVdKfDJJYM1nQeXQ=6NO5ySyz7E4750gNe+-GbfX2nT_YEQ@mail.gmail.com> (raw)
In-Reply-To: <CA+yw=mNFpBWqPYB+_S-L34MbH-MqudY3KiduK7p+cLs4aLB1Bw@mail.gmail.com>
References: <CAOscVdK0zqXa8N179ug0MZ3SqQQDsfXaqPSvsa4As2Mx4xR1KA@mail.gmail.com>
<CAG7mmoyScrFdXCY7apkS67S=j3ciQF7=+YX6QENb_rQ0q8ztuQ@mail.gmail.com>
<CA+yw=mPcHKuLwAwKU6qFa_v1mo=OBU_=g_x71vdDB1oK4_BMcg@mail.gmail.com>
<CA+yw=mNFpBWqPYB+_S-L34MbH-MqudY3KiduK7p+cLs4aLB1Bw@mail.gmail.com>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgadmin-hackers>
Hi Sanket,
Attached patch is rebased now.
Regards,
-- john
2015-09-16 11:20 GMT+02:00 Sanket Mehta <[email protected]>:
> 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 <
> [email protected]> 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 <
>> [email protected]> 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 <
>>> [email protected]> 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 ([email protected])
>>>> To make changes to your subscription:
>>>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>>>
>>>>
>>>
>>
>
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
Attachments:
[application/octet-stream] 0001-Add-Commit-Rollback-toolbar-action.patch (14.5K, 3-0001-Add-Commit-Rollback-toolbar-action.patch)
download | inline diff:
From 57a523f65415a3adce23cec063f80c3ea3a3682b Mon Sep 17 00:00:00 2001
From: John Obaterspok <[email protected]>
Date: Mon, 15 Jun 2015 22:29:48 +0200
Subject: [PATCH 1/2] Add Commit/Rollback toolbar action
Signed-off-by: John Obaterspok <[email protected]>
---
pgadmin/frm/frmQuery.cpp | 20 ++++++++++++++++++++
pgadmin/include/frm/frmQuery.h | 11 ++++++-----
pgadmin/include/frm/menu.h | 2 ++
pgadmin/include/images/module.mk | 2 ++
pgadmin/include/images/query_commit.png | Bin 0 -> 707 bytes
pgadmin/include/images/query_rollback.png | Bin 0 -> 583 bytes
pgadmin/pgAdmin3.vcxproj | 2 ++
pgadmin/pgAdmin3.vcxproj.filters | 6 ++++++
8 files changed, 38 insertions(+), 5 deletions(-)
create mode 100644 pgadmin/include/images/query_commit.png
create mode 100644 pgadmin/include/images/query_rollback.png
diff --git a/pgadmin/frm/frmQuery.cpp b/pgadmin/frm/frmQuery.cpp
index 03f81e8..f855e88 100644
--- a/pgadmin/frm/frmQuery.cpp
+++ b/pgadmin/frm/frmQuery.cpp
@@ -77,6 +77,8 @@
#include "images/query_execfile.pngc"
#include "images/query_explain.pngc"
#include "images/query_cancel.pngc"
+#include "images/query_commit.pngc"
+#include "images/query_rollback.pngc"
#include "images/help.pngc"
#include "images/gqbJoin.pngc"
@@ -120,6 +122,8 @@ BEGIN_EVENT_TABLE(frmQuery, pgFrame)
EVT_MENU(MNU_EXECFILE, frmQuery::OnExecFile)
EVT_MENU(MNU_EXPLAIN, frmQuery::OnExplain)
EVT_MENU(MNU_EXPLAINANALYZE, frmQuery::OnExplain)
+ EVT_MENU(MNU_DOCOMMIT, frmQuery::OnCommit)
+ EVT_MENU(MNU_DOROLLBACK, frmQuery::OnRollback)
EVT_MENU(MNU_CANCEL, frmQuery::OnCancel)
EVT_MENU(MNU_AUTOROLLBACK, frmQuery::OnAutoRollback)
EVT_MENU(MNU_AUTOCOMMIT, frmQuery::OnAutoCommit)
@@ -436,6 +440,10 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w
toolBar->AddTool(MNU_CANCEL, wxEmptyString, *query_cancel_png_bmp, _("Cancel query"), wxITEM_NORMAL);
toolBar->AddSeparator();
+ toolBar->AddTool(MNU_DOCOMMIT, wxEmptyString, *query_commit_png_bmp, _("Commit"), wxITEM_NORMAL);
+ toolBar->AddTool(MNU_DOROLLBACK, wxEmptyString, *query_rollback_png_bmp, _("Rollback"), wxITEM_NORMAL);
+ toolBar->AddSeparator();
+
toolBar->AddTool(MNU_HELP, wxEmptyString, *help_png_bmp, _("Display help on SQL commands."), wxITEM_NORMAL);
toolBar->Realize();
@@ -2201,6 +2209,16 @@ void frmQuery::OnExplain(wxCommandEvent &event)
execQuery(sql, resultToRetrieve, true, offset, false, true, verbose);
}
+void frmQuery::OnCommit(wxCommandEvent &event)
+{
+ execQuery(wxT("COMMIT;"));
+}
+
+void frmQuery::OnRollback(wxCommandEvent &event)
+{
+ execQuery(wxT("ROLLBACK;"));
+}
+
// Update the main SQL query from the GQB if desired
bool frmQuery::updateFromGqb(bool executing)
{
@@ -2423,6 +2441,8 @@ void frmQuery::setTools(const bool running)
toolBar->EnableTool(MNU_EXECFILE, !running);
toolBar->EnableTool(MNU_EXPLAIN, !running);
toolBar->EnableTool(MNU_CANCEL, running);
+ toolBar->EnableTool(MNU_DOCOMMIT, !running);
+ toolBar->EnableTool(MNU_DOROLLBACK, !running);
queryMenu->Enable(MNU_EXECUTE, !running);
queryMenu->Enable(MNU_EXECPGS, !running);
queryMenu->Enable(MNU_EXECFILE, !running);
diff --git a/pgadmin/include/frm/frmQuery.h b/pgadmin/include/frm/frmQuery.h
index 7120240..06baa0c 100644
--- a/pgadmin/include/frm/frmQuery.h
+++ b/pgadmin/include/frm/frmQuery.h
@@ -35,15 +35,14 @@
//
// This number MUST be incremented if changing any of the default perspectives
//
-#define FRMQUERY_PERSPECTIVE_VER wxT("8317")
-
+#define FRMQUERY_PERSPECTIVE_VER wxT("8320")
#ifdef __WXMAC__
-#define FRMQUERY_DEFAULT_PERSPECTIVE wxT("layout2|name=toolBar;caption=Tool bar;state=16788208;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=415;besth=23;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=databaseBar;caption=Database bar;state=16788208;dir=1;layer=10;row=0;pos=396;prop=100000;bestw=300;besth=21;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=sqlQuery;caption=SQL query;state=17404;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=200;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=outputPane;caption=Output pane;state=16779260;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=550;besth=300;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=scratchPad;caption=Scratch pad;state=16779260;dir=2;layer=0;row=0;pos=0;prop=100000;bestw=250;besth=200;minw=100;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|dock_size(1,10,0)=25|dock_size(5,0,0)=200|dock_size(3,0,0)=290|dock_size(2,0,0)=255|")
+#define FRMQUERY_DEFAULT_PERSPECTIVE wxT("layout2|name=toolBar;caption=Tool bar;state=16788208;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=465;besth=23;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=databaseBar;caption=Database bar;state=16788208;dir=1;layer=10;row=0;pos=396;prop=100000;bestw=300;besth=21;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=sqlQuery;caption=SQL query;state=17404;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=200;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=outputPane;caption=Output pane;state=16779260;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=550;besth=300;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=scratchPad;caption=Scratch pad;state=16779260;dir=2;layer=0;row=0;pos=0;prop=100000;bestw=250;besth=200;minw=100;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|dock_size(1,10,0)=25|dock_size(5,0,0)=200|dock_size(3,0,0)=290|dock_size(2,0,0)=255|")
#else
#ifdef __WXGTK__
-#define FRMQUERY_DEFAULT_PERSPECTIVE wxT("layout2|name=toolBar;caption=Tool bar;state=16788208;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=525;besth=30;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=databaseBar;caption=Database bar;state=16788208;dir=1;layer=10;row=0;pos=396;prop=100000;bestw=300;besth=30;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=sqlQuery;caption=SQL query;state=17404;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=200;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=outputPane;caption=Output pane;state=16779260;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=550;besth=300;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=scratchPad;caption=Scratch pad;state=16779260;dir=2;layer=0;row=0;pos=0;prop=100000;bestw=250;besth=200;minw=100;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|dock_size(1,10,0)=25|dock_size(5,0,0)=200|dock_size(3,0,0)=290|dock_size(2,0,0)=255|")
+#define FRMQUERY_DEFAULT_PERSPECTIVE wxT("layout2|name=toolBar;caption=Tool bar;state=16788208;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=590;besth=30;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=databaseBar;caption=Database bar;state=16788208;dir=1;layer=10;row=0;pos=396;prop=100000;bestw=300;besth=30;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=sqlQuery;caption=SQL query;state=17404;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=200;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=outputPane;caption=Output pane;state=16779260;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=550;besth=300;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=scratchPad;caption=Scratch pad;state=16779260;dir=2;layer=0;row=0;pos=0;prop=100000;bestw=250;besth=200;minw=100;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|dock_size(1,10,0)=25|dock_size(5,0,0)=200|dock_size(3,0,0)=290|dock_size(2,0,0)=255|")
#else
-#define FRMQUERY_DEFAULT_PERSPECTIVE wxT("layout2|name=toolBar;caption=Tool bar;state=16788208;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=415;besth=23;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=databaseBar;caption=Database bar;state=16788208;dir=1;layer=10;row=0;pos=396;prop=100000;bestw=300;besth=21;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=sqlQuery;caption=SQL query;state=17404;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=200;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=outputPane;caption=Output pane;state=16779260;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=550;besth=300;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=scratchPad;caption=Scratch pad;state=16779260;dir=2;layer=0;row=0;pos=0;prop=100000;bestw=250;besth=200;minw=100;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|dock_size(1,10,0)=25|dock_size(5,0,0)=200|dock_size(3,0,0)=290|dock_size(2,0,0)=255|")
+#define FRMQUERY_DEFAULT_PERSPECTIVE wxT("layout2|name=toolBar;caption=Tool bar;state=16788208;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=465;besth=23;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=databaseBar;caption=Database bar;state=16788208;dir=1;layer=10;row=0;pos=396;prop=100000;bestw=300;besth=21;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=sqlQuery;caption=SQL query;state=17404;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=200;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=outputPane;caption=Output pane;state=16779260;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=550;besth=300;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=scratchPad;caption=Scratch pad;state=16779260;dir=2;layer=0;row=0;pos=0;prop=100000;bestw=250;besth=200;minw=100;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|dock_size(1,10,0)=25|dock_size(5,0,0)=200|dock_size(3,0,0)=290|dock_size(2,0,0)=255|")
#endif
#endif
@@ -181,6 +180,8 @@ private:
void OnExecScript(wxCommandEvent &event);
void OnExecFile(wxCommandEvent &event);
void OnExplain(wxCommandEvent &event);
+ void OnCommit(wxCommandEvent &event);
+ void OnRollback(wxCommandEvent &event);
void OnBuffers(wxCommandEvent &event);
void OnTiming(wxCommandEvent &event);
void OnNew(wxCommandEvent &event);
diff --git a/pgadmin/include/frm/menu.h b/pgadmin/include/frm/menu.h
index 69a45c7..7024aea 100644
--- a/pgadmin/include/frm/menu.h
+++ b/pgadmin/include/frm/menu.h
@@ -66,6 +66,8 @@ enum
MNU_EXPLAIN,
MNU_EXPLAINANALYZE,
MNU_EXPLAINOPTIONS,
+ MNU_DOCOMMIT,
+ MNU_DOROLLBACK,
MNU_VERBOSE,
MNU_COSTS,
MNU_BUFFERS,
diff --git a/pgadmin/include/images/module.mk b/pgadmin/include/images/module.mk
index 0d5bd97..613146f 100644
--- a/pgadmin/include/images/module.mk
+++ b/pgadmin/include/images/module.mk
@@ -227,6 +227,8 @@ pgadmin3_SOURCES += \
include/images/query_execfile.png \
include/images/query_execute.png \
include/images/query_explain.png \
+ include/images/query_commit.png \
+ include/images/query_rollback.png \
include/images/query_pgscript.png \
include/images/readdata.png \
include/images/refresh.png \
diff --git a/pgadmin/include/images/query_commit.png b/pgadmin/include/images/query_commit.png
new file mode 100644
index 0000000000000000000000000000000000000000..500ef88c58b4fc812e4693177001b69fc0f55ed9
GIT binary patch
literal 707
zcmV;!0zCbRP)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00004XF*Lt006O%
z3;baP00009a7bBm000ic000ic0Tn1pfB*mh7<5HgbW?9;ba!ELWdLwtX>N2bZe?^J
zG%heMHD!e|WdHyIK}keGR5(w4ky}WUVI0P%;1LxWmcp!zvO;v9hn%woQ5W3=5_Q{M
z6eM)nRd>;K(19^CN+b*OFtM!EDa&*nqzH^!>R4;%Ltf~h4D#3e&iUEbsy{q@@Av+n
z=Xsy^|LOn@I<vCq&dFi8xR{3}CD@CK=*i3DrcSoCT#1a0+u7MTw^tCXuO-r?5N|LN
zYc?`jRwmk7u0+PhEs?-kT}h~^j>vw6h)JMTVO*~lZ7o+qU33)XBIC;ht|JZW!WM;)
zMSKr6Gixv~R$9uPKdz!Kx@7c<t-Rf}gP;(`O$`K&n((%@5INXL*sSnj-|o~Q8yX39
zA<>hY%ebK&_hE&PCmRVJPzalh`08tz+*VG1L4lxc@+CAiH*=NV{CsBiRN=AI5f*ds
znQL+GG;mkEOq!;a#$dS9g6q*a=4Y?aUs#BvvV!+D)lBcL;+{zMdg45effLwmCRL>x
zJR3NT=UoT<ToUlJw(91-c>BRE`jj{r>?7do!t3qig`*wGmpav8$Y$Zy=qcu2p5?1&
zgq6_bI^uSszUwMvU-F)Iw`mRfuhrvUm>{}1%JZRio^&0<Zf#K^|K)xnI!)}$7?Lk_
z8iSx`ie$_U-&f$<5^Kphl8F)GJ{zCsFXElQEUsZC;_v&n!E)>q{7Ay;y1`2HF^RA>
zW#C&B23{-Cz=OXV%sMWm6D+F+sRaJt5_oOAabCzYkTulN%GBT)7F;(r2bmt?#_%S3
pkBetCt16AbM*VMyX^L8a?iVsPVn?ss%Xk0)002ovPDHLkV1ly(N`3$U
literal 0
HcmV?d00001
diff --git a/pgadmin/include/images/query_rollback.png b/pgadmin/include/images/query_rollback.png
new file mode 100644
index 0000000000000000000000000000000000000000..b78ce614bbff77a80aae4e32e4aa1adc71ce4642
GIT binary patch
literal 583
zcmV-N0=WH&P)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00004XF*Lt006O%
z3;baP00009a7bBm000ic000ic0Tn1pfB*mh7<5HgbW?9;ba!ELWdLwtX>N2bZe?^J
zG%heMHD!e|WdHyH#Ysd#R5(wCk=;vEaTv$_ANn7>5>f)4h!J$B;7i>N@xrJ`y68e7
z@Jj1iY}s*RkYRYCHaEhz&9ln+lCq>?H>Hl_oG+a@y>J6fs89PHcYf`(Gkf66;rBe>
z?}vxylmWJKdauysX+V7cofXQqX@);(um1}vYM9}fua6mBb`py9UJ9{1%<$CbM|j`g
zL{aN`8EMWzo|J?Xg$L)a(mz|yz+45c&^2Dn*D@5o!SLd3TZjc<%5H<gxtS5NRBZW~
zVHi>!xPn!=Z5$}!>kLO)jeg!H%K~`otz%{Cfngk9buzKmjxXB5Wb{6P^@m1Z_1(hn
zu9hhYSn%B;{>1~ojtyfeX_}XhYA3=kauN`5*Rd9CBer^vqxdwL{dX5S^rI)9ONqJg
z&5bl!0dHKDBsat8TR|2Boy@*!#IMvyiMQyd^(9g}A%tJ#EP%augly^?oMqtjnBUnL
z+4MAr2{+ptJ!l(G*-a??NKTXnoTR?Pc@}<N05bXv=>x?8B(`z@O+nusw+BSkzWfF!
z5@2kQEZ9JEv;LvG7$7R(sU<Rbm(7*IzlY2p(L7#wtR?pw9WrGBn046^^A=e^*&qC)
Vd9JZq;cWl_002ovPDHLkV1m0-19<=d
literal 0
HcmV?d00001
diff --git a/pgadmin/pgAdmin3.vcxproj b/pgadmin/pgAdmin3.vcxproj
index 534bf78..9328a9c 100644
--- a/pgadmin/pgAdmin3.vcxproj
+++ b/pgadmin/pgAdmin3.vcxproj
@@ -3464,10 +3464,12 @@
<png2c Include="include\images\properties.png" />
<png2c Include="include\images\property.png" />
<png2c Include="include\images\query_cancel.png" />
+ <png2c Include="include\images\query_commit.png" />
<png2c Include="include\images\query_execfile.png" />
<png2c Include="include\images\query_execute.png" />
<png2c Include="include\images\query_explain.png" />
<png2c Include="include\images\query_pgscript.png" />
+ <png2c Include="include\images\query_rollback.png" />
<png2c Include="include\images\readdata.png" />
<png2c Include="include\images\refresh.png" />
<png2c Include="include\images\reload.png" />
diff --git a/pgadmin/pgAdmin3.vcxproj.filters b/pgadmin/pgAdmin3.vcxproj.filters
index 04def5f..c21104b 100644
--- a/pgadmin/pgAdmin3.vcxproj.filters
+++ b/pgadmin/pgAdmin3.vcxproj.filters
@@ -4505,6 +4505,12 @@
<png2c Include="include\images\views.png">
<Filter>include\images</Filter>
</png2c>
+ <png2c Include="include\images\query_commit.png">
+ <Filter>include\images</Filter>
+ </png2c>
+ <png2c Include="include\images\query_rollback.png">
+ <Filter>include\images</Filter>
+ </png2c>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="pgAdmin3.rc" />
--
1.9.5.msysgit.1
[application/octet-stream] 0002-Add-Commit-Rollback-to-query-menu-disable-when-not-i.patch (2.3K, 4-0002-Add-Commit-Rollback-to-query-menu-disable-when-not-i.patch)
download | inline diff:
From 96cb4e1683a47f5b14131a18e903ef975b290cf8 Mon Sep 17 00:00:00 2001
From: John Obaterspok <[email protected]>
Date: Sun, 13 Sep 2015 21:14:25 +0200
Subject: [PATCH 2/2] Add Commit/Rollback to query menu + disable when not in
transaction
---
pgadmin/frm/frmQuery.cpp | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/pgadmin/frm/frmQuery.cpp b/pgadmin/frm/frmQuery.cpp
index f855e88..a0a114a 100644
--- a/pgadmin/frm/frmQuery.cpp
+++ b/pgadmin/frm/frmQuery.cpp
@@ -328,6 +328,9 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w
queryMenu->Append(MNU_AUTOCOMMIT, _("&Auto-Commit"), _("Auto commit the cuurent transaction"), wxITEM_CHECK);
queryMenu->AppendSeparator();
queryMenu->Append(MNU_CANCEL, _("&Cancel\tAlt-Break"), _("Cancel query"));
+ queryMenu->AppendSeparator();
+ queryMenu->Append(MNU_DOCOMMIT, _("Commit\tCtrl-Shift-C"), _("Commit"));
+ queryMenu->Append(MNU_DOROLLBACK, _("Rollback\tCtrl-Shift-R"), _("Rollback"));
menuBar->Append(queryMenu, _("&Query"));
favouritesMenu = new wxMenu();
@@ -2436,19 +2439,23 @@ void frmQuery::OnMacroInvoke(wxCommandEvent &event)
void frmQuery::setTools(const bool running)
{
+ bool canEndTransaction = (!running && conn->GetTxStatus() != PQTRANS_IDLE);
+
toolBar->EnableTool(MNU_EXECUTE, !running);
toolBar->EnableTool(MNU_EXECPGS, !running);
toolBar->EnableTool(MNU_EXECFILE, !running);
toolBar->EnableTool(MNU_EXPLAIN, !running);
toolBar->EnableTool(MNU_CANCEL, running);
- toolBar->EnableTool(MNU_DOCOMMIT, !running);
- toolBar->EnableTool(MNU_DOROLLBACK, !running);
+ toolBar->EnableTool(MNU_DOCOMMIT, canEndTransaction);
+ toolBar->EnableTool(MNU_DOROLLBACK, canEndTransaction);
queryMenu->Enable(MNU_EXECUTE, !running);
queryMenu->Enable(MNU_EXECPGS, !running);
queryMenu->Enable(MNU_EXECFILE, !running);
queryMenu->Enable(MNU_EXPLAIN, !running);
queryMenu->Enable(MNU_EXPLAINANALYZE, !running);
queryMenu->Enable(MNU_CANCEL, running);
+ queryMenu->Enable(MNU_DOCOMMIT, canEndTransaction);
+ queryMenu->Enable(MNU_DOROLLBACK, canEndTransaction);
fileMenu->Enable(MNU_EXPORT, sqlResult->CanExport());
fileMenu->Enable(MNU_QUICKREPORT, sqlResult->CanExport());
fileMenu->Enable(MNU_RECENT, (recentFileMenu->GetMenuItemCount() > 0));
--
1.9.5.msysgit.1
view thread (11+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: [PATCH] Add Commit/Rollback toolbar action version 2
In-Reply-To: <CAOscVdKfDJJYM1nQeXQ=6NO5ySyz7E4750gNe+-GbfX2nT_YEQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox