From 36949b8f4505b57e518d240fce981d338d9fc50b Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 4 Jun 2014 15:14:57 +0300 Subject: [PATCH] Add Undo/Redo actions. --HG-- branch : feature --- src/app/mainwindow.cpp | 16 ++++++++++++++++ .../win.icon.theme/16x16/actions/edit-redo.png | Bin 0 -> 1246 bytes .../win.icon.theme/16x16/actions/edit-undo.png | Bin 0 -> 1252 bytes .../win.icon.theme/24x24/actions/edit-redo.png | Bin 0 -> 1353 bytes .../win.icon.theme/24x24/actions/edit-undo.png | Bin 0 -> 1352 bytes .../win.icon.theme/32x32/actions/edit-redo.png | Bin 0 -> 2077 bytes .../win.icon.theme/32x32/actions/edit-undo.png | Bin 0 -> 2037 bytes src/app/share/resources/theme.qrc | 6 ++++++ 8 files changed, 22 insertions(+) create mode 100644 src/app/share/resources/icons/win.icon.theme/16x16/actions/edit-redo.png create mode 100644 src/app/share/resources/icons/win.icon.theme/16x16/actions/edit-undo.png create mode 100755 src/app/share/resources/icons/win.icon.theme/24x24/actions/edit-redo.png create mode 100755 src/app/share/resources/icons/win.icon.theme/24x24/actions/edit-undo.png create mode 100644 src/app/share/resources/icons/win.icon.theme/32x32/actions/edit-redo.png create mode 100644 src/app/share/resources/icons/win.icon.theme/32x32/actions/edit-undo.png diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 781810d4c..66ba94573 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -36,6 +36,7 @@ #include "exception/vexceptionwrongid.h" #include "version.h" #include "xml/vstandardmeasurements.h" +#include "widgets/vapplication.h" #include #include @@ -1708,6 +1709,21 @@ void MainWindow::CreateMenus() separatorAct->setSeparator(true); ui->menuFile->insertAction(ui->actionPreferences, separatorAct); UpdateRecentFileActions(); + + //Add Undo/Redo actions. + QAction *undoAction = qApp->getUndoStack()->createUndoAction(this, tr("&Undo")); + undoAction->setShortcuts(QKeySequence::Undo); + undoAction->setIcon(QIcon::fromTheme("edit-undo")); + ui->menuDrawing->insertAction(ui->actionPattern_properties, undoAction); + + QAction *redoAction = qApp->getUndoStack()->createRedoAction(this, tr("&Redo")); + redoAction->setShortcuts(QKeySequence::Redo); + redoAction->setIcon(QIcon::fromTheme("edit-redo")); + ui->menuDrawing->insertAction(ui->actionPattern_properties, redoAction); + + separatorAct = new QAction(this); + separatorAct->setSeparator(true); + ui->menuDrawing->insertAction(ui->actionPattern_properties, separatorAct); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/share/resources/icons/win.icon.theme/16x16/actions/edit-redo.png b/src/app/share/resources/icons/win.icon.theme/16x16/actions/edit-redo.png new file mode 100644 index 0000000000000000000000000000000000000000..0bf5159f63b34d345fe9e9d0a7e6eb98a20dd4b7 GIT binary patch literal 1246 zcmV<41R?v0P)1M000C# zNklu|mwc_R_aV<%v(nD>FN>Lu|<}JFlG3?rYe?aGEZo7Rx@Y)is?>J`(5;~hK|vTJ77&?`%b9?L{DhTKuDb1RmHy{ zM%o^U5S?;cC69yXKiel6Gxzxdy@}E{9MBcr%i8ryzaN`IoIlo@$SvVhNPp--vG#)}Dt7`c>W?em%h@g_4?6Cg`RFh9T*O)+6 zQ*yi{2m%93r`S(~!2V~BA*fcDSox$uU}fp?1A8E-``ldRGYAPQKWDZGf<4Q!c^v_B zj!i|F{#)TVc?HZcFIxJj7iO3hb;S09|CC~feh%ROsJIMaR_6(o`3rbI{lpeae^_w& zn`GX^L}P9lg5TpqGvDihi97R~yMKmB1M-hXWr1?x(Rm1yw&tCs5AT-edLfLD`08oD zH1G?^RojGs-?qHvBcFlNH9uUE3CgVex9N-g#{M1zxxui(Sq+MzIl9&~PFmyTZ`Z($%sN2)0N>TeFxkv zcR421g2#uu^SXV(Q@cmIb{hC9_cfcX1Mk=@3;Losv*|E`b8Bh}f=ls^D31n^rEib9 za1cgbOqq304$g{g*?E6}Q}ot?Rdz7q<<{2K_29fYWnke(kQuih>6#8MZ9Bd$x(Ke* zQcaFBkS$9;i=fvB+~HMh>NhG8tRx8ocnHH!C2eu@0tde&?SVY7k4v&{a|64ZiK|Sb zz^*K@#^eqT1Ck!yl)>=1$+9$Ga4byrbV>!sqGSdCgk_^93&BdasSQCoB+hn_0j#X_ z!Q+%LOroz3%>=8@*Ut;ChG8r8O@~07*qo IM6N<$g0QPhRR910 literal 0 HcmV?d00001 diff --git a/src/app/share/resources/icons/win.icon.theme/16x16/actions/edit-undo.png b/src/app/share/resources/icons/win.icon.theme/16x16/actions/edit-undo.png new file mode 100644 index 0000000000000000000000000000000000000000..c6ddff49df4994273c5088a00bfb65139453ec3b GIT binary patch literal 1252 zcmV1M000C* zNkl?$s{q>26D2_s*f>c(bx-L`%wOw}+el=&`OISb3E) zN*T8r)wRx9r^Sjq4m~!xEIpjHo9o~v9gjuQ7!GIlJNvsoaO|9YKJePKMze;2pf#E` zgKa@;G;1W&L2EQ?_%Ezc-fcukNidB-i0LwCI~|0$nvQjmfe`;;M~{^S#7jErd7Dxe z^=2X@&v?=;Sqw4JX6LDwAnslBxFbO9b92;L8N@l5D{O-y&c>X>+YmM0xDO#pVT>Po z527O4qXV;H-2)RByCHgmX=bkrL=U`N+v)>r4;bZ>13*(^k_=TNxcq^TcIWX@UWZ!U z(t@B?wd4+H19ehM_v+gaX4AUyS_FiJw4Ujk2VtSDbq@@n&T5@{*8pECn$5p_4xt%M zr}V`Tx~l1bpAmv$n=1xQfEA_93wRZ3bxRBXQdc2-@n_@x36>D@;zGQB2!zNDh20?# zeA5uqcL##w4RJSmAte05*osRK+K5ZPVP}kkJaDo-v>P@@~ z=Mj7VLI^9n_zYqBmAWuHcL*@mPe@!3%bIJaUd;vnhczKhmf%05cC+*l1US^!OzeYY zS+(93p5Px*<9c-+ENMF(?&l8Se>YhoEZTe0p4Z{G=42znXWpk$2Gzh~ixUk?rh)H` z>fXZ3;Jdq8HR2vDe15DD!S}`SO4Tg*w4vIn-3=C&9^G2d2HvA8OD#RX$Gd79Z(?Rg zc@n~`A?3PvY+*rHrBo(^PxeqvY-gO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0Vsr zMYntc0386J&fu<$0RTh_8Lu3dnp--nX4Ztj1IsC8hHqOxhfJg0={$OOYPajbH79fI zL(F)vUSzsb?}Q7ZpPB)tM@!=m4<39IShW7X0{|fP?RM};%TgPrRa=EZcqrY}yicbfEw6@JRlOPw4;v3%xD>3UKGr7H_!qJl^0*+h3jq8FF?b zw=w_#03v!+SaefwW^{L9a%BJjc-kv3FW1Y=%Pvk%EJ)SMFG>dhHrNJO5L3!r00000 LNkvXXu0mjfM`>jN literal 0 HcmV?d00001 diff --git a/src/app/share/resources/icons/win.icon.theme/24x24/actions/edit-undo.png b/src/app/share/resources/icons/win.icon.theme/24x24/actions/edit-undo.png new file mode 100755 index 0000000000000000000000000000000000000000..c30db971d0a89881d4701883fdcb90e59792616d GIT binary patch literal 1352 zcmV-O1-JT%P)8L_t(Y$F-G9Y?M_L$N%?!kNM`& z>6B-&7O+slODq&pYbib!h;gSz6QT(sB`6CMU65cRB8dwl3t14wM~KlxMK{JEXfcY= zR4Szw+i5AZrSHi-1Wj1c<(?{MYw@EZPWtuH9bt;>H~ht*_dd zC@OTu1}^cs+LH%0p`BVQs<;#)2qps0A4;c2+jHF)J2A7wN7KGL07{+%I-AVW=QqFh z@DtU$X3j5;1WJQTg>2SEzyuiM;64NQd~ny}Y&>&$e0ZdO;9}o_OULVf!t7ZBU59Sb z^zWW(Cs#S7<01*K4i32B&sZ9`iYv|&P01A-c0#4veIQ zyQh0Nlu3^}URFAiTU0B`nS^2tGGLHGf)WBp3)j1x`iOJU<6byY~JJc^?jpKBfo?L*NZyV0$;+Gj6+EYN(rJW=pOCq z-Iw!uM)oz_2)F|Al4F>?Vg1OZrn8L&QKvG`v8Ipr4}4%p!hfb~_YQi-yq1w8hrf^C zTVy-2*gB6%0stX{Ana!k_kMTab2)3F#$e+l!%j7#|BEkC{Aktb!86UTTu!#N2aJ=z zX8-`v@)?}UYM$yFIAjHG${++F1QAG=Ph`F=-?Br(=aUaR0DyY}$@fFB(zPc>SJrHW zL5HrDea4{-;%lWj2oRzK4tIa- z3J4#T>CyL=R<6m`@Bi>RFU4I%VNoH%vFI{oSosM<`5`y+Zu0A0$6HP{0XX{~0jp}z z{nbvIm&jimv#E}FB6?I2D?NY%?PN(TTo*alb-Q_5Tb0000< KMNUMnLSTZ=#AfpV literal 0 HcmV?d00001 diff --git a/src/app/share/resources/icons/win.icon.theme/32x32/actions/edit-redo.png b/src/app/share/resources/icons/win.icon.theme/32x32/actions/edit-redo.png new file mode 100644 index 0000000000000000000000000000000000000000..353989137b43f09d9307f12b9e0579f2483ec906 GIT binary patch literal 2077 zcmV+&2;%pNP)*mt9^W~? zcH2I}g}5B9RRU@Njer(_y(1DYLO=pv3Voh|0Ncil4o|ra#^Xe&*q3I}kX( zX`D6(u9X7HDI_M$3uh#p5)iCdPOHYat10>P7=J)m?hVs`nORj4$P%sdyol#`G1s?? zvN$tI|8;<;>?ZtmAMl9s!rDF@PY@vEGBT_tm+NTd-bBD35cI>%#;~coD!Movg$IuW z03uGWme#Htuir8zsx>5kQI#~c_riY&2#mYZYBAdb0D*XJvT(YK#Z5u^_nQN6RhV^! z56m7FMw?7b3@{An1&1d@cBw>Uo)qJ`dD|5KOv(up5U@HWKrxq5oHdl`!GwSn$Etd# zpQw&(v2rqTt2r?oB0O#VcB~&i{}Ql+L+qT$?(Zef%AM2oeM1+O@mU0z$Y=rJR#A6E zX?06T%FcTOFPAjxc+53k7GB%xUR(bV_3@c;KEF>Mpi>;quX*LI zZFgfG@#mTAIV9odr98KBMz=*{W3&&L7C4hbyZ3# zrw{i1WJ7XjAyq^79cLkUWq zAH6zx&5d|SBJih(lgq`A_q-c9acqA*Dx8Gw?Y92N{rI%qcc<}W+|5N=Ix9Y4;o2FY z1yuKzj`{%-VD1l~)%O|l{;!F@+^+L!T|KySM2vpP;SZztP#p38PN)TGyY38Gn_K!G zdLT%r`YwA>uca{|p4bPPpSL3-0aQB=6c#{lKy*OT$r&~E7A0o0uSR+Ougv%)xL!pa zPD;w?^~TDpujS@FTsAO5v-IrB0f&XFcBG|9B={CNBZCAKBsy5{hLTFtz{r$Si7fU5 z!?j6axVz5x@o$z5Q6} z$agke9m-1T?a?nS$e3q11pn2M5fOPoN`^QASo2bll*@^bm7ZlY0{1izM9x^yq>OR|XXp*LoRE7NfDzT77-@=u|hA z42KkpkbtzE4)pPk%Us;hWOczrj0)A>%-=h130yCs6_}W+3GzW9m=)1@kFqLL_m>m) zPj0br5|jy@R&}QGr^IRSpRqjw)(2P~MD>|`Anmu}n$E1jtePLYb-}b=M`^;TW9mk6 zms700sfmRmiFa4$#ctVm>tz%utfu(>0Sk_QF%mmpqp%|idjVTPkMy0_5*Dw!G==p! zt*5f#>cKZx2k71I3ggK75+$535$KxzV{v%$ho}46>|ASalu9HGm%p9ZuXmU?PR(Xv zM-+BL7DHTlSlrb8sTT_>A{dF_K+i{?FNr%mY*0`U5wMU4T-ZJV!{8aCB11c^EBr2Lm0&F6oy`NRgivO?+$pU!#3tK2`1O|5-C3 zBZ2kod*J9FF{#T>&MT{|@5<~uYbveNl3+6O^Kn1EXwHDNc{BT!3R*JX;aDyhOjRT# znwA!uenLvl^y6pmPO{l~SvwNE@U3b$Wy$ODq06(kPB=v|H$ST-KW$&YluaSr7o5IO z5_s^)tzLiJ`8)i6xiPf*ktrDR!ldz3m1wo9B0nFG8(*f6Ipyc0X4^7rhx0%OJ0sx+ zMZvlt{g#r>+sKfGnvIni#{d8K=2WmnV`L=-{sD5~<1Q1H;#2?t z03v!+SaefwW^{L9a%BJjSi>tXFW1Y=%Pvk%EJ)SMFG>dhHrNJObUhoG00000NkvXX Hu0mjfr$E-m literal 0 HcmV?d00001 diff --git a/src/app/share/resources/icons/win.icon.theme/32x32/actions/edit-undo.png b/src/app/share/resources/icons/win.icon.theme/32x32/actions/edit-undo.png new file mode 100644 index 0000000000000000000000000000000000000000..938acb0d48e97cce78f1d0dbf72f49939d31c9ff GIT binary patch literal 2037 zcmVmsYi1@%Rog20bGCYzE-wI+wQsoPn=uHQb~j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`Vwo9v_kwcvO&O^yeA1l-(*(QEtw;2=;G7I;eCHR(*HjN zxFE60o=kQKOnpFg-Ng!hc5!Cilk4x7R)33=ozV!XUUCZca)&J5o!k$+gASGmyX@o$ zROg-S%AHq}Fs#-%-bCL3ofMPv+$(&^$zLh2ZLH9H8%J;-p8DuzRedb<4In~=<62?P zw8RtPgynYJ?D(8xl;>8C@&Y`za_#%3RQyw|8H07?!%AqNgdVpayb8DR-}QoWOX4VZ z09xOm1NR@6*AP#PBo|byj2O)-G&@`3xtXTiHgN=zdlIw%aN$}k*X@jI zfq@c|O4aL7R?%{~$EJFL>qd@p-N=(x>77(JWl2_6>603A;h2m%5dPv--K;%n`MWy~ zNPZ%4N#rP(M4ljU*}#p8Ih>6J$Q3;%G^&Pr7g80*I$-sdi`yxu1Xkdfz)_9~Jc0Zc zIL31}K1tO+LsClY{kJ_AI<12->o|dZJTGtnpf$CR=bU@*D5-g^8H<+^Ydl4!P2Gz1 z?}a2@1DCEpyTj6RW0k;mHUE|lgjJ1WyNVattzkl9{>ZGWXM**#qUjrvK`10>1aVuR zXU}URMn$A$i)~lZrft6Go5Hrs#;3phd2=Pq3&i|rgGapSJ7FV6w8YBTl_=bq+~S#Y zmZt9;GH(BQk6ualEu2_lO*kl71XNPx8g>mScKMF zp^AB7HV0r;8&0lmc;)Ji?si3&>x-1hr~WzB35*yGu|SdPfECXPvBOO*u^{OR)kpss z{ReMSCwnUzQ5paM03v!+SaefwW^{L9a%BJjSi>tXFW1Y=%Pvk%EJ)SMFG>dhHrNJO TbUhoG00000NkvXXu0mjfmp#icons/win.icon.theme/24x24/actions/list-add.png icons/win.icon.theme/32x32/actions/list-remove.png icons/win.icon.theme/32x32/actions/list-add.png + icons/win.icon.theme/16x16/actions/edit-redo.png + icons/win.icon.theme/16x16/actions/edit-undo.png + icons/win.icon.theme/24x24/actions/edit-undo.png + icons/win.icon.theme/24x24/actions/edit-redo.png + icons/win.icon.theme/32x32/actions/edit-redo.png + icons/win.icon.theme/32x32/actions/edit-undo.png