Re: Mobile phone app

2019-02-10 Thread Joakim Bygdell
Hi.

On Sat, 9 Feb 2019 at 23:45, Martin de Weger  wrote:

> Hi all,
>
> I’ve bought a Perdix last week and am using it with Subsurface on my
> iPhone. Am I missing something in the app or isn’t it possible to add extra
> tanks from within the mobile app? I’m diving Sidemount and am used to
> logging dives on my computer. There it is possible to add more tanks, I
> don’t see that option on the iPhone version.
>
>
Subsurface doesn't track cylinders but rather the gases you use so unless
your dive computer has a switch event indicating that you have used more
that one gas mix only one gas mix and by definition only one cylinder will
be shown in the UI.
Due to the limited screen size of the average mobile device some options
are not implemented, the option of adding extra cylinders is one of them.

You have a couple of options to choose from:
1# Use a cylinder specification that is the twinset version of the
cylinders you use. This is the simplest way to get more accurately tracked
gas consumption values.
2# Define a second gas in your dive computer and roughly halfway through
your dive you perform a gas switch to the second gas. Depending on if your
DC/libdivcomputer sends a gas ID together with the mix you might have to
set up the gases with different fO2 i.e. 21&22 & O2 or add 1% He to the
second gas mix in order to make them different. This will get you two gases
and thus two cylinders automatically in both the desktop and mobile version.
3# Use tank pods to get real time data of you gas usages.

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


Re: Website migration

2018-12-31 Thread Joakim Bygdell
On Mon, Dec 31, 2018, 03:38 Dirk Hohndel 
> I expect unexpected behavior (and would love to hear about it so I can try
> to address this).
>

No http to https redirect.
Other than that it seems to work on my phone.

/Jocke

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


Re: Bluetooth device names

2018-10-12 Thread Joakim Bygdell
On Fri, Oct 12, 2018, 19:12 Robert Helling  wrote:

> Hi,
>
> On 12. Oct 2018, at 18:59, Dirk Hohndel  wrote:
>
> So we have that already. What am I missing?
> https://github.com/Subsurface-divelog/subsurface/blob/master/core/btdiscovery.cpp#L20
>
>
> did not realise that. But is my impression correct that we do not yet set
> vendor and product in the dialogue based on that info? I currently don’t
> have a BT dive computer with me.
>

On mobile we do, I haven't looked at the desktop version in a while.


> Best
> Robert
>
> --
>
>
> .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
> Robert C. Helling Elite Master Course Theoretical and Mathematical
> Physics
>   Scientific Coordinator
>
>   Ludwig Maximilians Universitaet Muenchen, Dept.
> Physik
> print "Just another   Phone: +49 89 2180-4523  Theresienstr. 39, rm.
> B339
> stupid .sig\n";   http://www.atdotde.de
>

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


Re: Displaying multiple dive computer profiles with the mobile app?

2018-10-10 Thread Joakim Bygdell
On Wed, 10 Oct 2018 at 15:15, Adric Norris  wrote:

> Now that Subsurface includes Garmin Descent Mk1 support, I finally have a
> few dives logged which include profile info from multiple computers. Using
> Subsurface desktop I can easily display the dive profile from each device,
> but this doesn't seem to be possible with the mobile app. Is that a current
> limitation, or am I missing something?
>
> In the mobile app we only show the first profile.


> I have version 2.1.4 (4.8.3.0) for Android (current release, I believe),
> on a Google Pixel XL running Android 9.
>
> Thanx!
>
> --
> "In the beginning the Universe was created. This has made a lot of people
> very angry and been widely regarded as a bad move." -Douglas Adams
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>


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


Re: Subsurface mobile 2.1.2 auto cloud sync

2018-09-20 Thread Joakim Bygdell
On Wed, 19 Sep 2018 at 21:31, Bill Perry <
bperry...@opensource.billsworld.billandterrie.com> wrote:

> The initial post I did was for subsurface mobile 2.1.2 but in just a few
> hours 2.1.3(4.8.2.5) was pushed out.
> This response is for 2.1.3 but the behavior in this area seems to be same
> for both 2.1.2 or 2.1.3(4.8.2.5)
>
> On 09/19/2018 01:33 AM, Joakim Bygdell wrote:
>
> On Wed, 19 Sep 2018 at 03:25, Bill Perry  wrote:
>
>> --
>>
>> Will the app remember the cloud sync setting if the app was installed
>> with it enabled and the app is upgraded?
>> Seems like it should.
>>
> Unless you purge the current installation before installing the new
> version the setting should be remembered.
>
>>
>> Here is an odd and unexpected sync behavior that I'm seeing.
>> 26 dives were downloaded directly from the dive computer using my GS7.
>> (using a debug version of 4.8.1 that I built)
>>
> Did you download the dives before or after activating your cloud account
> on the device?
>
>
> Original dive computer downloading was done last summer during some other
> testing when I was trying to get the Pelagic data cables to work with
> subsurface mobile.
> Now that I think about it, these dives were originally downloaded on a
> linux desktop not the GS7 and synced to the cloud.
> During that testing, these 26 dives were being download from both a linux
> desktop and a GS4 and testing was being done with and without cloud syncing.
> Often I would remove the app to start clean with cloud sync disabled to
> force all the dives to be re-downloaded on both the desktop and mobile.
>
> However, during recent testing, with Subsurface mobile 4.8.1 I also
> downloaded them on the GS7 with cloud sync disabled.
> I had to disable cloud sync to ensure that the dives would actually be
> transfered from the dive computer.
> So I have done it both ways with various app installations.
>
>
>
> Another 30 dives were downloaded on another device and synced to the cloud
>> which where then synced to my GS7.
>> The app on the GS7 shows all 56 dives and when bringing up the app, it
>> says "56 dives loaded from local dive data file".
>>
>> I removed the 4.8.1 APP and then installed the latest app version of
>> 2.1.2 (4.8.2.0)
>> When it comes up only 26 dives show up - even though 56 dives were
>> showing up previously.
>>
> That is strange, if you fully remove the app all local data should be
> removed.
>
> When you then start the app you should be greeted with the landing page
> where you have the choise of typing in your
> cloud credentials or start in "No cloud mode".
> If you pick "No cloud mode" the divelist that loads should be empty.
> If you type in your cloud credentials on the first start up, it should
> pull everything from the cloud before the divelist is shown.
>
>
> That isn't what I'm seeing.
> The GS7 (Android 8.0.0) and the GS4 (Android 4.4.4) have different
> behaviors.
> GS7 remembers things between uninstall and re-install.
> GS4 seems to start clean and work like you mentioned after removing the
> app and re-installing.
>

The problem is in your GS7 then, you need to see if there is a way to fully
purge all app related data when uninstalling the app.

>
> On the GS7 (Android 8.0.0),  If I install the app, uninstall it and
> re-install it
> I sometimes see a very brief flash of the landing/cloud credentials page
> and then it displays the dive list with the add dives icon at the bottom of
> the screen.
> And the original local 26 dives are showing.
> If I go to the Dive management dialog, Enable auto cloud sync is checked
> and cloud credentials are already in place.
> I can click on Manual sync with cloud and the other 30 dives are pulled
> in.  It remembers the cloud account and password.
> I can repeat this over and over again, installing 2.1.3, seeing 26 dives,
> doing a cloud sync to get the other 30 dives, uninstalling it and
> re-installing, seeing the 26 dives,
> doing a manual cloud sync to get the other 30.
> So it isn't just a one time thing.
> This behavior is the same on the GS4 with Android 4.4.4 and the GS7 with
> Android 8.0.0
>
>
> The 4.8.1 app I built from sources and loaded from an SD card had a
> different behavior.
> 4.8.1 dropped you on the screen that asks for your cloud settings.
> It always came up with cloud disabled and didn't ever remember the
> previously used cloud account settings.
> No dives showed up if you didn't enable cloud and all 56 would immediately
> show up after the cloud credentials were entered.
>

That is the expected behaviour if the app was fully remov

Re: Subsurface mobile 2.1.2 auto cloud sync

2018-09-19 Thread Joakim Bygdell
On Wed, 19 Sep 2018 at 03:25, Bill Perry  wrote:

> --
>
> Will the app remember the cloud sync setting if the app was installed with
> it enabled and the app is upgraded?
> Seems like it should.
>
Unless you purge the current installation before installing the new version
the setting should be remembered.

>
> Here is an odd and unexpected sync behavior that I'm seeing.
> 26 dives were downloaded directly from the dive computer using my GS7.
> (using a debug version of 4.8.1 that I built)
>
Did you download the dives before or after activating your cloud account on
the device?

> Another 30 dives were downloaded on another device and synced to the cloud
> which where then synced to my GS7.
> The app on the GS7 shows all 56 dives and when bringing up the app, it
> says "56 dives loaded from local dive data file".
>
> I removed the 4.8.1 APP and then installed the latest app version of 2.1.2
> (4.8.2.0)
> When it comes up only 26 dives show up - even though 56 dives were showing
> up previously.
>
That is strange, if you fully remove the app all local data should be
removed.

When you then start the app you should be greeted with the landing page
where you have the choise of typing in your
cloud credentials or start in "No cloud mode".
If you pick "No cloud mode" the divelist that loads should be empty.
If you type in your cloud credentials on the first start up, it should pull
everything from the cloud before the divelist is shown.

> If I go to dive management and click on Manual sync with cloud I get the
> other 30 dives.
> If I exit the app and start it up again, it says "56 dives loaded from
> local dive data file" and all 56 dives are there.
> If I remove the 2.1.2(4.8.2.0) app, and re-install 2.1.2(4.8.2.) again,
> when I bring up the app again it says "26 dives loaded from the local dive
> data file".
>
It appears that any dives that were synced from the cloud (I assume to the
> local data file?) are lost when the app is re-installed.
> This seems really odd.
> Is that really the intended behavior?
>
There is a separation between local saved dives and dives stored in the
cloud.
You can have different cloud accounts while still having the same local
storage for the same user.

> If so, why does the app say that all the dives were loaded from the local
> dive data file when starting up?
>
> --- bill
>
>
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>


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


Re: QML help sought

2018-08-09 Thread Joakim Bygdell
Hi Robert,

You need to add "import QtQuick.Controls 2.2 as Controls" in the
reportBugPage.qml

 file

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


Re: Dive list scrolling in Subsurface-mobile

2018-04-16 Thread Joakim Bygdell
On 16 April 2018 at 18:05, Dirk Hohndel  wrote:

>
> > On Apr 16, 2018, at 9:03 AM, Dirk Hohndel  wrote:
> >
> > I got my five year old Nexus 10 to take a charge again and had a chance
> to test the latest beta of Subsurface-mobile on it.
> > Based on that I would say there are two different types of "jerkiness"
> that we need to distinguish.
> >
> > (1) the scrolling isn't completely "smooth". It sometimes stops briefly,
> but then continues in a logical and consistent manner (I see that with the
> Nexus 10)
> > (2) the scrolling jumps around in weird ways, i.e., you are at the
> bottom of the dive list scrolling up, you lift your finger to continue the
> scroll, the dive list jumps back to the bottom
> >
> > I can no longer see (2). Miika, Joacim - do you see this level of
> jerkiness, still?
>
> Thanks, Mac - I corrected this to Joakim and it promptly changed it back.
> Sorry about that.
>
> /D


I can see (1), most prominently when there is a shift between trip and non
trip dives.
Seems like it stops to read whats in the trips before the scrolling
continues.

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


Re: A few changes to the QML UI

2018-04-14 Thread Joakim Bygdell
I see a lot of jerkyness when scrolling, seems like it always restarts at
the top.
Cant' really scroll in small steps, to get beyond the top display I need to
flick really hard.
And then the scrolling will move in steps before it finally comes to a full
stop.

Can't get a cloud resync to happen by scrolling up from the top of the list
due to position reset issues.

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


Re: Cylinder vs. tank -

2017-11-28 Thread Joakim Bygdell
On 28 November 2017 at 09:03, Stefan Fuchs  wrote:

> Am 28.11.2017 um 07:52 schrieb Martin Měřinský:
>
> we really usually use "Cylinder" and only in 6 strings use "Tank".
>
>
> Shall we change EVERYTHING to "cylinder" or sometimes "cyl." (which
> we have already)?
> Would also mean the "Tank bar" becomes the "Cylinder bar"...
>
> In my opinion yes and yes.
>
>
> I already did change every string to "cylinder" or "cyl." save the "Tank
> bar". For the "Tank bar" I still hesitated because this maybe somehow has
> become a fixed phrase in Subsurface.
> So we have these votes up to now:
> "Cylinder bar" +1
> "Tank bar" 0
>
> Any other votes? - Yeah, I know - what an important topic! ;-)
>
Gas bar, since it contains info about  gasmixes and not cylinders.

>
>
> Best regards
> Stefan
>
> --
>
> Stefan Fuchs
> E-Mail: sfu...@gmx.de
>
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>
>


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


Re: new APK with smaller action button

2017-08-03 Thread Joakim Bygdell
On 4 August 2017 at 06:09, Dirk Hohndel  wrote:

>
> > On Aug 3, 2017, at 8:01 PM, Chirana Gheorghita Eugeniu Theodor <
> off...@adaptcom.ro> wrote:
> >
> > Looks ok but small issues on the size of the screens.
> > In show gps fixes text is positioned out of the screen and in each
> screen there is a remainant of the old one onbthe left side.
>
> The slightly too narrow pages that show a thin slice of the page next to
> them are caused by incorrect margins. I fixed this for the Settings page,
> it needs to get fixed for the others as well.
> I thought we had the gps fixes page, err, fixed, but maybe that got broken
> again.
>
> Hopefully one of the other QML savvy people will look at this over the
> next couple of weeks (hint, hint)
>

There are other issues with the GPS page as well, and it just happens to
next in line on my to do list
.

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



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


Re: Statistics - Preliminary Trials

2017-07-31 Thread Joakim Bygdell
On 31 July 2017 at 18:33, Dirk Hohndel  wrote:

>
> > On Jul 30, 2017, at 11:40 AM, Tomaz Canabrava 
> wrote:
> >
> > People,
> >
> > Please don't give me ideas, my head is full of them currently, I just
> wanna a bit of help to decide what should I use.  The pictures represent
> the Statistics for the Trip Depth (min, avg, max)
> > The data is not sorted on the first picture. I'm now trying with QWT
> because I had layouting issues with our profile code to add the trip
> headers on the statistics.
> >
> >
> > I'v done a bit of experimentation using our own profile code:
>
> That to me looks very... I don't know... ODD.
>
> > and using QML:
>
> That looked much more like what I would expect statistics to look like.
>

Bar graphs are not really good at displaying that kind of information,
boxplots are way better, they start at min end at max and mean/median
is represented by a dot or a line.



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



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


Re: Default tank size

2017-07-27 Thread Joakim Bygdell
On 27 Jul 2017 11:55 p.m., "John Griffiths" <scuba.jr...@grifent.com> wrote:

That is my issue. I'd like for the default to be my HP120.


You could use the metric variant of your cylinder as default, 15L 232bar.


Sent from my android device.


-Original Message-----
From: Joakim Bygdell <j.bygd...@gmail.com>
To: Dirk Hohndel <d...@hohndel.org>
Cc: John Griffiths <stuff.jr...@grifent.com>, Subsurface Mailing List <
subsurface@subsurface-divelog.org>
Sent: Thu, 27 Jul 2017 3:34 PM
Subject: Re: Default tank size

On 27 July 2017 at 21:25, Dirk Hohndel <d...@hohndel.org> wrote:

> Yes, once any of your dives contain such a cylinder, so once you have
> added a custom
> cylinder for the first time, it will be available as an auto-complete item
> in the drop down.
>
> /D
>
> When you edit a dive, yes.
But it can not be choosen as the default cylinder since we currently do not
look for custom cylinders
in the divelog when we populate the list of available default cylinders on
the preferences page.

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


Re: Default tank size

2017-07-27 Thread Joakim Bygdell
On 27 July 2017 at 21:25, Dirk Hohndel  wrote:

> Yes, once any of your dives contain such a cylinder, so once you have
> added a custom
> cylinder for the first time, it will be available as an auto-complete item
> in the drop down.
>
> /D
>
> When you edit a dive, yes.
But it can not be choosen as the default cylinder since we currently do not
look for custom cylinders
in the divelog when we populate the list of available default cylinders on
the preferences page.



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


Re: Default tank size

2017-07-27 Thread Joakim Bygdell
On 27 July 2017 at 21:06, Dirk Hohndel  wrote:

> Once you add it as a 15.3 liter tank (please do NOT add it as 120cuft tank
> as that would
> result in incorrect data) with HP120 as name, the next time you start
> Subsurface it SHOULD
> offer that as one of the options in the drop down.  I just tested this and
> it works for me™.
>
> /D
>
> > On Jul 27, 2017, at 12:00 PM, John Griffiths 
> wrote:
> >
> > I have Worthington X7-120 (HP120) tanks. They are not HP119. They are
> > not in the drop down list of tanks. I cannot find a way to add the tank.
> >
> > I have to add the tank to every dive.
> >
> > Regards,
> > John
>

Once you add a cylinder using the desktop version it can be found as the
last cylinder at the bottom of the list.



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


Re: Possibility to add custom field?

2017-07-25 Thread Joakim Bygdell
On 26 July 2017 at 06:48, Dirk Hohndel  wrote:

>
> > On Jul 25, 2017, at 7:44 PM, Linus Torvalds <
> torva...@linux-foundation.org> wrote:
> >
> > This message was in the Subsurface "Google Groups" thing, and I'm
> > moving the discussion to the development mailing list instead since I
> > think more people read that one.
> >
> > [ I don't know how many people follow that google group, thing - I
> > just do it over email anyway ]]
> >
> > Anyway, I suggested to Marc that the natural way to do this would be
> > to make it possible to edit the "extradata" { key, value } pairs that
> > we show in the "Extra Info" tab, and Marc said that would work well
> > for him.
> >
> > But obviously I don't do UI code. But it feels like it *should* be
> > fairly easy to make that "Extra data" thing be something you can add
> > entries to and edit.
>
> That wouldn't be too terribly hard in principle. But usually once you take
> that first step, people want more. Autocompletion of entries. Ability to
> search and/or filter. Ability to display the information in the mobile app,
> etc.
>
> I'm not against doing this, but I want us to do this eyes wide open.
>
> I really hope that Tomaz will NOT say "I'll do it", mainly because he is
> working on statistics and we have too many things already that got
> started and never got finished :-/
>
>
If we get this information from libDC or our text parsers, fine.
If it is something the user will add  manually they might as well add it in
the notes field.



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


Re: latest APK

2017-07-25 Thread Joakim Bygdell
On 25 July 2017 at 21:00, David Tillotson  wrote:

> On 25 July 2017 17:44:30 BST, Dirk Hohndel  wrote:
>>
>> Thanks to Jocke the UI keeps getting better and better.
>> I really like the colored icon as indication for the running location
>> service. Nicely done.
>>
>> The only thing I really feel is preventing me from doing another beta is
>> the issue with the cloud credentials - that's not in a good state right
>> now. The rest looks great!
>>
>> If you want to see for yourself...
>>
>> http://subsurface-divelog.org/downloads/test/Subsurface-mobile-4.6.4.508-arm.apk
>>
>> /D
>> --
>>
>> subsurface mailing list
>> subsurface@subsurface-divelog.org
>> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>>
>>
> I'm not sure if it's intentional, but the drop-downs are not the best
> colour combination when the dark scheme is applied. Screenshot attached.
> The progress on the mobile has been absolutely superb (although I haven't
> been able to check GPS or downloading as yet).
> --
> David Tillotson
>
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>
> The dark theme needs much more work before it can be considered anything
but a preview.


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


Re: [PATCH 1/2] QML UI: use Material default switches

2017-07-24 Thread Joakim Bygdell
On 23 July 2017 at 23:23, Rick Walsh <rickmwa...@gmail.com> wrote:

>
>
> On 24 Jul. 2017 1:46 am, "Joakim Bygdell" <j.bygd...@gmail.com> wrote:
>
> On 23 July 2017 at 16:56, Dirk Hohndel <d...@hohndel.org> wrote:
>
>>
>> > On Jul 23, 2017, at 7:45 AM, Dirk Hohndel <d...@hohndel.org> wrote:
>> >
>> >
>> >> On Jul 23, 2017, at 7:14 AM, Joakim Bygdell <j.bygd...@gmail.com>
>> wrote:
>> >> Look at my latest PR, the checkboxes are gone.
>> >
>> > pulling it right now... let's see how I like the other extreme...
>> > (I was leaning more towards "all check boxes" than "all switches", but
>> I haven't tried it, yet)
>>
>
> Thanks for trying this. Unfortunately I don't think it quite works.
> Switches and checkboxes are pretty much interchangeable, but replacing a
> radio button with a switch doesn't make sense. You should be able to turn
> off a switch by touching it. We can't do that with the theme selections.  I
> think we need to keep radio buttons for that.
>

That's assuming we keep the current theme choices, if we set the blue theme
as default we can keep the switches for Pink and Dark.
We will them get Blue or Pink accents on a light or dark background.
Either way we need to fix the hue and saturation levels for the accent
colors for the dark theme.


>> Yeah, this does look a little odd - but I only tried on the desktop.
>> Building an APK now which I will push to the server so everyone can try.
>>
>> /D
>
>
> The switches look a lot better if they are smaller.
> Our current switch on top, scaled switches in the middle and material
> original on the bottom.
>
> This is a good comparison, and I agree smaller is better.
>
> Before realising I liked the default qml Material switch, I was trying to
> replicate its dimensions, especially the relative values of each property
> so the thing could be scaled easily by changing one value only. Material
> may not be right but it's a decent starting point. You might have done
> something similar, but if it's helpful, I think I ended up with.
> Outer "rectangle" (slider)
> Width: gridunit * 1.8
> Height: width * 0.4
>
> Inner rectangle (selector)
> Width: slider height * 1.4
> Height: width
>
> Radius of both is obviously height * 0.5
>
> Dirk, when you say you'd prefer the switches and radio buttons to be about
> the same size, which dimension did you mean? A switch with a round selector
> is necessarily wider than it is tall. Radio buttons and checkboxes have
> same height and width. So same height? Same width? Somewhere in between?
>



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


Re: latest Android test binary

2017-07-23 Thread Joakim Bygdell
On 23 July 2017 at 20:16, Joakim Bygdell <j.bygd...@gmail.com> wrote:

> On 23 July 2017 at 19:40, Dirk Hohndel <d...@hohndel.org> wrote:
>
>>
>> On Jul 23, 2017, at 9:31 AM, Joakim Bygdell <j.bygd...@gmail.com> wrote:
>>
>>>
>>> Or we could apply an color the the GPS icon in the drawer when the
>>> service is active, that way it will be REALLY clear when it is active or
>>> not.
>>>
>>>
>>> THAT I like. Make the icon gray like all the other ones when not active,
>>> and accent color when active.
>>>
>>
>> Looks like Kirigami prevent us from doing that, can't assign color to a
>> Action element.
>> And since all images are of type svg, whatever color they are initially
>> doesn't matter.
>>
>>
>>
>>
>> Nothing is stopping us from turning this into six (or however many) PNGs
>> with the right colors
>>
>> /D
>>
>
> Kirigami applies color overlay to PNGs as well, so that's a no go.
>
> Seems we have to modify KIrigami to make this work.
>
>
> --
> Jocke
>

Without making any changes to Kirigami, the best we can do is this.

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


Re: latest Android test binary

2017-07-23 Thread Joakim Bygdell
On 23 July 2017 at 19:40, Dirk Hohndel <d...@hohndel.org> wrote:

>
> On Jul 23, 2017, at 9:31 AM, Joakim Bygdell <j.bygd...@gmail.com> wrote:
>
>>
>> Or we could apply an color the the GPS icon in the drawer when the
>> service is active, that way it will be REALLY clear when it is active or
>> not.
>>
>>
>> THAT I like. Make the icon gray like all the other ones when not active,
>> and accent color when active.
>>
>
> Looks like Kirigami prevent us from doing that, can't assign color to a
> Action element.
> And since all images are of type svg, whatever color they are initially
> doesn't matter.
>
>
>
>
> Nothing is stopping us from turning this into six (or however many) PNGs
> with the right colors
>
> /D
>

Kirigami applies color overlay to PNGs as well, so that's a no go.

Seems we have to modify KIrigami to make this work.


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


Re: latest Android test binary

2017-07-23 Thread Joakim Bygdell
On 23 July 2017 at 16:19, Dirk Hohndel <d...@hohndel.org> wrote:

>
> On Jul 22, 2017, at 10:39 PM, Joakim Bygdell <j.bygd...@gmail.com> wrote:
>
>>
>> Activating the GPS service should  not be under settings. This is not a
>> service setting: it is an action just as "Manual sync with cloud" is an
>> action. At the very least it should be in the GPS submenu and not in
>> Settings. Then again, there is under "Dive Management, the option "Enable
>> auto cloud sync". Is this a setting? It turns out these distinctions are
>> actually not black and white.
>>
>
> No they are not and we should define where the ambiguous parts should
> belong.
>
>
> I really liked having the GPS service at the top level - to make sure it's
> visible that it's on (it drains the battery - not a lot, but some).
>
>
>
>>
>> I have two proposals for "Run location service" activation. 1) Move the
>> "Run location service"  switch to the GPS submenu and indicate whether it
>> is active or inactive by an appropriate icon on the left, indicating on or
>> off. I could help with icons but Joakim has been so efficient with his
>> icons I would prefer him do this. 2) For the location service to be useful
>> at all, the user must be able to easily see whether it is active or not,
>> even on the main menu. This is why the previous arrangement with a checkbox
>> on the main menu was very useful. Is it possible to have an icon in the
>> Android icon bar at the top of the screen?
>>
>
> 1) Moving it to the GPS menu is no problem, the icon on the other hand...
> If we add a icon to show that the GPS is off, that would be the default
> view for most people, see picture.
>
> what we really should do is to interact with the OS backend and display
> the GPS icon in the top bar just like Google Maps does when active.
>
>
> That's totally non-obvious to me. I always thought that was a poor choice
> on Google's part.
>
> Or we could apply an color the the GPS icon in the drawer when the service
> is active, that way it will be REALLY clear when it is active or not.
>
>
> THAT I like. Make the icon gray like all the other ones when not active,
> and accent color when active.
>

Looks like Kirigami prevent us from doing that, can't assign color to a
Action element.
And since all images are of type svg, whatever color they are initially
doesn't matter.


>
> /D
>
>


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


Re: [PATCH 1/2] QML UI: use Material default switches

2017-07-23 Thread Joakim Bygdell
On 23 July 2017 at 16:56, Dirk Hohndel <d...@hohndel.org> wrote:

>
> > On Jul 23, 2017, at 7:45 AM, Dirk Hohndel <d...@hohndel.org> wrote:
> >
> >
> >> On Jul 23, 2017, at 7:14 AM, Joakim Bygdell <j.bygd...@gmail.com>
> wrote:
> >> Look at my latest PR, the checkboxes are gone.
> >
> > pulling it right now... let's see how I like the other extreme...
> > (I was leaning more towards "all check boxes" than "all switches", but I
> haven't tried it, yet)
>
> Yeah, this does look a little odd - but I only tried on the desktop.
> Building an APK now which I will push to the server so everyone can try.
>
> /D


The switches look a lot better if they are smaller.
Our current switch on top, scaled switches in the middle and material
original on the bottom.


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


Re: [PATCH 1/2] QML UI: use Material default switches

2017-07-23 Thread Joakim Bygdell
On 23 July 2017 at 16:12, Dirk Hohndel <d...@hohndel.org> wrote:

>
> On Jul 23, 2017, at 12:18 AM, Rick Walsh <rickmwa...@gmail.com> wrote:
>
>
>
> On 23 July 2017 at 18:57, Rick Walsh <rickmwa...@gmail.com> wrote:
>
>>
>>
>> On 23 July 2017 at 17:26, Joakim Bygdell <j.bygd...@gmail.com> wrote:
>>
>>>
>>>
>>> In which way does a white button on a white background look better??
>>>
>>> There is no styling what so ever on that button meaning that it will be
>>> white
>>> even when the dark theme is in use.
>>>
>>> White on a light background is what the Material guidelines say should
>> be used for an off switch.
>> https://material.io/guidelines/components/selection-
>> controls.html#selection-controls-switch
>>
>> The switch colouring is styled according to the Material accent colour,
>> which we set in main.qml.  I agree it looks pretty poor with the dark
>> theme, but if we set the accent colour to have the same sat and val (but
>> blue hue) as the Material default, then it looks much better.  Please try
>> the attached patch and see what you think.
>>
> So you don't have to apply and test it yourself, here is what I mean.  I
> think the dark theme is better with the lighter accent colour.
>
>
> I like the colored switches much better.
> But I think they need to be more similar in size to the check boxes, or
> maybe the check boxes need to be more similar in size to them?
> Either way, they should be consistent.
>
> /D
>
>
Look at my latest PR, the checkboxes are gone.


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


Re: [PATCH 1/2] QML UI: use Material default switches

2017-07-23 Thread Joakim Bygdell
On 23 July 2017 at 08:57, Rick Walsh <rickmwa...@gmail.com> wrote:

>
>
> On 23 July 2017 at 17:26, Joakim Bygdell <j.bygd...@gmail.com> wrote:
>
>>
>>
>> In which way does a white button on a white background look better??
>>
>> There is no styling what so ever on that button meaning that it will be
>> white
>> even when the dark theme is in use.
>>
>> White on a light background is what the Material guidelines say should be
> used for an off switch.
> https://material.io/guidelines/components/selection-controls.html#
> selection-controls-switch
>
> The switch colouring is styled according to the Material accent colour,
> which we set in main.qml.  I agree it looks pretty poor with the dark
> theme, but if we set the accent colour to have the same sat and val (but
> blue hue) as the Material default, then it looks much better.  Please try
> the attached patch and see what you think.
>

One thing I think we need to decide is how strict we are supposed to follow
the Material guidelines.
In order to minimise any downstream cleanup.

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


Re: progress on the QML UI

2017-07-23 Thread Joakim Bygdell
On 22 July 2017 at 21:29, Dirk Hohndel  wrote:

> As many have pointed out, progress on the QML UI has
> been just amazing. Davide's ideas have really made a
> difference to how Subsurface-mobile looks these days.
>
> I know that there are quite a few more areas that we need
> to address, but I wanted to check who is working on what
> so we don't step on each other. It's exciting to again have
> several people working on the UI, so let's make the most
> of it.
>
> It is late in Europe, so I may be the only one coding right
> now, but anyway...
>
> I'm planning to work on the Download dialog, there are
> still a few instances of odd texts being displayed, and
> most importantly, I want us to remember the last dive
> computer the user downloaded from so that that is the
> one that is selected by default. For most sane people
> with only one BT/BLE  dive computer we already do the
> right thing, but for those who have more than one dive
> computer that we can download from, we show the one
> that was detected first, which may be one that you tested
> with and that is still paired with your phone, but that you
> normally don't use.
>
> Additionally, I want to work on the height of the entries
> in the table after you downloaded dives, and finally on
> the fact that apparently we currently ignore which dives
> you select for downloading (oops).
>
> If others could post a quick note what they are working
> on, I think that would be really helpful.
>
> Thanks everyone!
>
> /D
>

I'll continue with the drawer and the settings page,
replacing the theme checkboxes with linked switches for starters.

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


Re: latest Android test binary

2017-07-23 Thread Joakim Bygdell
On 23 July 2017 at 08:12, Willem Ferguson 
wrote:

> "Dive Managment" on the main menu is spelt incorrectly.
>

Yepp, an "e" is missing.

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


Re: [PATCH 2/2] QML UI: align controls on settings page

2017-07-22 Thread Joakim Bygdell
On 23 July 2017 at 05:30, Rick Walsh  wrote:

> Signed-off-by: Rick Walsh 
> ---
>  mobile-widgets/qml/CloudCredentials.qml | 8 
>  mobile-widgets/qml/Settings.qml | 4 +---
>  2 files changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/mobile-widgets/qml/CloudCredentials.qml b/mobile-widgets/qml/
> CloudCredentials.qml
> index c1f38434..4ae5ebd5 100644
> --- a/mobile-widgets/qml/CloudCredentials.qml
> +++ b/mobile-widgets/qml/CloudCredentials.qml
> @@ -14,9 +14,9 @@ Item {
> property string username: login.text;
> property string password: password.text;
>
> -   property real gridWidth: loginWindow.width -
> Kirigami.Units.gridUnit
> -   property real col1Width: gridWidth * 0.80
> -   property real col2Width: gridWidth * 0.20
> +   property real gridWidth: outerLayout.width
> +   property real col1Width: gridWidth * 0.75
> +   property real col2Width: gridWidth * 0.25
>
> function saveCredentials() {
> manager.cloudUserName = login.text
> @@ -27,7 +27,7 @@ Item {
>
> ColumnLayout {
> id: outerLayout
> -   width: loginWindow.width - loginWindow.leftPadding -
> loginWindow.rightPadding - 2 * Kirigami.Units.gridUnit
> +   width: loginWindow.width
>
> function goToNext() {
> for (var i = 0; i < children.length; ++i)
> diff --git a/mobile-widgets/qml/Settings.qml
> b/mobile-widgets/qml/Settings.qml
> index 06554ceb..7226cee9 100644
> --- a/mobile-widgets/qml/Settings.qml
> +++ b/mobile-widgets/qml/Settings.qml
> @@ -15,12 +15,10 @@ Kirigami.ScrollablePage {
> property real gridWidth: settingsPage.width - 2 *
> Kirigami.Units.gridUnit
>
> ColumnLayout {
> -   width: parent.width - Kirigami.Units.gridUnit
> CloudCredentials {
> id: cloudCredentials
> Layout.fillWidth: true
> -   Layout.margins: Kirigami.Units.gridUnit
> -   Layout.topMargin: 0
> +   Layout.margins: 0
> property int headingLevel: 4
> }
> Rectangle {
> --
> 2.13.3
>
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>


The reason this looks like it does is that it is not finished yet, the
changes made where just to prevent
the lines overflowing the width of the screen and have the checkboxes
displayed on top of the
preview boxes.

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


Re: latest Android test binary

2017-07-22 Thread Joakim Bygdell
On 23 July 2017 at 07:25, Willem Ferguson 
wrote:

> On 22/07/2017 21:23, Dirk Hohndel wrote:
>
> I started testing the new binary and it seems not broken, so that's good
>
>
> Most everything in the changes I really like. The new menu layout makes a
> lot more sense. I miss the easily visible / accessible switch for the
> location service (but that may be just me... this seems like something I
> really want to be able to see at a glance when checking my phone while on
> the dive boat).
>
> What I wonder about is the switch to "switches" (no pun intended). I know
> that they are the Android standard, but I think they provide zero
> incremental value compared to having check boxes - and the round bigger
> switches and the smaller more squared check boxes (for example on the
> settings page) really do look odd together. I don't think this is quite
> right, yet.
>
>
> Activating the GPS service should  not be under settings. This is not a
> service setting: it is an action just as "Manual sync with cloud" is an
> action. At the very least it should be in the GPS submenu and not in
> Settings. Then again, there is under "Dive Management, the option "Enable
> auto cloud sync". Is this a setting? It turns out these distinctions are
> actually not black and white.
>

No they are not and we should define where the ambiguous parts should
belong.


>
> I have two proposals for "Run location service" activation. 1) Move the
> "Run location service"  switch to the GPS submenu and indicate whether it
> is active or inactive by an appropriate icon on the left, indicating on or
> off. I could help with icons but Joakim has been so efficient with his
> icons I would prefer him do this. 2) For the location service to be useful
> at all, the user must be able to easily see whether it is active or not,
> even on the main menu. This is why the previous arrangement with a checkbox
> on the main menu was very useful. Is it possible to have an icon in the
> Android icon bar at the top of the screen?
>

1) Moving it to the GPS menu is no problem, the icon on the other hand...
If we add a icon to show that the GPS is off, that would be the default
view for most people, see picture.

what we really should do is to interact with the OS backend and display the
GPS icon in the top bar just like Google Maps does when active.

Or we could apply an color the the GPS icon in the drawer when the service
is active, that way it will be REALLY clear when it is active or not.


>
> Kind regards,
> willem
>
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>
>


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


Re: [PATCH 1/2] QML UI: use Material default switches

2017-07-22 Thread Joakim Bygdell
On 23 July 2017 at 05:30, Rick Walsh  wrote:

> The Material theme's default switch is nicer than our own.
>
> Signed-off-by: Rick Walsh 
> ---
>  mobile-widgets/qml/CloudCredentials.qml | 21 ---
>  mobile-widgets/qml/Settings.qml | 63
> -
>  2 files changed, 84 deletions(-)
>
> diff --git a/mobile-widgets/qml/CloudCredentials.qml b/mobile-widgets/qml/
> CloudCredentials.qml
> index 72a5ccb1..c1f38434 100644
> --- a/mobile-widgets/qml/CloudCredentials.qml
> +++ b/mobile-widgets/qml/CloudCredentials.qml
> @@ -105,27 +105,6 @@ Item {
> password.text = "" //
> don't show a hidden password
> password.echoMode = checked ?
> TextInput.Normal : TextInput.Password
> }
> -   indicator: Rectangle {
> -   implicitWidth:
> Kirigami.Units.largeSpacing * 3
> -   implicitHeight:
> Kirigami.Units.largeSpacing
> -   x: showPassword.leftPadding
> -   y: parent.height / 2 - height / 2
> -   radius:
> Kirigami.Units.largeSpacing * 0.5
> -   color: showPassword.checked ?
> -   
> subsurfaceTheme.lightPrimaryColor
> : subsurfaceTheme.backgroundColor
> -   border.color: subsurfaceTheme.
> darkerPrimaryColor
> -
> -   Rectangle {
> -   x: showPassword.checked ?
> parent.width - width : 0
> -   y: parent.height / 2 -
> height / 2
> -   width:
> Kirigami.Units.largeSpacing * 1.5
> -   height:
> Kirigami.Units.largeSpacing * 1.5
> -   radius: height / 2
> -   color: showPassword.down
> || showPassword.checked ?
> -
>  subsurfaceTheme.primaryColor : subsurfaceTheme.lightPrimaryColor
> -   border.color:
> subsurfaceTheme.darkerPrimaryColor
> -   }
> -   }
> }
> }
>
> diff --git a/mobile-widgets/qml/Settings.qml
> b/mobile-widgets/qml/Settings.qml
> index 8669c3bb..06554ceb 100644
> --- a/mobile-widgets/qml/Settings.qml
> +++ b/mobile-widgets/qml/Settings.qml
> @@ -321,27 +321,6 @@ Kirigami.ScrollablePage {
> onClicked: {
> manager.locationServiceEnabled =
> checked
> }
> -   indicator: Rectangle {
> -   implicitWidth:
> Kirigami.Units.largeSpacing * 3
> -   implicitHeight:
> Kirigami.Units.largeSpacing
> -   x: locationButton.leftPadding
> -   y: parent.height / 2 - height / 2
> -   radius:
> Kirigami.Units.largeSpacing * 0.5
> -   color: locationButton.checked ?
> -   
> subsurfaceTheme.lightPrimaryColor
> : subsurfaceTheme.backgroundColor
> -   border.color: subsurfaceTheme.
> darkerPrimaryColor
> -
> -   Rectangle {
> -   x: locationButton.checked
> ? parent.width - width : 0
> -   y: parent.height / 2 -
> height / 2
> -   width:
> Kirigami.Units.largeSpacing * 1.5
> -   height:
> Kirigami.Units.largeSpacing * 1.5
> -   radius: height / 2
> -   color: locationButton.down
> || locationButton.checked ?
> -
>  subsurfaceTheme.primaryColor : subsurfaceTheme.lightPrimaryColor
> -   border.color:
> subsurfaceTheme.darkerPrimaryColor
> -   }
> -   }
> }
> }
> Rectangle {
> @@ -374,27 +353,6 @@ Kirigami.ScrollablePage {
> onClicked: {
> manager.libdcLog = checked
> }
> -   indicator: Rectangle {
> -   implicitWidth:
> 

Re: latest Android test binary

2017-07-22 Thread Joakim Bygdell
On 22 July 2017 at 21:23, Dirk Hohndel  wrote:

> I started testing the new binary and it seems not broken, so that's good
> :-)
>
> Most everything in the changes I really like. The new menu layout makes a
> lot more sense. I miss the easily visible / accessible switch for the
> location service (but that may be just me... this seems like something I
> really want to be able to see at a glance when checking my phone while on
> the dive boat).
>
> What I wonder about is the switch to "switches" (no pun intended). I know
> that they are the Android standard, but I think they provide zero
> incremental value compared to having check boxes - and the round bigger
> switches and the smaller more squared check boxes (for example on the
> settings page) really do look odd together. I don't think this is quite
> right, yet.
>

As I wrote in  the PR message, this particular piece of the UI is not done
yet.
Getting the UI to match my vision of this piece requires rewriting our
color swithing
logic as well.

That being said it is rather trivial to replace the checkboxes with linked
switches
in order to get a coherent look of the settings page.


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


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


Re: Subsurface mobile: delete and sync operations.

2017-07-19 Thread Joakim Bygdell
On 19 July 2017 at 15:03, Dirk Hohndel  wrote:

>
> > On Jul 19, 2017, at 4:11 AM, Willem Ferguson <
> willemfergu...@zoology.up.ac.za> wrote:
> >
> > I must preface this expressing my pleasure in seeing what is happening
> with Subsurface-mobile version 2. The enormous effort that is going into
> this and the incredible difference that it makes to the usability of the
> program. I am privileged to be associated with this team that is creating a
> remarkable piece of software.
> >
> > I experience that there are fundamental problems with manipulating dive
> lists on the mobile platform.
> >
> > 1) See screencast at
> >
> > https://www.dropbox.com/s/47m9ujbzancuxen/2017_06_24_11_28_30.mp4?dl=0
> >
> > using 4.6.4.443. This playback speed is at a THIRD of the live speed.
> >
> > View dive list.
> >
> > Delete a dive
> >
> > Go back to dive list
> >
> > Select another dive and hit delete button at bottom.
> >
> > Display goes to *previous deleted* dive and the second dive is not
> deleted at all. Looks like delete sequence is not even started.
> >
> > Hitting the Android Back button (to get back to the dive list) crashes
> the program.
> >
> > Fortunately, upon restart of the program, no dives are deleted.
> >
> > I can supply adb logcat if required.
>
> I have now been able to reproduce one of these "delete - divelist goes
> weird" bugs. I still don't understand why the model gets confused, but at
> least now I can work on it.
>
> > 2) When deleting a dive/profile from the button at the screen bottom,
> the undo option only shows up for about 1 second. This is way too short for
> an unprepared user to respond appropriately. And then the dive is
> (theoretically) permanently deleted. Extremely user-unfriendly. The
> interface would be much more safe if the 1-second button rather said:
> "Confirm delete". Noticed the steps in Github that are required to delete a
> repo? You must really be convinced to do this in order to delete a repo, no
> way of doing that accidentally. I am pretty conversant with the mobile UI
> and on a few occasions my finger has managed to accidentally stray to the
> dustbin under a dive profile. And then the "Undo" button comes up, out of
> the blue, and I am so startled that I do not respond in time. Dive gone.
>
> The pattern of confirming an action is something that is not well liked in
> mobile apps. I am pretty sure we had this discussion here a while ago. I
> agree that it's way too easy to delete a dive. Of course, that dive isn't
> really gone (thanks to our git storage), but that's no consolation for a
> regular user.
>
> I'm not sure what to do about this. Davide, you are our resident UI
> guru... what do you think?
>
> > 3) I intentionally deleted four dives from my dive log (using dive list
> and red button) in order to test the delete option. Then I tried to regain
> them by doing a "Save to cloud" from my desktop. Nice, divelog saved. Then
> I do a "Sync with cloud" on the mobile but the four dives do not come back.
> No way of get them back, except by uninstalling Subsurface-mobile on
> Android and doing a complete reinstallation, re-initialising the cloud
> credentials and reloading the divelog from scratch. My four dives are back.
>
> You'd think that would work, but it doesn't because of the way git merges
> the operations. We need a UI to bring back deleted dives. It's not really
> hard to do, it's just something someone needs to implement.
>
> > I am just thinking how an unfamiliar user will struggle with this
> interface. My firm suggestions are:
> >
> > a) On Android, the "Sync with cloud" tries to be too clever and as far
> as I can see does not succeed. As user I would be much more happy if I had
> complete control with two more options: "Save to cloud" and "Load from
> cloud". These are unambiguous with clearly predictable results.
>
> The way git works it's not that easy. Yes, it's easy to implement "forget
> everything I've done and go back to what's on the server". I actually
> started working on that and then got side tracked. I should have a branch
> that has the beginnings of that somewhere. But "save to cloud" and ignore
> changes from the other side is not something that I'm keen to implement.
> That's basically a force push and that will make any other Subsurface
> instance that is connected to the cloud storage decidedly unhappy. So this
> needs a bit more thought.
>
> > b) Make the delete dive action more safe. Dive data are valuable, often
> with significant time spent in writing notes, specifying cylinder pressures
> (that are lost upon delete) and the like. One does not want to lose a dive
> accidentally.
>
> Agreed. I'm just not sure what the best user interaction for that would be.
>

Simple fix, remove the delete button in the dive details view, in order to
delete a dive from the dive list
the user must pres and hold for a few seconds until the trashcan appears
then click it to delete the dive.
A bit cumbersome yes, but not 

Re: QML custom style

2017-07-18 Thread Joakim Bygdell
On 18 July 2017 at 22:10, Rick Walsh  wrote:

> Dirk and Jocke (especially),
> I can see you've done a lot over the past few weeks to make the mobile UI
> much more attracted.  Have you considered using a custom Subsurface style
> (falling back to Material) to make it more efficient to theme the QML
> controls?  It would be easier to customize the controls in one place, and
> have the change made consistently throughout, following the guidance in:
> https://doc.qt.io/qt-5/qtquickcontrols2-customize.
> html#creating-a-custom-style
>

The thing is that we are not just dealing with the material theme here,
Kirigami has it own theme as well.
And the interaction between these two are in some cases a bit special as
there are parts where the material theme decides what the user sees and
other parts where the Kirigami decides how things will look.
Right now we just tell the app that for material light theme to set a few
parameters to our own colors, the rest is actually handled by the Kirigami
theme.


>
> In the attached patch I have done that for the button controls (only used
> on DownloadFromDiveComputer.qml) moving the styling into
> SubsurfaceStyle/Button.qml, but it would not be hard to do it for the other
> controls.  Using the Button as an example, we could then add code to make
> the button depress and change colour when down, and only have to add the
> code in one place.
>
> The big problem now, is that the only way I've been able to use the custom
> style is to select it from the command line (testing on desktop):
> ./subsurface-mobile -style /home/rick/src/subsurface/mobile-widgets/qml/
> SubsurfaceStyle
> Clearly that is useless for the mobile app.  I believe we should also be
> able to use QQuickStyle::SetStyle to set it from within the app (see
> https://doc.qt.io/qt-5/qquickstyle.html), but the following doesn't work
> for me, either with or with setting the fallback style.  Maybe the problem
> is that I'm using Qt5.7, but I'm not sure.
>
> diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp
> index 68dd228b..cd1df6c6 100644
> --- a/subsurface-mobile-helper.cpp
> +++ b/subsurface-mobile-helper.cpp
> @@ -14,6 +14,7 @@
>
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -43,6 +44,10 @@ void run_ui()
> qmlRegisterType("org.subsurfacedivelog.mobile",
> 1, 0, "DCDownloadThread");
> qmlRegisterType("org.subsurfacedivelog.mobile",
> 1, 0, "DCImportModel");
>
> +   // set style for custom constrols
> +   QQuickStyle::setStyle(":/SubsurfaceStyle");
> +   QQuickStyle::setFallbackStyle("Material");
> +
> QQmlApplicationEngine engine;
> KirigamiPlugin::getInstance().registerTypes();
>  #if __APPLE__
>
> Cheers,
>
> Rick
>
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>
>


-- 

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


Re: QML UI theming

2017-07-18 Thread Joakim Bygdell
Patches sent to upstream Kirigami.


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


Re: QML UI theming

2017-07-18 Thread Joakim Bygdell
On 18 July 2017 at 15:39, Dirk Hohndel  wrote:

>
> > On Jul 18, 2017, at 2:16 AM, Davide DB  wrote:
> >
> > On 17 July 2017 at 22:14, Davide DB  wrote:
> >>
> >> My last try: we could just color dive number of those dives with five
> stars ;)
> >>
> >> davide@mobile
> >>
> >
> > While working with the latest APK I realized that the preference page
> > is a bit messed up.
> > There is a small offset on the panel and all strings are way too large
> > even in English. (see attachment)
>
> Hmm, this used to be wrapped and laid our correctly. Arg.
>
> > BTW I see that through all the app we used the common desktop
> > paradigma: "once I modify something I have to explicitly save it".
> > Hence we have the ubiquitous floppy disk button which covers part of the
> screen.
> > Except few specific cases (i.e. save to cloud) in all Android/IOS apps
> > I used, the save action is implicit while changing some parameter.
>
> We actually modify the theme immediately... I'm ok with modifying
> all the settings immediately. But then we need a different paradigm
> that gets us out of there. I guess the back button on Android and
> throwing the phone against the wall until it breaks under iOS.
>

Or you could just tap the "Divelist" at the top statusbar.


> /D
>
>


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


Re: QML UI theming

2017-07-17 Thread Joakim Bygdell
On 17 July 2017 at 21:50, Dirk Hohndel <d...@hohndel.org> wrote:

>
> On Jul 17, 2017, at 12:35 PM, Joakim Bygdell <j.bygd...@gmail.com> wrote:
>
> On 17 July 2017 at 21:21, Davide DB <dbdav...@gmail.com> wrote:
>
>> Would be nice having the third color defi ed as well . Sometime called
>> accent color. I.e. orange
>> It would be useful for showing on/off state on several widgets that we
>> will use on settings.
>> Just small details that make the difference.
>>
>> In our dive list I would see the small dive number in orange...
>>
>
> We shouldn't mix in to many different colors, but we can make it black,
> white or use the primary
> accent color depending on theme.
>
>
> No, I don't see this as useful. There is no reason to color this
> differently.
>
> Something like this.
>
>
> Ah, I see that you have fixed the coloring of the minor-button... eagerly
> hoping for a pull request...
>
> or is this still waiting on a Kirigami change?
>

Yes, I'm in the process of cleaning up the Kirigami changes now. And those
will be needed if we are
going to have different color overlays on the primary and secondary action
buttons.


> /D
>
>


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


Re: QML UI theming

2017-07-17 Thread Joakim Bygdell
On 17 July 2017 at 21:21, Davide DB  wrote:

> Would be nice having the third color defi ed as well . Sometime called
> accent color. I.e. orange
> It would be useful for showing on/off state on several widgets that we
> will use on settings.
> Just small details that make the difference.
>
> In our dive list I would see the small dive number in orange...
>

We shouldn't mix in to many different colors, but we can make it black,
white or use the primary
accent color depending on theme.

Something like this.


> PS
>
> I'm working on dive edit panel and sidebar items reloaded with settings
>
> davide@mobile
>
>
-- 
Jocke
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: QML UI theming

2017-07-17 Thread Joakim Bygdell
On 17 July 2017 at 18:58, Dirk Hohndel <d...@hohndel.org> wrote:

> Cool. I assume you have sent patches / pull request to Marco?
>
Not yet, need to test all the corner cases first.


>
>
> --
> From my phone
> ----------
> *From:* Joakim Bygdell
> *Sent:* Mon Jul 17 09:23:19 PDT 2017
> *To:* Dirk Hohndel
> *Cc:* Subsurface Mailing List
> *Subject:* Re: QML UI theming
>
> A small preview of how it can look after some changes to Kirigami.
>
>
> --
> Jocke
>



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


Re: QML UI theming

2017-07-17 Thread Joakim Bygdell
A small preview of how it can look after some changes to Kirigami.


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


Android styling woes

2017-07-13 Thread Joakim Bygdell
After working a bit on getting a coherent layout across the themes we use
I ran into a snag on the GPS page as can bee seen in the pictures.

SwipeListItem is not styled at all even though the code says that is should
have the same styling as the OverlayDrawer.

Adb logcat points the error to listItem not being declared in
DefaultListItemBackground.qml, but the actual declaration of listItem is in
SwipeListItem.qml.

Marco could you take a look at the Kirigami side of this and see why the
inheritance does not work as expected.

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


Re: Android beta...

2017-07-08 Thread Joakim Bygdell
 8 July 2017 at 19:36, Dirk Hohndel  wrote:

> Quick update, latest APK is here
>
> http://subsurface-divelog.org/downloads/test/Subsurface-
> mobile-4.6.4.353-arm.apk
>
> > On Jul 6, 2017, at 10:33 AM, Dirk Hohndel  wrote:
> >
> > - Petrel AI tank pressure reading (I keep forgetting to add that - I
> >  believe I have all the information I need, just haven't found the time
> >  to do it)
>
> This is working now, as is hardware model detection of your Shearwater
> dive computer (so the Perdix AI now shows up as Perdix AI and not as
> Petrel).
>
> > - Better download icon - Davide generously arranged for a designer to
> >  create a really cool icon for that, I want to switch this out before we
> >  release this (sorry, this of course affects screen shots)
>
> Done
>
> > - User manual - I know that Willem has started working on that, I need to
> >  confirm what his latest version is, possibly get the screen shots
> >  updated (but that can wait until final)
>
> Haven't done this (and of course thanks to the new icon we'll need new
> screenshots eventually)
>
> > If we get the OSTC BLE support in, that would be nice, it would be good
> to
> > get confirmation that the BT based OSTC support is still working (please
> > use the binary that I created to confirm that so we are sure there aren't
> > any discrepancies with your build environment).
>
> So we have confirmation that OSTC BT is working.
>
> What's missing is working on theme color issues and consistency - that
> can IMHO wait until after the Beta.
>

This is in the works, having a few problems with stuff that rely on the
qtquickcontrols2.conf file,
mostly text fields that don't want to play along.

I can open a PR now if you want to have a look.



>
> Which means that once I've done the use manual, we should be ready
> for an Android Beta this weekend.
>
> Yay.
>
> /D
>
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>


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


Re: test builds

2017-07-02 Thread Joakim Bygdell
On 2 July 2017 at 00:30, Dirk Hohndel  wrote:
>
>
> Mac (ten hours into trying to build Qt 5.9.1 with QWebKit - no luck yet)
> - BT works for Robert, doesn't work for me AT ALL
>   -- Qt documentation says that Qt gets no addresses from the Bt stack and
>  will always return 00:00:00:00:00:00
>   -- Robert says he gets addresses if he "waits long enough"
>   -- Qt documentation tells you to use the UUID instead of the address
>   -- paringStatus and other functions that we need can only be called with
>  an address, not with a UUID
>   -- when I try using the UUID instead of an address I get all-zeroes
>  UUIDs for some (but not all) devices - and have no idea how to use
>  the non-zero UUIDs throughout Subsurface to try to make the rest of
>  it work
>   I know that at some point (read about a year ago) BT worked for me on
>   the Mac as well - but right now on three different Macs I get zero
>   successful downloads from three different BT dive computers
> - BLE compiles but is otherwise in the same state as the above


I managed to do some testing on my old Mac, (El Capitan, 10.11.06)

BT download from my OSTC3 works if I do thing in a certain order.

1# If no cached adress exists in Subsurface start with pairing the device
from the OS.
2# Scan for new devices  from within Subsurface.
3# Save the BT address in the DC cache.
4# Download the dives.

1# is really important as if the DC is not paired when you tell Subsurface
to scan for devices
download mode on the DC will time out before it is discovered.

If a cached address already exists Subsurface will find the DC when
scanning even if it is not paired to the computer.

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


Re: Overthinking on Subsurface mobile app UX

2017-06-22 Thread Joakim Bygdell
On 22 June 2017 at 13:26, Dirk Hohndel  wrote:

>
> > On Jun 22, 2017, at 2:42 AM, Dirk Hohndel  wrote:
> >> 1) Any possibility to allow for multi-line dive trip titles? This would
> improve functionality of the app.
> >
> > Yes, that's a possibility. I'll see if I can implement that.
>
> Thanks to jet lag induced insomnia (dive vacations... the gift that keeps
> on giving) this has been implemented.
>
> As has a fix to no longer show "(dive(s))" in en_UK and() en_US.
>
> It would be great if the translators could add the singular / plural
> translations
> for this string on Transifex. Search for that source text, and note that
> you
> need to switch between "1" and "other" on the translation side (and for
> some
> language even three or four different options, e.g. in Polish 1, few,
> many, other)
>
> >> 2) The refresh/sync option. I think what you mean is that autosync
> happens when one pulls down the dive list beyond the topmost dive trip?
> >
> > Actually, I call the equivalent of the menu item "Manual sync with cloud"
> >
> >> But what if one accidentally pulls down the list without intending a
> sync? I did just that and autosync happened, even though I have autosync
> turned off. It is like some of the Microsoft applications that are trying
> to be too clever, doing something that the user did not intend. In general
> I have a strongly negative sentiment with respect to autosync. The reason
> is that I have on several occasions accidentally deleted a dive on the
> mobile application. It was then necessary to edit the lost dive on the
> desktop (so that git sees the dive again) and then to re-save the dive log
> from the desktop to the cloud in order to reinstate the deleted dive on the
> mobile app. Highly irritating. While I think that some users prefer auto
> sync, it is important to be able to have full control over the process of
> cloud backup from the mobile app. A solution could be:
> >> a) If autosync is turned off, NO autosync should take place anywhere.
> >> b) It would be incredibly helpful if there are options similar to the
> desktop version: Upload to cloud and download from cloud. These are
> unambiguous and give full control to the user so that unintended changes to
> dives are not saved to the cloud, messing up the backup of the dive log on
> cloud. This would improve the functionality of the app.
> >
> > That is an interesting point. One way around this would be to finally
> > implement a UI to walk back the git history explicitly. Because nothing
> > is truly ever LOST.
> >
> > In the meantime, an option in the menu to
> > a) turn of the pull down refresh for people who dislike it and
> > b) add an option "abandon local changes, re-open from server"
>
> This I haven't done, yet. Instead I'll try to get another hour or two of
> sleep.
>
> Everything is pushed to master, a new APK is app as well
>
> http://subsurface-divelog.org/downloads/test/Subsurface-
> mobile-4.6.4.257-arm.apk
>
> This one (thanks to Jan) also tries to show only supported dive computers
> in the Download from DC section. Anton, can you help by adding the FTDI
> devices for Android (even though that still doesn't work on Pixel and other
> strictly enforcing 7.x devices)?
>

This restriction also removed all DCs that we can download from via USB.


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



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


Re: Overthinking on Subsurface mobile app UX

2017-06-21 Thread Joakim Bygdell
On 21 Jun 2017 21:01, "Dirk Hohndel" <d...@hohndel.org> wrote:

On Wed, Jun 21, 2017 at 08:58:42PM +0200, Joakim Bygdell wrote:
> > previous dive is not part of a trip.
> > The only thing that sticks out is the sharpness of the blue in the top
bar
> > compared to opaque color palette of the dive list and the blue of the
> logo.
>
> I tried to use exactly the colors that Davide suggested. I may have gotten
> something wrong, though, as the selected dive on my phone doesn't seem to
> match the color. I have an idea what might be the reason and will play
> with it.
>
> Might start with the logo blue on the top and natch the rest. As it is the
> top bar seems out of place.

Well, Davide really wants me to use "standard" colors. You want me to
start from our color. I don't think I can do both. I'm happy to do either,
TBH. But we need to pick one or the other, I think.


For the blue I like the slightly toned down we have in the logo, but that
is my personal preference. To be precise it is the big difference in
sharpness between the top bar and everything else that bugs me, as seen in
the screenshots in my previous mail.

Or we go with the pink.. that was awsome.


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


Re: Overthinking on Subsurface mobile app UX

2017-06-21 Thread Joakim Bygdell
On 21 June 2017 at 20:10, Dirk Hohndel  wrote:

>
> On Jun 21, 2017, at 11:07 AM, Dirk Hohndel  wrote:
>
>
> Ok I will download latest apk asap.
>
>
> Please wait a few minutes so you test the latest
>
>
> Here we go: http://subsurface-divelog.org/downloads/test/Subsurface-
> mobile-4.6.4.232-arm.apk
>
> Based on Davide's colors, fixing (I hope) the key concerns raised so far.
>

Nice clear discrepancies of  which dives are part of a trip even if the
previous dive is not part of a trip.
The only thing that sticks out is the sharpness of the blue in the top bar
compared to opaque color palette of the dive list and the blue of the logo.


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


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


Re: Subsurface-mobile Bluetooth download

2017-06-05 Thread Joakim Bygdell
On 5 June 2017 at 17:48, Anton Lundin <gla...@acc.umu.se> wrote:

> On 05 June, 2017 - Joakim Bygdell wrote:
>
> > On 5 June 2017 at 16:41, Dirk Hohndel <d...@hohndel.org> wrote:
> >
> > > On Sun, Jun 04, 2017 at 05:48:03PM +0200, Joakim Bygdell wrote:
> > > >
> > > > USB download from a OSTC3 works and takes about 2 min, but it does
> not
> > > work
> > > > from a Suunto Vyper.
> > >
> > > That's interesting. Which phone / device? Which OS? Rooted?
> > >
> >
> > One+, Cyanogenmod 13
> >
> > I have got it to download from the suunto via ftdi on my laptop by
> > modifying serial_ftdi.c.
>
> It should just work.
>
> What did you end up modifying?
>

Line 108:
ts.tv_nsec = (timeout % 1000) * 100; --> ts.tv_nsec = (timeout % 1000)
* 200;


>
> //Anton
>
>
> --
> Anton Lundin+46702-161604
>



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


Re: [PATCH] Visualisation of individual oxygen sensor data for CCR dives

2017-05-10 Thread Joakim Bygdell
 10 May 2017 at 15:47, Anton Lundin <gla...@acc.umu.se> wrote:

> On 10 May, 2017 - Joakim Bygdell wrote:
>
> > On 10 May 2017 at 11:33, Anton Lundin <gla...@acc.umu.se> wrote:
> >
> > > Do we have any data from a Shearwater running as solenoid controller?
> >
> > I have data from a JJ in eCCr mode.
> > There is no sensor data in that log, only setpoint information at the
> > start,
> > when the setpoint changes during the descent and before surfacing.
>
> Are you sure? How did you look?


> You need to have applied the patches discussed here to have
> libdivecomputer expose that information.
>

To get individual cell information yes, and there is probably more
information we can get from those DCs.

Based on what was saved to subsurface logfile, eCCR log shows only setpoint
information, mCCR setpoint (which is unused) and voted ppO2.



> Anyway, looking at the data would be interesting, trying to figure out
> if there is any bits there disclosing that the computer was running in a
> controller mode, and if there are any bits there saying when it fired
> the solenoid.
>
>
> //Anton
>
>
> --
> Anton Lundin+46702-161604
>



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


Re: [PATCH] Visualisation of individual oxygen sensor data for CCR dives

2017-05-10 Thread Joakim Bygdell
On 10 May 2017 at 14:07, Jef Driesen  wrote:

> On 2017-05-10 11:33, Anton Lundin wrote:
>
>> On 10 May, 2017 - Jef Driesen wrote:
>>
>>> I've implemented the scaling factor now. See attached set of
>>> patches. It took me a bit longer than expected because there were a
>>> few cases where the ppO2 still ended up being zero. And that turned
>>> out to be for dives without external O2 sensors enabled (e.g. fixed
>>> setpoint mode). But the tricky part was that the external PPO2 bit
>>> seems to be reversed. According to the documentation [1] external
>>> PPO2 is 1 and internal PPO2 is 0. But based on the data I have, it
>>> seems to be the opposite.
>>>
>>> BTW, I wonder if we should ignore the setpoint value when external
>>> O2 sensors are used? Are setpoint still used in such case?
>>>
>>
>> Do we have any data from a Shearwater running as solenoid controller?
>>
>> Ex. On the JJ-CCR's they use a Shearwater Petrel with sensors which
>> controls the o2 solenoid to try to get the o2 sensor values to match
>> your configured setpoint.
>>
>
> I have data from several Petrels, but I have no idea how they were being
> used. Is it possible to detect this somehow based on the data itself?
>
> That said, I think setpoint values are still interesting to see, to
>> validate how well the controller did manage to try to keep the o2 close
>> to the setpoint.
>>
>
> After looking at the data, I had the impression that the setpoint value is
> "unused" because it seems to just contain some "dummy" value (for example
> the last used value, or some default value).
>
> I'll illustrate with an example dive from Steve's Petrel (*). This dive
> has a fixed setpoint of 0.70 on every sample, but the ppo2 values range
> from 0.32 to 1.74!


> (*) I can send you the data if you want to take a look. I don't know if
> Steve is okay with sending his dives to a public mailinglist, so I didn't
> attach it to this email.
>
> To me that doesn't look like the dive computer is even trying to keep the
> ppo2 close to the setpoint. At least not to the setpoint value that's
> stored in the sample. Hence my question whether this value is relevant or
> not?


I have seen similar things on data from mCCRs, fixed setpoint and variable
sensor data, the setpoint of 0.7 seems to be some sort of default value on
shearwaters DCs.
When the DC is used only as a visual reference of the measured ppO2 the
resulting data structure is logical.


>
> Attached is the last iteration I did of the sensors patch. It has some
>> minor differences from the one you included, but most of them isn't that
>> relevant.
>>
>
> The part where you add 1024 to the calibration value is actually worse
> then the original version where you only did that if the value is smaller
> than 1000. It works (although not perfect) for the Predator, but it breaks
> for the Petrel because it doesn't need any correction at all. The variant
> with the if < 1000 works for the Petrel because the values are always
> greater than 1000, and also for some Predators, but not all because
> sometimes the values are greater than 1000 too. So if you want to do it
> correctly, then you would need to check on the model as I did in the third
> patch. If you want, I can move that code from the third patch to the second
> one.
>
> The SENSOR_AVERAGE is maybe a good idea to keep around. Might come in
> handy once we have a way to communicate the type of value (sensor vs
> average/voted).
>
> The only relevant information is that the adc offset value is probably
>> in 0.025 mV as unit.
>> Thats party based on the information in
>> https://www.shearwater.com/wp-content/uploads/2016/07/O2-Off
>> sets-Public-Notice-RevA.pdf
>>
>
> The info in the comments is indeed useful knowledge, but since we're not
> using the adc values, it's pretty pointless to store them in the parser
> struct. It's just a waste of space there. I know it's only a few bytes, but
> I see no good reason to clutter the code with unused stuff.
>
> The only real comment about the code is that I would have liked to see
>> the calibration factor kept as a int, and just change the unit factor
>> from .1 to .22, between the models.
>>
>
> What would be the advantage of that? That would mean yet some other field
> to store the scaling factor, or doing some "if (model == PREDATOR)" when
> calculating the ppo2. Now it's just done once in advance, making the
> conversion from millivolt to ppO2 independent of the model. I'm even
> tempted to pre-multiply the value with the 10.0 factor too, to get rid
> of an extra
>
> Jef
>
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>



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


Re: [PATCH] Visualisation of individual oxygen sensor data for CCR dives

2017-05-10 Thread Joakim Bygdell
On 10 May 2017 at 11:33, Anton Lundin  wrote:

> On 10 May, 2017 - Jef Driesen wrote:
>

 

Do we have any data from a Shearwater running as solenoid controller?
>
> Ex. On the JJ-CCR's they use a Shearwater Petrel with sensors which
> controls the o2 solenoid to try to get the o2 sensor values to match
> your configured setpoint.
>
> I have data from a JJ in eCCr mode.
There is no sensor data in that log, only setpoint information at the
start,
when the setpoint changes during the descent and before surfacing.


> That said, I think setpoint values are still interesting to see, to
> validate how well the controller did manage to try to keep the o2 close
> to the setpoint.
>
>
> Attached is the last iteration I did of the sensors patch. It has some
> minor differences from the one you included, but most of them isn't that
> relevant.
>
>
> The only relevant information is that the adc offset value is probably
> in 0.025 mV as unit.
> Thats party based on the information in
> https://www.shearwater.com/wp-content/uploads/2016/07/O2-
> Offsets-Public-Notice-RevA.pdf
>
>
> The only real comment about the code is that I would have liked to see
> the calibration factor kept as a int, and just change the unit factor
> from .1 to .22, between the models.
>
>
> //Anton
>
>
> --
> Anton Lundin+46702-161604
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>



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


Re: Subsurface-mobile crashes

2017-04-14 Thread Joakim Bygdell
On 14 Apr 2017 19:47, "Dirk Hohndel"  wrote:




I just pushed a commit (and will create new builds for TestFlight / Play
this evening)
that draws a 2cm * 2cm square on the Developer->Theme Information page.

On my Google Pixel XL that square measures 19.5 * 19.5 mm - pretty good.

Can people try that and post the model number, screen resolution as
reported,
and the measured size of that black square?


One plus One
Resolution, 360 x 616
Square is 23.5 * 23.5mm


Thanks

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


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


Re: [PATCH] Visualisation of individual oxygen sensor data for CCR dives

2017-04-09 Thread Joakim Bygdell
 9 April 2017 at 11:39, Joakim Bygdell <j.bygd...@gmail.com> wrote:

>  9 April 2017 at 11:30, Davide DB <dbdav...@gmail.com> wrote:
>
>> On 9 April 2017 at 11:22, Joakim Bygdell <j.bygd...@gmail.com> wrote:
>> >  9 April 2017 at 11:01, Davide DB <dbdav...@gmail.com> wrote:
>> >>
>> >> I update my settings and nothing happens.
>> >> I have a Petrel 2 connected to a SF2 CCR with three sensors. I get
>> >> only one green line.
>> >
>> >
>> > I have data from both a Predator and a Petrel, in both cases only the
>> > consensus pO2 are reported
>> > together with the setpoint data.
>> >
>>
>> Hi Joakim and Steve,
>>
>> Thanks for the feedback.did you try with Shearwater desktop?
>>
>
> Not my DC so can't test.
> But according to the guy who owns the Predator it only shows one cell with
> Shearwaters software.
>

At least the Petrel2 should report 3 sensors.

Jef, how is on the backed side, how many sensors does libdivecomputer
supports for the Petrel series?

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


Re: [PATCH] Visualisation of individual oxygen sensor data for CCR dives

2017-04-08 Thread Joakim Bygdell
On 8 April 2017 at 12:35, Davide DB  wrote:

> On 12 January 2015 at 09:41, Willem Ferguson
>  wrote:
>
> Sorry guys, really a bad day :) So I bring bag to life this old hot topic.
>
> As far I see there's no way to see individual 02 sensor value plots or
> am I missing some setting?
>

Under Preferences -> Graph
You have "Show individual O2 sensors when viewing pO2"

Once you toggle the "show pO2" button on in the profile it should show data
from all sensors.
Assuming of course that your divecomputer and the libdc backend supports
multiple sensors.


>
> I understand different views on this but would it possible having a
> YAB (Yet Another Button) to toggle single/multiple visualization?
> There are rebs with up to five O2 sensors. I understand the resulting
> graph could be a mess but if I have a problem I would like to be able
> to see what's happened on Subsurface not another sw.
>
> Bye
>
> --
> Davide
> https://vimeo.com/bocio/videos
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>



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


Re: Subsurface-mobile status

2017-04-05 Thread Joakim Bygdell
On 5 April 2017 at 10:42, Marco Martin  wrote:
>
> did one more last commit for that edit box with hints with some small
> usability improvements, then, if there aren't significant problems with
> it, i'm
> happy as is.
>

Tested latest master, editing works fine except for one thing.

If any of the hints function objects has a null value when the edit page is
loaded
they get populated with the first entry in the list for that particular
object.
Which leads to the user having to erase and then retype the correct entry,
instead of just type into an empty space.


> > I'll drop that commit for now until I understand better what's happening
> > there, but push the rest and create a new APK so others can test.
>
> ok, a bit out of ideas then as the devices i tried it on seemed to work.
> Being
> a QGraphicsView makes it kindof tricky as is a view within an item, within
> a
> view that makes easy to lose track of what is transformed where :)
>
> --
> Marco Martin
>


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


Re: Subsurface-mobile status

2017-04-04 Thread Joakim Bygdell
On 4 Apr 2017 21:06, "Dirk Hohndel" <d...@hohndel.org> wrote:

On Tue, Apr 04, 2017 at 07:50:28PM +0200, Joakim Bygdell wrote:
> The profile issue is still present in master,

Which profile issue? There are so many. And is that with my APK or with
something you built yourself? It turns out that I had forgotten to push
two commits yesterday...


Built from master this afternoon.
Scaling issue where only the top left quarter of the profile where visible.


> it happens far more regularly when selecting any of the top two dives in
> the list
> than any other dive combined.
>
> Dive editing is broken for anything that uses the new HintsTextEdit
> function.

Can you elaborate on what is broken?


Any changes to fields which uses the new hints function is never saved nor
updated when reloading the dive after edit.
I have a hunch regarding the reason.


Thanks

/D


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


Re: Subsurface-mobile status

2017-04-04 Thread Joakim Bygdell
The profile issue is still present in master,
it happens far more regularly when selecting any of the top two dives in
the list
than any other dive combined.

Dive editing is broken for anything that uses the new HintsTextEdit
function.


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


Re: Problems building Subsurface for Android

2017-02-03 Thread Joakim Bygdell
On 3 February 2017 at 10:49, Willem Ferguson <
willemfergu...@zoology.up.ac.za> wrote:

> On 03/02/2017 08:25, Joakim Bygdell wrote:
>
> Remove the quotations on line 383 and try again, that fixed it for me.
> --
> Jocke
>
>
>
> I think your suggestions were extremely helpful. Thank you very much. The
> problem below is due to a totally different reason. It almost completes the
> build now, then I get:
>
> $ bash subsurface/packaging/android/build.sh
> ~/src/subsurface ~/src
> ~/src
> ~/src/qt-android-cmake ~/src
> Already up-to-date.
> ~/src
> -- building without marble widget support
> -- building without printing support
> -- building without usermanual
> -- building with libftdi support
> -- system name Android
> -- Found Qt for Android: /home/willem/src/Qt/5.7/android_armv7
> -- Found Android SDK: /home/willem/src/subsurface/../android-sdk-linux
> <===
> -- Found Android NDK: /home/willem/src/subsurface/../android-ndk-r13b
> -- Found ANT: /usr/bin/ant
> -- Configuring done
>
> . etc
>
> Scanning dependencies of target subsurface.apk
> [ 89%] Generating run_android_deploy_qt
> Directory /home/willem/src/android-sdk-linux/platforms does not exist
> make[2]: *** [run_android_deploy_qt] Error 2
> make[1]: *** [CMakeFiles/subsurface.apk.dir/all] Error 2
> make: *** [all] Error 2
> $
>
> There are two problems here.
>
> 1) The location of the android sdk. On my machine it resides at
> ~/Android/Sdk/tools. It is not in ~/src. For this reason I am not sure
> how to interpret the message marked with <===, above because it differs
> both in the name of the directory as well as its location. In theory I
> could generate a symlink just as I did for Qt and libdivecomputer.
>
Yes symlinking makes this easier for you.
The script expects to find android-sdk-linux and android-ndk-r13b in the
root of your working directory together with Qt, libdivecomputer and
subsurface.

> The current organisation on my machine is:
>
> ~/Android/Sdk$ ls -l
> total 28
> drwxrwxr-x  3 willem willem 4096 Feb  3 11:33 build-tools
> drwxrwxr-x  4 willem willem 4096 Feb  3 11:33 extras
> drwxrwxr-x  3 willem willem 4096 Feb  3 11:32 patcher
> drwxrwxr-x  3 willem willem 4096 Feb  3 11:31 platforms
> drwxrwxr-x  5 willem willem 4096 Feb  3 11:33 platform-tools
> drwxrwxr-x  3 willem willem 4096 Feb  3 11:32 sources
> drwxrwxr-x 12 willem willem 4096 Feb  3 11:34 tools
>
> And here, indeed is probably the missing platforms directory which, in
> turn, contains the Android-25 directory
>
> I think the script just does not know where to find all the bits and
> pieces.
>
> Obviously I have something simple not done right. Any suggestions?
>
make sure tour working src directory contains these folders:
android-sdk-linux
android-ndk-r13b
subsurface
libdivecomputer
Qt

symlinks to other places are ok, the important thing are that they have the
same name as listed above.

I am much closer now to building the .apk
>
> Kind regards,
>
> willem
>
>
>
>
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>
>


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


Re: Problems building Subsurface for Android

2017-02-02 Thread Joakim Bygdell
On 3 February 2017 at 07:59, Willem Ferguson <
willemfergu...@zoology.up.ac.za> wrote:

> On 03/02/2017 08:25, Joakim Bygdell wrote:
>
> Wilhelm,
>
> You can create a workaround for that error if you edit this file:
> Qt/5.7/android_armv7/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake
>
> Comment out line 101
> set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES
> cxx_decltype)
>
> --
> Jocke
>
> Thanks very much, Jocke. After doing the above, I get:
>
> -- system name Android
> -- Found Qt for Android: /home/willem/src/Qt/5.7/android_armv7
> -- Found Android SDK: /home/willem/src/subsurface/../android-sdk-linux
> -- Found Android NDK: /home/willem/src/subsurface/../android-ndk-r13b
> -- Found ANT: /usr/bin/ant
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /home/willem/src/subsurface-build-arm
> Scanning dependencies of target version
> Built target version
> cp: missing destination file operand after 
> '/home/willem/src/subsurface/android
> android-mobile'
>

Looks like it is line 382.

>
> I tried finding the offending cp in build.sh but I was not successful
> because there are no markers in the above log that I can use to locate the
> cp. E.g. there is no string "Scanning for dependencies" in the shell
> script, probably generated by cmake. Any ideas?
> Kind regards,
> willem
>
> Remove the quotations on line 383 and try again, that fixed it for me.


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


Re: Problems building Subsurface for Android

2017-02-02 Thread Joakim Bygdell
Wilhelm,

On 3 February 2017 at 06:20, Willem Ferguson <
willemfergu...@zoology.up.ac.za> wrote:

> On 03/01/2017 09:17, Joakim Bygdell wrote:
>
> On 3 January 2017 at 06:35, Willem Ferguson <willemfergu...@zoology.up.ac.
> za> wrote:
>
> CMake Error in CMakeLists.txt:
>>   No known features for CXX compiler
>>
>>   "GNU"
>>
>>   version 4.9.
>>
> I have seen that as well on my old mac.
> If I remember correctly it seemed to be an issue between an older version
> of GCC and the cmake flags.
>
> If you go into the build directory and run the ccmake command you should
> get a better error output.
>
> --
> Jocke
>
> Which directory do you refer to as  the build directory? ~/src?
>
> On my machine there is currently no build directory in
> src/subsurface/packaging/android.
>
> Clearly, src/subsurface/build is inappropriate.
>
> I am trying to get a better diagnostic than the above one.
>
> Kind regards,
>
> willem
>
>
> You can create a workaround for that error if you edit this file:
Qt/5.7/android_armv7/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake

Comment out line 101
set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES
cxx_decltype)

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


Re: Android/OSi comparison against Windows 10

2017-02-02 Thread Joakim Bygdell
On 2 February 2017 at 18:41, Dirk Hohndel <d...@hohndel.org> wrote:

>
> On Feb 2, 2017, at 9:32 AM, Joakim Bygdell <j.bygd...@gmail.com> wrote:
>
> On 2 February 2017 at 18:17, Dirk Hohndel <d...@hohndel.org> wrote:
>>
>>
>> Is this something I should hold 4.6.1 for?
>>
> No, not really.
> It it turns out to be simple I can have something done by Sunday morning
> your time.
> It is all about fine tuning the relative positions of the objects in the
> profile.
>
>
> But that's all in Subsurface-mobile. So that isn't really relevant for a
> 4.6.1 release.
> Storing the settings in cloud storage is what I'm most concerned about.
> And Sunday morning isn't a hard cut-off. We can wait another week if
> that's what
> it takes
>
> Or more specifically - this obviously has two components, the one where it
>> saves the relevant settings in git, and the one where it then uses that
>> information in Subsurface-mobile. Obviously the latter is pointless
>> without the former. It might be good to have the code that saves the
>> relevant settings to cloud storage in 4.6.1 so that once we are able to
>> test the changes to the mobile app, the average user actually has those
>> settings in their cloud storage, right?
>>
>
> Some settings already seems to be saved to cloud storage, tank-bar being
> one.
>
>
> Is it? Where? All I am aware of are
> - autogroup
> - units
> and the divecomputers
>

I did an quick and dirty test by adding the tank-bar to the mobile-profile.
And the visibility of it mirrors the settings on desktop at the time of
saving to cloud.

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


Re: Problems building Subsurface for Android

2017-02-02 Thread Joakim Bygdell
On 2 February 2017 at 17:01, Dirk Hohndel  wrote:

> >
> > originating at the line:
> >
> > "$SUBSURFACE_SOURCE"/../libdivecomputer/configure --host=${BUILDCHAIN}
> --prefix="$PREFIX" --enable-static --disable-shared --enable-examples=no
> >
> > Does any one have an idea?
> >
> > Of course there is not a libdivecomputer directory in src because I
> started with a clean src directory.
> >
> > Do I need a manual install of libdivecomputer? As fa ar I am aware this
> should not be necessary.
>
> It looks like the Android build.sh doesn't do that, yet.
>
No, but the android-build.sh sets up the current src directory correctly.
The only time this will be an issue is when people runs the build script in
packagin/android directly without running any of the other scripts first.


> Goes to show you that whatever we do, we always make assumptions.
>
> /D
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>



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


Re: Re: Problems building Subsurface for Android

2017-02-02 Thread Joakim Bygdell
Wilhelm,
On 2 February 2017 at 17:28, Willem Ferguson <
willemfergu...@zoology.up.ac.za> wrote:

>
>
> On 02/02/2017 18:01, Dirk Hohndel wrote:
>
>>
>> I get the folowing scripting error in build.sh:
>>>
>>> ~/src/libdivecomputer-build-arm ~/src
>>> subsurface/packaging/android/build.sh: line 296:
>>> /home/willem/src/subsurface/../libdivecomputer/configure: No such file
>>> or directory
>>>
>> autoreconf --install
>> in the libdivecomputer directory should take care of that.
>> For odd reasons I sometimes have to run that twice
>> The Android build instructions assume that this is a libdivecomputer
>> directory that has already been used for builds.
>> I guess we could should fix that in the Android build
>>
>>  There is no libdivecomputer directory in src. I have such a directory in
> my backup/src directory which contains the Linux build resources.
> However, in the current src there is a directory
> libdivecomputer-build-arm. But if I remember correctly, I do not need
> the 'normal' libdivecomputer but one that has some Android-specific
> things?? The only other way to get the 'normal' directory is to download
> it from the libdivecomputer website?
> Kind regards,
> willem


The libdivecomputer-build-arm contains the output when the script builds
libdivecomputer for the arm archtecture.
But in order to do so it needs aces to the libdivecomputer sources, and
that folder should be in the same directory as your subsurface folder.
You should be able to symlink your libdivecomputer folder from backup/src
to the current src folder.
If you have built the linux version you will have to do a clean before
building for arm.

If you look in your current src folder there vill be a number of
"-build-arm" folders, those contain the modules built for arm architecture
for subsurface-mobile.


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



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


Re: Android/OSi comparison against Windows 10

2017-01-31 Thread Joakim Bygdell
On 31 January 2017 at 19:11, Dirk Hohndel  wrote:

> This is actually an interesting idea. Today we just store a small number
> of settings
> in cloud storage - we could store some more to allow fine tuning of what
> you see
> in the profile.
>
> Keep in mind that we don't do the deco computations on the phones, so we
> can't
> do everything that we do on the desktop, but some things like the tank
> bar, average
> line, etc, could be easily done. I just don't want a complex settings UI
> in the mobile
> app. But if we "magically" show something that more closely resembles what
> a user
> already has configured on the desktop, I think that would make sense.
>
> Any volunteer to look into implementing this? I don't think this would be
> all that
> hard, TBH.
>

That should be fairly simple to set up,
it will take a bit of time to finetune the exact relative positions due to
the small screen size.

Tankbar, average depth, temp, reported ceiling are the ones that might be
possible to have options for.
Maybe pO2 if it is data from an RB.

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


Re: Re: Qt and subsurface for Android

2017-01-09 Thread Joakim Bygdell
On 3 January 2017 at 06:37, Willem Ferguson  wrote:


> Thank you very much, this really helped. It appears all the locations
> have been found.
>
> Now, I get the message below:
>
> -- system name Android
> -- Found Qt for Android: /home/willem/src/Qt/5.7/android_armv7
> -- Found Android SDK: /home/willem/src/subsurface/../android-sdk-linux
> -- Found Android NDK: /home/willem/src/subsurface/../android-ndk-r13b
> -- Found ANT: /usr/bin/ant
> -- Configuring done
> CMake Error in CMakeLists.txt:
>   No known features for CXX compiler
>
>   "GNU"
>
>   version 4.9.
>

I have found what causes the error above, not why though.

in 5.7/android_armv7/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake, line 101

set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype)


commenting out that line will make the error go away.

That line does not exists in QT 5.6.


> I do not find a log file in the src/subsurface-mobile-build-arm
> directory. I assume it arises at:
>
> export CXX=${BUILDROOT}/ndk-$ARCH/bin/${BUILDCHAIN}-g++
>
> and I have no idea however how to respond. Any advice is highly
> appreciated.
>
> Kind regards,
>
> willem
>
>
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>



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


Re: Building Subsurface-mobile

2017-01-09 Thread Joakim Bygdell
On 9 January 2017 at 14:55, Dirk Hohndel  wrote:

> I wonder if we could reasonably script that part as well? So that on a
> Ubuntu or Fedora it's really just running a single script that installs and
> grabs everything you need...
>
> Should be posible, i.e.

./android update sdk --no-ui -a -t 1,2,3,33

Packages selected for install:
- Android SDK Tools, revision 25.2.4
- Android SDK Platform-tools, revision 25.0.3
- Android SDK Build-tools, revision 25.0.2
- SDK Platform Android 7.1.1, API 25, revision 3



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


[PATCH] QML UI: deal with multiple buddies correctly

2016-09-12 Thread Joakim Bygdell
When editing adive in Subsurface-mobile we can only handle one buddy
due to the limitations of the combobox. To prevent loss of data when editing
a dive with more than one buddy we display "Multiple Buddies" in the buddy
field. This creates a special case where no changes are written to the buddy 
field
unless the user changes buddy for that dive.
---
 core/subsurface-qt/DiveObjectHelper.cpp |  1 +
 mobile-widgets/qml/DiveDetails.qml  |  6 +-
 mobile-widgets/qmlmanager.cpp   | 14 +++---
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/core/subsurface-qt/DiveObjectHelper.cpp 
b/core/subsurface-qt/DiveObjectHelper.cpp
index 37f954c..246e451 100644
--- a/core/subsurface-qt/DiveObjectHelper.cpp
+++ b/core/subsurface-qt/DiveObjectHelper.cpp
@@ -425,6 +425,7 @@ QStringList DiveObjectHelper::buddyList() const
QRegExp sep("(,\\s)");
QStringList tempList = temp.split(sep);
buddies << tempList;
+   buddies << "Multiple Buddies";
}
}
buddies.removeDuplicates();
diff --git a/mobile-widgets/qml/DiveDetails.qml 
b/mobile-widgets/qml/DiveDetails.qml
index 7f6ca81..be34288 100644
--- a/mobile-widgets/qml/DiveDetails.qml
+++ b/mobile-widgets/qml/DiveDetails.qml
@@ -156,7 +156,11 @@ Kirigami.Page {
airtemp = diveDetailsListView.currentItem.modelData.dive.airTemp
watertemp = 
diveDetailsListView.currentItem.modelData.dive.waterTemp
suitIndex = 
diveDetailsListView.currentItem.modelData.dive.suitList.indexOf(diveDetailsListView.currentItem.modelData.dive.suit)
-   buddyIndex = 
diveDetailsListView.currentItem.modelData.dive.buddyList.indexOf(diveDetailsListView.currentItem.modelData.dive.buddy)
+   if 
(diveDetailsListView.currentItem.modelData.dive.buddy.search(",")) {
+   buddyIndex = 
diveDetailsListView.currentItem.modelData.dive.buddyList.indexOf("Multiple 
Buddies");
+   } else {
+   buddyIndex = 
diveDetailsListView.currentItem.modelData.dive.buddyList.indexOf(diveDetailsListView.currentItem.modelData.dive.buddy)
+   }
divemasterIndex = 
diveDetailsListView.currentItem.modelData.dive.divemasterList.indexOf(diveDetailsListView.currentItem.modelData.dive.divemaster)
notes = diveDetailsListView.currentItem.modelData.dive.notes
if 
(diveDetailsListView.currentItem.modelData.dive.singleWeight) {
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 9de5ac1..1b9aebe 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -869,9 +869,17 @@ void QMLManager::commitChanges(QString diveId, QString 
date, QString location, Q
d->suit = strdup(qPrintable(suit));
}
if (myDive->buddy() != buddy) {
-   diveChanged = true;
-   free(d->buddy);
-   d->buddy = strdup(qPrintable(buddy));
+   if (myDive->buddy().contains(",")) {
+   if (!buddy.contains("Multiple Buddies")) {
+   diveChanged = true;
+   free(d->buddy);
+   d->buddy = strdup(qPrintable(buddy));
+   }
+   } else {
+   diveChanged = true;
+   free(d->buddy);
+   d->buddy = strdup(qPrintable(buddy));
+   }
}
if (myDive->divemaster() != diveMaster) {
diveChanged = true;
-- 
2.7.4

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


[PATCH v2 1/2] QML UI: Enable cylinder edit

2016-08-30 Thread Joakim Bygdell
This adds the option to select a cylinder when adding or editing a dive.
Due to limited screen size we restrict the editing to the first cylinder only.

Signed-off-by: Joakim Bygdell <j.bygd...@gmail.com>
---
 core/subsurface-qt/DiveObjectHelper.cpp | 25 -
 core/subsurface-qt/DiveObjectHelper.h   |  4 ++--
 mobile-widgets/qml/DiveDetails.qml  |  3 +++
 mobile-widgets/qml/DiveDetailsEdit.qml  | 24 +---
 mobile-widgets/qmlmanager.cpp   | 24 +++-
 mobile-widgets/qmlmanager.h | 10 +-
 6 files changed, 74 insertions(+), 16 deletions(-)

diff --git a/core/subsurface-qt/DiveObjectHelper.cpp 
b/core/subsurface-qt/DiveObjectHelper.cpp
index 768d4a8..87fae7c 100644
--- a/core/subsurface-qt/DiveObjectHelper.cpp
+++ b/core/subsurface-qt/DiveObjectHelper.cpp
@@ -5,6 +5,7 @@
 
 #include "../qthelper.h"
 #include "../helpers.h"
+#include "../../qt-models/tankinfomodel.h"
 
 static QString EMPTY_DIVE_STRING = QStringLiteral("");
 enum returnPressureSelector {START_PRESSURE, END_PRESSURE};
@@ -252,15 +253,29 @@ QString DiveObjectHelper::suit() const
return m_dive->suit ? m_dive->suit : EMPTY_DIVE_STRING;
 }
 
-QString DiveObjectHelper::cylinderList() const
+QStringList DiveObjectHelper::cylinderList() const
 {
-   QString cylinders;
-   for (int i = 0; i < MAX_CYLINDERS; i++) {
-   QString cyl = getFormattedCylinder(m_dive, i);
+   QStringList cylinders;
+   struct dive *d;
+   int i = 0;
+   for_each_dive (i, d) {
+   for (int j = 0; j < MAX_CYLINDERS; j++) {
+   QString cyl = d->cylinder[j].type.description;
+   if (cyl == EMPTY_DIVE_STRING)
+   continue;
+   cylinders << cyl;
+   }
+   }
+
+   for (i = 0; i < sizeof(tank_info) && tank_info[i].name != NULL; i++) {
+   QString cyl = tank_info[i].name;
if (cyl == EMPTY_DIVE_STRING)
continue;
-   cylinders += cyl + "; ";
+   cylinders << cyl;
}
+
+   cylinders.removeDuplicates();
+   cylinders.sort();
return cylinders;
 }
 
diff --git a/core/subsurface-qt/DiveObjectHelper.h 
b/core/subsurface-qt/DiveObjectHelper.h
index c685690..8650f7a 100644
--- a/core/subsurface-qt/DiveObjectHelper.h
+++ b/core/subsurface-qt/DiveObjectHelper.h
@@ -33,7 +33,7 @@ class DiveObjectHelper : public QObject {
Q_PROPERTY(QStringList weights READ weights CONSTANT)
Q_PROPERTY(bool singleWeight READ singleWeight CONSTANT)
Q_PROPERTY(QString suit READ suit CONSTANT)
-   Q_PROPERTY(QString cylinderList READ cylinderList CONSTANT)
+   Q_PROPERTY(QStringList cylinderList READ cylinderList CONSTANT)
Q_PROPERTY(QStringList cylinders READ cylinders CONSTANT)
Q_PROPERTY(QList<CylinderObjectHelper*> cylinderObjects READ 
cylinderObjects CONSTANT)
Q_PROPERTY(QString trip READ trip CONSTANT)
@@ -76,7 +76,7 @@ public:
QString weight(int idx) const;
bool singleWeight() const;
QString suit() const;
-   QString cylinderList() const;
+   QStringList cylinderList() const;
QStringList cylinders() const;
QString cylinder(int idx) const;
QList<CylinderObjectHelper*> cylinderObjects() const;
diff --git a/mobile-widgets/qml/DiveDetails.qml 
b/mobile-widgets/qml/DiveDetails.qml
index a66968a..b85b593 100644
--- a/mobile-widgets/qml/DiveDetails.qml
+++ b/mobile-widgets/qml/DiveDetails.qml
@@ -29,6 +29,8 @@ Kirigami.Page {
property alias weight: detailsEdit.weightText
property alias startpressure: detailsEdit.startpressureText
property alias endpressure: detailsEdit.endpressureText
+   property alias cylinderIndex: detailsEdit.cylinderIndex
+   property alias cylinderModel: detailsEdit.cylinderModel
property alias gasmix: detailsEdit.gasmixText
property alias gpsCheckbox: detailsEdit.gpsCheckbox
property int updateCurrentIdx: manager.updateSelectedDive
@@ -168,6 +170,7 @@ Kirigami.Page {
startpressure = 
diveDetailsListView.currentItem.modelData.dive.startPressure
endpressure = 
diveDetailsListView.currentItem.modelData.dive.endPressure
gasmix = 
diveDetailsListView.currentItem.modelData.dive.firstGas
+   cylinderIndex = 
diveDetailsListView.currentItem.modelData.dive.cylinderList.indexOf(diveDetailsListView.currentItem.modelData.dive.getCylinder)
} else {
// careful when translating, this text is "magic" in 
DiveDetailsEdit.qml
startpressure = "cannot edit multiple cylinders"
diff --git a/mobile-widgets/qml/DiveDetailsEdit.

Re: [PATCH 1/2] QML UI: Enable cylinder edit

2016-08-29 Thread Joakim Bygdell

> On 30 Aug 2016, at 07:15, Dirk Hohndel <d...@hohndel.org> wrote:
> 
> On Mon, Aug 29, 2016 at 09:35:05PM +0200, Joakim Bygdell wrote:
>> +QStringList cylinders;
>> +struct dive *d;
>> +int i = 0;
>> +for_each_dive (i, d) {
>> +for (int j = 0; j < MAX_CYLINDERS; j++) {
>> +QString cyl = d->cylinder[j].type.description;
>> +if (cyl == EMPTY_DIVE_STRING)
>> +continue;
>> +cylinders << cyl;
>> +}
>> +}
>> +
>> +for (i = 0; i < 100 && tank_info[i].name != NULL; i++) {
> 
> Why are we looping to 100 here. That just seems odd to me.

Ask the original author, that loop is from equipment.c.
The definition of tank_info in equipment.c looks like this: "struct tank_info_t 
tank_info[100]"

> 
>> +// info for first cylinder
>> +if (myDive->getCylinder() != cylinder) {
>> +diveChanged = true;
>> +int i, size, wp;
>> +for (i = 0; i < 100 && tank_info[i].name != NULL; i++) {
> 
> Again this loop to 100
> 
>> +if (tank_info[i].name == cylinder ) {
>> +if (tank_info[i].ml > 0){
>> +size = tank_info[i].ml;
>> +wp = tank_info[i].bar * 1000;
>> +}
>> +else {
> 
> That's not our coding style... } else {
My bad, I’ll fix that.

> 
> /D

/Jocke

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


[PATCH 2/2] Remove hacks regarding multiple gasmixes and cylinders

2016-08-29 Thread Joakim Bygdell
Enabling cylinder edit in Subsurface-mobile our previous hacks
regarding multiple cylinders and gasmixes must be removed.

Signed-off-by: Joakim Bygdell <j.bygd...@gmail.com>
---
 core/subsurface-qt/DiveObjectHelper.cpp |  8 +---
 mobile-widgets/qml/DiveDetails.qml  | 15 ---
 mobile-widgets/qml/DiveDetailsEdit.qml  |  3 ---
 3 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/core/subsurface-qt/DiveObjectHelper.cpp 
b/core/subsurface-qt/DiveObjectHelper.cpp
index 3f4d736..35de666 100644
--- a/core/subsurface-qt/DiveObjectHelper.cpp
+++ b/core/subsurface-qt/DiveObjectHelper.cpp
@@ -373,13 +373,7 @@ QString DiveObjectHelper::sumWeight() const
 
 QString DiveObjectHelper::getCylinder() const
 {
-   QString getCylinder;
-   if (is_cylinder_used(m_dive, 1)){
-   getCylinder = QObject::tr("Multiple");
-   }
-   else {
-   getCylinder = m_dive->cylinder[0].type.description;
-   }
+   QString getCylinder = m_dive->cylinder[0].type.description;
return getCylinder;
 }
 
diff --git a/mobile-widgets/qml/DiveDetails.qml 
b/mobile-widgets/qml/DiveDetails.qml
index b85b593..7f6ca81 100644
--- a/mobile-widgets/qml/DiveDetails.qml
+++ b/mobile-widgets/qml/DiveDetails.qml
@@ -166,17 +166,10 @@ Kirigami.Page {
// careful when translating, this text is "magic" in 
DiveDetailsEdit.qml
weight = "cannot edit multiple weight systems"
}
-   if (diveDetailsListView.currentItem.modelData.dive.getCylinder 
!= "Multiple" ) {
-   startpressure = 
diveDetailsListView.currentItem.modelData.dive.startPressure
-   endpressure = 
diveDetailsListView.currentItem.modelData.dive.endPressure
-   gasmix = 
diveDetailsListView.currentItem.modelData.dive.firstGas
-   cylinderIndex = 
diveDetailsListView.currentItem.modelData.dive.cylinderList.indexOf(diveDetailsListView.currentItem.modelData.dive.getCylinder)
-   } else {
-   // careful when translating, this text is "magic" in 
DiveDetailsEdit.qml
-   startpressure = "cannot edit multiple cylinders"
-   endpressure = "cannot edit multiple cylinders"
-   gasmix = "cannot edit multiple gases"
-   }
+   startpressure = 
diveDetailsListView.currentItem.modelData.dive.startPressure
+   endpressure = 
diveDetailsListView.currentItem.modelData.dive.endPressure
+   gasmix = diveDetailsListView.currentItem.modelData.dive.firstGas
+   cylinderIndex = 
diveDetailsListView.currentItem.modelData.dive.cylinderList.indexOf(diveDetailsListView.currentItem.modelData.dive.getCylinder)
 
diveDetailsPage.state = "edit"
}
diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml 
b/mobile-widgets/qml/DiveDetailsEdit.qml
index 093d911..0573c74 100644
--- a/mobile-widgets/qml/DiveDetailsEdit.qml
+++ b/mobile-widgets/qml/DiveDetailsEdit.qml
@@ -232,7 +232,6 @@ Item {
}
StyledTextField {
id: txtGasMix
-   fixed: (text == "cannot edit multiple gases" ? 
true : false)
Layout.fillWidth: true
validator: RegExpValidator { regExp: 
/(EAN100|EAN\d\d|AIR|100|\d{1,2}|\d{1,2}\/\d{1,2})/i }
}
@@ -243,7 +242,6 @@ Item {
}
StyledTextField {
id: txtStartPressure
-   fixed: (text == "cannot edit multiple 
cylinders" ? true : false)
Layout.fillWidth: true
}
 
@@ -253,7 +251,6 @@ Item {
}
StyledTextField {
id: txtEndPressure
-   readOnly: (text == "cannot edit multiple 
cylinders" ? true : false)
Layout.fillWidth: true
}
 
-- 
2.7.4

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


[PATCH 1/2] QML UI: Enable cylinder edit

2016-08-29 Thread Joakim Bygdell
This adds the option to select a cylinder when adding or editing a dive.
Due to limited screen size we restrict the editing to the first cylinder only.

Signed-off-by: Joakim Bygdell <j.bygd...@gmail.com>
---
 core/subsurface-qt/DiveObjectHelper.cpp | 25 -
 core/subsurface-qt/DiveObjectHelper.h   |  4 ++--
 mobile-widgets/qml/DiveDetails.qml  |  3 +++
 mobile-widgets/qml/DiveDetailsEdit.qml  | 24 +---
 mobile-widgets/qmlmanager.cpp   | 25 -
 mobile-widgets/qmlmanager.h | 10 +-
 6 files changed, 75 insertions(+), 16 deletions(-)

diff --git a/core/subsurface-qt/DiveObjectHelper.cpp 
b/core/subsurface-qt/DiveObjectHelper.cpp
index 768d4a8..3f4d736 100644
--- a/core/subsurface-qt/DiveObjectHelper.cpp
+++ b/core/subsurface-qt/DiveObjectHelper.cpp
@@ -5,6 +5,7 @@
 
 #include "../qthelper.h"
 #include "../helpers.h"
+#include "../../qt-models/tankinfomodel.h"
 
 static QString EMPTY_DIVE_STRING = QStringLiteral("");
 enum returnPressureSelector {START_PRESSURE, END_PRESSURE};
@@ -252,15 +253,29 @@ QString DiveObjectHelper::suit() const
return m_dive->suit ? m_dive->suit : EMPTY_DIVE_STRING;
 }
 
-QString DiveObjectHelper::cylinderList() const
+QStringList DiveObjectHelper::cylinderList() const
 {
-   QString cylinders;
-   for (int i = 0; i < MAX_CYLINDERS; i++) {
-   QString cyl = getFormattedCylinder(m_dive, i);
+   QStringList cylinders;
+   struct dive *d;
+   int i = 0;
+   for_each_dive (i, d) {
+   for (int j = 0; j < MAX_CYLINDERS; j++) {
+   QString cyl = d->cylinder[j].type.description;
+   if (cyl == EMPTY_DIVE_STRING)
+   continue;
+   cylinders << cyl;
+   }
+   }
+
+   for (i = 0; i < 100 && tank_info[i].name != NULL; i++) {
+   QString cyl = tank_info[i].name;
if (cyl == EMPTY_DIVE_STRING)
continue;
-   cylinders += cyl + "; ";
+   cylinders << cyl;
}
+
+   cylinders.removeDuplicates();
+   cylinders.sort();
return cylinders;
 }
 
diff --git a/core/subsurface-qt/DiveObjectHelper.h 
b/core/subsurface-qt/DiveObjectHelper.h
index c685690..8650f7a 100644
--- a/core/subsurface-qt/DiveObjectHelper.h
+++ b/core/subsurface-qt/DiveObjectHelper.h
@@ -33,7 +33,7 @@ class DiveObjectHelper : public QObject {
Q_PROPERTY(QStringList weights READ weights CONSTANT)
Q_PROPERTY(bool singleWeight READ singleWeight CONSTANT)
Q_PROPERTY(QString suit READ suit CONSTANT)
-   Q_PROPERTY(QString cylinderList READ cylinderList CONSTANT)
+   Q_PROPERTY(QStringList cylinderList READ cylinderList CONSTANT)
Q_PROPERTY(QStringList cylinders READ cylinders CONSTANT)
Q_PROPERTY(QList<CylinderObjectHelper*> cylinderObjects READ 
cylinderObjects CONSTANT)
Q_PROPERTY(QString trip READ trip CONSTANT)
@@ -76,7 +76,7 @@ public:
QString weight(int idx) const;
bool singleWeight() const;
QString suit() const;
-   QString cylinderList() const;
+   QStringList cylinderList() const;
QStringList cylinders() const;
QString cylinder(int idx) const;
QList<CylinderObjectHelper*> cylinderObjects() const;
diff --git a/mobile-widgets/qml/DiveDetails.qml 
b/mobile-widgets/qml/DiveDetails.qml
index a66968a..b85b593 100644
--- a/mobile-widgets/qml/DiveDetails.qml
+++ b/mobile-widgets/qml/DiveDetails.qml
@@ -29,6 +29,8 @@ Kirigami.Page {
property alias weight: detailsEdit.weightText
property alias startpressure: detailsEdit.startpressureText
property alias endpressure: detailsEdit.endpressureText
+   property alias cylinderIndex: detailsEdit.cylinderIndex
+   property alias cylinderModel: detailsEdit.cylinderModel
property alias gasmix: detailsEdit.gasmixText
property alias gpsCheckbox: detailsEdit.gpsCheckbox
property int updateCurrentIdx: manager.updateSelectedDive
@@ -168,6 +170,7 @@ Kirigami.Page {
startpressure = 
diveDetailsListView.currentItem.modelData.dive.startPressure
endpressure = 
diveDetailsListView.currentItem.modelData.dive.endPressure
gasmix = 
diveDetailsListView.currentItem.modelData.dive.firstGas
+   cylinderIndex = 
diveDetailsListView.currentItem.modelData.dive.cylinderList.indexOf(diveDetailsListView.currentItem.modelData.dive.getCylinder)
} else {
// careful when translating, this text is "magic" in 
DiveDetailsEdit.qml
startpressure = "cannot edit multiple cylinders"
diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml 
b/mobile-w

Re: Subsurface-mobile on Android

2016-08-28 Thread Joakim Bygdell

> On 28 Aug 2016, at 20:55, Dirk Hohndel  wrote:
> 
> 
> I’m completely baffled.
> 
> I don’t know, yet, if that’s the common problem for everyone, but more data 
> points (or even better, a fix) would be very welcome.
> 
> Of course it works on the two Android phones I have tested it on (Nexus 6P 
> with 6.0.1 and 5X with 7.0)

The "Android 7.0" patch causes my builds to crash on startup on my phone 
(6.0.1), 
can’t give any more than that at the moment as I haven’t tried to collect any 
debug data yet.

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

/Jocke

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


Re: Subsurface-mobile status update

2016-08-16 Thread Joakim Bygdell
On 16 August 2016 at 06:20, Dirk Hohndel <d...@hohndel.org> wrote:

> Once I fixed the build issues and added back a couple of our private
> patches I was able to build a working Subsurface-mobile for iOS based on
> Kirigami 1.0 (plus patches).
>
> Nice. Took me a LOT longer than I wanted, but hey... it's all good.
>
> 4.5.2.1525 should be available for testing on TestFlight, soon.
>
> Next I'll have to get this to work for Android :-)
>

The attached patch was all that was needed to get a working Android build
for me.
Built against Kirigami master and QT 5.6.1


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



-- 
Jocke
From 1b43c8ca5006bbb9163119461a70032e448bf18b Mon Sep 17 00:00:00 2001
From: Joakim Bygdell <j.bygd...@gmail.com>
Date: Tue, 16 Aug 2016 09:08:34 +0200
Subject: [PATCH] Android build: compile kirigami

Build kirkigami plugin out of source and make sure that we use the same QT
version for the plugin and the app.

Signed-off-by: Joakim Bygdell <j.bygd...@gmail.com>
---
 packaging/android/build.sh | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/packaging/android/build.sh b/packaging/android/build.sh
index 5319c4d..d844e8d 100644
--- a/packaging/android/build.sh
+++ b/packaging/android/build.sh
@@ -316,13 +316,12 @@ if [ "$SUBSURFACE_MOBILE" = "ON" ] ; then
 	pushd $SUBSURFACE_SOURCE
 	bash ./scripts/mobilecomponents.sh
 	popd
-
-	cd $SUBSURFACE_SOURCE/mobile-widgets/qml/kirigami/
-	mkdir -p build
-	cd build
-	cmake .. -DSTATIC_LIBRARY=ON
+	rm -rf kirigami-build
+	mkdir -p kirigami-build
+	pushd kirigami-build
+	cmake $SUBSURFACE_SOURCE/mobile-widgets/qml/kirigami/ -DSTATIC_LIBRARY=ON -DCMAKE_PREFIX_PATH:UNINITIALIZED=${QT5_ANDROID}/android_${QT_ARCH}/lib/cmake
 	make -j4
-	make install
+	popd
 fi
 
 if [ ! -z "$SUBSURFACE_MOBILE" ] ; then
-- 
2.7.4

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


Re: Subsurface-mobile status update

2016-08-14 Thread Joakim Bygdell

> On 14 Aug 2016, at 06:29, Dirk Hohndel  wrote:
> 
> 
> I still haven't managed to make the latest Kirigami work. And I don't think 
> I'll finish that today as I'm jet lagged and about to fall asleep on my 
> keyboard. But at least our iOS testers should be able to continue to use 
> Subsurface-mobile.

When you add Marcos patch "use-kirigami-built-in-static-mode” and work out some 
of the missing parts it builds properly.
But the app crashes on launch due to not being able to find the Kirigami 
components.

> 
> I think I asked this before - is there anyone else who is even able to build 
> on iOS? Tomaz no longer has his Mac. Anyone else?

Once the Kirigami issue has been solved I should be able to build and test the 
iOS version as well.
> 
> /D
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

/Jocke

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


Re: Cross-compiling Subsurface-mobile from Linux to Android

2016-06-22 Thread Joakim Bygdell
On 22 June 2016 at 13:30, Willem Ferguson 
wrote:

>
>
> Simple questions from an ignorant person.
>
> I am not sure how to install Qt for use on Android. For Subsurface-mobile
> to run on Android, where should Qt be installed?
>

Depending on if you use a distribution package or install QT from qt.io
there might be some differences.

Given that you do not use a distribution package there is a "Maintenance
Tool" that allows you to selectively install different QT modules.
The one you want is the "Android ARM v7".


> Destination platform:
> My intuition suggests to me that Qt-Android would need to be installed on
> native Android, but does this come across as part of the Subsurface
> application? I have never installed Qt on my Android device, yet I run
> Subsurface-mobile. Looks like the version for Android is Qt V5.7
>
> Source platform:
> What Qt version is required on the source (development) machine? I cannot
> see that Qt for Android would be required on the Linux source machine,
> unless this is somehow included as part of Subsurface-mobile? My Qt
> environment on Linux is 5.5.1
>
> Kind regards,
> willem
>
>
>
>
>
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>
>
// Jocke
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


[PATCH 3/3] White space cleanup

2016-05-20 Thread Joakim Bygdell
Signed-off-by: Joakim Bygdell <j.bygd...@gmail.com>
---
 mobile-widgets/qml/DiveDetails.qml | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/mobile-widgets/qml/DiveDetails.qml 
b/mobile-widgets/qml/DiveDetails.qml
index aee8a89..3dfb879 100644
--- a/mobile-widgets/qml/DiveDetails.qml
+++ b/mobile-widgets/qml/DiveDetails.qml
@@ -15,16 +15,16 @@ Kirigami.Page {
property alias date: detailsEdit.dateText
property alias airtemp: detailsEdit.airtempText
property alias watertemp: detailsEdit.watertempText
-property alias buddyIndex: detailsEdit.buddyIndex
+   property alias buddyIndex: detailsEdit.buddyIndex
property alias buddyModel: detailsEdit.buddyModel
-property alias divemasterIndex: detailsEdit.divemasterIndex
+   property alias divemasterIndex: detailsEdit.divemasterIndex
property alias divemasterModel: detailsEdit.divemasterModel
property alias depth: detailsEdit.depthText
property alias duration: detailsEdit.durationText
property alias location: detailsEdit.locationText
property alias gps: detailsEdit.gpsText
property alias notes: detailsEdit.notesText
-property alias suitIndex: detailsEdit.suitIndex
+   property alias suitIndex: detailsEdit.suitIndex
property alias suitModel: detailsEdit.suitModel
property alias weight: detailsEdit.weightText
property alias startpressure: detailsEdit.startpressureText
@@ -152,9 +152,9 @@ Kirigami.Page {
depth = diveDetailsListView.currentItem.modelData.dive.depth
airtemp = diveDetailsListView.currentItem.modelData.dive.airTemp
watertemp = 
diveDetailsListView.currentItem.modelData.dive.waterTemp
-suitIndex = 
diveDetailsListView.currentItem.modelData.dive.suitList.indexOf(diveDetailsListView.currentItem.modelData.dive.suit)
-buddyIndex = 
diveDetailsListView.currentItem.modelData.dive.buddyList.indexOf(diveDetailsListView.currentItem.modelData.dive.buddy)
-divemasterIndex = 
diveDetailsListView.currentItem.modelData.dive.divemasterList.indexOf(diveDetailsListView.currentItem.modelData.dive.divemaster)
+   suitIndex = 
diveDetailsListView.currentItem.modelData.dive.suitList.indexOf(diveDetailsListView.currentItem.modelData.dive.suit)
+   buddyIndex = 
diveDetailsListView.currentItem.modelData.dive.buddyList.indexOf(diveDetailsListView.currentItem.modelData.dive.buddy)
+   divemasterIndex = 
diveDetailsListView.currentItem.modelData.dive.divemasterList.indexOf(diveDetailsListView.currentItem.modelData.dive.divemaster)
notes = diveDetailsListView.currentItem.modelData.dive.notes
if 
(diveDetailsListView.currentItem.modelData.dive.singleWeight) {
// we have only one weight, go ahead, have fun and edit 
it
-- 
2.5.4 (Apple Git-61)

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


[PATCH 1/3] Add init function to qmlmanager

2016-05-20 Thread Joakim Bygdell
In order to get autocomplete to work on manual dive add
we apparently need a separate init function.

Signed-off-by: Joakim Bygdell <j.bygd...@gmail.com>
---
 mobile-widgets/qmlmanager.cpp | 51 +++
 mobile-widgets/qmlmanager.h   |  7 ++
 2 files changed, 58 insertions(+)

diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 82ea319..1c3e121 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1337,3 +1337,54 @@ void QMLManager::quit()
saveChangesCloud(false);
QApplication::quit();
 }
+
+QStringList QMLManager::suitInit() const
+{
+   QStringList suits;
+   struct dive *d;
+   int i = 0;
+   for_each_dive (i, d) {
+   QString temp = d->suit;
+   if (!temp.isEmpty())
+   suits << d->suit;
+   }
+   suits.removeDuplicates();
+   suits.sort();
+   return suits;
+}
+
+QStringList QMLManager::buddyInit() const
+{
+   QStringList buddies;
+   struct dive *d;
+   int i = 0;
+   for_each_dive (i, d) {
+   QString temp = d->buddy;
+   if (!temp.isEmpty() && !temp.contains(",")){
+   buddies << d->buddy;
+   }
+   else if (!temp.isEmpty()){
+   QRegExp sep("(,\\s)");
+   QStringList tempList = temp.split(sep);
+   buddies << tempList;
+   }
+   }
+   buddies.removeDuplicates();
+   buddies.sort();
+   return buddies;
+}
+
+QStringList QMLManager::divemasterInit() const
+{
+   QStringList divemasters;
+   struct dive *d;
+   int i = 0;
+   for_each_dive (i, d) {
+   QString temp = d->divemaster;
+   if (!temp.isEmpty())
+   divemasters << d->divemaster;
+   }
+   divemasters.removeDuplicates();
+   divemasters.sort();
+   return divemasters;
+}
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h
index 906e7b0..10ff0ba 100644
--- a/mobile-widgets/qmlmanager.h
+++ b/mobile-widgets/qmlmanager.h
@@ -29,6 +29,9 @@ class QMLManager : public QObject {
Q_PROPERTY(bool syncToCloud READ syncToCloud WRITE setSyncToCloud 
NOTIFY syncToCloudChanged)
Q_PROPERTY(int updateSelectedDive READ updateSelectedDive WRITE 
setUpdateSelectedDive NOTIFY updateSelectedDiveChanged)
Q_PROPERTY(int selectedDiveTimestamp READ selectedDiveTimestamp WRITE 
setSelectedDiveTimestamp NOTIFY selectedDiveTimestampChanged)
+   Q_PROPERTY(QStringList suitInit READ suitInit CONSTANT)
+   Q_PROPERTY(QStringList buddyInit READ buddyInit CONSTANT)
+   Q_PROPERTY(QStringList divemasterInit READ divemasterInit CONSTANT)
 
 public:
QMLManager();
@@ -97,6 +100,10 @@ public:
typedef void (QMLManager::*execute_function_type)();
DiveListSortModel *dlSortModel;
 
+   QStringList suitInit() const;
+   QStringList buddyInit() const;
+   QStringList divemasterInit() const;
+
 public slots:
void applicationStateChanged(Qt::ApplicationState state);
void savePreferences();
-- 
2.5.4 (Apple Git-61)

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


[PATCH 2/3] Make autocomplete work on add dive

2016-05-20 Thread Joakim Bygdell
This sets the list models for autocompleting suit, buddy and
divemaster.

Signed-off-by: Joakim Bygdell <j.bygd...@gmail.com>
---
 mobile-widgets/qml/DiveDetails.qml | 3 +++
 mobile-widgets/qml/DiveDetailsEdit.qml | 3 +++
 mobile-widgets/qml/main.qml| 9 ++---
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/mobile-widgets/qml/DiveDetails.qml 
b/mobile-widgets/qml/DiveDetails.qml
index 167eb69..aee8a89 100644
--- a/mobile-widgets/qml/DiveDetails.qml
+++ b/mobile-widgets/qml/DiveDetails.qml
@@ -16,13 +16,16 @@ Kirigami.Page {
property alias airtemp: detailsEdit.airtempText
property alias watertemp: detailsEdit.watertempText
 property alias buddyIndex: detailsEdit.buddyIndex
+   property alias buddyModel: detailsEdit.buddyModel
 property alias divemasterIndex: detailsEdit.divemasterIndex
+   property alias divemasterModel: detailsEdit.divemasterModel
property alias depth: detailsEdit.depthText
property alias duration: detailsEdit.durationText
property alias location: detailsEdit.locationText
property alias gps: detailsEdit.gpsText
property alias notes: detailsEdit.notesText
 property alias suitIndex: detailsEdit.suitIndex
+   property alias suitModel: detailsEdit.suitModel
property alias weight: detailsEdit.weightText
property alias startpressure: detailsEdit.startpressureText
property alias endpressure: detailsEdit.endpressureText
diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml 
b/mobile-widgets/qml/DiveDetailsEdit.qml
index 5b582d1..ad62997 100644
--- a/mobile-widgets/qml/DiveDetailsEdit.qml
+++ b/mobile-widgets/qml/DiveDetailsEdit.qml
@@ -26,6 +26,9 @@ Item {
property alias endpressureText: txtEndPressure.text
property alias gasmixText: txtGasMix.text
property alias gpsCheckbox: checkboxGPS.checked
+   property alias suitModel: suitBox.model
+   property alias divemasterModel: divemasterBox.model
+   property alias buddyModel: buddyBox.model
 
function saveData() {
// apply the changes to the dive_table
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml
index e025224..b4c6f36 100644
--- a/mobile-widgets/qml/main.qml
+++ b/mobile-widgets/qml/main.qml
@@ -71,14 +71,17 @@ Kirigami.ApplicationWindow {
detailsWindow.date = manager.getDate(detailsWindow.dive_id)
detailsWindow.airtemp = ""
detailsWindow.watertemp = ""
-   detailsWindow.buddy = ""
+   detailsWindow.buddyModel = manager.buddyInit
+   detailsWindow.buddyIndex = -1
detailsWindow.depth = ""
-   detailsWindow.divemaster = ""
+   detailsWindow.divemasterModel = manager.divemasterInit
+   detailsWindow.divemasterIndex = -1
detailsWindow.notes = ""
detailsWindow.location = ""
detailsWindow.gps = ""
detailsWindow.duration = ""
-   detailsWindow.suit = ""
+   detailsWindow.suitModel = manager.suitInit
+   detailsWindow.suitIndex = -1
detailsWindow.weight = ""
detailsWindow.gasmix = ""
detailsWindow.startpressure = ""
-- 
2.5.4 (Apple Git-61)

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


Re: QML inconsistency Android <-> Desktop

2016-05-20 Thread Joakim Bygdell

> On 16 May 2016, at 21:32, Dirk Hohndel <d...@hohndel.org> wrote:
> 
> On Mon, May 16, 2016 at 09:24:33PM +0200, Joakim Bygdell wrote:
>>> Can you send a follow up patch that addresses that?
>> Sure.
> 
> Thanks
> 
Do you prefer a full patch series or just the new patches standalone?

/Jocke

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


Re: QML inconsistency Android <-> Desktop

2016-05-16 Thread Joakim Bygdell

> On 16 May 2016, at 21:21, Dirk Hohndel <d...@hohndel.org> wrote:
> 
> On Mon, May 16, 2016 at 09:12:13PM +0200, Joakim Bygdell wrote:
>> 
>>> On 16 May 2016, at 20:39, Dirk Hohndel <d...@hohndel.org> wrote:
>>> 
>>> On Mon, May 16, 2016 at 11:17:22AM -0700, Dirk Hohndel wrote:
>>>> On Sat, May 07, 2016 at 02:33:50PM +0200, Joakim Bygdell wrote:
>>>>> When running Subsurface-mobile on my laptop
>>>>> I have a fully functional combobox that autocompletes text input
>>>>> based on what exists in the list model.
>>>>> 
>>>>> However when I run the same build on android 
>>>>> the autocompletion only works for elements in the list that start with 
>>>>> numbers.
>>>>> 
>>>>> First I thought that the text auto suggestion from the keyboard was to 
>>>>> blame
>>>>> but I have the same issue when I disable that via 
>>>>>   inputMethodHints: Qt.ImhNoPredictiveText
>>>>> 
>>>>> 
>>>>> I could find one bug report that autocompletion didn’t work on android
>>>>> but that should have been fixed for Qt 5.6.
>>>> 
>>>> It's very obvious that Android and iOS are second class platforms for Qt.
>>>> I just applied your patches and will test them in a minute... but it's
>>>> entirely possible that you are finding actual bugs...
>>> 
>>> Right now adding a dive is broken. There's the obvious issue that main.qml
>>> refers to buddy, suit and divemaster which all three no longer exist as
>>> properties (easy to fix), but even if you fix that, the auto completion on
>>> each of the three items simply shows a '0' in the combo box
>> Interesting, that means that the helper function wasn’t run when dive edit 
>> is activated via
>> the add dive function. As a zero in the combobox means that the list model 
>> is empty.
> 
> Yes - main.qml can start edit mode as well (in order to add dives), and
> you only changed DiveDetails.qml to make the change...
> 
> Can you send a follow up patch that addresses that?
Sure.
> 
> And thank you for your contribution. I know this was a massive pain to get
> working and really appreciate that you stuck with it and figured it out.
Can you verify that the autocomplete is non functional on android if you edit 
an already dive?
> 
> /D

/Jocke

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


Re: QML inconsistency Android <-> Desktop

2016-05-16 Thread Joakim Bygdell

> On 16 May 2016, at 20:39, Dirk Hohndel <d...@hohndel.org> wrote:
> 
> On Mon, May 16, 2016 at 11:17:22AM -0700, Dirk Hohndel wrote:
>> On Sat, May 07, 2016 at 02:33:50PM +0200, Joakim Bygdell wrote:
>>> When running Subsurface-mobile on my laptop
>>> I have a fully functional combobox that autocompletes text input
>>> based on what exists in the list model.
>>> 
>>> However when I run the same build on android 
>>> the autocompletion only works for elements in the list that start with 
>>> numbers.
>>> 
>>> First I thought that the text auto suggestion from the keyboard was to blame
>>> but I have the same issue when I disable that via 
>>> inputMethodHints: Qt.ImhNoPredictiveText
>>> 
>>> 
>>> I could find one bug report that autocompletion didn’t work on android
>>> but that should have been fixed for Qt 5.6.
>> 
>> It's very obvious that Android and iOS are second class platforms for Qt.
>> I just applied your patches and will test them in a minute... but it's
>> entirely possible that you are finding actual bugs...
> 
> Right now adding a dive is broken. There's the obvious issue that main.qml
> refers to buddy, suit and divemaster which all three no longer exist as
> properties (easy to fix), but even if you fix that, the auto completion on
> each of the three items simply shows a '0' in the combo box
Interesting, that means that the helper function wasn’t run when dive edit is 
activated via
the add dive function. As a zero in the combobox means that the list model is 
empty.

> 
> /D

/Jocke

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


[PATCH 1/3] Add functions to DiveObjectsHelper

2016-05-16 Thread Joakim Bygdell
This generated the QStringLists needed to populate the combobxes
in DiveDetailsEdit.

Signed-off-by: Joakim Bygdell <j.bygd...@gmail.com>
---
 core/subsurface-qt/DiveObjectHelper.cpp | 51 +
 core/subsurface-qt/DiveObjectHelper.h   |  6 
 2 files changed, 57 insertions(+)

diff --git a/core/subsurface-qt/DiveObjectHelper.cpp 
b/core/subsurface-qt/DiveObjectHelper.cpp
index e2847f7..9f694c5 100644
--- a/core/subsurface-qt/DiveObjectHelper.cpp
+++ b/core/subsurface-qt/DiveObjectHelper.cpp
@@ -360,3 +360,54 @@ QString DiveObjectHelper::firstGas() const
gas = get_gas_string(m_dive->cylinder[0].gasmix);
return gas;
 }
+
+QStringList DiveObjectHelper::suitList() const
+{
+   QStringList suits;
+   struct dive *d;
+   int i = 0;
+   for_each_dive (i, d) {
+   QString temp = d->suit;
+   if (!temp.isEmpty())
+   suits << d->suit;
+   }
+   suits.removeDuplicates();
+   suits.sort();
+   return suits;
+}
+
+QStringList DiveObjectHelper::buddyList() const
+{
+   QStringList buddies;
+   struct dive *d;
+   int i = 0;
+   for_each_dive (i, d) {
+   QString temp = d->buddy;
+   if (!temp.isEmpty() && !temp.contains(",")){
+   buddies << d->buddy;
+   }
+   else if (!temp.isEmpty()){
+   QRegExp sep("(,\\s)");
+   QStringList tempList = temp.split(sep);
+   buddies << tempList;
+   }
+   }
+   buddies.removeDuplicates();
+   buddies.sort();
+   return buddies;
+}
+
+QStringList DiveObjectHelper::divemasterList() const
+{
+   QStringList divemasters;
+   struct dive *d;
+   int i = 0;
+   for_each_dive (i, d) {
+   QString temp = d->divemaster;
+   if (!temp.isEmpty())
+   divemasters << d->divemaster;
+   }
+   divemasters.removeDuplicates();
+   divemasters.sort();
+   return divemasters;
+}
diff --git a/core/subsurface-qt/DiveObjectHelper.h 
b/core/subsurface-qt/DiveObjectHelper.h
index e3b5d1e..fd44f81 100644
--- a/core/subsurface-qt/DiveObjectHelper.h
+++ b/core/subsurface-qt/DiveObjectHelper.h
@@ -42,6 +42,9 @@ class DiveObjectHelper : public QObject {
Q_PROPERTY(QString startPressure READ startPressure CONSTANT)
Q_PROPERTY(QString endPressure READ endPressure CONSTANT)
Q_PROPERTY(QString firstGas READ firstGas CONSTANT)
+   Q_PROPERTY(QStringList suitList READ suitList CONSTANT)
+   Q_PROPERTY(QStringList buddyList READ buddyList CONSTANT)
+   Q_PROPERTY(QStringList divemasterList READ divemasterList CONSTANT)
 public:
DiveObjectHelper(struct dive *dive = NULL);
~DiveObjectHelper();
@@ -81,6 +84,9 @@ public:
QString startPressure() const;
QString endPressure() const;
QString firstGas() const;
+   QStringList suitList() const;
+   QStringList buddyList() const;
+   QStringList divemasterList() const;
 
 private:
struct dive *m_dive;
-- 
2.5.4 (Apple Git-61)

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


[PATCH 2/3] QML UI: add comboboxes to DiveDetailsEdit

2016-05-16 Thread Joakim Bygdell
This adds autocompleting text input fields for suit, buddy and
divemaster.

Signed-off-by: Joakim Bygdell <j.bygd...@gmail.com>
---
 core/subsurface-qt/DiveObjectHelper.cpp | 18 
 mobile-widgets/qml/DiveDetails.qml  | 12 +--
 mobile-widgets/qml/DiveDetailsEdit.qml  | 37 -
 3 files changed, 38 insertions(+), 29 deletions(-)

diff --git a/core/subsurface-qt/DiveObjectHelper.cpp 
b/core/subsurface-qt/DiveObjectHelper.cpp
index 9f694c5..e71b076 100644
--- a/core/subsurface-qt/DiveObjectHelper.cpp
+++ b/core/subsurface-qt/DiveObjectHelper.cpp
@@ -371,9 +371,9 @@ QStringList DiveObjectHelper::suitList() const
if (!temp.isEmpty())
suits << d->suit;
}
-   suits.removeDuplicates();
-   suits.sort();
-   return suits;
+   suits.removeDuplicates();
+   suits.sort();
+   return suits;
 }
 
 QStringList DiveObjectHelper::buddyList() const
@@ -392,9 +392,9 @@ QStringList DiveObjectHelper::buddyList() const
buddies << tempList;
}
}
-   buddies.removeDuplicates();
-   buddies.sort();
-   return buddies;
+   buddies.removeDuplicates();
+   buddies.sort();
+   return buddies;
 }
 
 QStringList DiveObjectHelper::divemasterList() const
@@ -407,7 +407,7 @@ QStringList DiveObjectHelper::divemasterList() const
if (!temp.isEmpty())
divemasters << d->divemaster;
}
-   divemasters.removeDuplicates();
-   divemasters.sort();
-   return divemasters;
+   divemasters.removeDuplicates();
+   divemasters.sort();
+   return divemasters;
 }
diff --git a/mobile-widgets/qml/DiveDetails.qml 
b/mobile-widgets/qml/DiveDetails.qml
index 8e258d7..167eb69 100644
--- a/mobile-widgets/qml/DiveDetails.qml
+++ b/mobile-widgets/qml/DiveDetails.qml
@@ -15,14 +15,14 @@ Kirigami.Page {
property alias date: detailsEdit.dateText
property alias airtemp: detailsEdit.airtempText
property alias watertemp: detailsEdit.watertempText
-   property alias buddy: detailsEdit.buddyText
-   property alias divemaster: detailsEdit.divemasterText
+property alias buddyIndex: detailsEdit.buddyIndex
+property alias divemasterIndex: detailsEdit.divemasterIndex
property alias depth: detailsEdit.depthText
property alias duration: detailsEdit.durationText
property alias location: detailsEdit.locationText
property alias gps: detailsEdit.gpsText
property alias notes: detailsEdit.notesText
-   property alias suit: detailsEdit.suitText
+property alias suitIndex: detailsEdit.suitIndex
property alias weight: detailsEdit.weightText
property alias startpressure: detailsEdit.startpressureText
property alias endpressure: detailsEdit.endpressureText
@@ -149,9 +149,9 @@ Kirigami.Page {
depth = diveDetailsListView.currentItem.modelData.dive.depth
airtemp = diveDetailsListView.currentItem.modelData.dive.airTemp
watertemp = 
diveDetailsListView.currentItem.modelData.dive.waterTemp
-   suit = diveDetailsListView.currentItem.modelData.dive.suit
-   buddy = diveDetailsListView.currentItem.modelData.dive.buddy
-   divemaster = 
diveDetailsListView.currentItem.modelData.dive.divemaster
+suitIndex = 
diveDetailsListView.currentItem.modelData.dive.suitList.indexOf(diveDetailsListView.currentItem.modelData.dive.suit)
+buddyIndex = 
diveDetailsListView.currentItem.modelData.dive.buddyList.indexOf(diveDetailsListView.currentItem.modelData.dive.buddy)
+divemasterIndex = 
diveDetailsListView.currentItem.modelData.dive.divemasterList.indexOf(diveDetailsListView.currentItem.modelData.dive.divemaster)
notes = diveDetailsListView.currentItem.modelData.dive.notes
if 
(diveDetailsListView.currentItem.modelData.dive.singleWeight) {
// we have only one weight, go ahead, have fun and edit 
it
diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml 
b/mobile-widgets/qml/DiveDetailsEdit.qml
index 7ff511d..9986d23 100644
--- a/mobile-widgets/qml/DiveDetailsEdit.qml
+++ b/mobile-widgets/qml/DiveDetailsEdit.qml
@@ -15,9 +15,9 @@ Item {
property alias gpsText: txtGps.text
property alias airtempText: txtAirTemp.text
property alias watertempText: txtWaterTemp.text
-   property alias suitText: txtSuit.text
-   property alias buddyText: txtBuddy.text
-   property alias divemasterText: txtDiveMaster.text
+   property alias suitIndex: suitBox.currentIndex
+   property alias buddyIndex: buddyBox.currentIndex
+   property alias divemasterIndex: divemasterBox.currentIndex
property alias notesText: txtNotes.text
property alias durationText: txtDuration.text
property alias depthText: txtDep

[PATCH 3/3] QML UI: hide handles for comboboxes

2016-05-16 Thread Joakim Bygdell
Hide the handles for the comboboxes, making the text input fields
look like the normal text fields.
This is left as a separate patch as there currently seems to be issues with 
autocomplete
on Android.

Signed-off-by: Joakim Bygdell <j.bygd...@gmail.com>
---
 mobile-widgets/qml/DiveDetailsEdit.qml | 9 +
 1 file changed, 9 insertions(+)

diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml 
b/mobile-widgets/qml/DiveDetailsEdit.qml
index 9986d23..5b582d1 100644
--- a/mobile-widgets/qml/DiveDetailsEdit.qml
+++ b/mobile-widgets/qml/DiveDetailsEdit.qml
@@ -160,6 +160,9 @@ Item {
model: 
diveDetailsListView.currentItem.modelData.dive.suitList
inputMethodHints: Qt.ImhNoPredictiveText
Layout.fillWidth: true
+   style: ComboBoxStyle {
+   dropDownButtonWidth: 0
+   }
}
 
Kirigami.Label {
@@ -172,6 +175,9 @@ Item {
model: 
diveDetailsListView.currentItem.modelData.dive.buddyList
inputMethodHints: Qt.ImhNoPredictiveText
Layout.fillWidth: true
+   style: ComboBoxStyle {
+   dropDownButtonWidth: 0
+   }
}
 
Kirigami.Label {
@@ -184,6 +190,9 @@ Item {
model: 
diveDetailsListView.currentItem.modelData.dive.divemasterList
inputMethodHints: Qt.ImhNoPredictiveText
Layout.fillWidth: true
+   style: ComboBoxStyle {
+   dropDownButtonWidth: 0
+   }
}
 
Kirigami.Label {
-- 
2.5.4 (Apple Git-61)

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


QML inconsistency Android <-> Desktop

2016-05-07 Thread Joakim Bygdell
When running Subsurface-mobile on my laptop
I have a fully functional combobox that autocompletes text input
based on what exists in the list model.

However when I run the same build on android 
the autocompletion only works for elements in the list that start with numbers.

First I thought that the text auto suggestion from the keyboard was to blame
but I have the same issue when I disable that via 
inputMethodHints: Qt.ImhNoPredictiveText


I could find one bug report that autocompletion didn’t work on android
but that should have been fixed for Qt 5.6.

/Jocke

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


Re: QML question

2016-04-27 Thread Joakim Bygdell

> On 27 Apr 2016, at 18:55, Tomaz Canabrava  wrote:
> 
> Please, please:
> 
> don't add more stuff to the QMLManager, it's a huge beast already :)
> crete something like this:
> 
> Q_INVOKABLE QStringListModel : DiveObjectHelper::buddies() {
>static QStringListModel buddies = new QStringListModel();
> QStringList temp;
>   for_each_dive (i, d) {
> temp << d->buddy;
>   }
>temp.removeDuplicates();
>buddies.setStringList(temp);
>qDebug() << temp;
>return buddies;
> }
> 
> What can be happening is that a QStringList will not tell QML that it 
> changed, and thus, it wont update it's contents.
> a Model will. 
Fully understandable.

But why do I get data in my combobox if I do this: buddies << “foo” << “bar”
and not this: buddies << d->buddy.

If I add 
buddies << “foo” << “bar”; 
before the return statement, the combobox will have two entries, “foo” and 
“bar".

If i replace the combobox with a label where the text is a QString generated by 
joining the QStringList
I get all buddies displayed on one line. “Buddy A, Buddy B, foo, bar"




> 
> 

/Jocke

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


Re: QML question

2016-04-27 Thread Joakim Bygdell

> On 27 Apr 2016, at 18:27, Thiago Macieira <thi...@macieira.org> wrote:
> 
> On quarta-feira, 27 de abril de 2016 17:40:53 PDT Joakim Bygdell wrote:
>> Thomas or Thiago can you explain what’s going on here?
>> 
>> I have a combobox that gets populated from a QStringList.
>> 
>> If I generate the QStringList on the C++ side like so,
>>  list << “foo” << “bar << “baz"
>> my combobox contains 3 elements as expected.
>> 
>> If I populate the QStringList with data from the dive struct,
>>  list << dive.buddy << dive.divemaster
>> the combobox is empty.
>> 
>> In the later example the QStringList contains the expected data as I can
>> join the QStringList into a QString  that displays correctly on the QML
>> side.
> 
> The source of the data is not the issue here. That's a red herring. The 
> problem is something else.
> 
> 1) are you sure dive.buddy and dive.divemasters are non-empty strings?

Yes as I can concatenate the list to a single string that is displayed on 
the QML side with the correct content.

> 
> 2) is there anything special about the content of those strings?

Nope, just normal names.

> 
> 3) can you show the code after that?

QML side:

Combobox {
id: buddyBox
model: buddyList
}



C++ side:

QStringList QMLManger::buddyList() const
{
QStringList buddies;
struct dive *d;
int i = 0;
for_each_dive (i, d) {
buddies << d->buddy;
}
buddies.removeDuplicates();
return buddies;
}

> 
> -- 
> Thiago Macieira - thiago (AT) macieira.info <http://macieira.info/> - thiago 
> (AT) kde.org <http://kde.org/>
>   Software Architect - Intel Open Source Technology Center
> 
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org <mailto:subsurface@subsurface-divelog.org>
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface 
> <http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface>
/Jocke

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


QML question

2016-04-27 Thread Joakim Bygdell
Thomas or Thiago can you explain what’s going on here?

I have a combobox that gets populated from a QStringList.

If I generate the QStringList on the C++ side like so,
list << “foo” << “bar << “baz"
my combobox contains 3 elements as expected.

If I populate the QStringList with data from the dive struct,
list << dive.buddy << dive.divemaster
the combobox is empty.

In the later example the QStringList contains the expected data as I can 
join the QStringList into a QString  that displays correctly on the QML side.

/Jocke

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


QML bug or caching issue.

2016-03-30 Thread Joakim Bygdell
I have been fiddling with cylinder editing fort subsurface-mobile
but have some rather strange UI issues.

After having selected a cylinder from the dropdown menu and pressing save
the dive details page loads but the text for the cylinder description is 
garbage,
for example it can show "uS\u007F” or similar.

Restarting the app clear the issue and the cylinder description is correctly 
displayed.

Also reloading the dive log from cloud on another device shows the new cylinder 
description,
so what ever is written to cloud storage is correct.

Refreshing the local divest from cloud has no effect since the local cache is 
the latest.

/Jocke

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


Re: Subsurface-mobile 854 - now even more Plasma-mobile than ever before

2016-02-14 Thread Joakim Bygdell

> On 14 Feb 2016, at 21:21, Dirk Hohndel  wrote:
>> 
>> The issue is still there, on both -858 and on the one I build my self.
>> Primary targets are Dive list, Show GPS fixes
> 
> I tried this on three different devices with all of the pages that you
> mentioned. For me in each and every case the menu drawer reliably closes.
> 
> Not quite sure what to say.

Still present in -861, very consistent behaviour.
The first time a sub page is selected the drawer closes but from the second
time a page is selected the drawer stays open.

> 
> /D

/Jocke

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


Re: Subsurface-mobile 854 - now even more Plasma-mobile than ever before

2016-02-14 Thread Joakim Bygdell

> On 14 Feb 2016, at 09:04, Joakim Bygdell <j.bygd...@gmail.com> wrote:
> 
>> 
>> On 14 Feb 2016, at 09:01, Dirk Hohndel <d...@hohndel.org> wrote:
>> 
>> On Sun, Feb 14, 2016 at 08:57:58AM +0100, Joakim Bygdell wrote:
>>>> On Sun, Feb 14, 2016 at 08:48:48AM +0100, Joakim Bygdell wrote:
>>>>> Issues found:
>>>>> Cloud credentials page:
>>>>> If you have valid cloud credentials in place it is not possible to go 
>>>>> back to the divelist,
>>>>> pressing the action button does nothing and the back button closes the 
>>>>> app.
>>>>> You can’t go back by selecting “Dive list” in the menu either.
>>>> 
>>>> You compiled from source and didn't use my APK. Use the attched patch for
>>>> plasma-mobile to make the back button work.
>>>> 
>>>>> Selecting sub-menues does not close the lefthand drawer, 
>>>>> the page is loaded in the background and the drawer is returned to the 
>>>>> top level listings.
>>>>> * Show GPS fixes
>>>>> * App log
>>>>> * Divelist
>>>>> * Add dive
>>>> 
>>>> That is NOT the case for me with the pre-compiled APK. Is your copy of
>>>> plasma-mobile current?
>>> It’s built via the script so plasma changes are synced at every build.
>> 
>> Could you humor me and try -858 which I just uploaded?
>> Because for me all of these close the drawer.
> A full uninstall / reinstall fixed the issue.
Apparently I was a bit fast with the answer.

The issue is still there, on both -858 and on the one I build my self.
Primary targets are Dive list, Show GPS fixes

On -858, hitting the back button while on the dive list does not close the app.
Instead you end up on the cloud credentials page which you can’t get out of 
since the credentials are valid.
Only way to get it back to working order is to hit the save button with wrong 
user/pass combination and then
 enter the correct one.
> 
>> 
>> /D
>> 
> 
> /Jocke

/Jocke

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


Re: Subsurface-mobile 854 - now even more Plasma-mobile than ever before

2016-02-14 Thread Joakim Bygdell

> On 14 Feb 2016, at 09:01, Dirk Hohndel <d...@hohndel.org> wrote:
> 
> On Sun, Feb 14, 2016 at 08:57:58AM +0100, Joakim Bygdell wrote:
>>> On Sun, Feb 14, 2016 at 08:48:48AM +0100, Joakim Bygdell wrote:
>>>> Issues found:
>>>> Cloud credentials page:
>>>> If you have valid cloud credentials in place it is not possible to go back 
>>>> to the divelist,
>>>> pressing the action button does nothing and the back button closes the app.
>>>> You can’t go back by selecting “Dive list” in the menu either.
>>> 
>>> You compiled from source and didn't use my APK. Use the attched patch for
>>> plasma-mobile to make the back button work.
>>> 
>>>> Selecting sub-menues does not close the lefthand drawer, 
>>>> the page is loaded in the background and the drawer is returned to the top 
>>>> level listings.
>>>> * Show GPS fixes
>>>> * App log
>>>> * Divelist
>>>> * Add dive
>>> 
>>> That is NOT the case for me with the pre-compiled APK. Is your copy of
>>> plasma-mobile current?
>> It’s built via the script so plasma changes are synced at every build.
> 
> Could you humor me and try -858 which I just uploaded?
> Because for me all of these close the drawer.
A full uninstall / reinstall fixed the issue.

> 
> /D
> 

/Jocke

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


[PATCH 3/3] QML UI: enable edit of gasmix

2016-02-13 Thread Joakim Bygdell
First cylinder only, show warning if there are more than one cylinder defined.

Signed-off-by: Joakim Bygdell <j.bygd...@gmail.com>
---
 qt-mobile/qml/DiveDetails.qml |  3 +++
 qt-mobile/qml/DiveDetailsEdit.qml | 13 -
 qt-mobile/qml/main.qml|  1 +
 qt-mobile/qmlmanager.cpp  |  9 -
 qt-mobile/qmlmanager.h|  2 +-
 5 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/qt-mobile/qml/DiveDetails.qml b/qt-mobile/qml/DiveDetails.qml
index 5a39576..c906ba2 100644
--- a/qt-mobile/qml/DiveDetails.qml
+++ b/qt-mobile/qml/DiveDetails.qml
@@ -24,6 +24,7 @@ MobileComponents.Page {
property alias weight: detailsEdit.weightText
property alias startpressure: detailsEdit.startpressureText
property alias endpressure: detailsEdit.endpressureText
+   property alias gasmix: detailsEdit.gasmixText
 
state: "view"
 
@@ -128,10 +129,12 @@ MobileComponents.Page {
if (diveDetailsListView.currentItem.modelData.dive.getCylinder 
!= "Multiple" ) {
startpressure = 
diveDetailsListView.currentItem.modelData.dive.startPressure
endpressure = 
diveDetailsListView.currentItem.modelData.dive.endPressure
+   gasmix = 
diveDetailsListView.currentItem.modelData.dive.firstGas
} else {
// careful when translating, this text is "magic" in 
DiveDetailsEdit.qml
startpressure = "cannot edit multiple cylinders"
endpressure = "cannot edit multiple cylinders"
+   gasmix = "cannot edit multiple gases"
}
 
diveDetailsPage.state = "edit"
diff --git a/qt-mobile/qml/DiveDetailsEdit.qml 
b/qt-mobile/qml/DiveDetailsEdit.qml
index f2b0462..ae943ca 100644
--- a/qt-mobile/qml/DiveDetailsEdit.qml
+++ b/qt-mobile/qml/DiveDetailsEdit.qml
@@ -24,6 +24,7 @@ Item {
property alias weightText: txtWeight.text
property alias startpressureText: txtStartPressure.text
property alias endpressureText: txtEndPressure.text
+   property alias gasmixText: txtGasMix.text
 
height: editArea.height
ColumnLayout {
@@ -147,6 +148,16 @@ Item {
 
MobileComponents.Label {
Layout.alignment: Qt.AlignRight
+   text: "Gas mix:"
+   }
+   TextField {
+   id: txtGasMix
+   readOnly: (text == "cannot edit multiple gases" 
? true : false)
+   Layout.fillWidth: true
+   }
+
+   MobileComponents.Label {
+   Layout.alignment: Qt.AlignRight
text: "Start Pressure:"
}
TextField {
@@ -192,7 +203,7 @@ Item {
manager.commitChanges(dive_id, 
detailsEdit.dateText, detailsEdit.locationText, detailsEdit.gpsText, 
detailsEdit.durationText,
  detailsEdit.depthText, 
detailsEdit.airtempText, detailsEdit.watertempText, detailsEdit.suitText,
  detailsEdit.buddyText, 
detailsEdit.divemasterText, detailsEdit.weightText, detailsEdit.notesText,
- 
detailsEdit.startpressureText, detailsEdit.endpressureText)
+ 
detailsEdit.startpressureText, detailsEdit.endpressureText, 
detailsEdit.gasmixText)
// apply the changes to the dive detail view - 
since the edit could have changed the order
// first make sure that we are looking at the 
correct dive - our model allows us to look
// up the index based on the unique dive_id
diff --git a/qt-mobile/qml/main.qml b/qt-mobile/qml/main.qml
index 2c066e2..68696b6 100644
--- a/qt-mobile/qml/main.qml
+++ b/qt-mobile/qml/main.qml
@@ -84,6 +84,7 @@ MobileComponents.ApplicationWindow {
detailsWindow.duration = ""
detailsWindow.suit = ""
detailsWindow.weight = ""
+   detailsWindow.gasmix = ""
detailsWindow.startpressure = ""
detailsWindow.endpressure = ""
stackView.push(detailsWindow)
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index cd45d

[PATCH 1/3] Add helper function to retrieve first gas

2016-02-13 Thread Joakim Bygdell
Signed-off-by: Joakim Bygdell <j.bygd...@gmail.com>
---
 subsurface-core/subsurface-qt/DiveObjectHelper.cpp | 7 +++
 subsurface-core/subsurface-qt/DiveObjectHelper.h   | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp 
b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp
index 8a44c0e..38b 100644
--- a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp
+++ b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp
@@ -292,3 +292,10 @@ QString DiveObjectHelper::endPressure() const
QString endPressure = getPressures(m_dive, END_PRESSURE);
return endPressure;
 }
+
+QString DiveObjectHelper::firstGas() const
+{
+   QString gas;
+   gas = get_gas_string(m_dive->cylinder[0].gasmix);
+   return gas;
+}
diff --git a/subsurface-core/subsurface-qt/DiveObjectHelper.h 
b/subsurface-core/subsurface-qt/DiveObjectHelper.h
index 5d8abfd..a4a425a 100644
--- a/subsurface-core/subsurface-qt/DiveObjectHelper.h
+++ b/subsurface-core/subsurface-qt/DiveObjectHelper.h
@@ -37,6 +37,7 @@ class DiveObjectHelper : public QObject {
 Q_PROPERTY(QString getCylinder READ getCylinder CONSTANT)
 Q_PROPERTY(QString startPressure READ startPressure CONSTANT)
 Q_PROPERTY(QString endPressure READ endPressure CONSTANT)
+Q_PROPERTY(QString firstGas READ firstGas CONSTANT)
 public:
DiveObjectHelper(struct dive *dive = NULL);
~DiveObjectHelper();
@@ -72,6 +73,7 @@ public:
QString getCylinder() const;
QString startPressure() const;
QString endPressure() const;
+   QString firstGas() const;
 
 private:
struct dive *m_dive;
-- 
2.4.9 (Apple Git-60)

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


[PATCH 2/3] Add helper function to parse gasmix strings

2016-02-13 Thread Joakim Bygdell
Signed-off-by: Joakim Bygdell <j.bygd...@gmail.com>
---
 subsurface-core/helpers.h|  2 ++
 subsurface-core/qthelper.cpp | 41 +
 2 files changed, 43 insertions(+)

diff --git a/subsurface-core/helpers.h b/subsurface-core/helpers.h
index 7537818..44f25f5 100644
--- a/subsurface-core/helpers.h
+++ b/subsurface-core/helpers.h
@@ -36,6 +36,8 @@ int parseLengthToMm(const QString );
 int parseTemperatureToMkelvin(const QString );
 int parseWeightToGrams(const QString );
 int parsePressureToMbar(const QString );
+int parseGasMixO2(const QString );
+int parseGasMixHE(const QString );
 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);
diff --git a/subsurface-core/qthelper.cpp b/subsurface-core/qthelper.cpp
index 07ec194..a889233 100644
--- a/subsurface-core/qthelper.cpp
+++ b/subsurface-core/qthelper.cpp
@@ -885,6 +885,47 @@ int parsePressureToMbar(const QString )
return mbar;
 }
 
+int parseGasMixO2(const QString )
+{
+   QString gasString = text;
+   int o2, number;
+   if (gasString.contains(QObject::tr("AIR"), Qt::CaseInsensitive)) {
+   o2 = O2_IN_AIR;
+   }
+   else if (gasString.contains(QObject::tr("EAN"), Qt::CaseInsensitive)) {
+   gasString.remove(QRegExp("[^0-9]"));
+   number = gasString.toInt();
+   o2 = number * 10;
+   }
+   else if (gasString.contains("/")) {
+   QStringList gasSplit = gasString.split("/");
+   number = gasSplit[0].toInt();
+   o2 = number * 10;
+   }
+   else {
+   number = gasString.toInt();
+   o2 = number * 10;
+   }
+   
+   return o2;
+}
+
+int parseGasMixHE(const QString )
+{
+   QString gasString = text;
+   int he, number;
+   if (gasString.contains("/")) {
+   QStringList gasSplit = gasString.split("/");
+   number = gasSplit[1].toInt();
+   he = number * 10;
+   }
+   else {
+   he = 0;
+   }
+   
+   return he;
+}
+
 QString get_dive_duration_string(timestamp_t when, QString hourText, QString 
minutesText)
 {
int hrs, mins;
-- 
2.4.9 (Apple Git-60)

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


Re: Subsurface-mobile for Android -845

2016-02-13 Thread Joakim Bygdell

> On 13 Feb 2016, at 18:52, Dirk Hohndel <d...@hohndel.org> wrote:
> 
> On Sat, Feb 13, 2016 at 09:29:34AM +0100, Joakim Bygdell wrote:
>>> 
>>> 845 should address the issues that were mentioned
>>> 
>>> - I think I finally figured out the hang with incorrect credentials
>>> - I FINALLY paid enough attention to realize why the 'Save' after an edit 
>>> accessed the network - that should be fixed now
>>> - the redundant context menus are gone. Android users are comfortable using 
>>> the back button to go up / back a level and to cancel an operation
>>> 
>>> So I think this is the UI direction I'm leaning towards. Small title bar 
>>> with no menus / buttons. Action button when there's an action. Handle to 
>>> open global menu / drawer (but swipe from the side works as well). Right 
>>> now we have no screen that has a context menu.
>> The handle that opens the drawer should maybe be a bit more transparent to 
>> start with, not the arrow but the background.
> 
> Yes, there is definitely some fine tuning to be done here.
> 
>> The action button we need to do something with as well, right now you have  
>> to scroll all the way to the bottom ft prevent the 
>> action button form obscuring stuff on the details and edit pages.
> 
> I find that an interesting comment. Let me try to figure out if I
> understand what you are saying: when you are in the middle of the dive
> list, the action button is obscuring a small part in the center of the
> bottom dive that is visible (assuming you are on a phone or tablet in
> portrait mode - in landscape mode it really isn't in the way at all as it
> sits on the center divider). So what is stopping you from scrolling up by
> one dive to see the dive that you want to see? I don't understand your
> refference to "have to scroll all the way to the bottom" of the dive list.
> Or are you saying you'd like to have this white margin at the bottom all
> the time? Because I'd hate that as wasted screen real estate.
Not the dive list, but on details and edit page. 

> /D

/Jocke

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


Re: Subsurface-mobile for Android -845

2016-02-13 Thread Joakim Bygdell

> On 13 Feb 2016, at 08:07, Dirk Hohndel  wrote:
> 
> Hi there.
> 
> 845 should address the issues that were mentioned
> 
> - I think I finally figured out the hang with incorrect credentials
> - I FINALLY paid enough attention to realize why the 'Save' after an edit 
> accessed the network - that should be fixed now
> - the redundant context menus are gone. Android users are comfortable using 
> the back button to go up / back a level and to cancel an operation
> 
> So I think this is the UI direction I'm leaning towards. Small title bar with 
> no menus / buttons. Action button when there's an action. Handle to open 
> global menu / drawer (but swipe from the side works as well). Right now we 
> have no screen that has a context menu.
The handle that opens the drawer should maybe be a bit more transparent to 
start with, not the arrow but the background.

The action button we need to do something with as well, right now you have  to 
scroll all the way to the bottom ft prevent the 
 action button form obscuring stuff on the details and edit pages.

> 
> There certainly is room for fine-tuning (I just noticed that the icon / text 
> in the title bar aren't vertically centered - also the drawer handle maybe 
> isn't the final design, yet - this is just my quick hack to give Thomas and 
> Marco an idea of what I'm thinking). But unless I hear strong and well 
> reasoned feedback from Henrik or some of the others who have been rather 
> outspoken on wanting the more Android typical menu / action buttons in the 
> top bar, I think that's where we'll go.
> 
> I realize that I'm going back and forth on this. Guilty as charged. This is 
> hard. But I spent almost an hour with a 4" phone, a 5.7" phone, a 7" tablet 
> and a 10" tablet and I think I'm happy with what we have.
> 
> Assuming we can get reasonable consensus (or only mostly unconvincing 
> whining), I'll do a second beta based on this UI idea (after Marco helps me 
> with the fine tuning mentioned above).
> 
> Thoughts? Comments?
> 
> /D
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

/Jocke

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


Re: Subsurface-mobile 854 - now even more Plasma-mobile than ever before

2016-02-13 Thread Joakim Bygdell

> On 14 Feb 2016, at 07:23, Dirk Hohndel  wrote:
> 
> 
> So based on the feedback received and the discussion here on the list, I
> decided to go all the way...
> 
> - all the save buttons on the pages are gone
> - the action button is used for the main action on any page, including all
>  the save actions (this is for preferences, credentials, edits, etc)
> - the back button is used for the go-back, discard, abort style actions
>  everywhere (without confirmation dialog)
> 
> In order for this to work a couple of patches to the mobile components are
> needed. They were all sent to the plasma-devel mailing list -- actually,
> only one is really /needed/ at this point. One is actually no longer
> relevant (because we don't use context menus) and one is more a visual
> thing and won't prevent functionality. So building from source will have
> almost everything work as expected - except when you decide to change
> credentials and then change your mind and hit the back key. Oops, you just
> quit Subsurface. That's fixed in my APK and in last of the patches I sent
> to the plasma-devel list :-)
> 
> Please test. I know, I keep saying that and I have to say I am thrilled
> with all the feedback you are giving. I think this is really shaping up to
> be a very strong first release.
> 
> I'll give it a day or two for testing and then hopefully I can make a
> second beta with the updated UI.

Issues found:
Cloud credentials page:
If you have valid cloud credentials in place it is not possible to go back to 
the divelist,
pressing the action button does nothing and the back button closes the app.
You can’t go back by selecting “Dive list” in the menu either.

Selecting sub-menues does not close the lefthand drawer, 
the page is loaded in the background and the drawer is returned to the top 
level listings.
* Show GPS fixes
* App log
* Divelist
* Add dive

Canceling the Add dive does not show you the divelist, but the details page of 
the last dive in the list.

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

/Jocke

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


[PATCH] While parsing weight and pressure we should not change the users settings.

2016-02-12 Thread Joakim Bygdell
Now it is possible to enter a specific unit that is different from the
unit stored in the preferences. If only numbers are inputed the unit will
be the same as specified by the users preferences.

Signed-off-by: Joakim Bygdell <j.bygd...@gmail.com>
---
 qt-mobile/qmlmanager.cpp |  8 
 subsurface-core/qthelper.cpp | 42 --
 2 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index 69ba51a..ff11bbb 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -502,20 +502,12 @@ QString QMLManager::commitChanges(QString diveId, QString 
date, QString location
if (weightsystem_none((void *)>weightsystem[1])) {
if (get_weight_string(d->weightsystem[0].weight, true) != 
weight) {
diveChanged = true;
-   if (weight.contains(tr("kg")))
-   prefs.units.weight = units::KG;
-   else if (weight.contains(tr("lbs")))
-   prefs.units.weight = units::LBS;
d->weightsystem[0].weight.grams = 
parseWeightToGrams(weight);
}
}
 // start and end pressures for first cylinder only
if (get_pressure_string(d->cylinder[0].start, true) != startpressure || 
get_pressure_string(d->cylinder[0].end, true) != endpressure) {
diveChanged = true;
-   if (startpressure.contains(tr("bar")) || 
endpressure.contains(tr("bar")))
-   prefs.units.pressure = units::BAR;
-   else if (startpressure.contains(tr("psi")) || 
endpressure.contains(tr("psi")))
-   prefs.units.pressure = units::PSI;
d->cylinder[0].start.mbar = parsePressureToMbar(startpressure);
d->cylinder[0].end.mbar = parsePressureToMbar(endpressure);
}
diff --git a/subsurface-core/qthelper.cpp b/subsurface-core/qthelper.cpp
index f2fc7e8..07ec194 100644
--- a/subsurface-core/qthelper.cpp
+++ b/subsurface-core/qthelper.cpp
@@ -832,20 +832,27 @@ int parseTemperatureToMkelvin(const QString )
 int parseWeightToGrams(const QString )
 {
int grams;
+   QString kg_or_lbs = text;
QString numOnly = text;
numOnly.replace(",", ".").remove(QRegExp("[^0-9.]"));
if (numOnly.isEmpty())
return 0;
double number = numOnly.toDouble();
-   switch (prefs.units.weight) {
-   case units::KG:
+   if (kg_or_lbs.contains(QObject::tr("kg")))
grams = rint(number * 1000);
-   break;
-   case units::LBS:
+   else if (kg_or_lbs.contains(QObject::tr("lbs")))
grams = lbs_to_grams(number);
-   break;
-   default:
-   grams = 0;
+   else {
+   switch (prefs.units.weight) {
+   case units::KG:
+   grams = rint(number * 1000);
+   break;
+   case units::LBS:
+   grams = lbs_to_grams(number);
+   break;
+   default:
+   grams = 0;
+   }
}
return grams;
 }
@@ -853,20 +860,27 @@ int parseWeightToGrams(const QString )
 int parsePressureToMbar(const QString )
 {
int mbar;
+   QString psi_or_bar = text;
QString numOnly = text;
numOnly.replace(",", ".").remove(QRegExp("[^0-9.]"));
if (numOnly.isEmpty())
return 0;
double number = numOnly.toDouble();
-   switch (prefs.units.pressure) {
-   case units::BAR:
+   if (psi_or_bar.contains(QObject::tr("bar")))
mbar = rint(number * 1000);
-   break;
-   case units::PSI:
+   else if (psi_or_bar.contains(QObject::tr("psi")))
mbar = psi_to_mbar(number);
-   break;
-   default:
-   mbar = 0;
+   else {
+   switch (prefs.units.pressure) {
+   case units::BAR:
+   mbar = rint(number * 1000);
+   break;
+   case units::PSI:
+   mbar = psi_to_mbar(number);
+   break;
+   default:
+   mbar = 0;
+   }
}
return mbar;
 }
-- 
2.4.9 (Apple Git-60)

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


Re: Subsurface-planner [was: Now Accepting GSoC 2016 Mentor Organization Applications]

2016-02-10 Thread Joakim Bygdell

> On 10 Feb 2016, at 16:43, Dirk Hohndel <d...@hohndel.org> wrote:
> 
> 
>> On Feb 9, 2016, at 10:46 PM, Joakim Bygdell <j.bygd...@gmail.com 
>> <mailto:j.bygd...@gmail.com>> wrote:
>> 
>> With the first beta out I consider the functionality more or less frozen.
>> I'll add the cylinder editing in the next beta, but other than that...?
>> Since we will have users coming directly to the mobile version we need to be 
>> able to 
>> do the following on the mobile version.
>> * Signup and verification of cloud credentials.
>> * Choose between metric or imperial as default units.
> 
> Actually, Subsurface-mobile is very much positioned as something that you use
> together with the desktop version. You can't download dives on your device, 
> you
> can't print, etc.
> 
> I am NOT INTERESTED in turning Subsurface-mobile into a replacement for
> the desktop version. So no, I don't want to reimplement all the things that we
> have in the preferences on the desktop for the mobile device.
Nor should we but we need to EXTREMELY clear about that in the app description, 
so people understand that this app can not be used standalone.

Currently everything you do with the app is discarded when closing the app 
since even local storage is
ignored if no cloud credentials exists. 

> 
> /D

/Jocke

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


Re: Subsurface-planner [was: Now Accepting GSoC 2016 Mentor Organization Applications]

2016-02-10 Thread Joakim Bygdell

> On 10 Feb 2016, at 17:27, Dirk Hohndel <d...@hohndel.org> wrote:
> 
> 
>> On Feb 10, 2016, at 8:12 AM, Joakim Bygdell <j.bygd...@gmail.com 
>> <mailto:j.bygd...@gmail.com>> wrote:
>>> 
>>> I am NOT INTERESTED in turning Subsurface-mobile into a replacement for
>>> the desktop version. So no, I don't want to reimplement all the things that 
>>> we
>>> have in the preferences on the desktop for the mobile device.
>> Nor should we but we need to EXTREMELY clear about that in the app 
>> description, 
>> so people understand that this app can not be used standalone.
> 
> Here is what the store description starts with:
> 
> Subsurface is a free open source dive log application available on Windows, 
> Mac and Linux. Subsurface-mobile allows you to access your dive log on your 
> tablet or phone. Simply create a Cloud Storage account with the Subsurface 
> desktop application, store your dive log in the cloud and then enter the same 
> credentials in Subsurface-mobile.
> 
> Now you can access your dive list, see dive details, even modify these 
> details right there on your mobile device. You can also manually add new 
> dives to the dive list.
> 
> Feel free to suggest better language for this particular point.
> 
>> Currently everything you do with the app is discarded when closing the app 
>> since even local storage is
>> ignored if no cloud credentials exists. 
> 
> We simply shouldn't allow the user to add dives unless cloud credentials are 
> entered.
> I'll modify the start page - hopefully that will address the concerns
The left-hand slide out menu needs to be disabled as well.


> 
> /D
> 

/Jocke

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


[PATCH 2/3] QML UI: add function to get cylinder pressures

2016-02-09 Thread Joakim Bygdell
Since we only show the first cylinder we can also only edit the first cylinder.

Signed-off-by: Joakim Bygdell <j.bygd...@gmail.com>
---
 subsurface-core/subsurface-qt/DiveObjectHelper.cpp | 23 ++
 subsurface-core/subsurface-qt/DiveObjectHelper.h   |  4 
 2 files changed, 27 insertions(+)

diff --git a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp 
b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp
index 2f058f4..40a67fb 100644
--- a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp
+++ b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp
@@ -33,6 +33,17 @@ static QString getFormattedCylinder(struct dive *dive, 
unsigned int idx)
return fmt;
 }
 
+static QString getPressures(struct dive *dive, bool returnPressures)
+{
+   cylinder_t *cyl = >cylinder[0];
+   QString fmt;
+   if (returnPressures == 0)
+   fmt = get_pressure_string(cyl->start, true);
+   if (returnPressures == 1)
+   fmt = get_pressure_string(cyl->end, true);
+   return fmt;
+}
+
 DiveObjectHelper::DiveObjectHelper(struct dive *d) :
m_dive(d)
 {
@@ -269,3 +280,15 @@ QString DiveObjectHelper::getCylinder() const
}
return getCylinder;
 }
+
+QString DiveObjectHelper::startPressure() const
+{
+   QString startPressure = getPressures(m_dive, 0);
+   return startPressure;
+}
+
+QString DiveObjectHelper::endPressure() const
+{
+   QString endPressure = getPressures(m_dive, 1);
+   return endPressure;
+}
diff --git a/subsurface-core/subsurface-qt/DiveObjectHelper.h 
b/subsurface-core/subsurface-qt/DiveObjectHelper.h
index f9ed6a5..5d8abfd 100644
--- a/subsurface-core/subsurface-qt/DiveObjectHelper.h
+++ b/subsurface-core/subsurface-qt/DiveObjectHelper.h
@@ -35,6 +35,8 @@ class DiveObjectHelper : public QObject {
Q_PROPERTY(QString otu READ otu CONSTANT)
Q_PROPERTY(QString sumWeight READ sumWeight CONSTANT)
 Q_PROPERTY(QString getCylinder READ getCylinder CONSTANT)
+Q_PROPERTY(QString startPressure READ startPressure CONSTANT)
+Q_PROPERTY(QString endPressure READ endPressure CONSTANT)
 public:
DiveObjectHelper(struct dive *dive = NULL);
~DiveObjectHelper();
@@ -68,6 +70,8 @@ public:
QString otu() const;
QString sumWeight() const;
QString getCylinder() const;
+   QString startPressure() const;
+   QString endPressure() const;
 
 private:
struct dive *m_dive;
-- 
2.4.9 (Apple Git-60)

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


[PATCH 3/3] QML UI: enable edit of cylinder pressures

2016-02-09 Thread Joakim Bygdell
First cylinder only, show warning if there are more than one cylinder defined.

Signed-off-by: Joakim Bygdell <j.bygd...@gmail.com>
---
 qt-mobile/qml/DiveDetails.qml | 10 ++
 qt-mobile/qml/DiveDetailsEdit.qml | 26 +-
 qt-mobile/qml/main.qml|  2 ++
 qt-mobile/qmlmanager.cpp  | 15 ++-
 qt-mobile/qmlmanager.h|  3 ++-
 5 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/qt-mobile/qml/DiveDetails.qml b/qt-mobile/qml/DiveDetails.qml
index 162e31b..f0e2ff3 100644
--- a/qt-mobile/qml/DiveDetails.qml
+++ b/qt-mobile/qml/DiveDetails.qml
@@ -22,6 +22,8 @@ MobileComponents.Page {
property alias notes: detailsEdit.notesText
property alias suit: detailsEdit.suitText
property alias weight: detailsEdit.weightText
+   property alias startpressure: detailsEdit.startpressureText
+   property alias endpressure: detailsEdit.endpressureText
 
state: "view"
 
@@ -99,6 +101,14 @@ MobileComponents.Page {
// careful when translating, this text is "magic" in 
DiveDetailsEdit.qml
weight = "cannot edit multiple weight systems"
}
+   if (diveDetailsListView.currentItem.modelData.dive.getCylinder 
!= "Multiple" ) {
+   startpressure = 
diveDetailsListView.currentItem.modelData.dive.startPressure
+   endpressure = 
diveDetailsListView.currentItem.modelData.dive.endPressure
+   } else {
+   // careful when translating, this text is "magic" in 
DiveDetailsEdit.qml
+   startpressure = "cannot edit multiple cylinders"
+   endpressure = "cannot edit multiple cylinders"
+   }
 
diveDetailsPage.state = "edit"
}
diff --git a/qt-mobile/qml/DiveDetailsEdit.qml 
b/qt-mobile/qml/DiveDetailsEdit.qml
index 90ca304..f6a197d 100644
--- a/qt-mobile/qml/DiveDetailsEdit.qml
+++ b/qt-mobile/qml/DiveDetailsEdit.qml
@@ -22,6 +22,8 @@ Item {
property alias durationText: txtDuration.text
property alias depthText: txtDepth.text
property alias weightText: txtWeight.text
+   property alias startpressureText: txtStartPressure.text
+   property alias endpressureText: txtEndPressure.text
 
height: editArea.height
ColumnLayout {
@@ -144,6 +146,27 @@ Item {
}
 
MobileComponents.Label {
+   Layout.alignment: Qt.AlignRight
+   text: "Start pressure:"
+   }
+   TextField {
+   id: txtStartPressure
+   readOnly: (text == "cannot edit multiple 
cylinders" ? true : false)
+   Layout.fillWidth: true
+   }
+
+   MobileComponents.Label {
+   Layout.alignment: Qt.AlignRight
+   text: "End Pressure:"
+   }
+   TextField {
+   id: txtEndPressure
+   readOnly: (text == "cannot edit multiple 
cylinders" ? true : false)
+   Layout.fillWidth: true
+   }
+
+
+   MobileComponents.Label {
Layout.columnSpan: 2
Layout.alignment: Qt.AlignLeft
text: "Notes:"
@@ -168,7 +191,8 @@ Item {
// apply the changes to the dive_table
manager.commitChanges(dive_id, 
detailsEdit.dateText, detailsEdit.locationText, detailsEdit.gpsText, 
detailsEdit.durationText,
  detailsEdit.depthText, 
detailsEdit.airtempText, detailsEdit.watertempText, detailsEdit.suitText,
- detailsEdit.buddyText, 
detailsEdit.divemasterText, detailsEdit.weightText, detailsEdit.notesText)
+ detailsEdit.buddyText, 
detailsEdit.divemasterText, detailsEdit.weightText, detailsEdit.notesText,
+ 
detailsEdit.startpressureText, detailsEdit.endpressureText)
// apply the changes to the dive detail view - 
since the edit could have changed the order
// first make sure that we are looking at the 
correct dive - our model allows us to look
// up the index based on the unique dive_id
diff --git a/qt-mobile/qml/main.qml b/qt-mobile/qml/main.qml
inde

  1   2   3   >