Re: [PATCH 0/3] Misc smaller patches

2017-07-22 Thread Dirk Hohndel
On Sat, Jul 22, 2017 at 09:35:49PM +0300, Miika Turkia wrote:
> On Sat, Jul 22, 2017 at 8:56 PM, Dirk Hohndel  wrote:
> > On Sat, Jul 22, 2017 at 08:50:33AM -0700, Linus Torvalds wrote:
> >>
> >>
> >> This is a set of three small patches that fix some particular issue that
> >> came up while looking at the gas pressure handling for multiple cylinders.
> >
> > Those all look good. I notice that we now reliably fail TestParse but
> > haven't had a time to bisect where this got broken. It would be nice if
> > someone could investigate this and either fix the bug or the test :-)
> 
> We had partly faulty and partly non-optimal test data to compare with.
> There was extra TTS with value 0min repeating in the log file, and
> also a few repeating values are nowadays absent. PR sent.

Thank you. Much appreciated.

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


Re: [PATCH 0/3] Misc smaller patches

2017-07-22 Thread Miika Turkia
On Sat, Jul 22, 2017 at 8:56 PM, Dirk Hohndel  wrote:
> On Sat, Jul 22, 2017 at 08:50:33AM -0700, Linus Torvalds wrote:
>>
>>
>> This is a set of three small patches that fix some particular issue that
>> came up while looking at the gas pressure handling for multiple cylinders.
>
> Those all look good. I notice that we now reliably fail TestParse but
> haven't had a time to bisect where this got broken. It would be nice if
> someone could investigate this and either fix the bug or the test :-)

We had partly faulty and partly non-optimal test data to compare with.
There was extra TTS with value 0min repeating in the log file, and
also a few repeating values are nowadays absent. PR sent.

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


Re: [PATCH 0/3] Misc smaller patches

2017-07-22 Thread Dirk Hohndel
On Sat, Jul 22, 2017 at 08:50:33AM -0700, Linus Torvalds wrote:
> 
> 
> This is a set of three small patches that fix some particular issue that 
> came up while looking at the gas pressure handling for multiple cylinders.

Those all look good. I notice that we now reliably fail TestParse but
haven't had a time to bisect where this got broken. It would be nice if
someone could investigate this and either fix the bug or the test :-)

thanks

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


[PATCH 0/3] Misc smaller patches

2017-07-22 Thread Linus Torvalds


This is a set of three small patches that fix some particular issue that 
came up while looking at the gas pressure handling for multiple cylinders.

The first one is really entirely independent of the others, and fixes the 
gas use reporting issue that Davide has had.

The second one is a trivial fix to XML parsing that will not affect any 
normal use, but came up because I was using "dctool" to generate some dive 
data from Dirk's logs, and subsurface crashed on the XML due to the lack 
of a  XML sub-section.

The third one is the patch that actually enables the profile for multiple 
gases at the same time - we already had the code, but it was conditional 
on the dive being CCR, and now that the cylinder pressure handling has 
been generalized it just enables it more widely.

This does *not* get the sidemount case all working, although depending on 
the exact libdivecomputer behavior for your dive computer, and *if* your 
dive computer generates pressure events for multiple cylinders, it can now 
work almost by mistake.

There's a bit more work required to make it actually work fairly reliably, 
but on the whole this gets us _mostly_ there. And it still works fine for 
CCR from my limited tests with Willem's XML files.

Linus Torvalds (3):
  Gas usage statistics: don't require gas switch events
  parse-xml: use "get_dc()" rather than "cur_dc" for filling in extra data
  Show multiple gas pressures in the profile even if the dive isn't CCR

 core/parse-xml.c   |  2 +-
 core/statistics.c  | 12 
 profile-widget/diveprofileitem.cpp | 29 -
 3 files changed, 13 insertions(+), 30 deletions(-)

-- 
2.13.1.518.g0d864c4df

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


patches for user manual

2017-01-12 Thread Willem Ferguson
I re-sent three patches to the user manual to Dirk. It seems these three 
might have been missed.


Kind regards,

willem


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


Re: [PATCHES] Two minor planner improvements

2016-12-28 Thread Stefan Fuchs
Hallo Dirk, hallo Robert,

thanks for pointing me to the daily builds and thanks a lot for doing
the latest fixes in the planner!

I did a quick test and can confirm that all the issues with re-editing a
dive in the planner are fixed now for my setup and dives. This includes
also Trac ticket #967.
There is one more similar item #1108 about the conservatism level but
this is minor important to me and maybe more difficult to change.

What I would like to ask to Robert:
Could you please have a look also at the idea of printing the altitude
at the beginning of the diveplan (#1109)?
And for the enhancement already done to highlight a repetitive dive by
printing "(repetitive)" in the diveplan, would it be possible to also
print the surface time there?


Best regards
Stefan


Am 28.12.2016 um 15:04 schrieb Dirk Hohndel:
> A daily build is ready for download at
> subsurface-divelog.org/downloads/daily
> <http://subsurface-divelog.org/downloads/daily>
>
> -- 
> From my phone
> 
> *From:* Stefan Fuchs
> *Sent:* Wed Dec 28 03:14:04 PST 2016
> *To:* subsurface@subsurface-divelog.org, d...@hohndel.org, "Robert C.
> Helling"
> *Subject:* Re: [PATCHES] Two minor planner improvements
>
> Hallo Dirk, hallo Robert,
>
> would it be possible to get another windows test version with Roberts
> latest fixes for the planner?
>
>
> Best regards
> Stefan

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


Re: [PATCHES] Two minor planner improvements

2016-12-28 Thread Dirk Hohndel
A daily build is ready for download at subsurface-divelog.org/downloads/daily

⁣-- 
>From my phone​


 Original Message 
From: Stefan Fuchs 
Sent: Wed Dec 28 03:14:04 PST 2016
To: subsurface@subsurface-divelog.org, d...@hohndel.org, "Robert C. Helling" 

Subject: Re: [PATCHES] Two minor planner improvements

Hallo Dirk, hallo Robert,

would it be possible to get another windows test version with Roberts
latest fixes for the planner?


Best regards
Stefan

-- 

Stefan Fuchs
Banzhaldenstr. 66
70469 Stuttgart
E-Mail: sfu...@gmx.de <mailto:sfu...@gmx.de>

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


Re: [PATCHES] Two minor planner improvements

2016-12-28 Thread Stefan Fuchs
Hallo Dirk, hallo Robert,

would it be possible to get another windows test version with Roberts
latest fixes for the planner?


Best regards
Stefan

-- 

Stefan Fuchs
Banzhaldenstr. 66
70469 Stuttgart
E-Mail: sfu...@gmx.de 

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


Re: [PATCHES] Two minor planner improvements

2016-12-26 Thread Dirk Hohndel
On Mon, Dec 26, 2016 at 07:06:40PM +0100, Robert Helling wrote:
> It seems these two were forgotten.

Sorry. Just added them.

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


Re: [PATCHES] Two minor planner improvements

2016-12-26 Thread Robert Helling
It seems these two were forgotten.

> On 15 Dec 2016, at 23:25, Robert Helling  wrote:
> 
> These two patches implement suggestions from trac.
> 
> Best
> Robert
> 
> <0001-Set-surface-pressure-and-salinity-correctly-when-repla.txt><0002-Indicate-a-repetitive-dive-in-the-diveplan.txt>___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


[PATCHES] Two minor planner improvements

2016-12-15 Thread Robert Helling
These two patches implement suggestions from trac.

Best
Robert

From 040b804c1c451963531db6d0da31e61b853747ae Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" 
Date: Thu, 15 Dec 2016 23:02:32 +0100
Subject: [PATCH 1/2] Set surface pressure and salinity correctly when
 replanning
To: subsurface@subsurface-divelog.org

We need to initialize the UI elements accordingly.

Fixes #1094

Signed-off-by: Robert C. Helling 
---
 desktop-widgets/diveplanner.cpp | 10 ++
 desktop-widgets/diveplanner.h   |  2 ++
 desktop-widgets/mainwindow.cpp  |  2 ++
 3 files changed, 14 insertions(+)

diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp
index b12feab..ee85d12 100644
--- a/desktop-widgets/diveplanner.cpp
+++ b/desktop-widgets/diveplanner.cpp
@@ -181,6 +181,16 @@ void DivePlannerWidget::setupStartTime(QDateTime startTime)
ui.dateEdit->setDate(startTime.date());
 }
 
+void DivePlannerWidget::setSurfacePressure(int surface_pressure)
+{
+   ui.ATMPressure->setValue(surface_pressure);
+}
+
+void DivePlannerWidget::setSalinity(int salinity)
+{
+   ui.salinity->setValue(salinity / 1.0);
+}
+
 void DivePlannerWidget::settingsChanged()
 {
// Adopt units
diff --git a/desktop-widgets/diveplanner.h b/desktop-widgets/diveplanner.h
index cf3a172..91501ce 100644
--- a/desktop-widgets/diveplanner.h
+++ b/desktop-widgets/diveplanner.h
@@ -52,6 +52,8 @@ slots:
void heightChanged(const int height);
void salinityChanged(const double salinity);
void printDecoPlan();
+   void setSurfacePressure(int surface_pressure);
+   void setSalinity(int salinity);
 
 private:
Ui::DivePlanner ui;
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 2143663..5231961 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -914,6 +914,8 @@ void MainWindow::on_actionReplanDive_triggered()
setApplicationState("PlanDive");
divePlannerWidget()->setReplanButton(true);
divePlannerWidget()->setupStartTime(QDateTime::fromMSecsSinceEpoch(1000 
* current_dive->when, Qt::UTC));
+   
divePlannerWidget()->setSurfacePressure(current_dive->surface_pressure.mbar);
+   divePlannerWidget()->setSalinity(current_dive->salinity);
DivePlannerPointsModel::instance()->loadFromDive(current_dive);
reset_cylinders(&displayed_dive, true);
 }
-- 
2.10.1 (Apple Git-78)

From af3dd29ddc3b4edd60fb9fed19fc2d0995e80346 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" 
Date: Thu, 15 Dec 2016 23:22:54 +0100
Subject: [PATCH 2/2] Indicate a repetitive dive in the diveplan
To: subsurface@subsurface-divelog.org

Fixes #1095

Signed-off-by: Robert C. Helling 
---
 core/dive.h |  1 +
 core/divelist.c |  9 ++---
 core/divelist.h |  2 +-
 core/planner.c  | 18 +++---
 4 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/core/dive.h b/core/dive.h
index 4a314da..aa6352d 100644
--- a/core/dive.h
+++ b/core/dive.h
@@ -860,6 +860,7 @@ struct diveplan {
short vpmb_conservatism;
struct divedatapoint *dp;
int eff_gflow, eff_gfhigh;
+   bool repetitive;
 };
 
 struct divedatapoint *plan_add_segment(struct diveplan *diveplan, int 
duration, int depth, int cylinderid, int po2, bool entered);
diff --git a/core/divelist.c b/core/divelist.c
index fa100c2..f4762dd 100644
--- a/core/divelist.c
+++ b/core/divelist.c
@@ -360,7 +360,8 @@ int get_divesite_idx(struct dive_site *ds)
 static struct gasmix air = { .o2.permille = O2_IN_AIR, .he.permille = 0 };
 
 /* take into account previous dives until there is a 48h gap between dives */
-double init_decompression(struct dive *dive)
+/* return true if this is a repetitive dive */
+bool init_decompression(struct dive *dive)
 {
int i, divenr = -1;
unsigned int surface_time;
@@ -369,7 +370,7 @@ double init_decompression(struct dive *dive)
double surface_pressure;
 
if (!dive)
-   return 0.0;
+   return false;
 
surface_pressure = get_surface_pressure_in_mbar(dive, true) / 1000.0;
divenr = get_divenr(dive);
@@ -445,7 +446,9 @@ double init_decompression(struct dive *dive)
dump_tissues();
 #endif
}
-   return tissue_tolerance_calc(dive, surface_pressure);
+   // I do not dare to remove this call. We don't need the result but it 
might have side effects. Bummer.
+   tissue_tolerance_calc(dive, surface_pressure);
+   return deco_init;
 }
 
 void update_cylinder_related_info(struct dive *dive)
diff --git a/core/divelist.h b/core/divelist.h
index 7a35fb2..f36766f 100644
--- a/core/divelist.h
+++ b/core/divelist.h
@@ -14,7 +14,7 @@ extern void update_cylinder_related_info(struct dive *);
 extern void mark_divelist_changed(int);
 extern int unsaved_changes(void);
 extern void remove_autogen_trips(void);
-extern double init_decompressi

Re: [PATCH] Re: Two patches for dive plan

2016-11-27 Thread Rick Walsh
On 27 November 2016 at 21:35, Robert Helling  wrote:

>
> Am 26.11.2016 um 23:24 schrieb Anton Lundin :
>
>
> It depends if i step to +1 from +0 or from +2. Timing issue somewhere?
> Weird numeric instability?
>
> Anton, I got even weirder numeric instability for dive with 60min at 30m
on 32% nitrox:


Subsurface dive plan
based on VPM-B at +2 conservatism, effective GF=-2147483648/-2147483648

Runtime: 96min

>
>
>
> Excellent spot! It first compiled the planner notes before computing the
> new gradient factors.
>
> Here is a patch.
>
>
> Robert, your patch fixes the above bug.  Same dive:

Subsurface dive plan
based on VPM-B at +2 conservatism, effective GF=63/63

Runtime: 96min

Cheers,

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


[PATCH] Re: Two patches for dive plan

2016-11-27 Thread Robert Helling
Am 26.11.2016 um 23:24 schrieb Anton Lundin :It depends if i step to +1 from +0 or from +2. Timing issue somewhere?Weird numeric instability? Excellent spot! It first compiled the planner notes before computing the new gradient factors.Here is a patch.BestRobertFrom 8ae82742d7b4b6954207a7fe4cc8a2ab50b70b6c Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" 
Date: Sun, 27 Nov 2016 11:31:30 +0100
Subject: [PATCH] Fix effective GFs in notes
To: subsurface@subsurface-divelog.org

This patch fixes two bugs:

1) It first computes the effective gradient factors and then
composes the notes with the diveplan rather than the other way
around.

2) It does not try to fit a line through a single point.

Signed-off-by: Robert C. Helling 
---
 core/deco.c| 2 +-
 core/planner.c | 8 
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/core/deco.c b/core/deco.c
index 57acfe9..a445c25 100644
--- a/core/deco.c
+++ b/core/deco.c
@@ -657,7 +657,7 @@ double get_gf(double ambpressure_bar, const struct dive 
*dive)
 
 double regressiona()
 {
-   if (sum1) {
+   if (sum1 > 1) {
double avxy = sumxy / sum1;
double avx = (double)sumx / sum1;
double avy = sumy / sum1;
diff --git a/core/planner.c b/core/planner.c
index 488fcb9..ccb71c3 100644
--- a/core/planner.c
+++ b/core/planner.c
@@ -1362,15 +1362,15 @@ bool plan(struct diveplan *diveplan, char 
**cached_datap, bool is_planner, bool
} while (!is_final_plan);
 
plan_add_segment(diveplan, clock - previous_point_time, 0, 
current_cylinder, po2, false);
-   create_dive_from_plan(diveplan, is_planner);
-   add_plan_to_notes(diveplan, &displayed_dive, show_disclaimer, error);
-   fixup_dc_duration(&displayed_dive.dc);
-
if(prefs.deco_mode == VPMB) {
diveplan->eff_gfhigh = rint(100.0 * regressionb());
diveplan->eff_gflow = rint(100*(regressiona() * 
first_stop_depth + regressionb()));
}
 
+   create_dive_from_plan(diveplan, is_planner);
+   add_plan_to_notes(diveplan, &displayed_dive, show_disclaimer, error);
+   fixup_dc_duration(&displayed_dive.dc);
+
free(stoplevels);
free(gaschanges);
free(bottom_cache);
-- 
2.9.3 (Apple Git-75)



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: [PATCHES] Two patches for dive plan

2016-11-26 Thread Anton Lundin
On 23 November, 2016 - Robert Helling wrote:

> From 404205c8f1aa37be374c2ba17acceb3541620bce Mon Sep 17 00:00:00 2001
> From: "Robert C. Helling" 
> Date: Wed, 23 Nov 2016 11:50:50 +0100
> Subject: [PATCH 2/2] Show effective gradient factors for VPMB-plans
> To: subsurface@subsurface-divelog.org
> 
> For each stop, this computes an effective gradient factor
> that gives the same ceiling. Then, it does linear regression
> to find values for GFlow and GFhigh that give a similar deco
> profile.
> 
> Note that this optimises the average gradient factor. The
> runtime however depends strongly at the gradient factor at
> the last depth. So we don't necessarily to get the runtime
> right.
> 


There's something wonkey in this patch. Try to plan a deco dive, 18/40
25min @60m with a 50% as deco gas, and then click on the VPM-B
Conservatism level spinbox. As you step it up and down the effective GF
field in the plan details just jumps all over the place.

I can provoke it into producing:

Subsurface dive plan
based on VPM-B at +1 conservatism, effective GF=25/89
Runtime: 78min

Subsurface dive plan
based on VPM-B at +1 conservatism, effective GF=18/85
Runtime: 78min


It depends if i step to +1 from +0 or from +2. Timing issue somewhere?
Weird numeric instability? 


//Anton


-- 
Anton Lundin+46702-161604
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: [PATCHES] Two patches for dive plan

2016-11-23 Thread Robert Helling
Rick,

> Am 24.11.2016 um 04:10 schrieb Rick Walsh :
> 
> One question: is there a reason why we can't access 
> displayed_dive.dc.duration.seconds instead of creating a new function to 
> iterate through all the data points to get the runtime?

I found that displayed_dive.dc.duration.seconds as well as 
displayed_dive.duration.seconds at least sometimes is still 0 at the time when 
the notes are assembled. I did not investigate this further (maybe I should), 
but rather wrote this helper function to compute it from the struct diveplan.

Best
Robert


signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: [PATCHES] Two patches for dive plan

2016-11-23 Thread Rick Walsh
Hi Robert,

On 23 November 2016 at 22:05, Robert Helling  wrote:

>
> Hi,
>
> here are two patches to improve the dive plan. The first simply shows the
> total runtime on top of the plan. This is one of the most important data of
> a plan and should be visible while adjusting parameters of the plan. So it
> is very inconvenient if is scrolled out of the dive plan widget.
>

This is a great idea.  I've lost count of the number of times I scroll down
to the bottom of the notes, just to see the total runtime.  One question:
is there a reason why we can't access displayed_dive.dc.duration.seconds
instead of creating a new function to iterate through all the data points
to get the runtime?


>
> the second attempts to find an approximation of a VPM-B profile in terms
> of Buehlmann+GF parameters: For each stop it computes an effective gradient
> factor that would give a similar ceiling. Of all these computed gradient
> factors it does a linear regression to fit a line to these factors (this is
> what the Baker GF’s do). This line is then expressed as effective GFlow and
> GFhigh in the dive plan.
>

This sounds very interesting; hopefully I'll have a chance to play with it
in the next day or two.

Cheers,

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


[PATCHES] Two patches for dive plan

2016-11-23 Thread Robert Helling
 is_planner, bool
TIMESTEP, po2, 
&displayed_dive, prefs.decosac);
clock += TIMESTEP;
depth -= deltad;
+   /* Print VPM-Gradient as gradient factor, this 
has to be done from within deco.c */
+   if (decodive)
+   plot_depth = depth;
} while (depth > 0 && depth > stoplevels[stopidx]);
 
if (depth <= 0)
@@ -1258,7 +1272,10 @@ bool plan(struct diveplan *diveplan, char 
**cached_datap, bool is_planner, bool
break; /* We did not hit the ceiling */
 
/* Add a minute of deco time and then try again 
*/
-   decodive = true;
+   if (!decodive) {
+   decodive = true;
+   first_stop_depth = depth;
+   }
if (!stopping) {
/* The last segment was an ascend 
segment.
 * Add a waypoint for start of this 
deco stop */
@@ -1349,6 +1366,11 @@ bool plan(struct diveplan *diveplan, char 
**cached_datap, bool is_planner, bool
add_plan_to_notes(diveplan, &displayed_dive, show_disclaimer, error);
fixup_dc_duration(&displayed_dive.dc);
 
+   if(prefs.deco_mode == VPMB) {
+   diveplan->eff_gfhigh = rint(100.0 * regressionb());
+   diveplan->eff_gflow = rint(100*(regressiona() * 
first_stop_depth + regressionb()));
+   }
+
free(stoplevels);
free(gaschanges);
free(bottom_cache);
-- 
2.8.4 (Apple Git-73)


Hi,

here are two patches to improve the dive plan. The first simply shows the total 
runtime on top of the plan. This is one of the most important data of a plan 
and should be visible while adjusting parameters of the plan. So it is very 
inconvenient if is scrolled out of the dive plan widget.

the second attempts to find an approximation of a VPM-B profile in terms of 
Buehlmann+GF parameters: For each stop it computes an effective gradient factor 
that would give a similar ceiling. Of all these computed gradient factors it 
does a linear regression to fit a line to these factors (this is what the Baker 
GF’s do). This line is then expressed as effective GFlow and GFhigh in the dive 
plan.

Note this is not the same as determining GFlow and GFhigh by requiring the 
first stop depth and total runtime to be the same, rather it optimizes the 
average gradient factor. In order to get the runtime right, one would mainly 
have to adjust GFhigh.

Best
Robert


signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


[PATCHES] Deco mode preferences

2016-11-02 Thread Robert Helling

Hi,

here are two patches, the first fixed a typo of Tomaz’, the second greys out 
labels of settings not in use.

Best
Robert

From 28bebc9abcd440f69f9bce87e218bcca4d2afff0 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" 
Date: Wed, 2 Nov 2016 09:54:09 +0100
Subject: [PATCH 1/2] Actually turn on the vpmb radio button in VPM-B mode
To: subsurface@subsurface-divelog.org

this fixes a typo.

Signed-off-by: Robert C. Helling 
---
 desktop-widgets/preferences/preferences_graph.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/desktop-widgets/preferences/preferences_graph.cpp 
b/desktop-widgets/preferences/preferences_graph.cpp
index 132db81..c236728 100644
--- a/desktop-widgets/preferences/preferences_graph.cpp
+++ b/desktop-widgets/preferences/preferences_graph.cpp
@@ -30,7 +30,7 @@ void PreferencesGraph::refreshSettings()
ui->vpmb->setChecked(false);
} else {
ui->buehlmann->setChecked(false);
-   ui->vpmb->setChecked(false);
+   ui->vpmb->setChecked(true);
}
 
ui->gflow->setValue(prefs.gflow);
-- 
2.8.4 (Apple Git-73)

From b874ce30c1ddada89a819ec8b439eb767393a43d Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" 
Date: Wed, 2 Nov 2016 10:00:51 +0100
Subject: [PATCH 2/2] Also grey out labels when not relevant for current deco
 mode
To: subsurface@subsurface-divelog.org

Signed-off-by: Robert C. Helling 
---
 desktop-widgets/preferences/preferences_graph.cpp |  3 +++
 desktop-widgets/preferences/preferences_graph.ui  | 30 +++
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/desktop-widgets/preferences/preferences_graph.cpp 
b/desktop-widgets/preferences/preferences_graph.cpp
index c236728..062f30a 100644
--- a/desktop-widgets/preferences/preferences_graph.cpp
+++ b/desktop-widgets/preferences/preferences_graph.cpp
@@ -88,8 +88,11 @@ void PreferencesGraph::on_buehlmann_toggled(bool buehlmann)
 {
ui->gfhigh->setEnabled(buehlmann);
ui->gflow->setEnabled(buehlmann);
+   ui->label_GFhigh->setEnabled(buehlmann);
+   ui->label_GFlow->setEnabled(buehlmann);
ui->gf_low_at_maxdepth->setEnabled(buehlmann);
ui->vpmb_conservatism->setEnabled(!buehlmann);
+   ui->label_VPMB->setEnabled(!buehlmann);
 }
 
 #undef DANGER_GF
diff --git a/desktop-widgets/preferences/preferences_graph.ui 
b/desktop-widgets/preferences/preferences_graph.ui
index 4c41ec6..ee31c20 100644
--- a/desktop-widgets/preferences/preferences_graph.ui
+++ b/desktop-widgets/preferences/preferences_graph.ui
@@ -6,15 +6,15 @@

 0
 0
-505
-575
+650
+578

   
   
Form
   
   
- // Gas pressure options
+   
 
  
   Gas pressure display setup
@@ -130,14 +130,14 @@
 

   
-   // row was 8
+  

 
  Show setpoints when viewing pO₂
 

   
-   // row was 9
+  

 
  Show individual O₂ sensor values when viewing pO₂
@@ -147,7 +147,7 @@
  
 

- //  Ceiling options
+   
 
  
   Ceiling display setup
@@ -181,11 +181,11 @@

   
   
-   
+   
 
  VPM-B Conservatism
 
-
+
  Qt::AlignCenter
 

@@ -214,11 +214,11 @@

   
   
-   
+   
 
  GFHigh
 
-
+
  Qt::AlignCenter
 

@@ -234,11 +234,11 @@

   
   
-   
+   
 
  GFLow
 
-
+
  Qt::AlignCenter
 

@@ -272,7 +272,7 @@
 
  Metabolic rate (ℓ O₂/min)
 
-
+
  Qt::AlignCenter
 

@@ -289,7 +289,7 @@
 
  Dilution ratio
 
-
+
  Qt::AlignCenter
 

@@ -307,7 +307,7 @@
  
 

- // Misc group
+   
 
  
   Misc
-- 
2.8.4 (Apple Git-73)



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: final patches for the preferences unittests

2016-11-01 Thread Dirk Hohndel
Tomaz,

Thanks for this long series of patches. Most of them I was able to
validate by reading the code, a couple will need more testing (especially
this last one that I'm responding to).

But a big THANKS for your work here, this was a big part of what I was
waiting for before continuing towards 4.6

May the testing commence. Please.

/D

On Tue, Nov 01, 2016 at 05:05:18PM +0100, Tomaz Canabrava wrote:
> This last patch should fix robert's issues with the different deco models
> for display and plan.
> Robert issues should be fixed with this path.
> The issue was that the preferences wasn't hoocked up (it was actually
> partially hoocked in the wrong pref)
> 
> 
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Patches to pref->graph

2016-11-01 Thread Dirk Hohndel
On Tue, Nov 01, 2016 at 03:15:13PM +0200, Willem Ferguson wrote:
> Dirk,
> I suspect the last of my two patches will not apply. There is a problem with
> character encoding in the raw text of the patch and I have no idea how to
> fix that. The subscript-2 of pO2 consequently appears unreadable.
> 
> If the second patch cannot be applied:
> If you apply the first of the two patches I will pull the latest version of
> the code from master and rewrite the second patch that removes pre-pended
> space characters.

Hmm. I had no problem appying the patch. pO₂ came across just fine.

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


Re: final patches for the preferences unittests

2016-11-01 Thread Tomaz Canabrava
This last patch should fix robert's issues with the different deco models
for display and plan.
Robert issues should be fixed with this path.
The issue was that the preferences wasn't hoocked up (it was actually
partially hoocked in the wrong pref)



On Tue, Nov 1, 2016 at 3:45 PM, Tomaz Canabrava  wrote:

>
>
> On Tue, Nov 1, 2016 at 3:25 PM, Tomaz Canabrava 
> wrote:
>
>> more fixes regarding preferences
>>
>> On Tue, Nov 1, 2016 at 2:46 PM, Tomaz Canabrava 
>> wrote:
>>
>>>  bugfixes regarding preferences
>>>
>>> still checking for more.
>>> (the font issue that willem said is fixed on this series)
>>>
>>> Tomaz
>>>
>>> On Tue, Nov 1, 2016 at 12:06 PM, Tomaz Canabrava 
>>> wrote:
>>>
 FINALLY
 this finishes the unittests - sorry for all delays.

 I'll now look for misbehaving preferences, like the one willan
 complained.

 Tomaz

>>>
>>>
>>
>
From 9b7be36c9dd6b8c46bad38c1c83b7dee12fb5130 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 1 Nov 2016 17:00:06 +0100
Subject: [PATCH 14/14] Deco mode for plannining is not deco mode for showing

We had (in the wrong place, imo) a new feature that
should differentiate the different deco_modes, you could
plan your dive in buelhman and see it in vpm-b, for instance
but both of them accessed the same pref.

Signed-off-by: Tomaz Canabrava 
---
 core/pref.h   |  1 +
 core/subsurface-qt/SettingsObjectWrapper.cpp  | 24 ++-
 core/subsurface-qt/SettingsObjectWrapper.h|  5 +
 desktop-widgets/preferences/preferences_graph.cpp |  4 +++-
 profile-widget/divetooltipitem.cpp|  5 -
 profile-widget/profilewidget2.cpp |  4 ++--
 6 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/core/pref.h b/core/pref.h
index c12a040..78d49b1 100644
--- a/core/pref.h
+++ b/core/pref.h
@@ -107,6 +107,7 @@ struct preferences {
 	int descrate;
 	int bottompo2;
 	int decopo2;
+	enum deco_mode display_deco_mode;
 	depth_t bestmixend;
 	int proxy_type;
 	char *proxy_host;
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index 60efe9a..34fe3dd 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -259,6 +259,24 @@ TechnicalDetailsSettings::TechnicalDetailsSettings(QObject* parent): QObject(par
 
 }
 
+deco_mode TechnicalDetailsSettings::deco() const
+{
+
+	return prefs.display_deco_mode;
+}
+
+void TechnicalDetailsSettings::setDecoMode(deco_mode d)
+{
+	if (prefs.display_deco_mode == d)
+		return;
+
+	prefs.display_deco_mode = d;
+	QSettings s;
+	s.beginGroup(group);
+	s.setValue("display_deco_mode", d);
+	emit decoModeChanged(d);
+}
+
 double TechnicalDetailsSettings:: modp02() const
 {
 	return prefs.modpO2;
@@ -2131,11 +2149,6 @@ void SettingsObjectWrapper::load()
 	GET_BOOL("tankbar", tankbar);
 	GET_BOOL("RulerBar", rulergraph);
 	GET_BOOL("percentagegraph", percentagegraph);
-	v = s.value("buehlmann");
-	if (v.isValid())
-		prefs.deco_mode = v.toBool() ? BUEHLMANN : VPMB;
-	else
-		prefs.deco_mode = BUEHLMANN;
 	GET_INT("gflow", gflow);
 	GET_INT("gfhigh", gfhigh);
 	GET_INT("vpmb_conservatism", vpmb_conservatism);
@@ -2149,6 +2162,7 @@ void SettingsObjectWrapper::load()
 	GET_BOOL("display_unused_tanks", display_unused_tanks);
 	GET_BOOL("show_average_depth", show_average_depth);
 	GET_BOOL("show_pictures_in_profile", show_pictures_in_profile);
+	prefs.display_deco_mode =  (deco_mode) s.value("display_deco_mode").toInt();
 	s.endGroup();
 
 	s.beginGroup("GeneralSettings");
diff --git a/core/subsurface-qt/SettingsObjectWrapper.h b/core/subsurface-qt/SettingsObjectWrapper.h
index bd12da5..7fdd104 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.h
+++ b/core/subsurface-qt/SettingsObjectWrapper.h
@@ -132,6 +132,8 @@ class TechnicalDetailsSettings : public QObject {
 	Q_PROPERTY(bool display_unused_tanks READ displayUnusedTanks WRITE setDisplayUnusedTanks NOTIFY displayUnusedTanksChanged)
 	Q_PROPERTY(bool show_average_depth   READ showAverageDepth   WRITE setShowAverageDepth   NOTIFY showAverageDepthChanged)
 	Q_PROPERTY(bool show_pictures_in_profile READ showPicturesInProfile WRITE setShowPicturesInProfile NOTIFY showPicturesInProfileChanged)
+	Q_PROPERTY(deco_mode deco READ deco WRITE setDecoMode NOTIFY decoModeChanged)
+
 public:
 	TechnicalDetailsSettings(QObject *parent);
 
@@ -160,6 +162,7 @@ public:
 	bool displayUnusedTanks() const;
 	bool showAverageDepth() const;
 	bool showPicturesInProfile() const;
+	deco_mode deco() const;
 
 public slots:
 	void setMod(bool value);
@@ -187,6 +190,7 @@ public slots:
 	void setDisplayUnusedTanks(bool value);
 	void setShowAverageDepth(bool value);
 	void setShowPicturesInProfile(bool value);
+	void setDecoMode(deco_mode d);
 
 signals:
 	void modpO2Changed(double value);
@@ -214,6 +218,7 @@ signals:
 	void displayUnusedTanksChanged(bool value);
 	void showAverageDepthChanged(

Re: final patches for the preferences unittests

2016-11-01 Thread Tomaz Canabrava
On Tue, Nov 1, 2016 at 3:25 PM, Tomaz Canabrava  wrote:

> more fixes regarding preferences
>
> On Tue, Nov 1, 2016 at 2:46 PM, Tomaz Canabrava 
> wrote:
>
>>  bugfixes regarding preferences
>>
>> still checking for more.
>> (the font issue that willem said is fixed on this series)
>>
>> Tomaz
>>
>> On Tue, Nov 1, 2016 at 12:06 PM, Tomaz Canabrava 
>> wrote:
>>
>>> FINALLY
>>> this finishes the unittests - sorry for all delays.
>>>
>>> I'll now look for misbehaving preferences, like the one willan
>>> complained.
>>>
>>> Tomaz
>>>
>>
>>
>
From c1fbcc557aeb6a631cc6361769d3e6dd9c4aab24 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 1 Nov 2016 15:44:30 +0100
Subject: [PATCH 13/13] Misc fixes

Remove a few uneeded lines and add more loading code for
the preferences.

Signed-off-by: Tomaz Canabrava 
---
 core/subsurface-qt/SettingsObjectWrapper.cpp | 2 ++
 desktop-widgets/subsurfacewebservices.cpp| 2 --
 profile-widget/diveprofileitem.cpp   | 2 --
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index 68fdf19..60efe9a 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -2296,6 +2296,8 @@ void SettingsObjectWrapper::load()
 	GET_TXT("time_format", time_format);
 	GET_TXT("date_format", date_format);
 	GET_TXT("date_format_short", date_format_short);
+	GET_BOOL("time_format_override", time_format_override);
+	GET_BOOL("date_format_override", date_format_override);
 	s.endGroup();
 }
 
diff --git a/desktop-widgets/subsurfacewebservices.cpp b/desktop-widgets/subsurfacewebservices.cpp
index 312e823..15a1496 100644
--- a/desktop-widgets/subsurfacewebservices.cpp
+++ b/desktop-widgets/subsurfacewebservices.cpp
@@ -380,8 +380,6 @@ void WebServices::resetState()
 
 SubsurfaceWebServices::SubsurfaceWebServices(QWidget *parent, Qt::WindowFlags f) : WebServices(parent, f)
 {
-	QSettings s;
-
 	// figure out if we know (or can determine) the user's web service userid
 	QString userid(prefs.userid);
 
diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/diveprofileitem.cpp
index 2400320..c3c7165 100644
--- a/profile-widget/diveprofileitem.cpp
+++ b/profile-widget/diveprofileitem.cpp
@@ -14,8 +14,6 @@
 #include "libdivecomputer/parser.h"
 #include "profile-widget/profilewidget2.h"
 
-#include 
-
 AbstractProfilePolygonItem::AbstractProfilePolygonItem() : QObject(), QGraphicsPolygonItem(), hAxis(NULL), vAxis(NULL), dataModel(NULL), hDataColumn(-1), vDataColumn(-1)
 {
 	setCacheMode(DeviceCoordinateCache);
-- 
2.10.2

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


Re: final patches for the preferences unittests

2016-11-01 Thread Tomaz Canabrava
more fixes regarding preferences

On Tue, Nov 1, 2016 at 2:46 PM, Tomaz Canabrava  wrote:

>  bugfixes regarding preferences
>
> still checking for more.
> (the font issue that willem said is fixed on this series)
>
> Tomaz
>
> On Tue, Nov 1, 2016 at 12:06 PM, Tomaz Canabrava 
> wrote:
>
>> FINALLY
>> this finishes the unittests - sorry for all delays.
>>
>> I'll now look for misbehaving preferences, like the one willan complained.
>>
>> Tomaz
>>
>
>
From 8f1755b59a5997d9553a5296e8e27a337affddd4 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 1 Nov 2016 14:57:47 +0100
Subject: [PATCH 10/12] on first run, use system language.

Signed-off-by: Tomaz Canabrava 
---
 core/subsurfacestartup.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/core/subsurfacestartup.c b/core/subsurfacestartup.c
index 7534a49..200e23b 100644
--- a/core/subsurfacestartup.c
+++ b/core/subsurfacestartup.c
@@ -83,6 +83,9 @@ struct preferences default_prefs = {
 		.tag_existing_dives = false,
 		.category = { 0 }
 	},
+	.locale = {
+		.use_system_language = true,
+	},
 	.deco_mode = BUEHLMANN,
 	.vpmb_conservatism = 3,
 	.distance_threshold = 1000,
-- 
2.10.2

From d6a7197907ff629bc8a520c1d4ffe5c79bafbbbf Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 1 Nov 2016 15:13:27 +0100
Subject: [PATCH 11/12] Use default values if value doesn't exist

By using the default value argument we can reduce
this code size to a half.

Signed-off-by: Tomaz Canabrava 
---
 desktop-widgets/printdialog.cpp | 45 +++--
 1 file changed, 16 insertions(+), 29 deletions(-)

diff --git a/desktop-widgets/printdialog.cpp b/desktop-widgets/printdialog.cpp
index 72e4d20..5fdc781 100644
--- a/desktop-widgets/printdialog.cpp
+++ b/desktop-widgets/printdialog.cpp
@@ -41,35 +41,22 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) :
 
 	// check if the options were previously stored in the settings; if not use some defaults.
 	QSettings s;
-	bool stored = s.childGroups().contains(SETTINGS_GROUP);
-	if (!stored) {
-		printOptions.print_selected = true;
-		printOptions.color_selected = true;
-		printOptions.landscape = false;
-		printOptions.p_template = "one_dive.html";
-		printOptions.type = print_options::DIVELIST;
-		templateOptions.font_index = 0;
-		templateOptions.font_size = 9;
-		templateOptions.color_palette_index = SSRF_COLORS;
-		templateOptions.line_spacing = 1;
-		custom_colors = ssrf_colors;
-	} else {
-		s.beginGroup(SETTINGS_GROUP);
-		printOptions.type = (print_options::print_type)s.value("type").toInt();
-		printOptions.print_selected = s.value("print_selected").toBool();
-		printOptions.color_selected = s.value("color_selected").toBool();
-		printOptions.landscape = s.value("landscape").toBool();
-		printOptions.p_template = s.value("template_selected").toString();
-		templateOptions.font_index = s.value("font").toInt();
-		templateOptions.font_size = s.value("font_size").toDouble();
-		templateOptions.color_palette_index = s.value("color_palette").toInt();
-		templateOptions.line_spacing = s.value("line_spacing").toDouble();
-		custom_colors.color1 = QColor(s.value("custom_color_1").toString());
-		custom_colors.color2 = QColor(s.value("custom_color_2").toString());
-		custom_colors.color3 = QColor(s.value("custom_color_3").toString());
-		custom_colors.color4 = QColor(s.value("custom_color_4").toString());
-		custom_colors.color5 = QColor(s.value("custom_color_5").toString());
-	}
+	s.beginGroup(SETTINGS_GROUP);
+	printOptions.type = (print_options::print_type)s.value("type", print_options::DIVELIST).toInt();
+	printOptions.print_selected = s.value("print_selected", true).toBool();
+	printOptions.color_selected = s.value("color_selected", true).toBool();
+	printOptions.landscape = s.value("landscape", false).toBool();
+	printOptions.p_template = s.value("template_selected", "one_dive.html").toString();
+	templateOptions.font_index = s.value("font", 0).toInt();
+	templateOptions.font_size = s.value("font_size", 9).toDouble();
+	templateOptions.color_palette_index = s.value("color_palette", SSRF_COLORS).toInt();
+	templateOptions.line_spacing = s.value("line_spacing", 1).toDouble();
+	custom_colors.color1 = QColor(s.value("custom_color_1", ssrf_colors.color1).toString());
+	custom_colors.color2 = QColor(s.value("custom_color_2", ssrf_colors.color2).toString());
+	custom_colors.color3 = QColor(s.value("custom_color_3", ssrf_colors.color3).toString());
+	custom_colors.color4 = QColor(s.value("custom_color_4", ssrf_colors.color4).toString());
+	custom_colors.color5 = QColor(s.value("custom_color_5", ssrf_colors.color5).toString());
+	s.endGroup();
 
 	// handle cases from old QSettings group
 	if (templateOptions.font_size < 9) {
-- 
2.10.2

From 2f07c91f4436f3110ff33e241925708912d31649 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 1 Nov 2016 15:18:12 +0100
Subject: [PATCH 12/12] Use the new preferences object to set the preferences

Signed-off-by: Tomaz Canabrava 
---

Re: final patches for the preferences unittests

2016-11-01 Thread Tomaz Canabrava
 bugfixes regarding preferences

still checking for more.
(the font issue that willem said is fixed on this series)

Tomaz

On Tue, Nov 1, 2016 at 12:06 PM, Tomaz Canabrava  wrote:

> FINALLY
> this finishes the unittests - sorry for all delays.
>
> I'll now look for misbehaving preferences, like the one willan complained.
>
> Tomaz
>
From aef59890d010ec6210bd4538d26ca5d64da12501 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 1 Nov 2016 14:08:59 +0100
Subject: [PATCH 5/9] Fix bug where the Font setting was ignored

Signed-off-by: Tomaz Canabrava 
---
 core/subsurface-qt/SettingsObjectWrapper.cpp | 1 +
 desktop-widgets/preferences/preferences_defaults.cpp | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index 81f6237..ec5e041 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -1834,6 +1834,7 @@ void DisplaySettingsObjectWrapper::setDivelistFont(const QString& value)
 		return;
 
 	QSettings s;
+	s.beginGroup(group);
 	s.setValue("divelist_font", value);
 
 	if (!subsurface_ignore_font(newValue.toUtf8().constData())) {
diff --git a/desktop-widgets/preferences/preferences_defaults.cpp b/desktop-widgets/preferences/preferences_defaults.cpp
index 2ebbe54..60b3d3a 100644
--- a/desktop-widgets/preferences/preferences_defaults.cpp
+++ b/desktop-widgets/preferences/preferences_defaults.cpp
@@ -88,8 +88,6 @@ void PreferencesDefaults::syncSettings()
 		general->setDefaultFileBehavior(CLOUD_DEFAULT_FILE);
 
 	auto display =  SettingsObjectWrapper::instance()->display_settings;
-
-	//TODO: Verify the 'save or remove special' feature for the divelist font and the font size.
 	display->setDivelistFont(ui->font->currentFont().toString());
 	display->setFontSize(ui->fontsize->value());
 	display->setDisplayInvalidDives(ui->displayinvalid->isChecked());
-- 
2.10.2

From cff62d4ee52fad9202ae396c9ac53c36571b94e0 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 1 Nov 2016 14:17:59 +0100
Subject: [PATCH 6/9] Remember to load the language

Signed-off-by: Tomaz Canabrava 
---
 core/subsurface-qt/SettingsObjectWrapper.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index ec5e041..9e9c2ec 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -2288,6 +2288,7 @@ void SettingsObjectWrapper::load()
 	s.endGroup();
 
 	s.beginGroup("Language");
+	prefs.locale.language = copy_string(qPrintable(s.value("UiLanguage").toString()));
 	prefs.locale.lang_locale = copy_string(qPrintable(s.value("UiLangLocale").toString()));
 	prefs.time_format = copy_string(qPrintable(s.value("time_format").toString()));
 	prefs.date_format = copy_string(qPrintable(s.value("date_format").toString()));
-- 
2.10.2

From 5b797f756c5d70a3856af99283794969f8f0b928 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 1 Nov 2016 14:22:43 +0100
Subject: [PATCH 7/9] Load use_system_language

Forgot to load use_system_language, wich borked the preferences.

Signed-off-by: Tomaz Canabrava 
---
 core/subsurface-qt/SettingsObjectWrapper.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index 9e9c2ec..d61200b 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -2288,6 +2288,7 @@ void SettingsObjectWrapper::load()
 	s.endGroup();
 
 	s.beginGroup("Language");
+	prefs.locale.use_system_language = s.value("UseSystemLanguage").toBool();
 	prefs.locale.language = copy_string(qPrintable(s.value("UiLanguage").toString()));
 	prefs.locale.lang_locale = copy_string(qPrintable(s.value("UiLangLocale").toString()));
 	prefs.time_format = copy_string(qPrintable(s.value("time_format").toString()));
-- 
2.10.2

From 0a5917351d528618e3a916ea8020d8da84e9a846 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 1 Nov 2016 14:35:56 +0100
Subject: [PATCH 8/9] use GET_* macros for getting settings

Those macros are nice because they take into consideration
the default preferences.

Signed-off-by: Tomaz Canabrava 
---
 core/subsurface-qt/SettingsObjectWrapper.cpp | 46 +++-
 1 file changed, 24 insertions(+), 22 deletions(-)

diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index d61200b..e8d1e7d 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -2249,28 +2249,30 @@ void SettingsObjectWrapper::load()
 	s.endGroup();
 
 	s.beginGroup("Planner");
-	prefs.last_stop = s.value("last_stop", prefs.last_stop).toBool();
-	prefs.verbatim_plan = s.value("verbatim_plan", prefs.verbatim_plan).toBool();
-	prefs.display_duration = s.value("display_durat

Patches to pref->graph

2016-11-01 Thread Willem Ferguson

Dirk,
I suspect the last of my two patches will not apply. There is a problem 
with character encoding in the raw text of the patch and I have no idea 
how to fix that. The subscript-2 of pO2 consequently appears unreadable.


If the second patch cannot be applied:
If you apply the first of the two patches I will pull the latest version 
of the code from master and rewrite the second patch that removes 
pre-pended space characters.


Kind regards,
willem

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


final patches for the preferences unittests

2016-11-01 Thread Tomaz Canabrava
FINALLY
this finishes the unittests - sorry for all delays.

I'll now look for misbehaving preferences, like the one willan complained.

Tomaz
From 7437265091fb221578a09b26199e1eea18a523e0 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 1 Nov 2016 11:16:50 +0100
Subject: [PATCH 1/4] Move animation_settings to the bottom of the test file

This is made just to make the tests appear in the same
order of the SettingsObjectWrapper order of initialization

Since the SettingsObjectWrapper is huge, this helps
checking if everything is correct.

Signed-off-by: Tomaz Canabrava 
---
 tests/testpreferences.cpp | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/testpreferences.cpp b/tests/testpreferences.cpp
index 862ba61..9ad3ee0 100644
--- a/tests/testpreferences.cpp
+++ b/tests/testpreferences.cpp
@@ -16,11 +16,6 @@ void TestPreferences::testPreferences()
 	auto pref = SettingsObjectWrapper::instance();
 	pref->load();
 
-	pref->animation_settings->setAnimationSpeed(20);
-	TEST(pref->animation_settings->animationSpeed(), 20);
-	pref->animation_settings->setAnimationSpeed(30);
-	TEST(pref->animation_settings->animationSpeed(), 30);
-
 	auto cloud = pref->cloud_storage;
 	cloud->setBackgroundSync(true);
 	TEST(cloud->backgroundSync(), true);
@@ -537,6 +532,11 @@ void TestPreferences::testPreferences()
 	TEST(language->timeFormatOverride(),true);
 	TEST(language->dateFormatOverride(),true);
 	TEST(language->useSystemLanguage(), true);
+
+	pref->animation_settings->setAnimationSpeed(20);
+	TEST(pref->animation_settings->animationSpeed(), 20);
+	pref->animation_settings->setAnimationSpeed(30);
+	TEST(pref->animation_settings->animationSpeed(), 30);
 }
 
 QTEST_MAIN(TestPreferences)
-- 
2.10.2

From b0ec91686a7ef719e4bfe67dc8c22997cd9fa172 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 1 Nov 2016 11:28:08 +0100
Subject: [PATCH 2/4] Location updates & bug fix

Fixed loading the location preferences.

Signed-off-by: Tomaz Canabrava 
---
 core/subsurface-qt/SettingsObjectWrapper.cpp |  7 ---
 core/subsurface-qt/SettingsObjectWrapper.h   |  2 +-
 tests/testpreferences.cpp| 13 +
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index 0cd0568..d692c4b 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -2229,13 +2229,6 @@ void SettingsObjectWrapper::load()
 	// Subsurface webservice id is stored outside of the groups
 	GET_TXT("subsurface_webservice_uid", userid);
 
-	// but the related time / distance threshold (only used in the mobile app)
-	// are in their own group
-	s.beginGroup("locationService");
-	GET_INT("distance_threshold", distance_threshold);
-	GET_INT("time_threshold", time_threshold);
-	s.endGroup();
-
 	// GeoManagement
 	s.beginGroup("geocoding");
 
diff --git a/core/subsurface-qt/SettingsObjectWrapper.h b/core/subsurface-qt/SettingsObjectWrapper.h
index d9b8196..bd12da5 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.h
+++ b/core/subsurface-qt/SettingsObjectWrapper.h
@@ -668,7 +668,7 @@ signals:
 	void timeThresholdChanged(int value);
 	void distanceThresholdChanged(int value);
 private:
-	const QString group = QStringLiteral("locationService");
+	const QString group = QStringLiteral("LocationService");
 };
 
 class SettingsObjectWrapper : public QObject {
diff --git a/tests/testpreferences.cpp b/tests/testpreferences.cpp
index 9ad3ee0..c1ef2a8 100644
--- a/tests/testpreferences.cpp
+++ b/tests/testpreferences.cpp
@@ -537,6 +537,19 @@ void TestPreferences::testPreferences()
 	TEST(pref->animation_settings->animationSpeed(), 20);
 	pref->animation_settings->setAnimationSpeed(30);
 	TEST(pref->animation_settings->animationSpeed(), 30);
+
+	auto location = pref->location_settings;
+	location->setTimeThreshold(10);
+	location->setDistanceThreshold(20);
+
+	TEST(location->timeThreshold(), 10);
+	TEST(location->distanceThreshold(), 20);
+
+	location->setTimeThreshold(30);
+	location->setDistanceThreshold(40);
+
+	TEST(location->timeThreshold(), 30);
+	TEST(location->distanceThreshold(), 40);
 }
 
 QTEST_MAIN(TestPreferences)
-- 
2.10.2

From 7de9581d3ce7be438512f2da7a4fa6c6b95960fe Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 1 Nov 2016 11:57:28 +0100
Subject: [PATCH 3/4] Fix Update Manager date loading

Date loading was incorrect, this unittest + fix deals with that.

Signed-off-by: Tomaz Canabrava 
---
 core/subsurface-qt/SettingsObjectWrapper.cpp |  6 +++---
 tests/testpreferences.cpp| 21 +
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index d692c4b..81f6237 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -102,7 +102,7 @@ QStri

Re: Missing patches

2016-10-19 Thread Tomaz Canabrava
Answering via phone -

I managed to do around 15 patches this week -  there are more comming, and
also I'll work on this weekend. So I hope to finish this.

Em 19 de out de 2016 20:29, "Robert Helling"  escreveu:

>
> Am 19.10.2016 um 20:20 schrieb Robert Helling :
>
> Hi Dirk,
>
> you asked on IRC which patches are missing from my perspective in master.
> This is what I have in my master but apparently is not in origin/master:
>
> The two patches of Rick (last two days) that rescale the heat-map color. I
> think I got convinced there.
>
> Regarding the deco model preference: Tomaz promised something which I
> still think is open. You took my patch but I guess, functionality is not
> complete, yet. I hope we will get this fixed tomorrow evening.
>
> There was a patch by Rick "Heatmap: Draw lines between data points rather
> than big dots“ that seems to be missing.
>
> I guess, that’s it
>
>
> No, there is also Martin’s tex export: check site pointer, before
> accessing it; print empty string rather than ‚null'
>
> Robert
>
>
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>
>
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Missing patches

2016-10-19 Thread Robert Helling

> Am 19.10.2016 um 20:20 schrieb Robert Helling :
> 
> Hi Dirk,
> 
> you asked on IRC which patches are missing from my perspective in master. 
> This is what I have in my master but apparently is not in origin/master:
> 
> The two patches of Rick (last two days) that rescale the heat-map color. I 
> think I got convinced there.
> 
> Regarding the deco model preference: Tomaz promised something which I still 
> think is open. You took my patch but I guess, functionality is not complete, 
> yet. I hope we will get this fixed tomorrow evening.
> 
> There was a patch by Rick "Heatmap: Draw lines between data points rather 
> than big dots“ that seems to be missing.
> 
> I guess, that’s it

No, there is also Martin’s tex export: check site pointer, before accessing it; 
print empty string rather than ‚null'

Robert



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Missing patches

2016-10-19 Thread Robert Helling
Hi Dirk,

you asked on IRC which patches are missing from my perspective in master. This 
is what I have in my master but apparently is not in origin/master:

The two patches of Rick (last two days) that rescale the heat-map color. I 
think I got convinced there.

Regarding the deco model preference: Tomaz promised something which I still 
think is open. You took my patch but I guess, functionality is not complete, 
yet. I hope we will get this fixed tomorrow evening.

There was a patch by Rick "Heatmap: Draw lines between data points rather than 
big dots“ that seems to be missing.

I guess, that’s it.

Best
Robert


signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: [PATCHES] Vary undersaturated portion of heatmap according inert gas

2016-10-19 Thread Hartley Horwitz
>
> -- Forwarded message --
> From: Rick Walsh 
> To: Robert Helling 
> Cc: "subsurface@subsurface-divelog.org"  >
> Date: Wed, 19 Oct 2016 08:48:57 +1100
> Subject: Re: [PATCHES] Vary undersaturated portion of heatmap according
> inert gas
>
>
> On 18 October 2016 at 20:55, Robert Helling  wrote:
>
>> Will try. I definitely like patch 2, that’s a no-brainer.
>>
>> For patch 1, I see your point (the user can see if on-gasing is
>> happening). I am not yet convinced, though. the trouble I am having is
>> “what is the heat-map supposed to show?”. I think, it should be a measure
>> of deco quality (I argued for this when answering if it depends on the deco
>> model used, and no, it does not depend on VPM and not on the gradient
>> factors chosen). So, and I think this is a philosophical question, should
>> it depend on what the diver is breathing?
>>
>
I agree with Rick that I was expecting the heat map to show me a benefit
when comparing a nitrox dive to an air dive with the same profile.  I think
if two dives are at the same END then you'd expect the on-gassing to occur
equally and thus the heat map to reflect that.

That being said, if you load up a tissue compartment to equal ambient
(black), then when you rapidly rise to 6m (for example), the initial colour
should be the same, regardless of the gas mix you're breathing, and it
should show you are off-gassing.  The gas mix should reflect how quickly
you move from yellow (or white) to green, but shouldn't reflect the colour
at the beginning of off-gassing.


> Without that patch it is only about the state of the gases in the diver’s
>> body (and not about the time derivative as in on- vs. off-gassing). It
>> shows the potential for bubble formation (at least that is what it is
>> supposed to show). If we do it relative to then breathing gas, then it is
>> more about the time derivative.
>>
>> I am not really against it, just need a bit more convincing.
>>
>
> 
>


> Compare a dive on 40% nitrox to 24m with a dive on air to 24m.  On
> reaching 24m, the rate of on-gassing is much faster with the air dive, but
> the colours are shown the exactly same if we do not adjust the heatmap
> according to the breathing gas inert gas pressure.
>

Agreed.

>
> Now consider an air dive to 16m (equivalent air depth of a dive to 24m on
> 40% nitrox).  Theory says the on-gassing is exactly the same as the deeper
> nitrox dive, so it makes sense to show the same colours on the heatmap.  If
> we take the patch to vary colours according to the breathed inert gas
> pressure (and descent and ascent take the same time), then the same heatmap
> is shown, which I think is helpful.
>
> ...Hartley Horwitz
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: [PATCHES] Vary undersaturated portion of heatmap according inert gas

2016-10-18 Thread Rick Walsh
On 18 October 2016 at 20:55, Robert Helling  wrote:

> Will try. I definitely like patch 2, that’s a no-brainer.
>
> For patch 1, I see your point (the user can see if on-gasing is
> happening). I am not yet convinced, though. the trouble I am having is
> “what is the heat-map supposed to show?”. I think, it should be a measure
> of deco quality (I argued for this when answering if it depends on the deco
> model used, and no, it does not depend on VPM and not on the gradient
> factors chosen). So, and I think this is a philosophical question, should
> it depend on what the diver is breathing? Without that patch it is only
> about the state of the gases in the diver’s body (and not about the time
> derivative as in on- vs. off-gassing). It shows the potential for bubble
> formation (at least that is what it is supposed to show). If we do it
> relative to then breathing gas, then it is more about the time derivative.
>
> I am not really against it, just need a bit more convincing.
>

I understand what you are saying, so while I will try to convince you, I
won't mind if I don't, and I'll rehash the second patch to make it apply
without the first.

As you say, it really does depend on what the heat map ought to show, and
by adjusting the scale over the range with tissue inert pressure less than
the ambient pressure, it does represent the time derivative.  But I'll
present a few examples / reasons why this could be beneficial.

Compare a dive on 40% nitrox to 24m with a dive on air to 24m.  On reaching
24m, the rate of on-gassing is much faster with the air dive, but the
colours are shown the exactly same if we do not adjust the heatmap
according to the breathing gas inert gas pressure.

Now consider an air dive to 16m (equivalent air depth of a dive to 24m on
40% nitrox).  Theory says the on-gassing is exactly the same as the deeper
nitrox dive, so it makes sense to show the same colours on the heatmap.  If
we take the patch to vary colours according to the breathed inert gas
pressure (and descent and ascent take the same time), then the same heatmap
is shown, which I think is helpful.

Looking at a decompression dive, with 100% O2 as decompression gas.  If we
don't adjust for breathed inert gas pressure, during decompression the slow
tissues appear as blue or purple, which are the "on-gassing" colours, when
in fact they are off-gassing (but still below ambient total pressure),
whereas if the colour adjustment is made, they are shown in darker shades
of green to indicate they are off-gassing and below ambient total pressure.

Also (but I think this is less important), by setting the point where
tissue inert pressure equals breathed gas inert pressure to black, this
aligns with the 'inert gas equilibrium pressure' line in the instantaneous
bar graph.  So then we have exact colours to align with the GF100 line
(red), the total gas pressure line (bright green), inert gas equilibrium
pressure (black), and zero pressure (cyan).

Please consider the above, but as I said, I want be offended if I haven't
convinced you.  I do also appreciate the cleanness of keeping a more pure
colour scale.


>
> Anyway, here is an experiment that one should do (of course not oneself
> but under controlled conditions): Do an air dive with an aggressive profile
> that has a significant chance of causing deco symptoms (or bubble count for
> that matter) in the first few minutes of the 6m stop. Discard all dives
> where the problems occur before reaching 6m. Then have two groups: One
> doing the stop with air, the others with oxygen.
>
> If it is really about the difference to ambient pressure, the incidence
> rate in the first minutes of the 6m stop will not depend on the gas
> breathed. But if it is about the inert gas gradient, there should be _more_
> incidents with O2 (irrespective of the fact that for the rest of the dive
> and the aftermath the more effective desaturation with O2 will take over).
>
> I might pass on your offer of the experiment, but yes that is a good
point.  The Buehlmann and VPM models do both imply that offgassing without
exceeding the ambient total pressure will not cause any damage.


> On an unrelated note: When googling for isobaric counter diffusion I came
> across http://www.advanceddivermagazine.com/articles/icd/icd.html where
> Wienke etal describe Mark Elliot’s plan to dive to 1049 fsw. For the fun of
> it I entered the gases used in our planner, see the file attached.
>
>
>
> Turns out, with VPM-B+3 I can roughly produce that profile (that was
> apparently calculated in RGBM) but based on Buehlmann that guy should be
> dead. You need GF 150/80 or similar to get in the ball park of the runtime
> used. And of course the heat-map is white to a large degree… And I had
> always thought that you can model bubble model dives with the appropriate
> gradient factors...
>
>
> An interesting article and a crazy dive.  Not one I'd volunteer for.
Another point - he must have been pretty narked.  Yes, it is interes

Re: Kirigami patches

2016-08-16 Thread Marco Martin
On Tuesday 16 August 2016, Dirk Hohndel wrote:
> > ah, if what you have now works, then that's fine :)
> > was something to try if it wasn't working yet :)
> 
> So here are the kirigami patches that I now use. The last one I don't

thanks, I'll take a look at all of them

> think you want to take. But I'd love to see a property that a program
> using Kirigami can use to overwrite the fairly narrow defauly of 20 grid
> units.

sure, you can do:

ApplicationWindow {
...
pageStack.defaultColumnWidth: Units.gridUnit * 30
...
}

you can set/access all the properties of pagerow in the above way

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


Re: Kirigami patches

2016-08-16 Thread Dirk Hohndel
On Tue, Aug 16, 2016 at 03:48:49PM +0200, Marco Martin wrote:
> On Tuesday 16 August 2016, Dirk Hohndel wrote:
> > Just to make sure I understand this correctly... You are suggesting that I
> > shouldn't build Kirigami as a separate library, but that I should include
> > the kirigami.pri file from the Subsurface-mobile.pro file? And I assume
> > that i then don't need much of what I spent all weekend trying to make
> > work?
> 
> ah, if what you have now works, then that's fine :)
> was something to try if it wasn't working yet :)

So here are the kirigami patches that I now use. The last one I don't
think you want to take. But I'd love to see a property that a program
using Kirigami can use to overwrite the fairly narrow defauly of 20 grid
units.

/D
>From 12d43e899ee28493098bb8d78f17413bddd10fd2 Mon Sep 17 00:00:00 2001
From: Dirk Hohndel 
Date: Mon, 15 Aug 2016 16:39:21 -0700
Subject: [PATCH 1/4] More qmake fixes

The .pro file didn't include the resource file, which made things not work when
built with qmake.

Also, the .pri file was missing the enums .cpp/.h files.

Signed-off-by: Dirk Hohndel 
---
 kirigami.pri | 4 ++--
 kirigami.pro | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/kirigami.pri b/kirigami.pri
index fc88c4c..8bf35a3 100644
--- a/kirigami.pri
+++ b/kirigami.pri
@@ -1,7 +1,7 @@
 
 QT  += qml quick gui svg
-HEADERS += $$PWD/src/kirigamiplugin.h
-SOURCES += $$PWD/src/kirigamiplugin.cpp
+HEADERS += $$PWD/src/kirigamiplugin.h $$PWD/src/enums.h
+SOURCES += $$PWD/src/kirigamiplugin.cpp $$PWD/src/enums.cpp
 INCLUDEPATH += $$PWD/src
 DEFINES += KIRIGAMI_BUILD_TYPE_STATIC
 
diff --git a/kirigami.pro b/kirigami.pro
index f7d6fe6..87af61f 100644
--- a/kirigami.pro
+++ b/kirigami.pro
@@ -4,6 +4,7 @@ CONFIG += plugin
 QT  += qml quick gui svg
 HEADERS += $$PWD/src/kirigamiplugin.h $$PWD/src/enums.h
 SOURCES += $$PWD/src/kirigamiplugin.cpp $$PWD/src/enums.cpp
+RESOURCES   += $$PWD/kirigami.qrc
 
 API_VER=1.0
 
-- 
2.7.4 (Apple Git-66)

>From a7db5877074d1ee6edc258827b54337eb67ca8f1 Mon Sep 17 00:00:00 2001
From: Dirk Hohndel 
Date: Mon, 15 Aug 2016 16:42:08 -0700
Subject: [PATCH 2/4] Q_RESOURCE_INIT macro has to be called by user

Calling this from within the library doesn't seem to be the right thing to do,
according to the documentation at http://doc.qt.io/qt-5/resources.html

Signed-off-by: Dirk Hohndel 
---
 src/kirigamiplugin.cpp | 4 
 1 file changed, 4 deletions(-)

diff --git a/src/kirigamiplugin.cpp b/src/kirigamiplugin.cpp
index fc530b3..83b4dc2 100644
--- a/src/kirigamiplugin.cpp
+++ b/src/kirigamiplugin.cpp
@@ -43,10 +43,6 @@ QString KirigamiPlugin::componentPath(const QString &fileName) const
 
 void KirigamiPlugin::registerTypes(const char *uri)
 {
-#ifdef KIRIGAMI_BUILD_TYPE_STATIC
-Q_INIT_RESOURCE(kirigami);
-#endif
-
 Q_ASSERT(uri == QLatin1String("org.kde.kirigami"));
 const QString style = QString::fromLatin1(qgetenv("QT_QUICK_CONTROLS_STYLE"));
 
-- 
2.7.4 (Apple Git-66)

>From 6fcefdfd9cc8c44dda9334a84a5f35da23d62adf Mon Sep 17 00:00:00 2001
From: Dirk Hohndel 
Date: Mon, 15 Aug 2016 19:15:36 -0700
Subject: [PATCH 3/4] Don't exit the app on iOS.

iOS users perceive that as "the app has crashed"

Signed-off-by: Dirk Hohndel 
---
 src/controls/ApplicationWindow.qml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/controls/ApplicationWindow.qml b/src/controls/ApplicationWindow.qml
index 5060214..2526453 100644
--- a/src/controls/ApplicationWindow.qml
+++ b/src/controls/ApplicationWindow.qml
@@ -145,7 +145,7 @@ AbstractApplicationWindow {
 }
 }
 
-if (Settings.isMobile && !backEvent.accepted) {
+if (Settings.isMobile && !backEvent.accepted && Qt.platform.os !== "ios") {
 Qt.quit();
 }
 }
-- 
2.7.4 (Apple Git-66)

>From 555b0062b777e9120fb749ecde5a81c85156be6b Mon Sep 17 00:00:00 2001
From: Dirk Hohndel 
Date: Mon, 15 Aug 2016 19:58:12 -0700
Subject: [PATCH 4/4] 20 gridUnits is too narrow

Signed-off-by: Dirk Hohndel 
---
 src/controls/templates/private/PageRow.qml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/controls/templates/private/PageRow.qml b/src/controls/templates/private/PageRow.qml
index 00e25d6..2b154e7 100644
--- a/src/controls/templates/private/PageRow.qml
+++ b/src/controls/templates/private/PageRow.qml
@@ -61,7 +61,7 @@ Item {
  * Pages can override it with their Layout.fillWidth,
  * implicitWidth Layout.minimumWidth etc.
  */
-property int defaultColumnWidth: Units.gridUnit * 20
+property int defaultColumnWidth: Units.gridUnit * 30
 
 /**
  * interactive: bool
-- 
2.7.4 (Apple Git-66)

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


Re: Kirigami patches

2016-08-16 Thread Dirk Hohndel

> On Aug 16, 2016, at 6:48 AM, Marco Martin  wrote:
> 
> On Tuesday 16 August 2016, Dirk Hohndel wrote:
>> Just to make sure I understand this correctly... You are suggesting that I
>> shouldn't build Kirigami as a separate library, but that I should include
>> the kirigami.pri file from the Subsurface-mobile.pro file? And I assume
>> that i then don't need much of what I spent all weekend trying to make
>> work?
> 
> ah, if what you have now works, then that's fine :)
> was something to try if it wasn't working yet :)

Well, the .pri approach means fewer changes to Subsurface (and Kirigami),
so in that sense I think it's preferable. I just need to test if it actually 
works
(it's still early morning here, haven't had time to try it)

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


Re: Kirigami patches

2016-08-16 Thread Marco Martin
On Tuesday 16 August 2016, Dirk Hohndel wrote:
> Just to make sure I understand this correctly... You are suggesting that I
> shouldn't build Kirigami as a separate library, but that I should include
> the kirigami.pri file from the Subsurface-mobile.pro file? And I assume
> that i then don't need much of what I spent all weekend trying to make
> work?

ah, if what you have now works, then that's fine :)
was something to try if it wasn't working yet :)

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


Re: Kirigami patches

2016-08-16 Thread Dirk Hohndel

-- 
Sent from my phone

On August 16, 2016 5:59:06 AM PDT, Marco Martin  wrote:
>On Tuesday 16 August 2016, Tomaz Canabrava wrote:
>> > > - use the .pri file when directly linking in kirigami into the
>(parent)
>> > > project (include directive in PROJECT.pro), then the
>Q_INIT_RESOURCE is
>> > > not necessary. using qmake this seems to be the easiest way and
>at
>> > > least seems to compile for different platforms.
>> > 
>> > subsurface is cmake based, so the pri file can't be used
>> 
>> Subsurface is cmake based only on all platforms besides ios, I didn't
>> managed to make the ios build work on cmake.
>
>ah.
>if it's qmake tThis is where I admit that I don't understand the subtleties..

Just to make sure I understand this correctly... You are suggesting that I 
shouldn't build Kirigami as a separate library, but that I should include the 
kirigami.pri file from the Subsurface-mobile.pro file? And I assume that i then 
don't need much of what I spent all weekend trying to make work?

/D

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


Re: Kirigami patches

2016-08-16 Thread Marco Martin
On Tuesday 16 August 2016, Tomaz Canabrava wrote:
> > > - use the .pri file when directly linking in kirigami into the (parent)
> > > project (include directive in PROJECT.pro), then the Q_INIT_RESOURCE is
> > > not necessary. using qmake this seems to be the easiest way and at
> > > least seems to compile for different platforms.
> > 
> > subsurface is cmake based, so the pri file can't be used
> 
> Subsurface is cmake based only on all platforms besides ios, I didn't
> managed to make the ios build work on cmake.

ah.
if it's qmake there then, can you try with just including the .pri instead?


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


Re: Kirigami patches

2016-08-16 Thread Tomaz Canabrava
Subsue

Em 16 de ago de 2016 04:43, "Marco Martin"  escreveu:
>
> On Tuesday 16 August 2016, Martin Gysel wrote:
> > Am 16.08.2016 um 01:55 schrieb Dirk Hohndel:
> > > It's pretty clear that no one ever tested the kirigami.pro qmake file.
> > > The second patch I'm not 100% sure about, but it seems to match what
the
> > > documentation tells us SHOULD be done.
> >
> > maybe my understanding of the qt build system, tools and libraries is
> > wrong, but wouldn't it be better to
> >
> > - use the .pri file when directly linking in kirigami into the (parent)
> > project (include directive in PROJECT.pro), then the Q_INIT_RESOURCE is
> > not necessary. using qmake this seems to be the easiest way and at least
> > seems to compile for different platforms.
>
> subsurface is cmake based, so the pri file can't be used

Subsurface is cmake based only on all platforms besides ios, I didn't
managed to make the ios build work on cmake.

> > - use the .pro file when using kirigami as library/plugin (static or
> > dynamic, from a parent 'subdirs' pro file). then the static variant
> > needs the Q_INIT_RESOURCE. using this approach leads at least on iOS to
> > various problems linking the app and not finding the resources at
> > runtime (so it did so while I tested this)
> >
> > this also means we probably need another define like
> > KIRIGAMI_BUILD_TYPE_STATIC_PLUGIN and/or
KIRIGAMI_BUILD_TYPE_DYNAMIC_PLUGIN
>
> why the one define used right now wouldn't be enough?
>
> --
> Marco Martin
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Kirigami patches

2016-08-16 Thread Marco Martin
On Tuesday 16 August 2016, Martin Gysel wrote:
> Am 16.08.2016 um 01:55 schrieb Dirk Hohndel:
> > It's pretty clear that no one ever tested the kirigami.pro qmake file.
> > The second patch I'm not 100% sure about, but it seems to match what the
> > documentation tells us SHOULD be done.
> 
> maybe my understanding of the qt build system, tools and libraries is
> wrong, but wouldn't it be better to
> 
> - use the .pri file when directly linking in kirigami into the (parent)
> project (include directive in PROJECT.pro), then the Q_INIT_RESOURCE is
> not necessary. using qmake this seems to be the easiest way and at least
> seems to compile for different platforms.

subsurface is cmake based, so the pri file can't be used

> - use the .pro file when using kirigami as library/plugin (static or
> dynamic, from a parent 'subdirs' pro file). then the static variant
> needs the Q_INIT_RESOURCE. using this approach leads at least on iOS to
> various problems linking the app and not finding the resources at
> runtime (so it did so while I tested this)
> 
> this also means we probably need another define like
> KIRIGAMI_BUILD_TYPE_STATIC_PLUGIN and/or KIRIGAMI_BUILD_TYPE_DYNAMIC_PLUGIN

why the one define used right now wouldn't be enough?

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


Re: Kirigami patches

2016-08-16 Thread Marco Martin
On Tuesday 16 August 2016, Dirk Hohndel wrote:
> It's pretty clear that no one ever tested the kirigami.pro qmake file. The
> second patch I'm not 100% sure about, but it seems to match what the
> documentation tells us SHOULD be done.

because with the pro it was supposed to build the dynamic plugin.
however, since seems to be easier to build it in static mode, I'm fine with 
the change.


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


Re: Kirigami patches

2016-08-15 Thread Martin Gysel
Am 16.08.2016 um 01:55 schrieb Dirk Hohndel:
> It's pretty clear that no one ever tested the kirigami.pro qmake file. The
> second patch I'm not 100% sure about, but it seems to match what the
> documentation tells us SHOULD be done.

maybe my understanding of the qt build system, tools and libraries is
wrong, but wouldn't it be better to

- use the .pri file when directly linking in kirigami into the (parent)
project (include directive in PROJECT.pro), then the Q_INIT_RESOURCE is
not necessary. using qmake this seems to be the easiest way and at least
seems to compile for different platforms.

- use the .pro file when using kirigami as library/plugin (static or
dynamic, from a parent 'subdirs' pro file). then the static variant
needs the Q_INIT_RESOURCE. using this approach leads at least on iOS to
various problems linking the app and not finding the resources at
runtime (so it did so while I tested this)

this also means we probably need another define like
KIRIGAMI_BUILD_TYPE_STATIC_PLUGIN and/or KIRIGAMI_BUILD_TYPE_DYNAMIC_PLUGIN

/martin

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


Kirigami patches

2016-08-15 Thread Dirk Hohndel
It's pretty clear that no one ever tested the kirigami.pro qmake file. The
second patch I'm not 100% sure about, but it seems to match what the
documentation tells us SHOULD be done.

/D
>From 8e4307346614943a940f11d2ee6159886c54ee83 Mon Sep 17 00:00:00 2001
From: Dirk Hohndel 
Date: Mon, 15 Aug 2016 16:39:21 -0700
Subject: [PATCH 1/2] More qmake fixes

So the qmake file didn't include the resource file, which of course made things
not work when built with qmake.

Since clearly no one else is using the qmake file but me, I also defined the
static build right there - feel free to change.

Signed-off-by: Dirk Hohndel 
---
 kirigami.pro | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kirigami.pro b/kirigami.pro
index f7d6fe6..ee77100 100644
--- a/kirigami.pro
+++ b/kirigami.pro
@@ -4,6 +4,8 @@ CONFIG += plugin
 QT  += qml quick gui svg
 HEADERS += $$PWD/src/kirigamiplugin.h $$PWD/src/enums.h
 SOURCES += $$PWD/src/kirigamiplugin.cpp $$PWD/src/enums.cpp
+DEFINES += KIRIGAMI_BUILD_TYPE_STATIC
+RESOURCES   += $$PWD/kirigami.qrc
 
 API_VER=1.0
 
-- 
2.7.4 (Apple Git-66)

>From e8de9c0bbc4dbe1e75fc4c8cb2ee0285e98c118a Mon Sep 17 00:00:00 2001
From: Dirk Hohndel 
Date: Mon, 15 Aug 2016 16:42:08 -0700
Subject: [PATCH 2/2] Q_RESOURCE_INIT macro has to be called by user

Calling this from within the library doesn't seem to be the right thing to do,
according to the documentation at http://doc.qt.io/qt-5/resources.html

Signed-off-by: Dirk Hohndel 
---
 src/kirigamiplugin.cpp | 4 
 1 file changed, 4 deletions(-)

diff --git a/src/kirigamiplugin.cpp b/src/kirigamiplugin.cpp
index fc530b3..83b4dc2 100644
--- a/src/kirigamiplugin.cpp
+++ b/src/kirigamiplugin.cpp
@@ -43,10 +43,6 @@ QString KirigamiPlugin::componentPath(const QString &fileName) const
 
 void KirigamiPlugin::registerTypes(const char *uri)
 {
-#ifdef KIRIGAMI_BUILD_TYPE_STATIC
-Q_INIT_RESOURCE(kirigami);
-#endif
-
 Q_ASSERT(uri == QLatin1String("org.kde.kirigami"));
 const QString style = QString::fromLatin1(qgetenv("QT_QUICK_CONTROLS_STYLE"));
 
-- 
2.7.4 (Apple Git-66)

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


some patches regarding the preferences mess

2016-08-15 Thread Tomaz Canabrava
This is by no means complete, just a "I'm actually working"
this should improve a few things and break others, so don't merge this yet,
it's mostly a WIP.

It's ~mainly~ finished, I just need to finish *testing* and fixing a couple
of occasional bugs.

Tomaz.
From 9b6b9aaef9ef1b87693bfee832af9432a40af990 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Thu, 11 Aug 2016 11:52:49 -0300
Subject: [PATCH 15/15] Removed a bunch of uneeded includes.

Signed-off-by: Tomaz Canabrava 
---
 desktop-widgets/preferences/preferences_georeference.cpp |  1 -
 desktop-widgets/preferences/preferences_graph.cpp|  1 -
 desktop-widgets/preferences/preferences_language.cpp |  1 -
 desktop-widgets/preferences/preferences_network.cpp  |  1 -
 desktop-widgets/preferences/preferences_units.cpp|  2 --
 desktop-widgets/preferences/preferencesdialog.cpp| 10 +-
 6 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/desktop-widgets/preferences/preferences_georeference.cpp b/desktop-widgets/preferences/preferences_georeference.cpp
index f626b31..dfa841c 100644
--- a/desktop-widgets/preferences/preferences_georeference.cpp
+++ b/desktop-widgets/preferences/preferences_georeference.cpp
@@ -6,7 +6,6 @@
 #include "qt-models/divelocationmodel.h"
 
 #include 
-#include 
 
 PreferencesGeoreference::PreferencesGeoreference() : AbstractPreferencesWidget(tr("Georeference"), QIcon(":/georeference"), 9)
 {
diff --git a/desktop-widgets/preferences/preferences_graph.cpp b/desktop-widgets/preferences/preferences_graph.cpp
index d94eae9..36951ef 100644
--- a/desktop-widgets/preferences/preferences_graph.cpp
+++ b/desktop-widgets/preferences/preferences_graph.cpp
@@ -2,7 +2,6 @@
 #include "ui_preferences_graph.h"
 #include "core/prefs-macros.h"
 #include "core/subsurface-qt/SettingsObjectWrapper.h"
-#include 
 #include 
 
 #include "qt-models/models.h"
diff --git a/desktop-widgets/preferences/preferences_language.cpp b/desktop-widgets/preferences/preferences_language.cpp
index 408b48b..75297a8 100644
--- a/desktop-widgets/preferences/preferences_language.cpp
+++ b/desktop-widgets/preferences/preferences_language.cpp
@@ -4,7 +4,6 @@
 #include "core/subsurface-qt/SettingsObjectWrapper.h"
 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/desktop-widgets/preferences/preferences_network.cpp b/desktop-widgets/preferences/preferences_network.cpp
index 2e0ebbd..68c8a94 100644
--- a/desktop-widgets/preferences/preferences_network.cpp
+++ b/desktop-widgets/preferences/preferences_network.cpp
@@ -6,7 +6,6 @@
 #include "core/cloudstorage.h"
 #include "core/subsurface-qt/SettingsObjectWrapper.h"
 #include 
-#include 
 
 PreferencesNetwork::PreferencesNetwork() : AbstractPreferencesWidget(tr("Network"),QIcon(":network"), 9), ui(new Ui::PreferencesNetwork())
 {
diff --git a/desktop-widgets/preferences/preferences_units.cpp b/desktop-widgets/preferences/preferences_units.cpp
index c62fb1c..aa324ec 100644
--- a/desktop-widgets/preferences/preferences_units.cpp
+++ b/desktop-widgets/preferences/preferences_units.cpp
@@ -4,8 +4,6 @@
 #include "core/qthelper.h"
 #include "core/subsurface-qt/SettingsObjectWrapper.h"
 
-#include 
-
 PreferencesUnits::PreferencesUnits(): AbstractPreferencesWidget(tr("Units"),QIcon(":units"),1), ui(new Ui::PreferencesUnits())
 {
 	ui->setupUi(this);
diff --git a/desktop-widgets/preferences/preferencesdialog.cpp b/desktop-widgets/preferences/preferencesdialog.cpp
index 01d0aac..3b92dff 100644
--- a/desktop-widgets/preferences/preferencesdialog.cpp
+++ b/desktop-widgets/preferences/preferencesdialog.cpp
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 PreferencesDialog* PreferencesDialog::instance()
@@ -34,10 +33,11 @@ PreferencesDialog::PreferencesDialog()
 {
 	loadPreferences(); //TODO: Move this code out of the qthelper.cpp
 
-	QSettings s;
-	s.beginGroup("GeneralSettings");
-	s.setValue("default_directory", system_default_directory());
-	s.endGroup();
+	//FIXME: This looks wrong.
+	//QSettings s;
+	//s.beginGroup("GeneralSettings");
+	//s.setValue("default_directory", system_default_directory());
+	//s.endGroup();
 
 	pagesList = new QListWidget();
 	pagesStack = new QStackedWidget();
-- 
2.9.3

From a3bd31d92f53803c3ce06fdc2d33435d05bfd9d6 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Thu, 11 Aug 2016 11:26:37 -0300
Subject: [PATCH 14/15] Correct usage of  QSettings

Signed-off-by: Tomaz Canabrava 
---
 core/qthelper.cpp | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index b8c9625..5c12d14 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -1597,7 +1597,10 @@ void init_proxy()
 
 QString getUUID()
 {
-	// FIXME: This settings should go somewhere or this is the correct place for it?
+	// This is a correct usage of QSettings,
+	// it's not a setting per se - the user cannot change it
+	// and thus, don't need to be on the prefs structure
+	// and this is the *only* point of a

Re: [PATCH 00/11] Use cylinder index in divedatapoint structure and best mix patches

2016-07-12 Thread Rick Walsh
On 10 Jul 2016 07:19, "Robert Helling"  wrote:
>
> I only have two questions or remarks: What exactly does the MND column
display/mean? It seems, for air it’s always 30m (which, as I understand is
the MND that GUE divers aim for). It seems to me, the meaning is something
like „what would be the MND of this dive if the depth were 30m?“. Is that
impression correct? Shouldn’t it rather show the MND at the max depth? So
it would always be max depth if the gas is air?
>
The MND as I understand and intended is the depth at which the total
partial pressure of narcotic gasses (pN2 + pO2 = 1 - pHe) is equivalent to
that of air at 30m, or whatever the END (equivalent narcotic depth)
preference is.  Like MOD at a particular pO2, it depends on the gasmix, not
what the actual depth of the dive is. For air or any nitrox mix, the MND
will equal the END as there is no helium so all gas in the mix is
considered narcotic.

> My other remark is about the renaming of the „Switch at“ column to „Deco
MOD“. I am not sure it is the best possible name. It suggests (at least to
me) that it is the same as the „Bottom MOD“ column, just for the other max
ppO2 value. But it is not. Its meaning is that the planner changes to that
gas at the given depth. It is initialized with the MOD but when the user
changes it it does not mean that this implicitly changes the gas to adopt
the new MOD, it only tells the planner to switch to that gas at a different
depth. Thus I kind of liked the old name better. But please convince me
otherwise.

You are correct - I don't think I need to convince you otherwise. The
difference is unimportant in a typical case and most efficient deco (and
what I was considering when I renamed the Switch at column), when the diver
will want to switch at the MOD. But if there's a reason to switch
shallower, and that's what a diver chooses, the columns behave differently,
as you point out. One will adjust the fO2 while the other doesn't.

You've convinced me that Deco MOD isn't the best name and the column should
be re-renamed. But the problem with "Switch at" is that it doesn't make
clear that it only applies to deco gas. It should be not too confusing and
not too long. How about "Deco switch depth"?

I might have a chance to send a little patch next week but probably not
before. A tooltip or two would be helpful too. By all means beat me too it,
or suggest an alternative.

> Maybe my problem is also that I am not sure what the most common use case
of a user entering a MOD (for subsurface to figure out the best mix) would
be. Would she expect that to be a bottom gas or a deco gas? Should we try
to be clever about this (e.g. only treat the gas with the lest O2 content
as bottom gas or maybe something else)? Of course, when a software is too
clever it is confusing for the user what it actually does. I don’t know.
>
I only imagined entering the MOD to determine fO2 would be useful for a
bottom mix. I can see the idea could be used in some situations for a deco
gas, but I think this would be less commonly helpful. Making it work would
make things too complicated (coding and ui) in my opinion.

Cheers,

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


Re: patches pushed to master

2016-07-11 Thread Dirk Hohndel
On Sat, Jul 09, 2016 at 10:37:25PM +0200, Axel Richter wrote:
> Am 09.07.2016 um 22:05 schrieb Dirk Hohndel:
> > 
> > Has anyone figured out the new Kirigami stuff?
> 
> Hi Dirk,
> 
> Qt 5.7 and kirigami works for the android build with the following patch:

Could I get this as a proper patch that I can apply? With Signed-off-by:
line and a commit message?

Thanks

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


Re: patches pushed to master

2016-07-09 Thread Robert Helling
Dirk,

> Am 09.07.2016 um 22:05 schrieb Dirk Hohndel :
> 
> Next week Linus and I will be in Tokyo. That may
> actually mean that I'll have at least SOME time to look at Subsurface.

maybe you find time to make new windows binaries available. Then the reporter 
of the time zone issue (in the google forum) could test if it got fixed (I hope 
so).

Thanks
Robert


signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: [PATCH 00/11] Use cylinder index in divedatapoint structure and best mix patches

2016-07-09 Thread Robert Helling
Rick,

> Am 06.07.2016 um 14:40 schrieb Rick Walsh :
> 
> The first patch in this series changes the divedatapoint structure to include 
> the cylinder index instead of the gasmix. This requires a number of changes, 
> but simplifies the planner code overall and makes it easier to manage 
> modifying multiple cylinders without model getting lost. The third patch 
> takes advantage of this and fixes #970 (update cylinder deco MOD when the 
> deco pO2 is changed).
> 
> The remaining patches are reworked from my previous series improving handling 
> of "best mixes", taking into consideration feedback from Robert and Anton.

I still haven’t had the proper time to carefully read through all your patches. 
But since Dirk has them applied, I played around a bit with them and all looks 
very nice.

I only have two questions or remarks: What exactly does the MND column 
display/mean? It seems, for air it’s always 30m (which, as I understand is the 
MND that GUE divers aim for). It seems to me, the meaning is something like 
„what would be the MND of this dive if the depth were 30m?“. Is that impression 
correct? Shouldn’t it rather show the MND at the max depth? So it would always 
be max depth if the gas is air?

My other remark is about the renaming of the „Switch at“ column to „Deco MOD“. 
I am not sure it is the best possible name. It suggests (at least to me) that 
it is the same as the „Bottom MOD“ column, just for the other max ppO2 value. 
But it is not. Its meaning is that the planner changes to that gas at the given 
depth. It is initialized with the MOD but when the user changes it it does not 
mean that this implicitly changes the gas to adopt the new MOD, it only tells 
the planner to switch to that gas at a different depth. Thus I kind of liked 
the old name better. But please convince me otherwise. Maybe my problem is also 
that I am not sure what the most common use case of a user entering a MOD (for 
subsurface to figure out the best mix) would be. Would she expect that to be a 
bottom gas or a deco gas? Should we try to be clever about this (e.g. only 
treat the gas with the lest O2 content as bottom gas or maybe something else)? 
Of course, when a software is too clever it is confusing for the user what it 
actually does. I don’t know.

Best
Robert


signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: patches pushed to master

2016-07-09 Thread Axel Richter

Am 09.07.2016 um 22:05 schrieb Dirk Hohndel:

Quick update... as some may have noticed, I have a new job and the first
two weeks kept me rather busy... so I haven't paid any attention here,
haven't even read the emails.

I know, Linus keeps saying job #1 of a maintainer is to be responsive. So
for the last month or two I have sucked as a maintainer. Guilty as charged.

I'd love to promise that it will be all better now, but that would be
silly because it won't. Next week Linus and I will be in Tokyo. That may
actually mean that I'll have at least SOME time to look at Subsurface. So
if you have patches that I have overlooked, if you have things that you
want my opinion on, now may be a great time to (re-)send those.

The following week we'll be on a liveaboard with no phone or internet.
That means that Subsurface will likely get some critical testing, but of
course it also means another week with the maintainer absent from the
mailing list :-(

Quick request:

Rick / Robert, can you please check that I got everything applied for the
planner changes and that things work as expected?

Anton, do I have all your patches for Android?

Has anyone figured out the new Kirigami stuff?

/D


Hi Dirk,

Qt 5.7 and kirigami works for the android build with the 
following patch:


diff --git a/mobile-widgets/qml/mobile-resources.qrc 
b/mobile-widgets/qml/mobile-resources.qrc

index 6983533..1c56e94 100644

--- a/mobile-widgets/qml/mobile-resources.qrc

+++ b/mobile-widgets/qml/mobile-resources.qrc

@@ -24,7 +24,6 @@

 icons/nocloud.svg

 

 

-kirigami/qmldir

 kirigami/Action.qml

 kirigami/ApplicationWindow.qml

 kirigami/BasicListItem.qml

diff --git a/scripts/mobilecomponents.sh b/scripts/mobilecomponents.sh

index ec1e97f..27c8e7f 100755

--- a/scripts/mobilecomponents.sh

+++ b/scripts/mobilecomponents.sh

@@ -44,13 +44,14 @@ fi

 


 # now copy the components and a couple of icons into plae

 MC=$SRC/subsurface/mobile-widgets/qml/kirigami

-PMMC=kirigami/src/qml

+# PMMC=kirigami/src/qml

+PMMC=kirigami/src/controls

 BREEZE=breeze-icons

 


 rm -rf $MC

 mkdir -p $MC/icons

 cp -R $PMMC/* $MC/

-cp $PMMC/../fallbacktheme/*qml $MC/

+cp -R $PMMC/templates/* $MC/

 


 # fix plugin requirement

 sed -i -e 's/^plugin kirigamiplugin/# plugin kirigamiplugin/' $MC/qmldir


Regards,
Axel.


--


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


patches pushed to master

2016-07-09 Thread Dirk Hohndel
Quick update... as some may have noticed, I have a new job and the first
two weeks kept me rather busy... so I haven't paid any attention here,
haven't even read the emails.

I know, Linus keeps saying job #1 of a maintainer is to be responsive. So
for the last month or two I have sucked as a maintainer. Guilty as charged.

I'd love to promise that it will be all better now, but that would be
silly because it won't. Next week Linus and I will be in Tokyo. That may
actually mean that I'll have at least SOME time to look at Subsurface. So
if you have patches that I have overlooked, if you have things that you
want my opinion on, now may be a great time to (re-)send those.

The following week we'll be on a liveaboard with no phone or internet.
That means that Subsurface will likely get some critical testing, but of
course it also means another week with the maintainer absent from the
mailing list :-(

Quick request:

Rick / Robert, can you please check that I got everything applied for the
planner changes and that things work as expected?

Anton, do I have all your patches for Android?

Has anyone figured out the new Kirigami stuff?

/D



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


[PATCH 0/2] Some initial Suunto EON Steel CCR patches

2016-06-21 Thread Linus Torvalds

The first patch is something I should have sent in long ago, rather than 
always do ad-hoc every single time I want to check new fields from the 
dive computer: add debug support for showing all the dive descriptors.

That patch has no semantic difference, but it means that the download logs 
will now have the decoding information in them, which is really useful 
when there's a new field that shows up due to a new thing happening.

The second patch actually parses the new CCR sample data, and sets the 
dive mode correctly when diving in CCR mode.

It's not complete: I still need to look at how to describe the cylinder 
information (ie which cylinder is Oxygen, which one is diluent, and which 
one is the OC gas), but it gets the basics right, and at least now my 
2-hour "discover CCR" dive download doesn't look like I died at the end 
due to being in deco.

Linus Torvalds (2):
  Suunto EON Steel: add descriptor debugging output
  Initial Suunto EON Steel CCR support

 src/suunto_eonsteel_parser.c | 160 +--
 1 file changed, 140 insertions(+), 20 deletions(-)

-- 
2.9.0.rc1.20.g6326f19

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


[PATCH 0/2] Minor fairly cosmetic patches

2016-05-31 Thread Linus Torvalds

Here are two trivial patches. The first one I've had pending for a 
while and fixes a memory leak (not big, but I happened to notice it when 
running valgrind), and the second one removes the code to ignore surface 
samples at divecomputer import time.

That second one will mean that we'll get the noisy samples from dive 
computers that keep insisting that they are at the surface, but I will 
need the samples to see what would be a better alternative. I suspect we 
can just replace the "don't import surface events" with "don't show 
surface events if one of the samples around it is at the surface", but I 
don't actually know where the surface event trigger is since we don't have 
this data in our history.

Linus

 core/dive.c| 9 -
 core/libdivecomputer.c | 8 
 2 files changed, 8 insertions(+), 9 deletions(-)

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


Re: [PATCHES] 4.5.5

2016-03-23 Thread Dirk Hohndel

> On Mar 23, 2016, at 1:23 PM, Henrik Brautaset Aronsen 
>  wrote:
> 
> On Wed, Mar 23, 2016 at 8:47 AM, Robert Helling  > wrote:
> b) Get rid of the maximum value properly (not by making it ridiculously big 
> but by also deleting it from the .ui file). In any case, what is it good for? 
> Why do we want to prevent the user from doing stupid things? Because we could 
> get crazy values when turning the mouse wheel? And what is an appropriate 
> maximum? 100bar since no sane person would keep a reserve that big? Or 300bar 
> since this is roughly the highest pressure we would ever encounter no matter 
> if it makes sense as a reserve?
> 
> In that case, use 400 or 500 bars.  I've seen 330 bar fills.

And that person would want more than 300 bar of reserve in their tank? Not even 
under GUI+

:-)

/D

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


Re: [PATCHES] 4.5.5

2016-03-23 Thread Henrik Brautaset Aronsen
On Wed, Mar 23, 2016 at 8:47 AM, Robert Helling  wrote:

> b) Get rid of the maximum value properly (not by making it ridiculously
> big but by also deleting it from the .ui file). In any case, what is it
> good for? Why do we want to prevent the user from doing stupid things?
> Because we could get crazy values when turning the mouse wheel? And what is
> an appropriate maximum? 100bar since no sane person would keep a reserve
> that big? Or 300bar since this is roughly the highest pressure we would
> ever encounter no matter if it makes sense as a reserve?
>

In that case, use 400 or 500 bars.  I've seen 330 bar fills.

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


Re: [PATCHES] 4.5.5

2016-03-23 Thread Robert Helling
Dirk,On 23.03.2016, at 15:52, Dirk Hohndel  wrote:Since this was already pushed out, it has to be a second patch that fixesthings. Otherwise this would change a git repository that others havepulled from and pulls wouldn't be 'fast forward' anymore.here you go.From 06af8ecaf41dcbd04e2d0d162c6ed8a1ba221b50 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" 
Date: Wed, 23 Mar 2016 16:59:18 +0100
Subject: [PATCH] When changing units from psi to bar first change value, then
 max
To: subsurface@subsurface-divelog.org

otherwise the max interferes with the value. Furthermore this increases
the max values a bit.

Signed-off-by: Robert C. Helling 
---
 desktop-widgets/diveplanner.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp
index f4c53d7..f84781e 100644
--- a/desktop-widgets/diveplanner.cpp
+++ b/desktop-widgets/diveplanner.cpp
@@ -450,12 +450,12 @@ void PlannerSettingsWidget::settingsChanged()
if(get_units()->pressure == units::BAR) {
ui.reserve_gas->setSuffix(tr("bar"));
ui.reserve_gas->setSingleStep(1);
-   ui.reserve_gas->setMaximum(100);
ui.reserve_gas->setValue(prefs.reserve_gas / 1000);
+   ui.reserve_gas->setMaximum(300);
} else {
ui.reserve_gas->setSuffix(tr("psi"));
ui.reserve_gas->setSingleStep(10);
-   ui.reserve_gas->setMaximum(1500);
+   ui.reserve_gas->setMaximum(5000);
ui.reserve_gas->setValue(mbar_to_PSI(prefs.reserve_gas));
}
 
-- 
2.5.4 (Apple Git-61)

BestRobert

signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: [PATCHES] 4.5.5

2016-03-23 Thread Dirk Hohndel
On Wed, Mar 23, 2016 at 08:47:36AM +0100, Robert Helling wrote:
> 
> you caught me here but your „solution“ actually makes it worse:

Ha.

> The problem is when switching from PSI to bar: You start, say with a value of 
> 580psi (roughly 40bar). Then you change units, this makes the above code 
> execute. Now you reduce the maximum to 100 which changes the value displayed 
> from 580 to 100. This in turn sends a value changed signal. The receiving 
> slots checks units and finds „bar“, and so interprets the 100 as 100bar  and 
> sets the prefs.reserve_gas to 10. And only then the above code is further 
> executed but now thinks 100bar is what the user wants.

Oops. I tested this only in the other direction. And should of course have
tested both directions.

> When I wrote this yesterday, I had (somewhat) reasonable values for the 
> maximum first (after I encountered that there is a maximum, probably coming 
> from the .ui file which is way to low for a psi value). The I ran into the 
> issue I described above. But as you noted, this was around midnight and I was 
> not able to solve this properly. So I just thought „what the heck“ and made 
> the maximum values so big that they did not interfere anymore with reasonably 
> sized reserves. This obviously was a hack of somebody who desperately wanted 
> to go to bed and you caught me.

So I did half of my maintainer job :-)

> What I should have done instead would have been either
> 
> a) Move the setMaximim() call after the setValue() call in the metric branch 
> which avoids the above issue (my thinking was not clear enough to realize 
> this would have been the appropriate thing)

That sounds like a good idea.
> 
> or
> 
> b) Get rid of the maximum value properly (not by making it ridiculously big 
> but by also deleting it from the .ui file). In any case, what is it good for? 
> Why do we want to prevent the user from doing stupid things? Because we could 
> get crazy values when turning the mouse wheel? And what is an appropriate 
> maximum? 100bar since no sane person would keep a reserve that big? Or 300bar 
> since this is roughly the highest pressure we would ever encounter no matter 
> if it makes sense as a reserve?

I think having a maximum there is reasonable. We could make it
300bar/5000psi and be done with it. Who knows, maybe there is GUI++ that
says "never use more than half your tank because an Asteroid could hit the
earth while you are diving".

> Please let me know your preference and I will send a new patch. Do you want 
> one with —amend or a second one on top of your modification?

Since this was already pushed out, it has to be a second patch that fixes
things. Otherwise this would change a git repository that others have
pulled from and pulls wouldn't be 'fast forward' anymore.

/D

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


Re: [PATCHES] 4.5.5

2016-03-23 Thread Robert Helling

> On 23.03.2016, at 00:14, Dirk Hohndel  wrote:
> 
> Thanks, Robert.
> 
> I have a couple of small concerns. Given that it's past midnight in
> Germany, I'll just fix them in your commit
> 
> /D
> 
>> diff --git a/desktop-widgets/diveplanner.cpp 
>> b/desktop-widgets/diveplanner.cpp
>> index e6fe612..32797f0 100644
>> --- a/desktop-widgets/diveplanner.cpp
>> +++ b/desktop-widgets/diveplanner.cpp
>> @@ -448,6 +447,18 @@ void PlannerSettingsWidget::settingsChanged()
>>  ui.bottomSAC->setValue((double) prefs.bottomsac / 1000.0);
>>  ui.decoStopSAC->setValue((double) prefs.decosac / 1000.0);
>>  }
>> +if(get_units()->pressure == units::BAR) {
>> +ui.reserve_gas->setSuffix(tr("bar"));
>> +ui.reserve_gas->setSingleStep(1);
>> +ui.reserve_gas->setMaximum(5000);
> 
> step of 1 makes sense, a maximum of 5000 bar makes no sense. We used to
> allow up to 99bar here - I think we should keep that, or make it an even
> 100.
> 
>> +ui.reserve_gas->setValue(prefs.reserve_gas / 1000);
>> +} else {
>> +ui.reserve_gas->setSuffix(tr("psi"));
>> +ui.reserve_gas->setSingleStep(1);
> 
> Step of 1psi? I don't think so. Let's make that 10.
> 
>> +ui.reserve_gas->setMaximum(5000);
> 
> 5000 psi reserve? How about 1500? Which is similar to the 100bar above.


Dirk,

you caught me here but your „solution“ actually makes it worse:

The problem is when switching from PSI to bar: You start, say with a value of 
580psi (roughly 40bar). Then you change units, this makes the above code 
execute. Now you reduce the maximum to 100 which changes the value displayed 
from 580 to 100. This in turn sends a value changed signal. The receiving slots 
checks units and finds „bar“, and so interprets the 100 as 100bar  and sets the 
prefs.reserve_gas to 10. And only then the above code is further executed 
but now thinks 100bar is what the user wants.

When I wrote this yesterday, I had (somewhat) reasonable values for the maximum 
first (after I encountered that there is a maximum, probably coming from the 
.ui file which is way to low for a psi value). The I ran into the issue I 
described above. But as you noted, this was around midnight and I was not able 
to solve this properly. So I just thought „what the heck“ and made the maximum 
values so big that they did not interfere anymore with reasonably sized 
reserves. This obviously was a hack of somebody who desperately wanted to go to 
bed and you caught me.

What I should have done instead would have been either

a) Move the setMaximim() call after the setValue() call in the metric branch 
which avoids the above issue (my thinking was not clear enough to realize this 
would have been the appropriate thing)

or

b) Get rid of the maximum value properly (not by making it ridiculously big but 
by also deleting it from the .ui file). In any case, what is it good for? Why 
do we want to prevent the user from doing stupid things? Because we could get 
crazy values when turning the mouse wheel? And what is an appropriate maximum? 
100bar since no sane person would keep a reserve that big? Or 300bar since this 
is roughly the highest pressure we would ever encounter no matter if it makes 
sense as a reserve?

Please let me know your preference and I will send a new patch. Do you want one 
with —amend or a second one on top of your modification?

Best
Robert


signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: [PATCHES] Re: 4.5.5

2016-03-22 Thread Dirk Hohndel
Thanks, Robert.

I have a couple of small concerns. Given that it's past midnight in
Germany, I'll just fix them in your commit

/D

> diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp
> index e6fe612..32797f0 100644
> --- a/desktop-widgets/diveplanner.cpp
> +++ b/desktop-widgets/diveplanner.cpp
> @@ -448,6 +447,18 @@ void PlannerSettingsWidget::settingsChanged()
>   ui.bottomSAC->setValue((double) prefs.bottomsac / 1000.0);
>   ui.decoStopSAC->setValue((double) prefs.decosac / 1000.0);
>   }
> + if(get_units()->pressure == units::BAR) {
> + ui.reserve_gas->setSuffix(tr("bar"));
> + ui.reserve_gas->setSingleStep(1);
> + ui.reserve_gas->setMaximum(5000);

step of 1 makes sense, a maximum of 5000 bar makes no sense. We used to
allow up to 99bar here - I think we should keep that, or make it an even
100.

> + ui.reserve_gas->setValue(prefs.reserve_gas / 1000);
> + } else {
> + ui.reserve_gas->setSuffix(tr("psi"));
> + ui.reserve_gas->setSingleStep(1);

Step of 1psi? I don't think so. Let's make that 10.

> + ui.reserve_gas->setMaximum(5000);

5000 psi reserve? How about 1500? Which is similar to the 100bar above.


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


[PATCHES] Re: 4.5.5

2016-03-22 Thread Robert Helling
On 22.03.2016, at 19:45, Robert C. Helling  wrote:Yesterday, I filed two bugs that should easily be fixed: Make the reserve of recreational mode units aware and warn when running as root. here is the patch that fixes the first:From 7727d83b46c6522add245cc05f86eb2295108987 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" 
Date: Tue, 22 Mar 2016 23:44:59 +0100
Subject: [PATCH] Make the reserve gas units aware
To: subsurface@subsurface-divelog.org

In the planner, for recreational mode, there is a setting indicating
the pressure at which the diver should be back at the surface. This
pressure was hardcoded to bar.

Fixes #1027

Signed-off-by: Robert C. Helling 
---
 desktop-widgets/diveplanner.cpp | 13 -
 qt-models/diveplannermodel.cpp  |  5 -
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp
index e6fe612..32797f0 100644
--- a/desktop-widgets/diveplanner.cpp
+++ b/desktop-widgets/diveplanner.cpp
@@ -306,7 +306,6 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget 
*parent, Qt::WindowFlags f)
ui.display_runtime->setChecked(prefs.display_runtime);
ui.display_transitions->setChecked(prefs.display_transitions);
ui.safetystop->setChecked(prefs.safetystop);
-   ui.reserve_gas->setValue(prefs.reserve_gas / 1000);
ui.bottompo2->setValue(prefs.bottompo2 / 1000.0);
ui.decopo2->setValue(prefs.decopo2 / 1000.0);
ui.backgasBreaks->setChecked(prefs.doo2breaks);
@@ -448,6 +447,18 @@ void PlannerSettingsWidget::settingsChanged()
ui.bottomSAC->setValue((double) prefs.bottomsac / 1000.0);
ui.decoStopSAC->setValue((double) prefs.decosac / 1000.0);
}
+   if(get_units()->pressure == units::BAR) {
+   ui.reserve_gas->setSuffix(tr("bar"));
+   ui.reserve_gas->setSingleStep(1);
+   ui.reserve_gas->setMaximum(5000);
+   ui.reserve_gas->setValue(prefs.reserve_gas / 1000);
+   } else {
+   ui.reserve_gas->setSuffix(tr("psi"));
+   ui.reserve_gas->setSingleStep(1);
+   ui.reserve_gas->setMaximum(5000);
+   ui.reserve_gas->setValue(mbar_to_PSI(prefs.reserve_gas));
+   }
+
ui.bottomSAC->blockSignals(false);
ui.decoStopSAC->blockSignals(false);
updateUnitsUI();
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index f7570fd..c3996d0 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -481,7 +481,10 @@ void DivePlannerPointsModel::setSafetyStop(bool value)
 
 void DivePlannerPointsModel::setReserveGas(int reserve)
 {
-   prefs.reserve_gas = reserve * 1000;
+   if (prefs.units.pressure == units::BAR)
+   prefs.reserve_gas = reserve * 1000;
+   else
+   prefs.reserve_gas = psi_to_mbar(reserve);
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS 
- 1));
 }
 
-- 
2.5.4 (Apple Git-61)

While working on this, I found two more problems for which right now I don’t have time to fix them, so I created two tickets.BestRobert

signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: [PATCH] OSX build patches against v4.5-branch

2016-03-19 Thread Dirk Hohndel
On Wed, Mar 16, 2016 at 09:31:44AM +0100, Jeroen Massar wrote:
> 
> These are quite close to the changes I needed for the patches against
> master.
> 
> I did add "user home dir Qt5.5/5.6" detection to this too, just in case
> as we have that in master.

Good idea.

Thanks for doing this against both branches. I did reformat / slightly
rephrase one of the commit messages, otherwise things looked good.

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


[PATCH] OSX build patches against v4.5-branch

2016-03-16 Thread Jeroen Massar
Hola,

These are quite close to the changes I needed for the patches against
master.

I did add "user home dir Qt5.5/5.6" detection to this too, just in case
as we have that in master.

As noted, I'll do full-clean builds coming weekend, but I think this
resolves the biggest chunks of a clean install already.

Greets,
 Jeroen

From 937b2b1fb764ed5df0d0353e1d462dba4ec1a1ca Mon Sep 17 00:00:00 2001
From: Jeroen Massar 
Date: Wed, 16 Mar 2016 08:57:41 +0100
Subject: [PATCH 1/3] Debug reminder: how to get more verbose details out of
 cmake

Signed-off-by: Jeroen Massar 
---
 CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3b78457..7e687c7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,8 @@
 # cmake based build of Subsurface
 
+# Uncomment his to see all commands cmake actually executes
+# set(CMAKE_VERBOSE_MAKEFILE ON)
+
 project(Subsurface)
 cmake_minimum_required(VERSION 2.8.11)
 
-- 
2.7.3

From 6808b3158d80a09a680fcc46c97a85fb5b26bf75 Mon Sep 17 00:00:00 2001
From: Jeroen Massar 
Date: Wed, 16 Mar 2016 09:26:16 +0100
Subject: [PATCH 2/3] Detect user's Qt5.5 + Qt5.6 (as per master) and Homebrew
 qt5 + preserve that path in CMAKE_PREFIX_PATH and pass it along to cmake

Signed-off-by: Jeroen Massar 
---
 scripts/build.sh | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/scripts/build.sh b/scripts/build.sh
index 02bb3a6..73b0601 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -142,7 +142,14 @@ fi
 mkdir -p build
 cd build
 if [ $PLATFORM = Darwin ] ; then
-   export CMAKE_PREFIX_PATH=~/Qt/5.5/clang_64/lib/cmake
+   if [ -d "~/Qt/5.5" ] ; then
+   export CMAKE_PREFIX_PATH=~/Qt/5.5/clang_64/lib/cmake
+   elif [ -d "~/Qt/5.6" ] ; then
+   export CMAKE_PREFIX_PATH=~/Qt/5.6/clang_64/lib/cmake
+   elif [ -d /usr/local/opt/qt5/lib ] ; then
+   # Homebrew location for qt5 package
+   export CMAKE_PREFIX_PATH=/usr/local/opt/qt5/lib/cmake
+   fi
 fi
 cmake -DCMAKE_BUILD_TYPE=Release -DQTONLY=TRUE -DQT5BUILD=ON \
-DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT \
@@ -200,7 +207,7 @@ fi
 cd $SRC/subsurface
 mkdir -p build
 cd build
-export CMAKE_PREFIX_PATH=$INSTALL_ROOT/lib/cmake
+export CMAKE_PREFIX_PATH="$INSTALL_ROOT/lib/cmake;${CMAKE_PREFIX_PATH}"
 cmake -DCMAKE_BUILD_TYPE=Debug .. \
-DLIBGIT2_INCLUDE_DIR=$INSTALL_ROOT/include \
-DLIBGIT2_LIBRARIES=$INSTALL_ROOT/lib/libgit2.$SH_LIB_EXT \
@@ -208,6 +215,7 @@ cmake -DCMAKE_BUILD_TYPE=Debug .. \
-DLIBDIVECOMPUTER_LIBRARIES=$INSTALL_ROOT/lib/libdivecomputer.a \
-DMARBLE_INCLUDE_DIR=$INSTALL_ROOT/include \
-DMARBLE_LIBRARIES=$INSTALL_ROOT/lib/libssrfmarblewidget.$SH_LIB_EXT \
+   -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH \
-DNO_PRINTING=OFF \
-DUSE_LIBGIT23_API=1
 
-- 
2.7.3

From 9464be1ebe0c3c318cc53e8bea1eee3a1a49c692 Mon Sep 17 00:00:00 2001
From: Jeroen Massar 
Date: Wed, 16 Mar 2016 09:28:52 +0100
Subject: [PATCH 3/3] Verify that the Xcode Command Line Tools are installed

Otherwise /usr/include does not exist on a clean-ish install

Signed-off-by: Jeroen Massar 
---
 scripts/build.sh | 12 
 1 file changed, 12 insertions(+)

diff --git a/scripts/build.sh b/scripts/build.sh
index 73b0601..105a214 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -28,6 +28,18 @@ if [[ ! -d "subsurface" ]] ; then
exit 1
 fi
 
+# Verify that the Xcode Command Line Tools are installed
+if [ $PLATFORM = Darwin ] ; then
+   if [ ! -d /usr/include ] ; then
+   echo "Error: Xcode Command Line Tools are not installed"
+   echo ""
+   echo "Please run:"
+   echo " xcode-select --install"
+   echo "to install them (you'll have to agree to Apple's 
licensing terms etc), then run build.sh again"
+   exit 1;
+   fi
+fi
+
 mkdir -p install-root
 INSTALL_ROOT=$SRC/install-root
 
-- 
2.7.3



signature.asc
Description: OpenPGP digital signature
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


[PATCH] 3 tiny OSX build patches (against master)

2016-03-16 Thread Jeroen Massar
Hola,

Noticed that I stated that I did not had a /usr/include, well, that is
correct when one does not have done a 'xcode-select install' and thus
installed the command line tools aha! ;)

Installing that solved quite a bit of the puzzle, hence I've added a
check for that in the third patch. I went for an error, as auto
installing that causes possibly unexpected popups for accepting apple
licenses, thus better to error out at that point.


Find attached three separate tiny patches:
 - [PATCH 1/3] Debug reminder: how to get more verbose details out of
 cmake
 - [PATCH 2/3] Detect Homebrew qt5 + preserve that path in
 CMAKE_PREFIX_PATH and pass it along to cmake
 - [PATCH 3/3] Verify that the Xcode Command Line Tools are installed

If there are any formatting or other general comments, don't hesitate to
fire them back so that I can fix those issues.

I'll test later (likely over the weekend though) on a clean OSX install
to make sure that we have tackled all the possibly missing steps.

Note that my build do not include mysql/postgres support, the build
properly notes that at the end[1]. Also, I only booted the app, did not
do further testing yet, another thing for the weekend.

There are a bunch of other weird build messages that I'll dig in then too.

I'll separate provide these against 4.5, see next mail.

Greets,
 Jeroen

--

[1] "-- two ERRORS here about libmysqlclient and libpq not found are
harmless"
From 0cc6c0d8ec5ce8ba0d34206bb77ec56fd2d656e0 Mon Sep 17 00:00:00 2001
From: Jeroen Massar 
Date: Wed, 16 Mar 2016 08:57:41 +0100
Subject: [PATCH 1/3] Debug reminder: how to get more verbose details out of
 cmake

Signed-off-by: Jeroen Massar 
---
 CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c636d1f..ea6f17e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,8 @@
 # cmake based build of Subsurface
 
+# Uncomment his to see all commands cmake actually executes
+# set(CMAKE_VERBOSE_MAKEFILE ON)
+
 project(Subsurface)
 cmake_minimum_required(VERSION 2.8.11)
 
-- 
2.7.3

From fc6d411fbbbc317d156fe207e9e636017f901840 Mon Sep 17 00:00:00 2001
From: Jeroen Massar 
Date: Wed, 16 Mar 2016 09:00:37 +0100
Subject: [PATCH 2/3] Detect Homebrew qt5 + preserve that path in
 CMAKE_PREFIX_PATH and pass it along to cmake

Signed-off-by: Jeroen Massar 
---
 scripts/build.sh | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/build.sh b/scripts/build.sh
index e4164db..a3cad13 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -144,6 +144,9 @@ if [ $PLATFORM = Darwin ] ; then
export CMAKE_PREFIX_PATH=~/Qt/5.5/clang_64/lib/cmake
elif [ -d "~/Qt/5.6" ] ; then
export CMAKE_PREFIX_PATH=~/Qt/5.6/clang_64/lib/cmake
+   elif [ -d /usr/local/opt/qt5/lib ] ; then
+   # Homebrew location for qt5 package
+   export CMAKE_PREFIX_PATH=/usr/local/opt/qt5/lib/cmake
else
echo "cannot find Qt 5.5 or 5.6 in ~/Qt"
exit 1
@@ -218,7 +221,7 @@ for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do
 
mkdir -p $SRC/subsurface/$BUILDDIR
cd $SRC/subsurface/$BUILDDIR
-   export CMAKE_PREFIX_PATH=$INSTALL_ROOT/lib/cmake
+   export CMAKE_PREFIX_PATH="$INSTALL_ROOT/lib/cmake;${CMAKE_PREFIX_PATH}"
cmake -DCMAKE_BUILD_TYPE=Debug .. \
-DSUBSURFACE_TARGET_EXECUTABLE=$SUBSURFACE_EXECUTABLE \
-DLIBGIT2_INCLUDE_DIR=$INSTALL_ROOT/include \
@@ -227,6 +230,7 @@ for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do
-DLIBDIVECOMPUTER_LIBRARIES=$INSTALL_ROOT/lib/libdivecomputer.a 
\
-DMARBLE_INCLUDE_DIR=$INSTALL_ROOT/include \

-DMARBLE_LIBRARIES=$INSTALL_ROOT/lib/libssrfmarblewidget.$SH_LIB_EXT \
+   -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH \
-DNO_PRINTING=OFF
 
if [ $PLATFORM = Darwin ] ; then
-- 
2.7.3

From e6c0232ed1be9bb36bd079d8f740b9c7862cc502 Mon Sep 17 00:00:00 2001
From: Jeroen Massar 
Date: Wed, 16 Mar 2016 09:02:03 +0100
Subject: [PATCH 3/3] Verify that the Xcode Command Line Tools are installed

Otherwise /usr/include does not exist on a clean-ish install

Signed-off-by: Jeroen Massar 
---
 scripts/build.sh | 12 
 1 file changed, 12 insertions(+)

diff --git a/scripts/build.sh b/scripts/build.sh
index a3cad13..36a91c3 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -23,6 +23,18 @@ exec 1> >(tee build.log) 2>&1
 SRC=$(pwd)
 PLATFORM=$(uname)
 
+# Verify that the Xcode Command Line Tools are installed
+if [ $PLATFORM = Darwin ] ; then
+   if [ ! -d /usr/include ] ; then
+   echo "Error: Xcode Command Line Tools are not installed"
+   echo ""
+   echo "Please run:"
+   echo " xcode-select --install"
+  

more cleanup patches to remove tons of warnings while building for iOS

2016-03-07 Thread Tomaz Canabrava
I hate warnings.


0001-Clean-DiveCartesianAxis.patch
Description: Binary data


0002-Clean-DiveEventItem.patch
Description: Binary data


0003-Clean-DiveProfileItem.patch
Description: Binary data


0004-Clean-Profilewidget2.patch
Description: Binary data


0005-Clean-TankItem.patch
Description: Binary data


0006-clean-QmlManager.patch
Description: Binary data


0007-Clena-cleanerTableModel.patch
Description: Binary data


0008-Clean-CylinderModel.patch
Description: Binary data


0009-Clean-Divecomputerextradatamodel.cpp.patch
Description: Binary data


0010-Clean-divecomputermodel.patch
Description: Binary data


0011-Clean-divelocationmodel.cpp.patch
Description: Binary data


0013-Clean-Diveplannermodel.patch
Description: Binary data


0014-Clean-diveplotdatamodel.cpp.patch
Description: Binary data


0015-clean-GpsListModel.patch
Description: Binary data


0016-Clean-models.cpp.patch
Description: Binary data


0017-Clean-tankinfomodel.patch
Description: Binary data


0018-Clean-treemodel.patch
Description: Binary data


0019-Clean-weightmodel.patch
Description: Binary data


0020-Clean-weightsysteminfomodel.patch
Description: Binary data


0021-Clean-gaspressures.c.patch
Description: Binary data


0012-Clean-divepicturemodel.cpp.patch
Description: Binary data
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


silence-warning patches

2016-03-07 Thread Tomaz Canabrava
we hare more than 1000 warnings while building for iOS
we need to silence those because they are hiding possible real errors
this is the beginning of that work.


0001-Silence-warning-about-unued-parameter.patch
Description: Binary data


0002-Create-a-constructor-with-default-parameters-to-some.patch
Description: Binary data


0003-Silence-warnings-for-the-GpsLocation.patch
Description: Binary data


0004-Simplify-Q_FOREACH.patch
Description: Binary data


0005-Remove-uneeded-variable.patch
Description: Binary data


0006-Clean-some-unused-variables.patch
Description: Binary data


0007-Silence-unused-variable-warnings.patch
Description: Binary data


0008-silence-more-warnings.patch
Description: Binary data


0009-Fix-annoyances-on-file.c.patch
Description: Binary data


0010-Fix-build-for-desktop.patch
Description: Binary data
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: subsurface-ios first patches

2016-03-05 Thread Tomaz Canabrava
icons.

On Sat, Mar 5, 2016 at 8:19 PM, Tomaz Canabrava  wrote:

> forget this last patch, it breaks deployment for some reason.
>
> On Sat, Mar 5, 2016 at 3:57 PM, Tomaz Canabrava 
> wrote:
>
>> this cleans the CMakeLists file (it reverts to master) and removes some
>> noise on the dumb project for iOS.
>>
>>
>> On Sat, Mar 5, 2016 at 2:01 PM, Tomaz Canabrava 
>> wrote:
>>
>>>
>>>
>>> On Sat, Mar 5, 2016 at 1:50 PM, Dirk Hohndel  wrote:
>>>
>>>> Sadly the patches are base64 encoded (typical Mac issue) and I can't
>>>> easily quote them in there.
>>>>
>>>> A few comments:
>>>>
>>>> If you don't use cmake, why patches to the CMakeLists.txt file? That
>>>> seems
>>>> to make no sense (oh, and it's whitespace damaged, too)
>>>> There are also changes to the CMakeLists.txt files in subdirectories.
>>>>
>>>> subsurface-ios/Mainform.ui.qml
>>>> subsurface-ios/main.qml
>>>> subsurface-ios/qml.qrc
>>>>
>>>> What is that used for?
>>>>
>>>
>>> Forgot to clean. Will send a new patch in a bit, sorry for the noise.
>>> The CMake was part of the squash (I forgot about it, but I think I can
>>> easily checkout the CMake from master)
>>>
>>>
>>>>
>>>>
>>>> The include file cleanups could easily be their own patch I think.
>>>>
>>>
>>>
>>>
>>>>
>>>> /D
>>>>
>>>
>>>
>>
>


0003-Fix-loading-icons-on-ios.patch
Description: Binary data
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: subsurface-ios first patches

2016-03-05 Thread Tomaz Canabrava
forget this last patch, it breaks deployment for some reason.

On Sat, Mar 5, 2016 at 3:57 PM, Tomaz Canabrava  wrote:

> this cleans the CMakeLists file (it reverts to master) and removes some
> noise on the dumb project for iOS.
>
>
> On Sat, Mar 5, 2016 at 2:01 PM, Tomaz Canabrava 
> wrote:
>
>>
>>
>> On Sat, Mar 5, 2016 at 1:50 PM, Dirk Hohndel  wrote:
>>
>>> Sadly the patches are base64 encoded (typical Mac issue) and I can't
>>> easily quote them in there.
>>>
>>> A few comments:
>>>
>>> If you don't use cmake, why patches to the CMakeLists.txt file? That
>>> seems
>>> to make no sense (oh, and it's whitespace damaged, too)
>>> There are also changes to the CMakeLists.txt files in subdirectories.
>>>
>>> subsurface-ios/Mainform.ui.qml
>>> subsurface-ios/main.qml
>>> subsurface-ios/qml.qrc
>>>
>>> What is that used for?
>>>
>>
>> Forgot to clean. Will send a new patch in a bit, sorry for the noise.
>> The CMake was part of the squash (I forgot about it, but I think I can
>> easily checkout the CMake from master)
>>
>>
>>>
>>>
>>> The include file cleanups could easily be their own patch I think.
>>>
>>
>>
>>
>>>
>>> /D
>>>
>>
>>
>
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: subsurface-ios first patches

2016-03-05 Thread Tomaz Canabrava
this cleans the CMakeLists file (it reverts to master) and removes some
noise on the dumb project for iOS.


On Sat, Mar 5, 2016 at 2:01 PM, Tomaz Canabrava  wrote:

>
>
> On Sat, Mar 5, 2016 at 1:50 PM, Dirk Hohndel  wrote:
>
>> Sadly the patches are base64 encoded (typical Mac issue) and I can't
>> easily quote them in there.
>>
>> A few comments:
>>
>> If you don't use cmake, why patches to the CMakeLists.txt file? That seems
>> to make no sense (oh, and it's whitespace damaged, too)
>> There are also changes to the CMakeLists.txt files in subdirectories.
>>
>> subsurface-ios/Mainform.ui.qml
>> subsurface-ios/main.qml
>> subsurface-ios/qml.qrc
>>
>> What is that used for?
>>
>
> Forgot to clean. Will send a new patch in a bit, sorry for the noise.
> The CMake was part of the squash (I forgot about it, but I think I can
> easily checkout the CMake from master)
>
>
>>
>>
>> The include file cleanups could easily be their own patch I think.
>>
>
>
>
>>
>> /D
>>
>
>


0003-Remove-leftovers-from-the-other-trials-for-iOS-build.patch
Description: Binary data
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: subsurface-ios first patches

2016-03-05 Thread Tomaz Canabrava
On Sat, Mar 5, 2016 at 1:50 PM, Dirk Hohndel  wrote:

> Sadly the patches are base64 encoded (typical Mac issue) and I can't
> easily quote them in there.
>
> A few comments:
>
> If you don't use cmake, why patches to the CMakeLists.txt file? That seems
> to make no sense (oh, and it's whitespace damaged, too)
> There are also changes to the CMakeLists.txt files in subdirectories.
>
> subsurface-ios/Mainform.ui.qml
> subsurface-ios/main.qml
> subsurface-ios/qml.qrc
>
> What is that used for?
>

Forgot to clean. Will send a new patch in a bit, sorry for the noise.
The CMake was part of the squash (I forgot about it, but I think I can
easily checkout the CMake from master)


>
>
> The include file cleanups could easily be their own patch I think.
>



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


Re: subsurface-ios first patches

2016-03-05 Thread Dirk Hohndel
Sadly the patches are base64 encoded (typical Mac issue) and I can't
easily quote them in there.

A few comments:

If you don't use cmake, why patches to the CMakeLists.txt file? That seems
to make no sense (oh, and it's whitespace damaged, too)
There are also changes to the CMakeLists.txt files in subdirectories.

subsurface-ios/Mainform.ui.qml
subsurface-ios/main.qml
subsurface-ios/qml.qrc

What is that used for?


The include file cleanups could easily be their own patch I think.

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


Re: subsurface-ios first patches

2016-03-05 Thread Tomaz Canabrava
On Sat, Mar 5, 2016 at 1:43 PM, Dirk Hohndel  wrote:

> On Sat, Mar 05, 2016 at 01:27:44PM -0300, Tomaz Canabrava wrote:
> > people:
> >
> > This will work only with Qt 5.6 for now, so don't even try with 5.5
> > the prerequisites should be build for x86_64 bits, and qt 5.5 is build
> for
> > 32 bits, giving tons of erros.
> >
> > I tested the desktop build, it works
> > android build also works,
> > ios builds are currently "meh", they open but don't do much besides that.
>
> The irony of going back to qmake. Giggle.
>
> That said - why does the first mega patch show up as authored by me?
>

Don't know, lack of sleep and misusage of the rebase?


>
> And what the heck does this do in the second patch?
>
> +set(LIBSS2_VERSION ${LIBSSH2_VERSION})
>

"if the libssh2 is from 1.7.0 or greater, dont't touch it"
because after that line I do
"if the libssh2 is from 1.6.0 or greater, change to libssh2::libssh2"

it seems that the libssh2 guys likes to change how they are found by cmake.


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


Re: subsurface-ios first patches

2016-03-05 Thread Dirk Hohndel
On Sat, Mar 05, 2016 at 01:27:44PM -0300, Tomaz Canabrava wrote:
> people:
> 
> This will work only with Qt 5.6 for now, so don't even try with 5.5
> the prerequisites should be build for x86_64 bits, and qt 5.5 is build for
> 32 bits, giving tons of erros.
> 
> I tested the desktop build, it works
> android build also works,
> ios builds are currently "meh", they open but don't do much besides that.

The irony of going back to qmake. Giggle.

That said - why does the first mega patch show up as authored by me?

And what the heck does this do in the second patch?

+set(LIBSS2_VERSION ${LIBSSH2_VERSION})

?

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


subsurface-ios first patches

2016-03-05 Thread Tomaz Canabrava
people:

This will work only with Qt 5.6 for now, so don't even try with 5.5
the prerequisites should be build for x86_64 bits, and qt 5.5 is build for
32 bits, giving tons of erros.

I tested the desktop build, it works
android build also works,
ios builds are currently "meh", they open but don't do much besides that.

much love. <3
Tomaz


0001-ios-emulator.patch
Description: Binary data


0002-Added-code-to-handle-libssh-1.7.0.patch
Description: Binary data
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


[PATCH] 2 Android related build patches

2016-02-02 Thread Jan Mulder

Attached 2 Android related build patches.

Subject: [PATCH 1/2] Build Android mobile app against latest OpenSSL

No reasons not to upgrade to the latest OpenSSL lib. The currently used
1.0.1 branch is ending end of 2016, so a switch to 1.0.2 is useful
anyway.

Signed-off-by: Jan Mulder 
---
 packaging/android/build.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packaging/android/build.sh b/packaging/android/build.sh
index 2f03d4e..d9d9251 100644
--- a/packaging/android/build.sh
+++ b/packaging/android/build.sh
@@ -38,7 +38,7 @@ LIBZIP_VERSION=0.11.2
 LIBGIT2_VERSION=0.23.4
 LIBSSH2_VERSION=1.6.0
 LIBUSB_VERSION=1.0.19
-OPENSSL_VERSION=1.0.1p
+OPENSSL_VERSION=1.0.2f
 LIBFTDI_VERSION=1.2
 
 # arm or x86

--

Subject: [PATCH 2/2] Simplify building of Android build from one source tree

Currently, when running the packaging/android/build.sh from a source
tree that has been used for desktop builds, libdivecomputer wants a
make distclean. This is inconvinient, and is caused by building
libdivecomputer in source. Now, configure and build libdivecomputer
in a new subdirectory, allowing to run the android build script
from the same source tree as the desktop (both desktop and mobile)
builds.

Signed-off-by: Jan Mulder 
---
 scripts/build.sh | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/scripts/build.sh b/scripts/build.sh
index b313cec..79264b0 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -109,10 +109,14 @@ if ! git checkout Subsurface-branch ; then
echo "can't check out the Subsurface-branch branch of libdivecomputer -- 
giving up"
exit 1
 fi
-if [ ! -f configure ] ; then
-   autoreconf --install
+
+mkdir -p build
+cd build
+
+if [ ! -f ../configure ] ; then
+   autoreconf --install ..
 fi
-./configure --prefix=$INSTALL_ROOT
+../configure --prefix=$INSTALL_ROOT
 make -j4
 make install
 
--





>From f8098c4feacb7b80dc3a77e2d9cf2cb2b6e2af49 Mon Sep 17 00:00:00 2001
From: Jan Mulder 
Date: Tue, 2 Feb 2016 10:17:51 +0100
Subject: [PATCH 2/2] Simplify building of Android build from one source tree

Currently, when running the packaging/android/build.sh from a source
tree that has been used for desktop builds, libdivecomputer wants a
make distclean. This is inconvinient, and is caused by building
libdivecomputer in source. Now, configure and build libdivecomputer
in a new subdirectory, allowing to run the android build script
from the same source tree as the desktop (both desktop and mobile)
builds.

Signed-off-by: Jan Mulder 
---
 scripts/build.sh | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/scripts/build.sh b/scripts/build.sh
index b313cec..79264b0 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -109,10 +109,14 @@ if ! git checkout Subsurface-branch ; then
 	echo "can't check out the Subsurface-branch branch of libdivecomputer -- giving up"
 	exit 1
 fi
-if [ ! -f configure ] ; then
-	autoreconf --install
+
+mkdir -p build
+cd build
+
+if [ ! -f ../configure ] ; then
+	autoreconf --install ..
 fi
-./configure --prefix=$INSTALL_ROOT
+../configure --prefix=$INSTALL_ROOT
 make -j4
 make install
 
-- 
2.7.0

>From be38aad1699db565a3f808fadf5cb9297ec71935 Mon Sep 17 00:00:00 2001
From: Jan Mulder 
Date: Tue, 2 Feb 2016 10:11:02 +0100
Subject: [PATCH 1/2] Build Android mobile app against latest OpenSSL

No reasons not to upgrade to the latest OpenSSL lib. The currently used
1.0.1 branch is ending end of 2016, so a switch to 1.0.2 is useful
anyway.

Signed-off-by: Jan Mulder 
---
 packaging/android/build.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packaging/android/build.sh b/packaging/android/build.sh
index 2f03d4e..d9d9251 100644
--- a/packaging/android/build.sh
+++ b/packaging/android/build.sh
@@ -38,7 +38,7 @@ LIBZIP_VERSION=0.11.2
 LIBGIT2_VERSION=0.23.4
 LIBSSH2_VERSION=1.6.0
 LIBUSB_VERSION=1.0.19
-OPENSSL_VERSION=1.0.1p
+OPENSSL_VERSION=1.0.2f
 LIBFTDI_VERSION=1.2
 
 # arm or x86
-- 
2.7.0

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


Re: [PATCHES] Three patches for image handling

2016-01-10 Thread Dirk Hohndel
On Sat, Jan 09, 2016 at 04:39:34PM +0100, Robert Helling wrote:
> 
> Hi,
> 
> I started into the image loading logic. The first patch just simplifies the 
> logic a bit, the second add an attempt if we do not find the image locally to 
> download it from the cloud server (the URL being currently 
> https://cloud.subsurface-divelog.org/images/HASHVALUE). The last patch adds 
> the possibility to upload images to that server: When we successfully loaded 
> a local file we check if the cloud server knows about an image with that hash 
> and if not uploads it via the  HTTP PUT method.
> 
> Nothing so far has been implemented on the server side. So this is totally 
> untested. These patches should not break anything but being conservative, 
> they might be considered a RFC.

I took the first two. Before I take the third one I want to spend a little
more time thinking about how I would like this to work on the backend...

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


Re: Patches regarding subsurface-mobile

2016-01-08 Thread Tomaz Canabrava
On Fri, Jan 8, 2016 at 1:22 PM, Lubomir I. Ivanov 
wrote:

> On 8 January 2016 at 17:10, Tomaz Canabrava  wrote:
> >
> >
> > On Fri, Jan 8, 2016 at 1:04 PM, Lubomir I. Ivanov 
> > wrote:
> >>
> >> On 8 January 2016 at 17:02, Tomaz Canabrava  wrote:
> >> >
> >> >
> >> > On Fri, Jan 8, 2016 at 1:00 PM, Lubomir I. Ivanov <
> neolit...@gmail.com>
> >> > wrote:
> >> >>
> >> >> On 8 January 2016 at 16:48, Tomaz Canabrava 
> wrote:
> >> >> > Dirk asked for a reworked set of patches, here they are.
> >> >>
> >> >> + Q_PROPERTY(QStringList weights READ weights CONSTANT)
> >> >> + Q_PROPERTY(QStringList cylinders READ cylinders CONSTANT)
> >> >>
> >> >> is it still possible to get cylinder0 - cylinderN and
> >> >> wieght0...weigthN as Grantlee variables?
> >> >
> >> >
> >> > I tested the grantlee printings and didn't found anything wrong, I may
> >> > have
> >> > missed something,
> >> > but I think it supports it.
> >> >
> >>
> >> i'm asking because, i don't see the support for the xxx0-N variables,
> >> which is even documented, but mind that these are not used in the
> >> bundled templates.
> >> if these are broken then the patches cause a regression.
> >
> >
> > well - I'll ask to apply the patches anyhow, and I'll create a test
> template
> > to test for cylinder / weigths 0-8
> > I do belive it works because
> http://www.grantlee.org/apidox/for_app_dev.html
> > shows some support for lists, and QStringList is just a typedef for
> > QList
> >
>
> ok,
>
> basically these:
> -else _RETURN_DIVE_PROPERTY_IDX(cylinder, 0);
> -else _RETURN_DIVE_PROPERTY_IDX(cylinder, 1);
> -else _RETURN_DIVE_PROPERTY_IDX(cylinder, 2);
> -else _RETURN_DIVE_PROPERTY_IDX(cylinder, 3);
> -else _RETURN_DIVE_PROPERTY_IDX(cylinder, 4);
> -else _RETURN_DIVE_PROPERTY_IDX(cylinder, 5);
> -else _RETURN_DIVE_PROPERTY_IDX(cylinder, 6);
> -else _RETURN_DIVE_PROPERTY_IDX(cylinder, 7);
> 
> -else _RETURN_DIVE_PROPERTY_IDX(weight, 0);
> -else _RETURN_DIVE_PROPERTY_IDX(weight, 1);
> -else _RETURN_DIVE_PROPERTY_IDX(weight, 2);
> -else _RETURN_DIVE_PROPERTY_IDX(weight, 3);
> -else _RETURN_DIVE_PROPERTY_IDX(weight, 4);
> -else _RETURN_DIVE_PROPERTY_IDX(weight, 5);
>
> called these methods:
>
> Object.cylinder(0-7)
> Object.weight(0-5)
>
> and the "if...then...else" thing was certainly cumbersome.
>
> i don't see a property (Q_PROPERTY) for weight0 for instance and i'm
> not sure how that would work.
> the direct QStringList exposure from Grantlee HTML is a mystery to me
> (e.g. is that a weights[0]?).
>

it is.


>
> if you modify the variables in any way let me know so that i can
> update the docs.
>

okay, will test here and say what I found out.

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


Re: Patches regarding subsurface-mobile

2016-01-08 Thread Lubomir I. Ivanov
On 8 January 2016 at 17:10, Tomaz Canabrava  wrote:
>
>
> On Fri, Jan 8, 2016 at 1:04 PM, Lubomir I. Ivanov 
> wrote:
>>
>> On 8 January 2016 at 17:02, Tomaz Canabrava  wrote:
>> >
>> >
>> > On Fri, Jan 8, 2016 at 1:00 PM, Lubomir I. Ivanov 
>> > wrote:
>> >>
>> >> On 8 January 2016 at 16:48, Tomaz Canabrava  wrote:
>> >> > Dirk asked for a reworked set of patches, here they are.
>> >>
>> >> + Q_PROPERTY(QStringList weights READ weights CONSTANT)
>> >> + Q_PROPERTY(QStringList cylinders READ cylinders CONSTANT)
>> >>
>> >> is it still possible to get cylinder0 - cylinderN and
>> >> wieght0...weigthN as Grantlee variables?
>> >
>> >
>> > I tested the grantlee printings and didn't found anything wrong, I may
>> > have
>> > missed something,
>> > but I think it supports it.
>> >
>>
>> i'm asking because, i don't see the support for the xxx0-N variables,
>> which is even documented, but mind that these are not used in the
>> bundled templates.
>> if these are broken then the patches cause a regression.
>
>
> well - I'll ask to apply the patches anyhow, and I'll create a test template
> to test for cylinder / weigths 0-8
> I do belive it works because http://www.grantlee.org/apidox/for_app_dev.html
> shows some support for lists, and QStringList is just a typedef for
> QList
>

ok,

basically these:
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 0);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 1);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 2);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 3);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 4);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 5);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 6);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 7);

-else _RETURN_DIVE_PROPERTY_IDX(weight, 0);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 1);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 2);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 3);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 4);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 5);

called these methods:

Object.cylinder(0-7)
Object.weight(0-5)

and the "if...then...else" thing was certainly cumbersome.

i don't see a property (Q_PROPERTY) for weight0 for instance and i'm
not sure how that would work.
the direct QStringList exposure from Grantlee HTML is a mystery to me
(e.g. is that a weights[0]?).

if you modify the variables in any way let me know so that i can
update the docs.

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


Re: Patches regarding subsurface-mobile

2016-01-08 Thread Tomaz Canabrava
On Fri, Jan 8, 2016 at 1:04 PM, Lubomir I. Ivanov 
wrote:

> On 8 January 2016 at 17:02, Tomaz Canabrava  wrote:
> >
> >
> > On Fri, Jan 8, 2016 at 1:00 PM, Lubomir I. Ivanov 
> > wrote:
> >>
> >> On 8 January 2016 at 16:48, Tomaz Canabrava  wrote:
> >> > Dirk asked for a reworked set of patches, here they are.
> >>
> >> + Q_PROPERTY(QStringList weights READ weights CONSTANT)
> >> + Q_PROPERTY(QStringList cylinders READ cylinders CONSTANT)
> >>
> >> is it still possible to get cylinder0 - cylinderN and
> >> wieght0...weigthN as Grantlee variables?
> >
> >
> > I tested the grantlee printings and didn't found anything wrong, I may
> have
> > missed something,
> > but I think it supports it.
> >
>
> i'm asking because, i don't see the support for the xxx0-N variables,
> which is even documented, but mind that these are not used in the
> bundled templates.
> if these are broken then the patches cause a regression.
>

well - I'll ask to apply the patches anyhow, and I'll create a test
template to test for cylinder / weigths 0-8
I do belive it works because http://www.grantlee.org/apidox/for_app_dev.html
shows some support for lists, and QStringList is just a typedef for
QList



>
> good direction with the refactoring, though.
>
> lubomir
> --
>
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Patches regarding subsurface-mobile

2016-01-08 Thread Lubomir I. Ivanov
On 8 January 2016 at 17:02, Tomaz Canabrava  wrote:
>
>
> On Fri, Jan 8, 2016 at 1:00 PM, Lubomir I. Ivanov 
> wrote:
>>
>> On 8 January 2016 at 16:48, Tomaz Canabrava  wrote:
>> > Dirk asked for a reworked set of patches, here they are.
>>
>> + Q_PROPERTY(QStringList weights READ weights CONSTANT)
>> + Q_PROPERTY(QStringList cylinders READ cylinders CONSTANT)
>>
>> is it still possible to get cylinder0 - cylinderN and
>> wieght0...weigthN as Grantlee variables?
>
>
> I tested the grantlee printings and didn't found anything wrong, I may have
> missed something,
> but I think it supports it.
>

i'm asking because, i don't see the support for the xxx0-N variables,
which is even documented, but mind that these are not used in the
bundled templates.
if these are broken then the patches cause a regression.

good direction with the refactoring, though.

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


Re: Patches regarding subsurface-mobile

2016-01-08 Thread Tomaz Canabrava
On Fri, Jan 8, 2016 at 1:00 PM, Lubomir I. Ivanov 
wrote:

> On 8 January 2016 at 16:48, Tomaz Canabrava  wrote:
> > Dirk asked for a reworked set of patches, here they are.
>
> + Q_PROPERTY(QStringList weights READ weights CONSTANT)
> + Q_PROPERTY(QStringList cylinders READ cylinders CONSTANT)
>
> is it still possible to get cylinder0 - cylinderN and
> wieght0...weigthN as Grantlee variables?
>

I tested the grantlee printings and didn't found anything wrong, I may have
missed something,
but I think it supports it.


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


Re: Patches regarding subsurface-mobile

2016-01-08 Thread Lubomir I. Ivanov
On 8 January 2016 at 16:48, Tomaz Canabrava  wrote:
> Dirk asked for a reworked set of patches, here they are.

+ Q_PROPERTY(QStringList weights READ weights CONSTANT)
+ Q_PROPERTY(QStringList cylinders READ cylinders CONSTANT)

is it still possible to get cylinder0 - cylinderN and
wieght0...weigthN as Grantlee variables?

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


Re: Patches regarding subsurface-mobile

2016-01-08 Thread Tomaz Canabrava
Dirk asked for a reworked set of patches, here they are.

around 200 lines removed by using QObject properties in a single class, yey.



On Thu, Jan 7, 2016 at 7:53 PM, Tomaz Canabrava  wrote:

> I'm trying to cleanup how we interact from QML to C++
> those patches are cleaning a bunch of code and makign sure things continue
> working as they should.
>
> Mostly:
> - Clean the DiveListModel to only give what we need (the Dive)
> - Move a bit of things around
> - Remove unecessary methods / calls
> - speed up the printing dialog (by lazy loading a QPrinter)
>
> I also wanna merge the DiveListModel with the DiveTripModel in the near
> future, we don't need two different models that does the same thing, but
> that will be a tiny more complex.
>
> Tomaz
>
From 1ec0903fc9bbdd2ff862d37dd23ecfebedcc4e5f Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Fri, 8 Jan 2016 11:59:34 -0200
Subject: [PATCH 5/5] Removed grantlee template code to deal with non-Qobject

Since we alreday have a Q_PROPERTY on the DiveObjectHelper,
grantlee introspection can use that directly to access it's
data, so there's no need for us to redeclare everything.

More QObject Introspection, Less handmade boilerplate for
Grantlee, QML, and a few other things.

Signed-off-by: Tomaz Canabrava 
---
 desktop-widgets/templatelayout.h | 54 
 1 file changed, 54 deletions(-)

diff --git a/desktop-widgets/templatelayout.h b/desktop-widgets/templatelayout.h
index 6f4478a..9e420f3 100644
--- a/desktop-widgets/templatelayout.h
+++ b/desktop-widgets/templatelayout.h
@@ -49,60 +49,6 @@ Q_DECLARE_METATYPE(template_options)
 Q_DECLARE_METATYPE(print_options)
 Q_DECLARE_METATYPE(YearInfo)
 
-#define _CONC_STR(prop, idx)   _CONC_STR1(prop, idx)
-#define _CONC_STR1(prop, idx)  _CONC_STR2(prop ## idx)
-#define _CONC_STR2(prop)   #prop
-
-#define _RETURN_DIVE_PROPERTY(prop) \
-	if (property == #prop) return object.prop()
-
-#define _RETURN_DIVE_PROPERTY_IDX(prop, idx) \
-	if (property == _CONC_STR(prop, idx)) return object.prop(idx)
-
-GRANTLEE_BEGIN_LOOKUP(DiveObjectHelper)
-_RETURN_DIVE_PROPERTY(number);
-else _RETURN_DIVE_PROPERTY(id);
-else _RETURN_DIVE_PROPERTY(date);
-else _RETURN_DIVE_PROPERTY(time);
-else _RETURN_DIVE_PROPERTY(location);
-else _RETURN_DIVE_PROPERTY(duration);
-else _RETURN_DIVE_PROPERTY(depth);
-else _RETURN_DIVE_PROPERTY(buddy);
-else _RETURN_DIVE_PROPERTY(divemaster);
-else _RETURN_DIVE_PROPERTY(airTemp);
-else _RETURN_DIVE_PROPERTY(waterTemp);
-else _RETURN_DIVE_PROPERTY(notes);
-else _RETURN_DIVE_PROPERTY(rating);
-else _RETURN_DIVE_PROPERTY(sac);
-else _RETURN_DIVE_PROPERTY(tags);
-else _RETURN_DIVE_PROPERTY(gas);
-else _RETURN_DIVE_PROPERTY(suit);
-else _RETURN_DIVE_PROPERTY(cylinders);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 0);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 1);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 2);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 3);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 4);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 5);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 6);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 7);
-else _RETURN_DIVE_PROPERTY(weights);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 0);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 1);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 2);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 3);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 4);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 5);
-else _RETURN_DIVE_PROPERTY(maxcns);
-else _RETURN_DIVE_PROPERTY(otu);
-GRANTLEE_END_LOOKUP
-
-#undef _RETURN_DIVE_PROPERTY
-#undef _RETURN_DIVE_PROPERTY_IDX
-#undef _CONC_STR
-#undef _CONC_STR1
-#undef _CONC_STR2
-
 GRANTLEE_BEGIN_LOOKUP(template_options)
 if (property == "font") {
 	switch (object.font_index) {
-- 
2.7.0

From 0d3bd02bd47a77ee51fc50cf237825efb9b48767 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Thu, 7 Jan 2016 19:33:58 -0200
Subject: [PATCH 4/5] Lazy Initialize QPrinter

it was taking 3 - 4 segs here to open the print dialog,
first I tougth it was a bug in our side, but it looks like
it's a Qt bug, and by lazy initializing it we don't actually
solve this, since it will still take 3 - 4 segs for the printer
to start, but the dialog will appear much quicker.

Signed-off-by: Tomaz Canabrava 
---
 desktop-widgets/printdialog.cpp | 32 +---
 desktop-widgets/printdialog.h   |  4 +++-
 2 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/desktop-widgets/printdialog.cpp b/desktop-widgets/printdialog.cpp
index cf08062..d10e679 100644
--- a/desktop-widgets/printdialog.cpp
+++ b/desktop-widgets/printdialog.cpp
@@ -14,7 +14,10 @@
 
 template_options::color_palette_struct ssrf_colors, almond_colors, blueshades_colors, custom_colors;
 
-PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f)
+PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) :
+	QDialog(parent, f),
+	print

Patches regarding subsurface-mobile

2016-01-07 Thread Tomaz Canabrava
I'm trying to cleanup how we interact from QML to C++
those patches are cleaning a bunch of code and makign sure things continue
working as they should.

Mostly:
- Clean the DiveListModel to only give what we need (the Dive)
- Move a bit of things around
- Remove unecessary methods / calls
- speed up the printing dialog (by lazy loading a QPrinter)

I also wanna merge the DiveListModel with the DiveTripModel in the near
future, we don't need two different models that does the same thing, but
that will be a tiny more complex.

Tomaz
From 340d1aaca5f379a8c55b0387de39517439c85233 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Thu, 7 Jan 2016 19:33:58 -0200
Subject: [PATCH 9/9] Lazy Initialize QPrinter

it was taking 3 - 4 segs here to open the print dialog,
first I tougth it was a bug in our side, but it looks like
it's a Qt bug, and by lazy initializing it we don't actually
solve this, since it will still take 3 - 4 segs for the printer
to start, but the dialog will appear much quicker.

Signed-off-by: Tomaz Canabrava 
---
 desktop-widgets/printdialog.cpp | 32 +---
 desktop-widgets/printdialog.h   |  4 +++-
 2 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/desktop-widgets/printdialog.cpp b/desktop-widgets/printdialog.cpp
index cf08062..d10e679 100644
--- a/desktop-widgets/printdialog.cpp
+++ b/desktop-widgets/printdialog.cpp
@@ -14,7 +14,10 @@
 
 template_options::color_palette_struct ssrf_colors, almond_colors, blueshades_colors, custom_colors;
 
-PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f)
+PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) :
+	QDialog(parent, f),
+	printer(NULL),
+	qprinter(NULL)
 {
 	// initialize const colors
 	ssrf_colors.color1 = QColor::fromRgb(0xff, 0xff, 0xff);
@@ -57,7 +60,6 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f
 		printOptions.color_selected = s.value("color_selected").toBool();
 		printOptions.landscape = s.value("landscape").toBool();
 		printOptions.p_template = s.value("template_selected").toString();
-		qprinter.setOrientation((QPrinter::Orientation)printOptions.landscape);
 		templateOptions.font_index = s.value("font").toInt();
 		templateOptions.font_size = s.value("font_size").toDouble();
 		templateOptions.color_palette_index = s.value("color_palette").toInt();
@@ -95,9 +97,6 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f
 	// create a print options object and pass our options struct
 	optionsWidget = new PrintOptions(this, &printOptions, &templateOptions);
 
-	// create a new printer object
-	printer = new Printer(&qprinter, &printOptions, &templateOptions, Printer::PRINT);
-
 	QVBoxLayout *layout = new QVBoxLayout(this);
 	setLayout(layout);
 
@@ -140,6 +139,12 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f
 	connect(this, SIGNAL(finished(int)), this, SLOT(onFinished()));
 }
 
+PrintDialog::~PrintDialog()
+{
+	delete qprinter;
+	delete printer;
+}
+
 void PrintDialog::onFinished()
 {
 	QSettings s;
@@ -165,9 +170,20 @@ void PrintDialog::onFinished()
 	s.setValue("custom_color_5", custom_colors.color5.name());
 }
 
+void PrintDialog::createPrinterObj()
+{
+	// create a new printer object
+	if (!printer) {
+		qprinter = new QPrinter();
+		qprinter->setOrientation((QPrinter::Orientation)printOptions.landscape);
+		printer = new Printer(qprinter, &printOptions, &templateOptions, Printer::PRINT);
+	}
+}
+
 void PrintDialog::previewClicked(void)
 {
-	QPrintPreviewDialog previewDialog(&qprinter, this, Qt::Window
+	createPrinterObj();
+	QPrintPreviewDialog previewDialog(qprinter, this, Qt::Window
 		| Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint
 		| Qt::WindowTitleHint);
 	connect(&previewDialog, SIGNAL(paintRequested(QPrinter *)), this, SLOT(onPaintRequested(QPrinter *)));
@@ -176,7 +192,8 @@ void PrintDialog::previewClicked(void)
 
 void PrintDialog::printClicked(void)
 {
-	QPrintDialog printDialog(&qprinter, this);
+	createPrinterObj();
+	QPrintDialog printDialog(qprinter, this);
 	if (printDialog.exec() == QDialog::Accepted) {
 		connect(printer, SIGNAL(progessUpdated(int)), progressBar, SLOT(setValue(int)));
 		printer->print();
@@ -186,6 +203,7 @@ void PrintDialog::printClicked(void)
 
 void PrintDialog::onPaintRequested(QPrinter *printerPtr)
 {
+	createPrinterObj();
 	connect(printer, SIGNAL(progessUpdated(int)), progressBar, SLOT(setValue(int)));
 	printer->print();
 	progressBar->setValue(0);
diff --git a/desktop-widgets/printdialog.h b/desktop-widgets/printdialog.h
index a00c4c5..c615744 100644
--- a/desktop-widgets/printdialog.h
+++ b/desktop-widgets/printdialog.h
@@ -18,12 +18,13 @@ class PrintDialog : public QDialog {
 
 public:
 	explicit PrintDialog(QWidget *parent = 0, Qt::WindowFlags f =

Re: CMake patches

2015-12-17 Thread Tomaz Canabrava
It is, I fixed bugs, not those. :D

On Thu, Dec 17, 2015 at 5:11 PM, Joakim Bygdell  wrote:

>
> On 17 Dec 2015, at 18:03, Tomaz Canabrava  wrote:
>
> code cleanup and bug fixes.
>
>
> Building for android is broken.
>
> -- Found ANT: /usr/local/bin/ant
> CMake Error at
> /Users/Jocke/src/Android/qt-android-cmake/AddQtAndroidApk.cmake:90
> (get_property):
>   get_property could not find TARGET subsurface-mobile.  Perhaps it has not
>   yet been created.
> Call Stack (most recent call first):
>   CMakeLists.txt:323 (add_qt_android_apk)
>
>
> -- Configuring incomplete, errors occurred!
>
>
> /Jocke
>
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: CMake patches

2015-12-17 Thread Joakim Bygdell

> On 17 Dec 2015, at 18:03, Tomaz Canabrava  wrote:
> 
> code cleanup and bug fixes.

Building for android is broken.

-- Found ANT: /usr/local/bin/ant
CMake Error at 
/Users/Jocke/src/Android/qt-android-cmake/AddQtAndroidApk.cmake:90 
(get_property):
  get_property could not find TARGET subsurface-mobile.  Perhaps it has not
  yet been created.
Call Stack (most recent call first):
  CMakeLists.txt:323 (add_qt_android_apk)


-- Configuring incomplete, errors occurred!


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


CMake patches

2015-12-17 Thread Tomaz Canabrava
code cleanup and bugfixes.
From 51a441c514beede832361efa8f9b4c7a18837c49 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Thu, 17 Dec 2015 14:01:28 -0200
Subject: [PATCH 1/5] Remove depreceated calls to -DLIBGIT23

Signed-off-by: Tomaz Canabrava 
---
 cmake/Modules/HandleFindGit2.cmake | 8 
 1 file changed, 8 deletions(-)

diff --git a/cmake/Modules/HandleFindGit2.cmake b/cmake/Modules/HandleFindGit2.cmake
index e0bb997..34db7b6 100644
--- a/cmake/Modules/HandleFindGit2.cmake
+++ b/cmake/Modules/HandleFindGit2.cmake
@@ -2,9 +2,6 @@
 if(LIBGIT2_FROM_PKGCONFIG)
 	pkg_config_library(LIBGIT2 libgit2 REQUIRED)
 	set(LIBGIT2_LIBRARIES "")
-	if(USE_LIBGIT23_API)
-		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_LIBGIT23_API")
-		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_LIBGIT23_API")
 		if(ANDROID)
 			# for Android we need to force a static link against ssl and crypto
 			# this is a bit hacky, but it seems to work
@@ -14,13 +11,9 @@ if(LIBGIT2_FROM_PKGCONFIG)
 			pkg_config_library(LIBSSH2 libssh2 REQUIRED)
 			set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} ${LIBSSH2_LIBRARIES})
 		endif()
-	endif()
 else()
 	find_package(LIBGIT2 REQUIRED)
 	include_directories(${LIBGIT2_INCLUDE_DIR})
-	if(USE_LIBGIT23_API)
-		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_LIBGIT23_API")
-		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_LIBGIT23_API")
 		if(FORCE_LIBSSH)
 			find_package(Libssh2 QUIET CONFIG)
 			if ("${LIBSSH2_VERSION}" STRGREATER "1.6.1")
@@ -35,5 +28,4 @@ else()
 			pkg_config_library(LIBCURL libcurl REQUIRED)
 		endif()
 		set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} -L${LIBSSH2_LIBRARY_DIRS} ${LIBSSH2_LIBRARIES} ${LIBCURL_LIBRARIES})
-	endif()
 endif()
-- 
2.6.4

From 9690123cf6a46aa7a21c5c2790fe94a9e2be7614 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Thu, 17 Dec 2015 14:01:58 -0200
Subject: [PATCH 2/5] Code cleanup

Signed-off-by: Tomaz Canabrava 
---
 cmake/Modules/HandleFindGit2.cmake | 46 +++---
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/cmake/Modules/HandleFindGit2.cmake b/cmake/Modules/HandleFindGit2.cmake
index 34db7b6..2f88b36 100644
--- a/cmake/Modules/HandleFindGit2.cmake
+++ b/cmake/Modules/HandleFindGit2.cmake
@@ -2,30 +2,30 @@
 if(LIBGIT2_FROM_PKGCONFIG)
 	pkg_config_library(LIBGIT2 libgit2 REQUIRED)
 	set(LIBGIT2_LIBRARIES "")
-		if(ANDROID)
-			# for Android we need to force a static link against ssl and crypto
-			# this is a bit hacky, but it seems to work
-			set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} ${LIBGIT2_LIBRARY_DIRS}/libssl.a ${LIBGIT2_LIBRARY_DIRS}/libcrypto.a)
-		endif()
-		if(FORCE_LIBSSH)
-			pkg_config_library(LIBSSH2 libssh2 REQUIRED)
-			set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} ${LIBSSH2_LIBRARIES})
-		endif()
+if(ANDROID)
+# for Android we need to force a static link against ssl and crypto
+# this is a bit hacky, but it seems to work
+set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} ${LIBGIT2_LIBRARY_DIRS}/libssl.a ${LIBGIT2_LIBRARY_DIRS}/libcrypto.a)
+endif()
+if(FORCE_LIBSSH)
+pkg_config_library(LIBSSH2 libssh2 REQUIRED)
+set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} ${LIBSSH2_LIBRARIES})
+endif()
 else()
 	find_package(LIBGIT2 REQUIRED)
 	include_directories(${LIBGIT2_INCLUDE_DIR})
-		if(FORCE_LIBSSH)
-			find_package(Libssh2 QUIET CONFIG)
-			if ("${LIBSSH2_VERSION}" STRGREATER "1.6.1")
-set(LIBSSH2_LIBRARIES Libssh2::libssh2)
-			endif()
-			if(!LIBSSH2_FOUND OR "${LIBSSH2_FOUND}" STREQUAL "")
-pkg_config_library(LIBSSH2 libssh2 REQUIRED)
-			endif()
-		endif()
-		find_package(libcurl QUIET)
-		if(!LIBCURL_FOUND OR "${LIBCURL_FOUND}" STREQUAL "")
-			pkg_config_library(LIBCURL libcurl REQUIRED)
-		endif()
-		set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} -L${LIBSSH2_LIBRARY_DIRS} ${LIBSSH2_LIBRARIES} ${LIBCURL_LIBRARIES})
+if(FORCE_LIBSSH)
+find_package(Libssh2 QUIET CONFIG)
+if ("${LIBSSH2_VERSION}" STRGREATER "1.6.1")
+set(LIBSSH2_LIBRARIES Libssh2::libssh2)
+endif()
+if(!LIBSSH2_FOUND OR "${LIBSSH2_FOUND}" STREQUAL "")
+pkg_config_library(LIBSSH2 libssh2 REQUIRED)
+endif()
+endif()
+find_package(libcurl QUIET)
+if(!LIBCURL_FOUND OR "${LIBCURL_FOUND}" STREQUAL "")
+pkg_config_library(LIBCURL libcurl REQUIRED)
+endif()
+set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} -L${LIBSSH2_LIBRARY_DIRS} ${LIBSSH2_LIBRARIES} ${LIBCURL_LIBRARIES})
 endif()
-- 
2.6.4

From 9e5d6e4d1a934f7ce4b848fa804fcbe3b37f3ff3 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Thu, 17 Dec 2015 14:28:43 -0200
Subject: [PATCH 3/5] Simplify IF for OSX handling

Signed-off-by: Tomaz Canabrava 
---
 CMakeLists.txt | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f338f0e..255ff62 1

Re: [PATCHES]

2015-11-25 Thread Sebastian Kügler
On Tuesday, November 24, 2015 05:49:21 PM Robert Helling wrote:
> +   QPixmap tempPixmap = pixmap;
> +   QPainter painter;
> +   painter.begin(&tempPixmap);
> +   painter.fillRect(pixmap.rect(), QColor(127, 127, 127, 127));
> +   painter.end();

I may be dense today, but this seems unused? (Removing this would also get rid 
of a hard-coded color, always a good thing.)
-- 
sebas

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


[PATCHES]

2015-11-24 Thread Robert Helling
Hi,I am resending a number of patches I sent earlier which seem to me are still not pushed. Comments or pushes would be appreciated.From 10be4f46ca1a16353cedbd4b709bcc2332d69a78 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" 
Date: Mon, 16 Nov 2015 16:10:07 +0100
Subject: [PATCH 1/2] Interpret - as STDOUT on writing xml files

This prepares for the smartrack converter webservice.

Signed-off-by: Robert C. Helling 
---
 subsurface-core/save-xml.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/subsurface-core/save-xml.c b/subsurface-core/save-xml.c
index 1668858..eabcf4f 100644
--- a/subsurface-core/save-xml.c
+++ b/subsurface-core/save-xml.c
@@ -666,12 +666,15 @@ int save_dives_logic(const char *filename, const bool 
select_only)
if (git)
return git_save_dives(git, branch, remote, select_only);
 
-   try_to_backup(filename);
-
save_dives_buffer(&buf, select_only);
 
-   error = -1;
-   f = subsurface_fopen(filename, "w");
+   if (same_string(filename, "-")) {
+   f = stdout;
+   } else {
+   try_to_backup(filename);
+   error = -1;
+   f = subsurface_fopen(filename, "w");
+   }
if (f) {
flush_buffer(&buf, f);
error = fclose(f);
-- 
2.4.9 (Apple Git-60)

From 8836c98e29b80762c43f6131c37bb1ac17bca17f Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" 
Date: Mon, 16 Nov 2015 16:54:01 +0100
Subject: [PATCH 2/2] CGI script wrapper for smtk2ssrf.pl

This script should go to the cgi-bin directory of the webserver to proivide
conversion of SmarTrack files as a web service. Paths need to be adopted
and more html to make it more beautiful should be added.

Signed-off-by: Robert C. Helling 
---
 scripts/smtk2ssrf.pl | 42 ++
 1 file changed, 42 insertions(+)
 create mode 100755 scripts/smtk2ssrf.pl

diff --git a/scripts/smtk2ssrf.pl b/scripts/smtk2ssrf.pl
new file mode 100755
index 000..a65ebf9
--- /dev/null
+++ b/scripts/smtk2ssrf.pl
@@ -0,0 +1,42 @@
+#!/usr/bin/env perl
+
+use CGI;
+
+# Change this to the correct path to binary.
+my $smtk2ssrf = "../build/smtk2ssrf"; 
+
+my $q = CGI->new;
+
+if ($q->upload("uploaded_file")) {
+my $original_filename = $q->param("uploaded_file");
+my $tmp_filename = $q->tmpFileName($original_filename);
+my $new_filename = $original_filename;
+$new_filename =~ s/.*[\/\\]//;
+$new_filename =~ s/\..*$/.ssrf/;
+  
+print "Content-Disposition: attachment; filename=\"$new_filename\"\n";
+print "Content-type: subsurface/xml\n\n";
+system "$smtk2ssrf $tmp_filename -";
+} else {
+print "Content-type: text/html\n\n";
+
+# Here we could print some header stuff to fit better in the subsurface 
webspace context. Do do so uncomment
+# open (IN, "filename_header.html);
+# while () {
+# print;
+# }
+# close(IN);
+
+print $q->start_multipart_form();
+
+print $q->h1("Convert Smartrack files to Subsurface");
+
+print $q->filefield( -name => "uploaded_file",
+ -size => 50,
+ -maxlength => 200);
+print $q->submit();
+print $q-end_form();
+
+# Here we could print some footer stuff as above
+
+}
-- 
2.4.9 (Apple Git-60)

From 88ac4ad982ae8429214f134497cafdb4c4b36822 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" 
Date: Tue, 17 Nov 2015 11:13:08 +0100
Subject: [PATCH] Only close html tags if they were opened before

The runtime html table is printed only if printing
a verbatim diveplan is disabled. So the closing tags
should be printed only in that case.

Signed-off-by: Robert C. Helling 
---
 subsurface-core/planner.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/subsurface-core/planner.c b/subsurface-core/planner.c
index 9c8b9e9..db1460a 100644
--- a/subsurface-core/planner.c
+++ b/subsurface-core/planner.c
@@ -776,7 +776,8 @@ static void add_plan_to_notes(struct diveplan *diveplan, 
struct dive *dive, bool
lastsetpoint = dp->setpoint;
lastentered = dp->entered;
} while ((dp = nextdp) != NULL);
-   len += snprintf(buffer + len, sz_buffer - len, 
"");
+   if (!plan_verbatim)
+   len += snprintf(buffer + len, sz_buffer - len, 
"");
 
dive->cns = 0;
dive->maxcns = 0;
-- 
2.4.9 (Apple Git-60)

From e00d8b6fca596e194ee16e571bba2f55a04a820d Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" 
Date: Tue, 3 Nov 2015 21:17:50 +0100
Subject: [PATCH] Drag and Drop Images

Now that we have the possibility to add images without meaningful
time stamps to a dive, we s

[PATCH 0/3] some patches that fix printing for planned dive

2015-11-15 Thread Lubomir I. Ivanov
From: "Lubomir I. Ivanov" 

Lubomir I. Ivanov (3):
  qthelper.cpp: support line breaks for notes when printing

pretty much a hack to convert some planner HTML tags to .
non-planned dive notes line breaks are also converted to 

  printing_templates: mark 'dive.notes' as 'safe'

this patch requires the previous one.
makes modifications to the bundled HTML templates (ouch!)

  Planner: support profile in planner print

this addition is nice. the implementation is questionable, but it works(tm)
and it does auto-pagination while the alternatives are much harder.

 desktop-widgets/mainwindow.cpp | 29 +
 printing_templates/Flowlayout.html |  2 +-
 printing_templates/One Dive.html   |  2 +-
 printing_templates/Six Dives.html  |  2 +-
 printing_templates/Two Dives.html  |  2 +-
 profile-widget/profilewidget2.cpp  |  1 +
 subsurface-core/qthelper.cpp   | 20 +++-
 7 files changed, 49 insertions(+), 9 deletions(-)

-- 
1.7.11.msysgit.0

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


Re: Patches to add Context Menu to Images

2015-11-03 Thread Guido Lerch
Hi Robert

2015-11-03 21:34 GMT+01:00 Robert C. Helling :

> Hi Guido,
>
> On 03 Nov 2015, at 17:21, Guido Lerch  wrote:
>
> This set of patches enables users to use the mouse and a context menu to:
>
>
> I think the interference between these and my Drag and Drop patch should
> be very small, so yes, of course, go ahead, let’s sort this out together!
>
> For me the next step would be the possibility to shift the time of images
> in the profile using the mouse.
>
> 1. Add images from files/web
> 2. Delete selected images
> 3. Delete all images
>
>
>
> If there is no objection, I am going to work on a local file based
> management
> of images again that can be selected via the preferences, so people that
> don't
> want that don't have to.
>
>
> I must say, I am still not convinced about your „local file based
> management“ solution. It seems to me besides the actual copying of the
> files to a folder (possibly the magic dropbox or own cloud folder) this is
> a subset of what we already do with the image hashes. And there, when I
> wrote that, I decided that I would not do the coping as the cicurmstances
> where this makes sense (given the possible data size and issues of
> reediting etc) we should better let the user do this explicitly.
>

Maybe you and I need to sit together for me to better understand the
hashing.  In general I think ! I know what it's there for but this doesn't
solve
my dislike that i have to ask subsurface to find my moved images once I
have relocated them. I actually think, sorry, this is very user unfriendly.
I have tried it and dislike it.

Here is how I work ...
I come home from a day or multiple day trip, I select the appropriate dives
and I point it directly to my SD card, selecting what I would like
to keep. Those are dive related images, hence I have a dropbox folder for
it as I really want to save and secure them.
With my solution, I select all dives, select all the images and the nice
subsurface image handling saves the correct files to each dive.
This takes a while, I don't care...
Once done, I go through the dives and delete those images, I don' want,
typically duplicates as I am doing burst once in a while. My way
would check if the files are used in other dives and if not delete from the
managed location.
Result, I have all pictures I want in a managed location, I also have them
in the original location as my code would never delete in the original\
locations. Managed, selected, fine .. done. I leave the sync. to DropBox,
Box, Google Drive, whatever.

>
> Plus there is this proposal by Dirk, to sort this out once and for all in
> a way that is compatible with could saving. I think this whole context
> needs a bit more thinking before we can start implementing as otherwise we
> will very likely throw away stuff we write now or even worse run into a
> legacy problem.
>

I get that point too but ... cloud saving is resource intense and much
slower than local. I don't dispute what Dirk envisions but why not have
an easy approach, cheap, no GIT stuff and selectable by the user. We can
extend any time.
Today, without managing, handling images it's cumbersome IMHO. I don't get
the benefit of calculating hashes if the images are managed
upfront. Hashes are more like ... I lost them, where are they? Unless I
miss something ...
My 2 cents.


> Just my $.02.
>
> Best
> Robert
>
>


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


Re: Patches to add Context Menu to Images

2015-11-03 Thread Robert C. Helling
Hi Guido,

> On 03 Nov 2015, at 17:21, Guido Lerch  wrote:
> 
> This set of patches enables users to use the mouse and a context menu to:

I think the interference between these and my Drag and Drop patch should be 
very small, so yes, of course, go ahead, let’s sort this out together!

For me the next step would be the possibility to shift the time of images in 
the profile using the mouse.

> 1. Add images from files/web
> 2. Delete selected images
> 3. Delete all images


> If there is no objection, I am going to work on a local file based management
> of images again that can be selected via the preferences, so people that don't
> want that don't have to.

I must say, I am still not convinced about your „local file based management“ 
solution. It seems to me besides the actual copying of the files to a folder 
(possibly the magic dropbox or own cloud folder) this is a subset of what we 
already do with the image hashes. And there, when I wrote that, I decided that 
I would not do the coping as the cicurmstances where this makes sense (given 
the possible data size and issues of reediting etc) we should better let the 
user do this explicitly.

Plus there is this proposal by Dirk, to sort this out once and for all in a way 
that is compatible with could saving. I think this whole context needs a bit 
more thinking before we can start implementing as otherwise we will very likely 
throw away stuff we write now or even worse run into a legacy problem.

Just my $.02.

Best
Robert



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Patches to add Context Menu to Images

2015-11-03 Thread Guido Lerch
Hi All,

Re-submitting.

This set of patches enables users to use the mouse and a context menu to:
1. Add images from files/web
2. Delete selected images
3. Delete all images

If there is no objection, I am going to work on a local file based
management
of images again that can be selected via the preferences, so people that
don't
want that don't have to.

-- 
Best regards,
Guido
From 65241f94f08ebcd5165d488067b32ba64c0620dc Mon Sep 17 00:00:00 2001
From: Guido Lerch 
Date: Tue, 20 Oct 2015 21:02:41 +0200
Subject: [PATCH 1/6] Adding context menu to Images

Allowing to delete selected or all photos from the
dive images

Signed-off-by: Guido Lerch 
---
 desktop-widgets/maintab.cpp | 9 +
 desktop-widgets/maintab.h   | 1 +
 2 files changed, 10 insertions(+)

diff --git a/desktop-widgets/maintab.cpp b/desktop-widgets/maintab.cpp
index 0afb7b4..a1f0438 100644
--- a/desktop-widgets/maintab.cpp
+++ b/desktop-widgets/maintab.cpp
@@ -1610,3 +1610,12 @@ void MainTab::showAndTriggerEditSelective(struct 
dive_components what)
weightModel->changed = true;
}
 }
+
+void MainTab::contextMenuEvent(QContextMenuEvent *event)
+{
+   QMenu popup(this);
+   popup.addAction(tr("Delete selected images"), this, 
SLOT(removeSelectedPhotos()));
+   popup.addAction(tr("Delete all images"), this, SLOT(removeAllPhotos()));
+   QAction *actionTaken = popup.exec(event->globalPos());
+   event->accept();
+}
diff --git a/desktop-widgets/maintab.h b/desktop-widgets/maintab.h
index 20b4da6..7b2bb86 100644
--- a/desktop-widgets/maintab.h
+++ b/desktop-widgets/maintab.h
@@ -54,6 +54,7 @@ public:
void refreshDisplayedDiveSite();
void nextInputField(QKeyEvent *event);
void showAndTriggerEditSelective(struct dive_components what);
+   void contextMenuEvent(QContextMenuEvent *event);
 
 signals:
void addDiveFinished();
-- 
2.3.8 (Apple Git-58)

From a62e8f94408dded8cff07d8bec3c8cefb50200ff Mon Sep 17 00:00:00 2001
From: Guido Lerch 
Date: Tue, 20 Oct 2015 21:07:43 +0200
Subject: [PATCH 3/6] Context menu support for images

removing obsolete code

Signed-off-by: Guido Lerch 
---
 desktop-widgets/maintab.cpp | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/desktop-widgets/maintab.cpp b/desktop-widgets/maintab.cpp
index a1f0438..595e9da 100644
--- a/desktop-widgets/maintab.cpp
+++ b/desktop-widgets/maintab.cpp
@@ -177,13 +177,6 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
ui.cylinders->view()->horizontalHeader()->addAction(action);
}
 
-   QAction *deletePhoto = new QAction(this);
-   deletePhoto->setShortcut(Qt::Key_Delete);
-   deletePhoto->setShortcutContext(Qt::WidgetShortcut);
-   ui.photosView->addAction(deletePhoto);
-   ui.photosView->setSelectionMode(QAbstractItemView::SingleSelection);
-   connect(deletePhoto, SIGNAL(triggered(bool)), this, 
SLOT(removeSelectedPhotos()));
-
ui.waitingSpinner->setRoundness(70.0);
ui.waitingSpinner->setMinimumTrailOpacity(15.0);
ui.waitingSpinner->setTrailFadePercentage(70.0);
-- 
2.3.8 (Apple Git-58)

From f7f3e711262989f2ae095fc49af173b3c1909167 Mon Sep 17 00:00:00 2001
From: Guido Lerch 
Date: Tue, 20 Oct 2015 21:08:59 +0200
Subject: [PATCH 4/6] Context menu support for images

Adding modified code to support deletion of selected images as
well as deleting of all images (with warning messagebox)

Signed-off-by: Guido Lerch 
---
 desktop-widgets/maintab.cpp | 25 ++---
 desktop-widgets/maintab.h   |  1 +
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/desktop-widgets/maintab.cpp b/desktop-widgets/maintab.cpp
index 595e9da..88f7903 100644
--- a/desktop-widgets/maintab.cpp
+++ b/desktop-widgets/maintab.cpp
@@ -1556,12 +1556,31 @@ void MainTab::photoDoubleClicked(const QString filePath)
 
 void MainTab::removeSelectedPhotos()
 {
+   bool last = false;
if (!ui.photosView->selectionModel()->hasSelection())
return;
+   QModelIndexList indexes =  
ui.photosView->selectionModel()->selectedRows();
+   if (indexes.count() == 0)
+   indexes = ui.photosView->selectionModel()->selectedIndexes();
+   QModelIndex photo = indexes.first();
+   do {
+   photo = indexes.first();
+   last = indexes.count() == 1;
+   if (photo.isValid()) {
+   QString fileUrl = 
photo.data(Qt::DisplayPropertyRole).toString();
+   if (fileUrl.length() > 0)
+   
DivePictureModel::instance()->removePicture(fileUrl, last);
+   }
+   indexes.removeFirst();
+   } while(!indexes.isEmpty());
+}
 
-   QModelIndex photoIndex = 
ui.photosView->selectionModel()->selectedIndexes().first();
-   QString fileUrl = photoIndex.data(Qt::DisplayPr

[PATCH] 2 translation related patches

2015-10-20 Thread Jan Mulder

2 patched attached.

1) Fix broken translation in divelist

Fixes a broken translation in the divelist introduced in commit 45b1d0d73db6e21.
Now, the (.. dives) string on a trip line in the divelist is translated (again).

2) Add missing tr() implementations

One specific string did not translate. First, Dirk and I (via IRC) suspected a 
leading space was
the issue (see commit eccac1321f512d8). However, I found out that the problem 
was still there. A non
translated string "%1 shown", when applying a filter on the divelist, and 
looking at a trip
line. It shows always untranslated "%1 shown". Extracting to-be-translated 
strings from
the code, I found 2 errors: Class  lacks Q_OBJECT macro.

This patch adds a missing tr() definition and implementation to 2 structs.

best,

--jan



>From 4f3b38d2a66963f2e64d5d17ead00a6e85134c86 Mon Sep 17 00:00:00 2001
From: Jan Mulder 
Date: Tue, 20 Oct 2015 14:36:53 +0200
Subject: [PATCH 2/2] [PATCH] Add missing tr() implementations

One specific string did not translate. First, Dirk and I (via IRC) suspected a leading space was
the issue (see commit eccac1321f512d8). However, I found out that the problem was still there. A non
translated string "%1 shown", when applying a filter on the divelist, and looking at a trip
line. It shows always untranslated "%1 shown". Extracting to-be-translated strings from
the code, I found 2 errors: Class  lacks Q_OBJECT macro.

This patch adds a missing tr() definition and implementation to 2 structs.

Signed-off-by: Jan Mulder 
---
 qt-models/divetripmodel.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/qt-models/divetripmodel.h b/qt-models/divetripmodel.h
index 63dc806..31cee96 100644
--- a/qt-models/divetripmodel.h
+++ b/qt-models/divetripmodel.h
@@ -5,6 +5,8 @@
 #include "dive.h"
 
 struct DiveItem : public TreeItem {
+	Q_DECLARE_TR_FUNCTIONS(TripItem)
+public:
 	enum Column {
 		NR,
 		DATE,
@@ -38,6 +40,8 @@ struct DiveItem : public TreeItem {
 };
 
 struct TripItem : public TreeItem {
+	Q_DECLARE_TR_FUNCTIONS(TripItem)
+public:
 	virtual QVariant data(int column, int role) const;
 	dive_trip_t *trip;
 };
-- 
2.6.1

>From 7456b1d3ae62cd9f26d99775cc69ddf6afcc126e Mon Sep 17 00:00:00 2001
From: Jan Mulder 
Date: Tue, 20 Oct 2015 14:18:27 +0200
Subject: [PATCH 1/2] [PATCH] Fix broken translation in divelist

Fixes a broken translation in the divelist introduced in commit 45b1d0d73db6e21.
Now, the (.. dives) string on a trip line in de divelist is translated (again).

Signed-off-by: Jan Mulder 
---
 qthelper.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/qthelper.cpp b/qthelper.cpp
index db0649b..7e4d64e 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -1069,12 +1069,12 @@ QString get_trip_date_string(timestamp_t when, int nr, bool getday)
 
 	if (nr != 1) {
 		if (getday) {
-			ret = localTime.date().toString(dateFormat).append(" (%1 dives)").arg(nr);
+			ret = localTime.date().toString(dateFormat) + " " + QObject::tr("(%1 dives)").arg(nr);
 		} else {
-			ret = localTime.date().toString("MMM yy").append(" (%1 dives)").arg(nr);
+			ret = localTime.date().toString("MMM yy") + " " + QObject::tr("(%1 dives)").arg(nr);
 		}
 	} else {
-		ret = localTime.date().toString(dateFormat).append(" (1 dive)");
+		ret = localTime.date().toString(dateFormat) + " " + QObject::tr("(1 dive)");
 	}
 	return ret;
 
-- 
2.6.1

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


Fwd: minor [PATCHES] for freediving

2015-10-18 Thread Giorgio Marzano
Now that the new release is out, could we consider adding those patches to
the next minor?

G

-- Forwarded message --
From: Giorgio Marzano 
Date: 2015-10-11 23:40 GMT+02:00
Subject: minor [PATCHES] for freediving
To: Subsurface Mailing List 


Hi,

I know that this is something which won't be merged before the next
release, but I would like to propose those patches for a (low priority)
review. They are all easy, cosmetic and  freedive specific (no impact on
scuba)


0001-Change-plot-scaling-to-handle-FREEDIVE-mode hacks the autoscaling
function to produce better result for the usually very short freedives


0001-Display-day-number-in-trips-longer-than-1-day is the old patch to add
some info in the trip header. I only rebased it to the last master


0001-Display-divetime-according-to-dive-mode-and-translat changes, for
freedive mode, the time strings in the info and statistics tab. For us
seconds may be very relevant.


0001-Enable-Disable-toolbar-element-in-freedive-mode disable some toolbar
element for freedive mode. I found very disturbing those buttons which are,
for me, of no use.  I would like, in the future, to understand how ppO2 and
similar are different in scuba and freediving. It would be important to
represent them in a correct way, to profile the risk of "taravana"
(something like the decompression disease but for freedivers)



G
From 6c91115e393c6dfa7743072c0f5e868ad260e09e Mon Sep 17 00:00:00 2001
From: Giorgio Marzano 
Date: Tue, 6 Oct 2015 21:08:27 +0200
Subject: [PATCH] Display day number in trips longer than 1 day

Signed-off-by: Giorgio Marzano 
---
 helpers.h   |  3 ++-
 qt-models/divetripmodel.cpp |  6 --
 qthelper.cpp| 37 +
 3 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/helpers.h b/helpers.h
index 6c5c31c..760d962 100644
--- a/helpers.h
+++ b/helpers.h
@@ -33,7 +33,8 @@ int parseTemperatureToMkelvin(const QString &text);
 QString get_dive_duration_string(timestamp_t when, QString hourText, QString minutesText);
 QString get_dive_date_string(timestamp_t when);
 QString get_short_dive_date_string(timestamp_t when);
-QString get_trip_date_string(timestamp_t when, int nr);
+bool is_same_day (timestamp_t trip_when, timestamp_t dive_when);
+QString get_trip_date_string(timestamp_t when, int nr, bool getday);
 QString uiLanguage(QLocale *callerLoc);
 QLocale getLocale();
 QString getDateFormat();
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp
index 819bb54..78a7a74 100644
--- a/qt-models/divetripmodel.cpp
+++ b/qt-models/divetripmodel.cpp
@@ -43,6 +43,7 @@ static QVariant dive_table_alignment(int column)
 QVariant TripItem::data(int column, int role) const
 {
 	QVariant ret;
+	bool oneDayTrip=true;
 
 	if (role == DiveTripModel::TRIP_ROLE)
 		return QVariant::fromValue(trip);
@@ -59,14 +60,15 @@ QVariant TripItem::data(int column, int role) const
 			while (d) {
 if (!d->hidden_by_filter)
 	countShown++;
+oneDayTrip &= is_same_day (trip->when,  d->when);
 d = d->next;
 			}
 			if (countShown < trip->nrdives)
 shownText = tr("(%1 shown)").arg(countShown);
 			if (trip->location && *trip->location)
-ret = QString(trip->location) + ", " + get_trip_date_string(trip->when, trip->nrdives) + " " + shownText;
+ret = QString(trip->location) + ", " + get_trip_date_string(trip->when, trip->nrdives, oneDayTrip) + " "+ shownText;
 			else
-ret = get_trip_date_string(trip->when, trip->nrdives) + shownText;
+ret = get_trip_date_string(trip->when, trip->nrdives, oneDayTrip) + shownText;
 			break;
 		}
 	}
diff --git a/qthelper.cpp b/qthelper.cpp
index a963ad7..dd5f974 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -1011,20 +1011,41 @@ const char *get_dive_date_c_string(timestamp_t when)
 	return strdup(text.toUtf8().data());
 }
 
-QString get_trip_date_string(timestamp_t when, int nr)
+bool is_same_day(timestamp_t trip_when, timestamp_t dive_when)
+{
+	static timestamp_t twhen = (timestamp_t) 0;
+	static struct tm tmt;
+	struct tm tmd;
+
+	utc_mkdate(dive_when, &tmd);
+
+	if (twhen != trip_when) {
+		twhen = trip_when;
+		utc_mkdate(twhen, &tmt);
+	}
+
+	return ((tmd.tm_mday == tmt.tm_mday) && (tmd.tm_mon == tmt.tm_mon) && (tmd.tm_year == tmt.tm_year));
+}
+
+QString get_trip_date_string(timestamp_t when, int nr, bool getday)
 {
 	struct tm tm;
 	utc_mkdate(when, &tm);
+	QDateTime localTime = QDateTime::fromTime_t(when);
+	localTime.setTimeSpec(Qt::UTC);
+	QString ret ;
+
 	if (nr != 1) {
-		QString ret =  translate("gettextFromC", "%1 %2 (%3 dives)");
-		return ret.arg(monthname(tm.tm_mon))
-			.arg(tm.tm_year + 1900)
-			.arg(nr);
+		if (getday) {
+			ret = localTime.date().toString(dateFormat).append(" (%1 dives)").arg(nr);
+		} else {

minor [PATCHES] for freediving

2015-10-11 Thread Giorgio Marzano
Hi,

I know that this is something which won't be merged before the next
release, but I would like to propose those patches for a (low priority)
review. They are all easy, cosmetic and  freedive specific (no impact on
scuba)


0001-Change-plot-scaling-to-handle-FREEDIVE-mode hacks the autoscaling
function to produce better result for the usually very short freedives


0001-Display-day-number-in-trips-longer-than-1-day is the old patch to add
some info in the trip header. I only rebased it to the last master


0001-Display-divetime-according-to-dive-mode-and-translat changes, for
freedive mode, the time strings in the info and statistics tab. For us
seconds may be very relevant.


0001-Enable-Disable-toolbar-element-in-freedive-mode disable some toolbar
element for freedive mode. I found very disturbing those buttons which are,
for me, of no use.  I would like, in the future, to understand how ppO2 and
similar are different in scuba and freediving. It would be important to
represent them in a correct way, to profile the risk of "taravana"
(something like the decompression disease but for freedivers)



G
From 6c91115e393c6dfa7743072c0f5e868ad260e09e Mon Sep 17 00:00:00 2001
From: Giorgio Marzano 
Date: Tue, 6 Oct 2015 21:08:27 +0200
Subject: [PATCH] Display day number in trips longer than 1 day

Signed-off-by: Giorgio Marzano 
---
 helpers.h   |  3 ++-
 qt-models/divetripmodel.cpp |  6 --
 qthelper.cpp| 37 +
 3 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/helpers.h b/helpers.h
index 6c5c31c..760d962 100644
--- a/helpers.h
+++ b/helpers.h
@@ -33,7 +33,8 @@ int parseTemperatureToMkelvin(const QString &text);
 QString get_dive_duration_string(timestamp_t when, QString hourText, QString minutesText);
 QString get_dive_date_string(timestamp_t when);
 QString get_short_dive_date_string(timestamp_t when);
-QString get_trip_date_string(timestamp_t when, int nr);
+bool is_same_day (timestamp_t trip_when, timestamp_t dive_when);
+QString get_trip_date_string(timestamp_t when, int nr, bool getday);
 QString uiLanguage(QLocale *callerLoc);
 QLocale getLocale();
 QString getDateFormat();
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp
index 819bb54..78a7a74 100644
--- a/qt-models/divetripmodel.cpp
+++ b/qt-models/divetripmodel.cpp
@@ -43,6 +43,7 @@ static QVariant dive_table_alignment(int column)
 QVariant TripItem::data(int column, int role) const
 {
 	QVariant ret;
+	bool oneDayTrip=true;
 
 	if (role == DiveTripModel::TRIP_ROLE)
 		return QVariant::fromValue(trip);
@@ -59,14 +60,15 @@ QVariant TripItem::data(int column, int role) const
 			while (d) {
 if (!d->hidden_by_filter)
 	countShown++;
+oneDayTrip &= is_same_day (trip->when,  d->when);
 d = d->next;
 			}
 			if (countShown < trip->nrdives)
 shownText = tr("(%1 shown)").arg(countShown);
 			if (trip->location && *trip->location)
-ret = QString(trip->location) + ", " + get_trip_date_string(trip->when, trip->nrdives) + " " + shownText;
+ret = QString(trip->location) + ", " + get_trip_date_string(trip->when, trip->nrdives, oneDayTrip) + " "+ shownText;
 			else
-ret = get_trip_date_string(trip->when, trip->nrdives) + shownText;
+ret = get_trip_date_string(trip->when, trip->nrdives, oneDayTrip) + shownText;
 			break;
 		}
 	}
diff --git a/qthelper.cpp b/qthelper.cpp
index a963ad7..dd5f974 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -1011,20 +1011,41 @@ const char *get_dive_date_c_string(timestamp_t when)
 	return strdup(text.toUtf8().data());
 }
 
-QString get_trip_date_string(timestamp_t when, int nr)
+bool is_same_day(timestamp_t trip_when, timestamp_t dive_when)
+{
+	static timestamp_t twhen = (timestamp_t) 0;
+	static struct tm tmt;
+	struct tm tmd;
+
+	utc_mkdate(dive_when, &tmd);
+
+	if (twhen != trip_when) {
+		twhen = trip_when;
+		utc_mkdate(twhen, &tmt);
+	}
+
+	return ((tmd.tm_mday == tmt.tm_mday) && (tmd.tm_mon == tmt.tm_mon) && (tmd.tm_year == tmt.tm_year));
+}
+
+QString get_trip_date_string(timestamp_t when, int nr, bool getday)
 {
 	struct tm tm;
 	utc_mkdate(when, &tm);
+	QDateTime localTime = QDateTime::fromTime_t(when);
+	localTime.setTimeSpec(Qt::UTC);
+	QString ret ;
+
 	if (nr != 1) {
-		QString ret =  translate("gettextFromC", "%1 %2 (%3 dives)");
-		return ret.arg(monthname(tm.tm_mon))
-			.arg(tm.tm_year + 1900)
-			.arg(nr);
+		if (getday) {
+			ret = localTime.date().toString(dateFormat).append(" (%1 dives)").arg(nr);
+		} else {
+			ret = localTime.date().toString("MMM yy").append(" (%1 dives)").arg(nr);
+		}
 	} else {
-		QString ret = translate("gettextFromC", "%1 %2 (1 dive)");
-		return ret.arg(monthname(tm.tm_mon))
-			.arg(tm.tm_year + 1900);
+		ret

Re: three small patches for current git head

2015-10-07 Thread K. "pestophagous" Heller
On Wed, Oct 7, 2015 at 12:27 AM, Dirk Hohndel  wrote:
> On Wed, Oct 07, 2015 at 08:55:00AM +0300, Miika Turkia wrote:
>> > When you pull the latest from github.com/torvalds/subsurface, if you (like
>> > me) are configured to open the default "username.xml" logbook on launch, 
>> > you
>> > will likely discover a problem in commit e8a868aae of Oct 6.  See comments
>> > here:
>> >
>> > https://github.com/torvalds/subsurface/commit/e8a868aae2583fc3065b3ff150edb005cc32682b#commitcomment-13630347
>>
>> How about sending another patch for this one? (This has worked just
>> fine for me, but I am sure this is an issue in some environments.)
>
> I'll fix this here by making it a calloc as I had originally intended.
> :facepalm:
>
>> > Also, I have provided two (unrelated) bug fixes at:
>> >
>> > http://trac.subsurface-divelog.org/ticket/912  and
>> > http://trac.subsurface-divelog.org/ticket/820
>>
>> We generally prefer patches to be sent to the mailing list (to answer
>> your question in the bug comment). I personally use git send-email if
>> using properly configured laptop. You should tune the commit message
>> slightly in the future, adding the reference to the bug that is being
>> fixed in following format will close the bug automatically once
>> committed to master:
>>
>> Fixes #820
>
> All great advise - thanks Miika. I figured out how to get the commits from
> github (it's a multistep process but not as hard as I thought... if you
> attach ".patch" to the end of a commit link you can wget to download it as
> a patch that is formatted correctly for git am) and applied them. And I
> updated the commit messages to fix our automation syntax.

Thanks, Miika.  Next time I will use send-mail, and tune the tracker
id tag appropriately.

I am also glad to learn of this ".patch" trick on github. Github has
many secrets (and many annoyances).

>
>> Also a common warning, if your patch does not make it to master, or
>> get commented in a day or two, just remind us (Dirk) about it, he
>> might just have missed it for some reason.
>
> Yes. Definitely.
>
> I usually recommend (and git send-email does this) to make sure that your
> email has "[PATCH]" in the subject line. But with all my travel I still at
> times miss things (or my system randomly decides that a patch is spam).
> So a reminder is appreciated.

Excellent. It's very gracious of you to make that clear up front, so
people don't have to wonder if they will be seen as just "nagging you"
with reminders.

> The nice things about patches in email is that it's easy to comment on
> them and to make sure everyone sees the comments and other people can
> engage as well.

Agreed.

>  Qt... it's fun... it's easy...

hmmm. subjective ;)

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


Re: three small patches for current git head

2015-10-07 Thread K. "pestophagous" Heller
On Wed, Oct 7, 2015 at 12:11 AM, Dirk Hohndel  wrote:
>
> Hello and welcome. I think you are the first person who told me that they
> "lurked without subscribing". That's a new approach :-)
>

Yep :)  your httpd access logs probably show activity that looks like
i was trying to hit every page of the archive to slowly download a
static backup page by page, traversing the archive slowly but
methodically.
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: three small patches for current git head

2015-10-07 Thread Dirk Hohndel
On Wed, Oct 07, 2015 at 08:55:00AM +0300, Miika Turkia wrote:
> > When you pull the latest from github.com/torvalds/subsurface, if you (like
> > me) are configured to open the default "username.xml" logbook on launch, you
> > will likely discover a problem in commit e8a868aae of Oct 6.  See comments
> > here:
> >
> > https://github.com/torvalds/subsurface/commit/e8a868aae2583fc3065b3ff150edb005cc32682b#commitcomment-13630347
> 
> How about sending another patch for this one? (This has worked just
> fine for me, but I am sure this is an issue in some environments.)

I'll fix this here by making it a calloc as I had originally intended.
:facepalm:

> > Also, I have provided two (unrelated) bug fixes at:
> >
> > http://trac.subsurface-divelog.org/ticket/912  and
> > http://trac.subsurface-divelog.org/ticket/820
> 
> We generally prefer patches to be sent to the mailing list (to answer
> your question in the bug comment). I personally use git send-email if
> using properly configured laptop. You should tune the commit message
> slightly in the future, adding the reference to the bug that is being
> fixed in following format will close the bug automatically once
> committed to master:
> 
> Fixes #820

All great advise - thanks Miika. I figured out how to get the commits from
github (it's a multistep process but not as hard as I thought... if you
attach ".patch" to the end of a commit link you can wget to download it as
a patch that is formatted correctly for git am) and applied them. And I
updated the commit messages to fix our automation syntax.

> Also a common warning, if your patch does not make it to master, or
> get commented in a day or two, just remind us (Dirk) about it, he
> might just have missed it for some reason.

Yes. Definitely.

I usually recommend (and git send-email does this) to make sure that your
email has "[PATCH]" in the subject line. But with all my travel I still at
times miss things (or my system randomly decides that a patch is spam).
So a reminder is appreciated.

The nice things about patches in email is that it's easy to comment on
them and to make sure everyone sees the comments and other people can
engage as well.

> Thanks for starting to contribute, the bug 820 has been quite
> annoying, when I very rarely have been selecting which dives to
> import. (But not annoying enough to actually start learning Qt to
> figure out a fix for it.)

Several people have run into this but the bug was so obvious that none of
us noticed.

And Miika, you really should learn Qt... it's fun... it's easy... the
first one is always free...

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


Re: three small patches for current git head

2015-10-07 Thread Dirk Hohndel
On Tue, Oct 06, 2015 at 10:32:58PM -0700, K. Heller wrote:
> Hi all,
> 
> When you pull the latest from github.com/torvalds/subsurface, if you (like
> me) are configured to open the default "username.xml" logbook on launch,
> you will likely discover a problem in commit e8a868aae of Oct 6.  See
> comments here:
> 
> 
> https://github.com/torvalds/subsurface/commit/e8a868aae2583fc3065b3ff150edb005cc32682b#commitcomment-13630347
> 
> Also, I have provided two (unrelated) bug fixes at:
> 
> http://trac.subsurface-divelog.org/ticket/912  and
> http://trac.subsurface-divelog.org/ticket/820
> 
> Cheers
> 
> /K
> 
> P.S. i have "lurked" on the mailing list for a few months (without even
> subscribing! just trawling the archives). this is my first hello sent to
> the list.

Hello and welcome. I think you are the first person who told me that they
"lurked without subscribing". That's a new approach :-)

As for patches... I love fixes so I'll go and look at github to see if I
can find them... but you may have noticed that we mostly do things in
email here. Or at least with pull requests sent in email. I find the
github UI quite annoying and the way github handles merges makes Linus
unhappy... anyway, let me take a look!

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


Re: three small patches for current git head

2015-10-06 Thread Miika Turkia
On Wed, Oct 7, 2015 at 8:32 AM, K. Heller  wrote:
> Hi all,
>
> When you pull the latest from github.com/torvalds/subsurface, if you (like
> me) are configured to open the default "username.xml" logbook on launch, you
> will likely discover a problem in commit e8a868aae of Oct 6.  See comments
> here:
>
>
> https://github.com/torvalds/subsurface/commit/e8a868aae2583fc3065b3ff150edb005cc32682b#commitcomment-13630347

How about sending another patch for this one? (This has worked just
fine for me, but I am sure this is an issue in some environments.)

> Also, I have provided two (unrelated) bug fixes at:
>
> http://trac.subsurface-divelog.org/ticket/912  and
> http://trac.subsurface-divelog.org/ticket/820

We generally prefer patches to be sent to the mailing list (to answer
your question in the bug comment). I personally use git send-email if
using properly configured laptop. You should tune the commit message
slightly in the future, adding the reference to the bug that is being
fixed in following format will close the bug automatically once
committed to master:

Fixes #820

Also a common warning, if your patch does not make it to master, or
get commented in a day or two, just remind us (Dirk) about it, he
might just have missed it for some reason.

> P.S. i have "lurked" on the mailing list for a few months (without even
> subscribing! just trawling the archives). this is my first hello sent to the
> list.

Thanks for starting to contribute, the bug 820 has been quite
annoying, when I very rarely have been selecting which dives to
import. (But not annoying enough to actually start learning Qt to
figure out a fix for it.)

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


three small patches for current git head

2015-10-06 Thread K. Heller
Hi all,

When you pull the latest from github.com/torvalds/subsurface, if you (like
me) are configured to open the default "username.xml" logbook on launch,
you will likely discover a problem in commit e8a868aae of Oct 6.  See
comments here:


https://github.com/torvalds/subsurface/commit/e8a868aae2583fc3065b3ff150edb005cc32682b#commitcomment-13630347

Also, I have provided two (unrelated) bug fixes at:

http://trac.subsurface-divelog.org/ticket/912  and
http://trac.subsurface-divelog.org/ticket/820

Cheers

/K

P.S. i have "lurked" on the mailing list for a few months (without even
subscribing! just trawling the archives). this is my first hello sent to
the list.
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


patches pushed

2015-09-16 Thread Dirk Hohndel
So I think I have pushed what I had pending - except for my Uemis fixes as
I don't want to cause merge issues for Guido. Hopefully we'll get his
patches and I can add them tomorrow.

I'll kick of new dailies and I hope to do Beta 2 tomorrow or Friday.

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


  1   2   3   4   >