From 1fa855e1c091175afcdb0cc4a3395d3aecb96d1c Mon Sep 17 00:00:00 2001 From: Willem Ferguson Date: Sat, 19 Nov 2016 14:23:54 +0200 Subject: [PATCH] Provide photos summary on dive list 1) Add an extra column to dive list, just left of Locality field. 2) For each dive, give summary of photos as follows: i) no photos: no icon in that column ii) photos taken during dive: show icon of fish iii) photos taken before/after dive: show icon of sun iv) photos taken during as well as before/after dive: show icon with both fish and sun 3) Provide information for the sort operation to work on this column of the dive list. Signed-off-by: Willem Ferguson Signed-off-by: Dirk Hohndel --- desktop-widgets/divelistview.cpp | 7 +++-- icons/duringPhoto.png | Bin 0 -> 5352 bytes icons/inAndOutPhoto.png | Bin 0 -> 5520 bytes icons/outsidePhoto.png | Bin 0 -> 3032 bytes qt-models/divetripmodel.cpp | 50 +++++++++++++++++++++++++++++-- qt-models/divetripmodel.h | 5 ++++ subsurface.qrc | 5 +++- 7 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 icons/duringPhoto.png create mode 100644 icons/inAndOutPhoto.png create mode 100644 icons/outsidePhoto.png diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index 0c1ea91e7..081cd93be 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -24,8 +24,8 @@ #include "core/metrics.h" #include "core/helpers.h" -// # Date Rtg Dpth Dur Tmp Wght Suit Cyl Gas SAC OTU CNS Loc -static int defaultWidth[] = { 70, 140, 90, 50, 50, 50, 50, 70, 50, 50, 70, 50, 50, 500}; +// # Date Rtg Dpth Dur Tmp Wght Suit Cyl Gas SAC OTU CNS Px Loc +static int defaultWidth[] = { 70, 140, 90, 50, 50, 50, 50, 70, 50, 50, 70, 50, 50, 25, 500}; DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelection(false), sortColumn(0), currentOrder(Qt::DescendingOrder), dontEmitDiveChangedSignal(false), selectionSaved(false) @@ -81,6 +81,9 @@ DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelec case DiveTripModel::SAC: sw = 7*em; break; + case DiveTripModel::PHOTOS: + sw = 5*em; + break; case DiveTripModel::LOCATION: sw = 50*em; break; diff --git a/icons/duringPhoto.png b/icons/duringPhoto.png new file mode 100644 index 0000000000000000000000000000000000000000..6984b304144eaaeb4870e009b1f9ad5476217bc5 GIT binary patch literal 5352 zcmb_g^;cA1v>#xop@#tkq=!_7mQcC|kOl>Y7Nx#~ba%-J3|x!{RLkSm|;8Nk&B_gHs``NJj+AsG0Ik(n-U6_ zmxqUtqg8BFsAlIka}&M}9re;Pjkp^;qkBalwk8zvT`+9*h=9%&M4TZ9?Pm@JLu=ku zJVpte+{UQ5C0V{N|Ezv?lZow`SnxbdSlg{AZ#VShjk3B|)oCNVvNrHe;`JYx8-gyc zt`JOiB33o~UzKsie;)Eg805n!BY0Hm6dgf0PVWcTc@chkUS3`uzLZbL@^SD&u6M*& z6!$yhDZC4+1X-jMA+WBA+$q&=GuseTYEW#xF>f*@qSsl`|F34WWHZ13H`cTfD{LktgkBRJ%b=ggO5MW@+V{C&zKIUt)HwV=Fr z*T>w`(?jaeBEO&G-Fk=fYS=8M^QwVuV~iB4V{J5V&>rLakos~qLy*IhS!QTPvULAI zB1xDu+;f|;>Tt9n#^N`zjf3nIgv%7A>P}PRUA!_DdA1riZGoq(ix=e8i2>fF(Uw6| zOQyu2+9}xIWY&fePuuJ|C~9qRe30S2$8sl9ZC#tap}jMa zK(8}jU*8XjQWW~;Lt&=B4lxSE`2|G;B@Iuz60td5cA}?#mCyerrVdCOH?MuS4RHXMi3Cl8%Y=JVBhckb}iugw+?1W-|F z2oA68kZUL8^qCmb3)j!!Dv*$6TwGiPIWww>J1<6c@;*Sy5t|SEkOIRIUpFcak6TrQ zNUfoO9eUs*y;Kvvg zM9a|&HvsIg-mAY_X;mm2CN%x-KNj}F1KGVBi0JOdwc~#JtLb6b`5WySQq%Ti^p`J> zM!B`KBfevvB8<4ek@Z`%P>@ii-Sp=tQ$!jl>g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eap{8EGNg4V_P_>v~apE63 z!h{}yYh*T+?v}=v&y9sLLPQOD$4&5WF zzMG&fHbKGYK4!j}z+!|N`JSI4B1xUpJ6_unOO6Ysow67+p5Xby1 zKGIZ(7HzS7HbM9okeDJuCWvc-=@JV2w$N{+7-JVpzhe1WxJ{X##YY-jm1~RTvkCP5 zAyGr;vGdmiYL1`9N1D9GW9O?0a#Z?Re5A>f(H6^B6AY?Feik2T23&o|&R-L_OZ+T8 z(hRahTP$BqFrb$BS$w1!(0Bp)YJxLrxu3;H7Kc)X)Bx>2_~G zVQGu!`y9hA_eQ@%M2=4P<67hSZi3F(1O?L-H4}8WH>1oyDK9kSREA!6wbq!vpPdm^ ztKHdQ=D2%1uI7i&Yq>;QoiFML6A9W394jp*IO*ON=`H1Ei(xgNZg-9LxLQn*S83Xu zFX#vrYK}N}VPZoqZ5i7^`vI+e->{KaX^z-;8;PyW1cPcJC!Je#g$o@=oO_IIx~aAA zcF=hs?k5fWb{K&Qi}#`-g;ixAE!XlH#rW*1*ihHrii1Z%#+dB?yU+Hm-n@ct|b2wR159^nC3E@OcI=L)e0=Ir-^x#5Fut{35ZmE~#Po>L0rOG}b;ie{7 zSOa_7U^q8Jl`+0CKLa-`@C^qQCk74=3l%$TnIv` z=`B97U1;s`UOhw8DIsR2BrPxTTRP7h37jU+OxpyPGL(gme&`&4-eDNZK{VGjnI&m? zNqTMCyYlNQCQtgNz%xQAwRslwjUwxi_^_AytV7vIF2v8A2>=O;d`dE$DW|u-l3pJ| awEQ27ad1Smaxcns; break; + case PHOTOS: + retVal = countPhotos(dive); + break; case LOCATION: retVal = QString(get_dive_location(dive)); break; @@ -171,6 +177,8 @@ QVariant DiveItem::data(int column, int role) const case MAXCNS: retVal = dive->maxcns; break; + case PHOTOS: + break; case LOCATION: retVal = QString(get_dive_location(dive)); break; @@ -182,11 +190,21 @@ QVariant DiveItem::data(int column, int role) const } break; case Qt::DecorationRole: - if (column == LOCATION) + switch (column) { + case LOCATION: if (dive_has_gps_location(dive)) { IconMetrics im = defaultIconMetrics(); - retVal = QIcon(":satellite").pixmap(im.sz_small, im.sz_small); + retVal = QIcon(":globe-icon").pixmap(im.sz_small, im.sz_small); } + break; + case PHOTOS: // if enabled, show photos icon: fish= photos during dive; sun=photos before/after dive + if (dive->picture_list) // sun+fish=photos during dive as well as before/after + { + IconMetrics im = defaultIconMetrics(); + retVal = QIcon(icon_names[countPhotos(dive)]).pixmap(im.sz_small, im.sz_small); + } + break; + } break; case Qt::ToolTipRole: switch (column) { @@ -231,6 +249,9 @@ QVariant DiveItem::data(int column, int role) const case MAXCNS: retVal = tr("Max CNS"); break; + case PHOTOS: + retVal = tr("Photos before/during/after dive"); + break; case LOCATION: retVal = tr("Location"); break; @@ -301,6 +322,25 @@ QString DiveItem::displayDepthWithUnit() const return get_depth_string(dive->maxdepth, true); } +int DiveItem::countPhotos(dive *dive) const +{ + int diveDuration = dive->duration.seconds; + int pic_offset, icon_index = 0; + struct picture *pic_list = dive->picture_list; // Point to 1st picture of dive + if (!pic_list) return 0; // This dive does not contain pictures + do { + pic_offset = pic_list->offset.seconds; + if ((pic_offset < 0) | (pic_offset > diveDuration)) { + icon_index |= 0x02; // If picture is before/after the dive + } // then set the appropriate bit ... + else { + icon_index |= 0x01; // else set the bit for picture during the dive + } + pic_list = pic_list->next; // look at next photo + } while (pic_list); + return icon_index; // return value: 0=no pictures; 1=pictures during dive; +} // 2=pictures before/after; 3=pictures during as well as before/after + QString DiveItem::displayDuration() const { int hrs, mins, fullmins, secs; @@ -430,6 +470,9 @@ QVariant DiveTripModel::headerData(int section, Qt::Orientation orientation, int case MAXCNS: ret = tr("Max CNS"); break; + case PHOTOS: + ret = tr("█"); + break; case LOCATION: ret = tr("Location"); break; @@ -478,6 +521,9 @@ QVariant DiveTripModel::headerData(int section, Qt::Orientation orientation, int case MAXCNS: ret = tr("Max CNS"); break; + case PHOTOS: + ret = tr("Photos before/during/after dive"); + break; case LOCATION: ret = tr("Location"); break; diff --git a/qt-models/divetripmodel.h b/qt-models/divetripmodel.h index 7844d813f..01626448f 100644 --- a/qt-models/divetripmodel.h +++ b/qt-models/divetripmodel.h @@ -3,6 +3,7 @@ #include "treemodel.h" #include "core/dive.h" +#include struct DiveItem : public TreeItem { Q_DECLARE_TR_FUNCTIONS(TripItem) @@ -21,6 +22,7 @@ public: SAC, OTU, MAXCNS, + PHOTOS, LOCATION, COLUMNS }; @@ -36,7 +38,9 @@ public: QString displayTemperature() const; QString displayWeight() const; QString displaySac() const; + int countPhotos(dive *dive) const; int weight() const; + QString icon_names[4]; }; struct TripItem : public TreeItem { @@ -63,6 +67,7 @@ public: SAC, OTU, MAXCNS, + PHOTOS, LOCATION, COLUMNS }; diff --git a/subsurface.qrc b/subsurface.qrc index 2f58782cf..dc73ad454 100644 --- a/subsurface.qrc +++ b/subsurface.qrc @@ -74,7 +74,10 @@ icons/go-top.svg icons/process-stop.svg icons/edit-circled.svg - icons/Emblem-earth.svg + icons/Emblem-earth.svg icons/geocode.svg + icons/duringPhoto.png + icons/outsidePhoto.png + icons/inAndOutPhoto.png