From b620e3d81644082a7a5d123e61928d5a6dc05636 Mon Sep 17 00:00:00 2001 From: garak Date: Fri, 12 Jan 2024 15:48:51 -0500 Subject: [PATCH] add button to lock group edits --- forms/mainwindow.ui | 37 ++++++++++++++++++++++++++------ include/mainwindow.h | 1 + resources/icons/lock_edit.ico | Bin 0 -> 4418 bytes resources/icons/unlock_edit.ico | Bin 0 -> 4286 bytes resources/images.qrc | 2 ++ src/mainwindow.cpp | 29 ++++++++++++++++++++----- 6 files changed, 58 insertions(+), 11 deletions(-) create mode 100644 resources/icons/lock_edit.ico create mode 100644 resources/icons/unlock_edit.ico diff --git a/forms/mainwindow.ui b/forms/mainwindow.ui index 244f1b29..92bf0b13 100644 --- a/forms/mainwindow.ui +++ b/forms/mainwindow.ui @@ -89,8 +89,8 @@ - :/icons/folder_eye_closed.ico - :/icons/folder_eye_open.ico + :/icons/folder_eye_open.ico + :/icons/folder_eye_closed.ico @@ -144,6 +144,31 @@ + + + + <html><head/><body><p>Toggle editability of group folders</p></body></html> + + + + + + + :/icons/lock_edit.ico + :/icons/unlock_edit.ico + + + + QToolButton::InstantPopup + + + true + + + true + + + @@ -249,8 +274,8 @@ - :/icons/folder_eye_closed.ico - :/icons/folder_eye_open.ico + :/icons/folder_eye_open.ico + :/icons/folder_eye_closed.ico @@ -409,8 +434,8 @@ - :/icons/folder_eye_closed.ico - :/icons/folder_eye_open.ico + :/icons/folder_eye_open.ico + :/icons/folder_eye_closed.ico diff --git a/include/mainwindow.h b/include/mainwindow.h index 4a5d5777..536f659c 100644 --- a/include/mainwindow.h +++ b/include/mainwindow.h @@ -282,6 +282,7 @@ private slots: void on_toolButton_HideShow_Groups_clicked(); void on_toolButton_ExpandAll_Groups_clicked(); void on_toolButton_CollapseAll_Groups_clicked(); + void on_toolButton_EnableDisable_EditGroups_clicked(); void on_toolButton_HideShow_Areas_clicked(); void on_toolButton_ExpandAll_Areas_clicked(); void on_toolButton_CollapseAll_Areas_clicked(); diff --git a/resources/icons/lock_edit.ico b/resources/icons/lock_edit.ico new file mode 100644 index 0000000000000000000000000000000000000000..f30f424914e61f251359e82f311b28b90d34cfd2 GIT binary patch literal 4418 zcmb`Kc~I5Y6~}*ofC~87d1KRRn`xWO#G1OqnKlH)IK=7Hg|w#sL`^kB4U51~RFqA8 zpb+J;KHveG;1XO450u6lR-Y`&j*mqnAc!n+1eHWt-nZvGmcWyTkm+H*-2408bI<48 zbMNoR4?)nQpT)lx__y$ug&^1pg75}uG0Bm{_kX4t(mYerJd*y;j4|yr00K*gF`HH< z{FcPa`oHEe#-70E^@>O~qr63~9$w$C-1NyYy0#~ASr?9uaXwRt=W+~=HLYp!*#O2-?DpPq0{c8bZ_107>`dSp35;f*0ecj@j2(^qTOk&BKHee z;C2C~ZWm$fuE5$I2e8A(AA55j;rDK*VBvBKW}X>X;BgV`D^O7VL))xcoZ>Tk`Qwi{HdK-L;dXU}@1eXtDLu>`!+atpVx5%%QH0tl9 z9EOupjkhQU$09KAg-+Ar+gf;KU{e{e@^T-jqS2L{74hh?+s$h z&rtjOwxW9|#Q zpFcnvgk!-lmZj7q_*xSl4FOxP0oL(=m~(K6f+MYY4f)w$`w<@&zrf$hhG9;z2s|sk zrFS;ARSs+T;-m)5r}fW|WL3gAss<~3l?c2CH2(nn^IO1XJO?RkQ=70t(FJGXe_TEU zjx}4pl}`>_YSdUhVg2i9UF!-+MZ=gITZ?xN+(2*(&_bIrF$afFrLZp;f^+F0c2=ul zNwH?l_x%PQsuBLg^_x%)%%W=`N~nk6oPt&UWiRDmM|<(^j!1l14!G3=R{O5bns2@T zzwl|Ky;l6R|6}WSDxx*X8=>bM2VqkTRvjuua5L3m!d}?QfIsh$VjtDV=3wsZ`3G|0 z{~hp0;@eHwe^Y5C%;V}{mHHj#Y>a?D$u#Be$X?KSn3Mz6;k{ikunQ_;{%=S|q$y4N z{M#HXz>#J(-p+iCHKXUB_uh&2-hygx_OC1$Za$7VBopeJ(lfep-*p6O}0q-k@|=Gz4-5!(SQeQEu?_rzc83&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/unlock_edit.ico b/resources/icons/unlock_edit.ico new file mode 100644 index 0000000000000000000000000000000000000000..85a99e980c95ca2f81fc4b8b63fea7d9a0d10f8f GIT binary patch literal 4286 zcmb_fX;4&G7Jh($3fSy)IhoO#R87WA95XJlY9<7QSj3vDh$Lg?Ph7@?sKZV%7*Pa7 zcBAY|w}2^71DZesQgIBcEsH?2*(@5tB`g|CP)L;Rn{ysZu%!u9&7nT-efOSwzVDoS z-{T?(I`p%0rNF<1^QMAeEeOIN2{a^ZBJj9210XQ8m>G@#iLja=B`hK668FCg{z16j~kr!L{i_Dz-cWf@SHaAT8_c7<}?j{_U9be5jGPX2=Bi2-amr( zY~Kpo9s7ruJMNF5u`QExJU<(FEyv(kb867wXU*#*`!nxI+%I66+XWcAU4)^#0uFl* zVXtohJc}RUHMcV`b2$SOuUstixCr)@kgvooht}jwJX4HG4IEReY4BT_x}NV`EmLD_ zC9w6{xY#;Y0dHsDgI~o%WZwsZ>qhW?LOtF&kc{_g$*-C)>F=l?!BX)Wo=kW z`7b@iP{A;^3G4lo2)qq+{sjE%JHTpMLkz6bJFs5S2WR5{xNa02YoYuWzD00p8ppaB z`EQ}Twv-Vn#;`b{8E+lBhTtxsi#B7X2D?vVU|Ti{=jsuB(l`!tinU;Vzi;88p5ULE zzY*2IB(4dPlvW7NY1kN0^O6P|+KadMp27!pfLkkIaq#kj`7J;HFMQi+uNA-S|5W~t z6_k^_9Xig55S-$%@klj-JE;yc_QEyqWhH znYlNk|jWm=Ykm|tShg~JW(o`TSzzhC0;g>`R8>!0&(g7$gZTFiUNxI@}V$ebYoWeH%u}Zv>mj_pimn z__I$L4wHt~=Ri(c95Pap;N#^1--E6%Y0%)8EDx>6g#qBr{Kr_9)CQfXI_O5%L+^wN z`X?J<5Yq(1m}U_Z{U&i-?~4XVNXzPPdg<@S2>#%64OcE^;=vDhQBhtBnLHW(f!;_x zP{$fJ68K&t-g~Ar(4+ouL+jdHiu;g11Skf90%{AXmX`=cTEKJc$NqUwsio(gC67>) znT*@5&FJm@0ilsWsEMvdS;%E1|GSDc%*M}>^p}ShWW+!aVmFi zXP9-==dQrBCr}oBjT8PJJo!3t3B>;bc#KSsU_`K-1owH2&7eF~jqbdA=s2fFj(_bm zH&1Hg4>{t8XFm<$@+Aer0{wZ-8w4F*GmA0bYXtt*Fu2cm#3?fuYVGS>E^Q1QZ zV}VC7G&F>w!hD1t3*vQrmz#~B$E>~G_Gg423q*KGAiUiVWY8GbV%msbApYs+sg5>& z<{TOv!leQQB0@u$eXt3!=h9nSaiEAI*!Vh2Jci^5Ogo z6uC&3rNGP6Bb^q!N?;9qb{X7%)zjTIJ^O4H?sRpctLqLuYQ2Y(Idi_Btv`OGI2PD@ApsQmpw?%DbYbNg%jlfJrC*WKyz)F!Td_PH#v{@hQKr!>*I*iC-(+V9DD(+%^F z8`8Z=&_OB5nFo%Nj~!tJK|(Mj=uM%E`u%pghW#t_B>lhBg9u}4gicons/folder_map_opened.ico icons/folder_map.ico icons/folder.ico + icons/lock_edit.ico + icons/unlock_edit.ico icons/map_edited.ico icons/map_opened.ico icons/map.ico diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 1c7da36c..b609be59 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1179,11 +1179,12 @@ bool MainWindow::populateMapList() { ui->layoutList->setModel(layoutListProxyModel); /// !TODO - ui->mapList->setSelectionMode(QAbstractItemView::ExtendedSelection); - ui->mapList->setDragEnabled(true); - ui->mapList->setAcceptDrops(true); - ui->mapList->setDropIndicatorShown(true); - ui->mapList->setDragDropMode(QAbstractItemView::InternalMove); + // ui->mapList->setSelectionMode(QAbstractItemView::ExtendedSelection); + // ui->mapList->setDragEnabled(true); + // ui->mapList->setAcceptDrops(true); + // ui->mapList->setDropIndicatorShown(true); + // ui->mapList->setDragDropMode(QAbstractItemView::InternalMove); + on_toolButton_EnableDisable_EditGroups_clicked(); return success; } @@ -2852,6 +2853,24 @@ void MainWindow::on_toolButton_CollapseAll_Groups_clicked() { } } +void MainWindow::on_toolButton_EnableDisable_EditGroups_clicked() { + if (this->ui->toolButton_EnableDisable_EditGroups->isChecked()) { + ui->mapList->setSelectionMode(QAbstractItemView::ExtendedSelection); + ui->mapList->setDragEnabled(true); + ui->mapList->setAcceptDrops(true); + ui->mapList->setDropIndicatorShown(true); + ui->mapList->setDragDropMode(QAbstractItemView::InternalMove); + ui->mapList->setEditTriggers(QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed); + } else { + ui->mapList->setSelectionMode(QAbstractItemView::NoSelection); + ui->mapList->setDragEnabled(false); + ui->mapList->setAcceptDrops(false); + ui->mapList->setDropIndicatorShown(false); + ui->mapList->setDragDropMode(QAbstractItemView::NoDragDrop); + ui->mapList->setEditTriggers(QAbstractItemView::NoEditTriggers); + } +} + void MainWindow::on_toolButton_HideShow_Areas_clicked() { if (ui->areaList) { this->areaListProxyModel->toggleHideEmpty();