Re: GSoC - Customizable print formats

2015-05-04 Thread Lubomir I. Ivanov
CCing the mailing list.

On 4 May 2015 at 02:23, Gehad gehadelro...@gmail.com wrote:
 On 05/02/2015 07:14 PM, Lubomir I. Ivanov wrote:
 On 29 April 2015 at 02:00, Gehad gehadelro...@gmail.com wrote:

 This is my fork:
 https://github.com/Gehadelrobey/subsurface
 I'll push to 'custom-print' branch and rebase it with master regularly.


 hello Gehad,
 here are some comments on the two commits that i see.

 https://github.com/Gehadelrobey/subsurface/commit/781f0f98167096c045df1426667078962b96f101

 CSS coding style related

 .innerContainer {
 height: 85%;
 ...
 }

 note that:
 - the opening brace is on the same line as the class name
 - height : ... should be without space after height and before
 :. space only after :.


 Fixed and pushed to the branch.

thanks, looks good.


 https://github.com/Gehadelrobey/subsurface/commit/af2376ff2e9277d938d29c95c3999443f8023c56

 i need to see if if this works from me (on win32):
 find_package(Grantlee5)

 for instance, it finds marble using find_package, but the resulted
 variables were bogus if i recall correctly.

 even if AFAIK both libraries don't use pkg-config we may have to add
 the optional:
 GRANTLEE_FROM_PKGCONFIG
 MARBLE_FROM_PKGCONFIG


 I changed the cmake file a little bit.

 -find_package(Grantlee5)
 -set(GRANTLEE_LIBRARIES Grantlee5::Templates)
 +if(GRANTLEE_FROM_PKGCONFIG)
 +   pkg_config_library(LIBGRANTLEE libgrantlee-templates5 REQUIRED)
 +   set(GRANTLEE_LIBRARIES )
 +else()
 +   find_package(Grantlee5)
 +   set(GRANTLEE_LIBRARIES Grantlee5::Templates)
 +endif()

 I installed libgrantlee-dev but couldn't find the package with
 pkg-config, So I didn't succeed to link subsurface to libgrantlee5.



that's probably because marble and grantlee AFAIK don't use pkg-config.

like i said:
 unlike cmake, qmake allowed PKGCONFIG += libmarble, which was very handy.

i need to figure a way how to approach the cmake issue before i
continue reviewing, as i simply can't compile ATM.
then i also need to look into the rest of the patches that you have pushed.

lubomir
--
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: How about 4.4.2?

2015-05-04 Thread Dirk Hohndel
On Fri, May 01, 2015 at 09:26:36AM -0700, Dirk Hohndel wrote:
 
 
  On May 1, 2015, at 09:09, Miika Turkia miika.tur...@gmail.com wrote:
  
  On Thu, Apr 30, 2015 at 10:05 AM, Dirk Hohndel d...@hohndel.org wrote:
  On Wed, Apr 29, 2015 at 11:26:57AM -0700, Dirk Hohndel wrote:
  I just merged our libdc branches with the latest upstream from
  libdivecomputer. More precisely, Subsurface-4.4 branch was merged, but
  Subsurface-testing was rebased, so that one will require a force pull. Jef
  has done some good work recently and added support for a few more dive
  computers.
  
  So if I were to make a 4.4.2 release with the latest libdivecomputer code
  included... are there any other fixes in master that I absolutely should
  back port?
  
  I know that I'd take a couple of my Uemis fixes as Uemis support in 4.4.1
  is actually rather broken :-(
  
  Anything else?
  
  The multi-dive editing seems to be broken also in v4.4-branch.
  (Overwrites tags that are different from the displayed dive.)
 
 I think I fixed that... Wasn't that before 4.4?
 
 I'm on my phone, will look into this later. Definitely something we should 
 fix for 4.4.2

OK, the XSLT fixes for the Eon Steel are in, as is the fix for the multi
dive editing of tags. Latest translations are pulled.

Anything else that I'm missing? Otherwise I'll cut 4.4.2 today.

/D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


[PATCH 1/5] Support for new data format for MacDive

2015-05-04 Thread Miika Turkia
Signed-off-by: Miika Turkia miika.tur...@gmail.com
---
 xslt/MacDive.xslt | 79 +--
 1 file changed, 54 insertions(+), 25 deletions(-)

diff --git a/xslt/MacDive.xslt b/xslt/MacDive.xslt
index 4d83006..c2c3ba1 100644
--- a/xslt/MacDive.xslt
+++ b/xslt/MacDive.xslt
@@ -113,34 +113,63 @@
 xsl:value-of select=sampleInterval/
   /xsl:variable
 
-  location
-xsl:for-each select=country|location|site
-  xsl:choose
-xsl:when test=following-sibling::location[1] != ''
-  xsl:value-of select=concat(., ' / ')/
-/xsl:when
-xsl:when test=following-sibling::site[1] != ''
-  xsl:value-of select=concat(., ' / ')/
-/xsl:when
-xsl:otherwise
-  xsl:value-of select=./
-/xsl:otherwise
-  /xsl:choose
-/xsl:for-each
-  /location
+  xsl:choose
+xsl:when 
test=site/country|site/location|site/name|site/lat|site/lon
+  location debug=true
+xsl:for-each select=site/country|site/location|site/name
+  xsl:choose
+xsl:when test=following-sibling::location[1] != ''
+  xsl:value-of select=concat(., ' / ')/
+/xsl:when
+xsl:when test=following-sibling::name[1] != ''
+  xsl:value-of select=concat(., ' / ')/
+/xsl:when
+xsl:otherwise
+  xsl:value-of select=./
+/xsl:otherwise
+  /xsl:choose
+/xsl:for-each
+  /location
 
   !-- This will discard GPS coordinates of 0 0 but I suppose that
is better than all non-gps dives to be in that location --
-  xsl:if test=sitelat != 0
-gps
-  xsl:value-of select=concat(sitelat, ' ', sitelon)/
-/gps
-  /xsl:if
-  xsl:if test=siteLat != 0
-gps
-  xsl:value-of select=concat(siteLat, ' ', siteLon)/
-/gps
-  /xsl:if
+  xsl:if test=site/lat != 0
+gps
+  xsl:value-of select=concat(site/lat, ' ', site/lon)/
+/gps
+  /xsl:if
+/xsl:when
+xsl:otherwise
+  location
+xsl:for-each select=country|location|site
+  xsl:choose
+xsl:when test=following-sibling::location[1] != ''
+  xsl:value-of select=concat(., ' / ')/
+/xsl:when
+xsl:when test=following-sibling::site[1] != ''
+  xsl:value-of select=concat(., ' / ')/
+/xsl:when
+xsl:otherwise
+  xsl:value-of select=./
+/xsl:otherwise
+  /xsl:choose
+/xsl:for-each
+  /location
+
+  !-- This will discard GPS coordinates of 0 0 but I suppose that
+   is better than all non-gps dives to be in that location --
+  xsl:if test=sitelat != 0
+gps
+  xsl:value-of select=concat(sitelat, ' ', sitelon)/
+/gps
+  /xsl:if
+  xsl:if test=siteLat != 0
+gps
+  xsl:value-of select=concat(siteLat, ' ', siteLon)/
+/gps
+  /xsl:if
+/xsl:otherwise
+  /xsl:choose
 
   notes
 xsl:value-of select=notes/
-- 
2.1.0

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


[PATCH 2/5] Re-order the MacDive import

2015-05-04 Thread Miika Turkia
Next commit will do indentation so this one will keep it clear of what
actually occurs.

Signed-off-by: Miika Turkia miika.tur...@gmail.com
---
 xslt/MacDive.xslt | 162 +++---
 1 file changed, 81 insertions(+), 81 deletions(-)

diff --git a/xslt/MacDive.xslt b/xslt/MacDive.xslt
index c2c3ba1..1f6b157 100644
--- a/xslt/MacDive.xslt
+++ b/xslt/MacDive.xslt
@@ -66,49 +66,6 @@
 /xsl:call-template
   /xsl:attribute
 
-  xsl:choose
-xsl:when test=maxdepth != ''
-  depth
-xsl:attribute name=max
-  xsl:call-template name=depthConvert
-xsl:with-param name=depth
-  xsl:value-of select=maxdepth/
-/xsl:with-param
-xsl:with-param name=units select=$units/
-  /xsl:call-template
-/xsl:attribute
-xsl:attribute name=mean
-  xsl:call-template name=depthConvert
-xsl:with-param name=depth
-  xsl:value-of select=avgdepth/
-/xsl:with-param
-xsl:with-param name=units select=$units/
-  /xsl:call-template
-/xsl:attribute
-  /depth
-/xsl:when
-xsl:otherwise
-  depth
-xsl:attribute name=max
-  xsl:call-template name=depthConvert
-xsl:with-param name=depth
-  xsl:value-of select=maxDepth/
-/xsl:with-param
-xsl:with-param name=units select=$units/
-  /xsl:call-template
-/xsl:attribute
-xsl:attribute name=mean
-  xsl:call-template name=depthConvert
-xsl:with-param name=depth
-  xsl:value-of select=averageDepth/
-/xsl:with-param
-xsl:with-param name=units select=$units/
-  /xsl:call-template
-/xsl:attribute
-  /depth
-/xsl:otherwise
-  /xsl:choose
-
   xsl:variable name=delta
 xsl:value-of select=sampleInterval/
   /xsl:variable
@@ -175,12 +132,6 @@
 xsl:value-of select=notes/
   /notes
 
-  divecomputer deviceid=
-xsl:attribute name=model
-  xsl:value-of select=computer/
-/xsl:attribute
-  /divecomputer
-
   xsl:if test=o2percent != ''
 cylinder
   xsl:attribute name=o2
@@ -243,6 +194,87 @@
 /cylinder
   /xsl:for-each
 
+  xsl:if test=diveMaster
+divemaster
+  xsl:value-of select=diveMaster/
+/divemaster
+  /xsl:if
+  buddy
+xsl:for-each select=buddies/buddy
+  xsl:choose
+xsl:when test=following-sibling::*[1] != ''
+  xsl:value-of select=concat(., ', ')/
+/xsl:when
+xsl:otherwise
+  xsl:value-of select=./
+/xsl:otherwise
+  /xsl:choose
+/xsl:for-each
+  /buddy
+
+  xsl:if test=weight != ''
+weightsystem
+  xsl:attribute name=weight
+xsl:call-template name=weightConvert
+  xsl:with-param name=weight select=translate(weight, ',', 
'.')/
+  xsl:with-param name=units select=$units/
+/xsl:call-template
+  /xsl:attribute
+  xsl:attribute name=description
+xsl:value-of select='unknown'/
+  /xsl:attribute
+/weightsystem
+  /xsl:if
+
+  divecomputer deviceid=
+xsl:attribute name=model
+  xsl:value-of select=computer/
+/xsl:attribute
+  /divecomputer
+
+  xsl:choose
+xsl:when test=maxdepth != ''
+  depth
+xsl:attribute name=max
+  xsl:call-template name=depthConvert
+xsl:with-param name=depth
+  xsl:value-of select=maxdepth/
+/xsl:with-param
+xsl:with-param name=units select=$units/
+  /xsl:call-template
+/xsl:attribute
+xsl:attribute name=mean
+  xsl:call-template name=depthConvert
+xsl:with-param name=depth
+  xsl:value-of select=avgdepth/
+/xsl:with-param
+xsl:with-param name=units select=$units/
+  /xsl:call-template
+/xsl:attribute
+  /depth
+/xsl:when
+xsl:otherwise
+  depth
+xsl:attribute name=max
+  xsl:call-template name=depthConvert
+xsl:with-param name=depth
+  xsl:value-of select=maxDepth/
+/xsl:with-param
+xsl:with-param name=units select=$units/
+  /xsl:call-template
+/xsl:attribute
+xsl:attribute name=mean
+  xsl:call-template name=depthConvert
+xsl:with-param name=depth
+  xsl:value-of select=averageDepth/
+

[PATCH 4/5] Add entryType as tag on MacDive import

2015-05-04 Thread Miika Turkia
Signed-off-by: Miika Turkia miika.tur...@gmail.com
---
 xslt/MacDive.xslt | 4 
 1 file changed, 4 insertions(+)

diff --git a/xslt/MacDive.xslt b/xslt/MacDive.xslt
index 6353c17..da52f33 100644
--- a/xslt/MacDive.xslt
+++ b/xslt/MacDive.xslt
@@ -66,6 +66,10 @@
 /xsl:call-template
   /xsl:attribute
 
+  xsl:attribute name=tags
+xsl:value-of select=entryType/
+  /xsl:attribute
+
   xsl:variable name=delta
 xsl:value-of select=sampleInterval/
   /xsl:variable
-- 
2.1.0

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


[PATCH 3/5] Have computer data inside divecomputer tag

2015-05-04 Thread Miika Turkia
This includes all the data computer related data within the divecomputer
tag. All the extra noise is just indentation (apart from moving the
divecomputer end tag).

Signed-off-by: Miika Turkia miika.tur...@gmail.com
---
 xslt/MacDive.xslt | 314 +++---
 1 file changed, 157 insertions(+), 157 deletions(-)

diff --git a/xslt/MacDive.xslt b/xslt/MacDive.xslt
index 1f6b157..6353c17 100644
--- a/xslt/MacDive.xslt
+++ b/xslt/MacDive.xslt
@@ -230,150 +230,113 @@
 xsl:attribute name=model
   xsl:value-of select=computer/
 /xsl:attribute
-  /divecomputer
 
-  xsl:choose
-xsl:when test=maxdepth != ''
-  depth
-xsl:attribute name=max
-  xsl:call-template name=depthConvert
-xsl:with-param name=depth
-  xsl:value-of select=maxdepth/
-/xsl:with-param
-xsl:with-param name=units select=$units/
-  /xsl:call-template
-/xsl:attribute
-xsl:attribute name=mean
-  xsl:call-template name=depthConvert
-xsl:with-param name=depth
-  xsl:value-of select=avgdepth/
-/xsl:with-param
-xsl:with-param name=units select=$units/
-  /xsl:call-template
-/xsl:attribute
-  /depth
-/xsl:when
-xsl:otherwise
-  depth
-xsl:attribute name=max
-  xsl:call-template name=depthConvert
-xsl:with-param name=depth
-  xsl:value-of select=maxDepth/
-/xsl:with-param
-xsl:with-param name=units select=$units/
-  /xsl:call-template
-/xsl:attribute
-xsl:attribute name=mean
-  xsl:call-template name=depthConvert
-xsl:with-param name=depth
-  xsl:value-of select=averageDepth/
-/xsl:with-param
-xsl:with-param name=units select=$units/
-  /xsl:call-template
-/xsl:attribute
-  /depth
-/xsl:otherwise
-  /xsl:choose
+xsl:choose
+  xsl:when test=maxdepth != ''
+depth
+  xsl:attribute name=max
+xsl:call-template name=depthConvert
+  xsl:with-param name=depth
+xsl:value-of select=maxdepth/
+  /xsl:with-param
+  xsl:with-param name=units select=$units/
+/xsl:call-template
+  /xsl:attribute
+  xsl:attribute name=mean
+xsl:call-template name=depthConvert
+  xsl:with-param name=depth
+xsl:value-of select=avgdepth/
+  /xsl:with-param
+  xsl:with-param name=units select=$units/
+/xsl:call-template
+  /xsl:attribute
+/depth
+  /xsl:when
+  xsl:otherwise
+depth
+  xsl:attribute name=max
+xsl:call-template name=depthConvert
+  xsl:with-param name=depth
+xsl:value-of select=maxDepth/
+  /xsl:with-param
+  xsl:with-param name=units select=$units/
+/xsl:call-template
+  /xsl:attribute
+  xsl:attribute name=mean
+xsl:call-template name=depthConvert
+  xsl:with-param name=depth
+xsl:value-of select=averageDepth/
+  /xsl:with-param
+  xsl:with-param name=units select=$units/
+/xsl:call-template
+  /xsl:attribute
+/depth
+  /xsl:otherwise
+/xsl:choose
 
-  temperature
+temperature
 
-!-- If we have temperature reading and it is non-zero, we use
+  !-- If we have temperature reading and it is non-zero, we use
  it. If the temperature is zero, we only use it if we have
  temperature samples from the dive. --
-xsl:if test=tempAir != ''
-  xsl:variable name=air
-xsl:call-template name=tempConvert
-  xsl:with-param name=temp select=tempAir/
-  xsl:with-param name=units select=$units/
-/xsl:call-template
-  /xsl:variable
-  xsl:if test=substring-before($air, ' ') != 0 or 
$temperatureSamples gt; 0
-xsl:attribute name=air
-  xsl:value-of select=$air/
-/xsl:attribute
+  xsl:if test=tempAir != ''
+xsl:variable name=air
+  xsl:call-template name=tempConvert
+xsl:with-param name=temp select=tempAir/
+xsl:with-param name=units select=$units/
+  /xsl:call-template
+/xsl:variable
+xsl:if test=substring-before($air, ' ') != 0 or 
$temperatureSamples gt; 0
+  

Re: How about 4.4.2?

2015-05-04 Thread Salvador Cuñat
Hi Dirk.

El lun., 4 may. 2015 a las 16:18, Dirk Hohndel (d...@hohndel.org)
escribió:


 Anything else that I'm missing? Otherwise I'll cut 4.4.2 today.


As far as I can see, there are untranslated strings that aren't loaded on
transifex, e.g.  Find moved images in File dropdown list, and others.

BTW, latest changes on user manual are untranslated too.

Regards.

Salva.
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: How about 4.4.2?

2015-05-04 Thread Dirk Hohndel
On Mon, May 04, 2015 at 05:42:42PM +, Salvador Cuñat wrote:
 Hi Dirk.
 
 El lun., 4 may. 2015 a las 16:18, Dirk Hohndel (d...@hohndel.org)
 escribió:
 
 
  Anything else that I'm missing? Otherwise I'll cut 4.4.2 today.
 
 
 As far as I can see, there are untranslated strings that aren't loaded on
 transifex, e.g.  Find moved images in File dropdown list, and others.
 
 BTW, latest changes on user manual are untranslated too.

Are you talking the v4.4-branch? Or master.
Master is not fully translated. And a while away from a release. I will
issue a call for translations as that gets closer.

v4.4-branch shouldn't have received new strings since 4.4.1
(doesn't mean I didn't mess it up, but it SHOULDN'T)

/D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


[PATCH 2/2] Parse the MacDive gaschange values

2015-05-04 Thread Miika Turkia
Fixes #869

Signed-off-by: Miika Turkia miika.tur...@gmail.com
---
 xslt/MacDive.xslt | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/xslt/MacDive.xslt b/xslt/MacDive.xslt
index 9e3d33e..3e2c462 100644
--- a/xslt/MacDive.xslt
+++ b/xslt/MacDive.xslt
@@ -428,6 +428,24 @@
   /xsl:otherwise
 /xsl:choose
   /xsl:attribute
+  xsl:if test=alarm = 'gas_change'
+xsl:attribute name=value
+  xsl:choose
+xsl:when test=contains(extra, 'EAN')
+  xsl:value-of select=translate(extra, translate(extra, 
'1234567890', ''), '')/
+/xsl:when
+xsl:when test=contains(extra, 'Trimix')
+  xsl:variable name=trimix
+xsl:value-of select=translate(extra, 
translate(extra, '1234567890/', ''), '')/
+  /xsl:variable
+  xsl:value-of select=substring-after($trimix, '/') * 
65536 + substring-before($trimix, '/')/
+/xsl:when
+xsl:otherwise
+  xsl:value-of select=extra/
+/xsl:otherwise
+  /xsl:choose
+/xsl:attribute
+  /xsl:if
 /event
   /xsl:if
 /xsl:for-each
-- 
2.1.4

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


[PATCH 1/2] Fix event name for MacDive gas changes

2015-05-04 Thread Miika Turkia
Signed-off-by: Miika Turkia miika.tur...@gmail.com
---
 xslt/MacDive.xslt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xslt/MacDive.xslt b/xslt/MacDive.xslt
index 4448767..9e3d33e 100644
--- a/xslt/MacDive.xslt
+++ b/xslt/MacDive.xslt
@@ -420,6 +420,9 @@
   xsl:when test=alarm = 'user_depth_alarm'
 xsl:value-of select='maxdepth'/
   /xsl:when
+  xsl:when test=alarm = 'gas_change'
+xsl:value-of select='gaschange'/
+  /xsl:when
   xsl:otherwise
 xsl:value-of select=alarm/
   /xsl:otherwise
-- 
2.1.4

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: How about 4.4.2?

2015-05-04 Thread Salvador Cuñat
Hi Dirk.

2015-05-04 19:59 GMT+02:00 Dirk Hohndel d...@hohndel.org:


 Are you talking the v4.4-branch? Or master.
 Master is not fully translated. And a while away from a release. I will
 issue a call for translations as that gets closer.

 v4.4-branch shouldn't have received new strings since 4.4.1
 (doesn't mean I didn't mess it up, but it SHOULDN'T)


You are right,  I was talking about master.
 I apologize for this noise.

Regards.

Salva.
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


4.4.2 is out

2015-05-04 Thread Dirk Hohndel
Binaries are up, I'll push the tag in a minute. Announced on our website
but not yet on FB or G+ or any of the other usual outlets.

An update check should point people to the latest version.

/D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface