Building from scratch on a MAC (El Captain)

2015-11-03 Thread Guido Lerch
Hi All,

I am getting several warnings around libdivecomputer.

 WARNING: Target "Subsurface" requests linking to directory
"/Users/glerch/src/libdivecomputer/include".  Targets may

 link only to libraries.  CMake is dropping the item.

this is what ccmake looks like

[image: Inline-Bild 1]

I do not find a cmake folder within libdivecomputer though, any ideas ?
I deleted the subsurface folder
cloned subsurface into src
ran subsurface/scripts/build.sh

got tons of errors because the cmake configuration had no idea about any of
the
required libs and Qt. Adding some paths to ccmake fixed that but the I have
no idea
about the above.

In general I thought build.sh is supposed to build subsurface, is this only
me having
those kind of issues ?

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


Re: Patches to add Context Menu to Images

2015-11-03 Thread Guido Lerch
Hi Robert

2015-11-03 21:34 GMT+01:00 Robert C. Helling <hell...@atdotde.de>:

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

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

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

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

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


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


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


Building Subsurface on MAC

2015-11-03 Thread Guido Lerch
All,

The blues is over ...
Here are the steps to get the new master loaded and build on a MAC OS 10.11

1. remove the entire subsurface folder
2. launch XCode to complete the XCode installation if you have not done
already
3. xcode-select --install
4. brew install libssh2
5. brew install libgcrypt
6. run subsurface/scripts/build.sh
7. navigate to build folder
8. ccmake .
9. supply folders for QT5_Gui and QT5
10. cmake .
11. make -j4
12. make install

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


Patches to add Context Menu to Images

2015-11-03 Thread Guido Lerch
Hi All,

Re-submitting.

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

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

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

Allowing to delete selected or all photos from the
dive images

Signed-off-by: Guido Lerch <guido.le...@gmail.com>
---
 desktop-widgets/maintab.cpp | 9 +
 desktop-widgets/maintab.h   | 1 +
 2 files changed, 10 insertions(+)

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

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

removing obsolete code

Signed-off-by: Guido Lerch <guido.le...@gmail.com>
---
 desktop-widgets/maintab.cpp | 7 ---
 1 file changed, 7 deletions(-)

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

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

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

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

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

Re: [PATCH] Drag and Drop images

2015-11-03 Thread Guido Lerch
Hi Dirk,

Just saw this, hope my context menu does fit with this ...

2015-11-03 16:48 GMT+01:00 Dirk Hohndel :

> On Tue, Nov 03, 2015 at 11:31:32AM +0100, Robert Helling wrote:
> > Hi,
> >
> > > On 21.09.2015, at 09:30, Robert C. Helling  > wrote:
> > >
> > > <0001-Drag-and-Drop-images.txt>
> > > Hi,
> > >
> > > Dirk I don’t know if you want to take this at this point or wait till
> after the release (although I am pretty sure not much harm can be caused by
> this…).
> > >
> > > We have a checkbox to ignore image time stamps when adding pictures.
> Those pictures end up at time 0. With this patch, the user can drag those
> images form the list of images to the profile and a drop sets the time
> offset accordingly.
> > >
> > > Best
> > > Robert
> >
> >
> > I am resending this as 4.5.1 is out and we should be allowed to break
> things again…
>
> Well, it didn't include the patch. I went back to the old patch and that
> of course doesn't apply any more. I can manually make it work or I can ask
> you to resend a working patch :-)
>
> /D
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>



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


Re: storing pictures

2015-10-26 Thread Guido Lerch
Hi Dirk,

I¹ve put some thoughts into this. Not an easy topic as people might have
very individual requirements on this topic.
I suggest to take a step-wise approach, determining who would benefit
quickly depending on the complexity of the
implementation.

Let me explain my case.
* I love to take films and pictures
* I¹d like to assign them to dives
* I¹d like to use my mouse to add or delete them (have patches for this
already)
* I¹d appreciate if the loading doesn¹t take too long (no idea on how to do
async loading yet with threads but would be interested to dig into)
* I would like to have them stored in a  way I can access them from
different computers
* I do NOT expect them to load on mobile.
>From my perspective, implementing a V1, the easiest is to allow managing
pictures ³locally² in the way I send a few test
patches already. 
I don't know how Google drive or Box work in detail but I know with DropBox
I can synchronise my pictures across computers
and even on my iPhone.

If we allow the copy process from the source medial (SD card for example) to
a local DropBox location we already have achieved a lot.
I have the patches running with the last master and it works very nicely.
Files are copied automatically during the loading,
the new location is stored based on the user preferences. Images that are
used in multiple dives are not being physically
deleted on delete. If the preference to manage images is switched off images
are not deleted physically either and last
but not least, images are not deleted if the managed location has changed.

More comments below

Guido

From:  subsurface  on behalf of
Dirk Hohndel 
Date:  Thursday 22 October 2015 14:08
To:  Subsurface Mailing List 
Subject:  storing pictures

> So I've been thinking about this for a while and I'm not sure what we do
> right now is the right thing after all.
> 
> So when a user adds pictures to their dive file, the dive file itself
> should contain information how to find the picture and (possibly?) a
> thumbnail of the picture (so if the picture isn't available for whatever
> reason, we can at least show a thumbnail.
> 
> So what does "information how to find the picture" mean?
> 
> - simplest case, it's a file:// url - i.e., where on my local computer
> - of course it has a hash which allows us to find it again if it was moved
> 
> But Subsurface should have a preference option that allows the user to
> specify a network base way to store pictures as well
could be done with radio buttons like O store locally O store remotely (e.g.
unc path)
> 
> - cloud storage: pictures are no longer stored as part of the users'
>   branch in the git repo - that makes remote operations over super
>   slow/bad networks harder and makes the first sync take forever.
>   Instead the cloud storage should allow users to upload their pictures
>   directly into their picture directory on the cloud server and then to
>   download them "on demand" (i.e., if the user clicks on a picture to see
>   the full sized version) - but of course look for a local cached copy,
>   first. So if I open my repo on my phone it only downloads the picture if
>   I tap on it (pictures currently aren't implemented there, anyway).
Can¹t comment on this as I am not experienced enough
> - Dropbox / Google drive / other shared storage mechanisma: allow in the
>   preferences to tell Subsurface how data can be uploaded / downloaded.
>   This can be as easy as a subdirectory of the "magic directory" that is
>   used for this cloud data storage. And then use hash-based names to find
>   the pictures there.
This is what I played with
> 
> Is this reasonable? What am I missing? I know that Guido has started to
> look into this, as has Robert... please comment / make suggestions how the
> idea can be improved.
> 
> I want pictures to be easy to get to from any device, but I don't want
> them to bloat the git repository as they do today.
> 
> /D
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
> 


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


Re: Fixing warning about freediving

2015-10-22 Thread Guido Lerch


Regards,
Guido
+41 79 3217739

> Am 22.10.2015 um 09:26 schrieb Dirk Hohndel <d...@hohndel.org>:
> 
>> On Thu, Oct 22, 2015 at 12:26:17AM +0200, Guido Lerch wrote:
>> let me know what and why you rewrote, otherwise I wont grow.
> 
> Sure thing.
> 
> Read your commit message and read mine:
> 
>>>> Subject: [PATCH] Fixing build warning about freediving
>>>> 
>>>> This just fixes an issue with freediving not being with a switch
>>> statement
>>>> that was a little annoying.
>>>> 
>>>> location: profice.c
>>>> function: plot_string
> 
> Fixing build warning about freediving
> 
> This just fixes an annoying warning that freediving wasn't
> covered in the switch statement.
> 
> 
> 
> I guess it's a matter of style - I like mine better as it is clear and
> concise (I hope) :-)

Hmm to me reads more or less the same. English is not my native language and 
certainly not as good as yours.
Keep on correcting ... :-)
> 
>>>> diff --git a/profile.c b/profile.c
>>>> index 55cf629..4bfb5ff 100644
>>>> --- a/profile.c
>>>> +++ b/profile.c
>>>> @@ -1173,6 +1173,9 @@ static void plot_string(struct plot_info *pi,
>>> struct plot_data *entry, struct me
>>>>  case AIR:
>>>>  /* nothing */
>>>>  break;
>>>> + case FREEDIVING:
>>>> + /* nothing */
>>>> + break;
> 
> So you duplicate the "do nothing case". I figured it's easier and clearer
> to do this:
> 
> --- a/profile.c
> +++ b/profile.c
> @@ -1171,6 +1171,7 @@ static void plot_string(struct plot_info *pi, struct
> plot_data *entry, struct me
>put_format(b, translate("gettextFromC", "END:
> %d%s\nEADD: %d%s\n"), end, depth_unit, eadd, depth_unit);
>break;
>case AIR:
> +   case FREEDIVING:
>/* nothing */
>break;
>}
> 
> 
> Nothing major, just fine tuning :-)
> 
> /D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Another braces warning this that I overlooked

2015-10-22 Thread Guido Lerch
Hi Dirk

Thanks, I got a warning about dangling braces. That is send in two patches was 
because I didn't capture the second set the first time and I am still having 
issues to understand GIT  reset --amend and so on... GIT commands never get me 
where I think they would.

I'd love to see what you do when you rewrite my patches..
Are you doing this in a editor or do you apply them to a branch, reset the head 
and then commit?

Regards,
Guido
+41 79 3217739

> Am 22.10.2015 um 12:38 schrieb Dirk Hohndel <d...@hohndel.org>:
> 
>> On Thu, Oct 22, 2015 at 09:21:41AM +0200, Robert C. Helling wrote:
>> Dirk,
>> 
>>> On 22 Oct 2015, at 09:15, Dirk Hohndel <d...@hohndel.org> wrote:
>>> 
>>> Why? What does the compiler complain about? The existing code is correct
>>> and unambiguous. What am I missing?
>> 
>> one could worry to which if the else applies (yes, there is a rule but 
>> people often get this wrong. And since this is not python the compiler does 
>> not look at your beautiful indentation).
> 
> Yes. It is well defined, and clear to the reader, but still, in theory one
> could misinterpret it. In practice C binds else to the closest if, so the
> code is actually correct.
> 
> I will once again rewrite Guido's patches into one simpler one that makes
> it unambiguous... basically the second patch without the first :-)
> 
> /D
> 
> commit f1c682b55a52c11d7cb57da0fc66d6edb118ba77
> Author: Guido Lerch <guido.le...@gmail.com>
> Date:   Thu Oct 22 00:17:05 2015 +0200
> 
>Fixing annoying compiler warning
> 
>Adding { } to if clause to avoid dangling warning
>/Users/guidolerch/src/subsurface/qt-models/cylindermodel.cpp:117:
>warning: add explicit braces to avoid dangling else [-Wdangling-else]
> 
>[Dirk Hohndel: combined two of Guido's patches to one that is simpler]
> 
>Signed-off-by: Guido Lerch <guido.le...@gmail.com>
>Signed-off-by: Dirk Hohndel <d...@hohndel.org>
> 
> diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp
> index 8c9bee8b1882..8341d36081eb 100644
> --- a/qt-models/cylindermodel.cpp
> +++ b/qt-models/cylindermodel.cpp
> @@ -111,18 +111,20 @@ QVariant CylindersModel::data(const QModelIndex , 
> int role) const
>}
>break;
>case Qt::DecorationRole:
> -if (index.column() == REMOVE)
> +if (index.column() == REMOVE) {
>if (rowCount() > 1)
>ret = trashIcon();
>else
>ret = trashForbiddenIcon();
> +}
>break;
>case Qt::SizeHintRole:
> -if (index.column() == REMOVE)
> +if (index.column() == REMOVE) {
>if (rowCount() > 1)
>ret = trashIcon();
>else
>ret = trashForbiddenIcon();
> +}
>break;
> 
>case Qt::ToolTipRole:
> 
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Uemis patch

2015-10-21 Thread Guido Lerch
2015-10-21 15:40 GMT+02:00 Lubomir I. Ivanov <neolit...@gmail.com>:

> On 21 October 2015 at 16:21, Guido Lerch <guido.le...@gmail.com> wrote:
> > fixing an issue with loading dives on Ubuntu.
> >
> > it seems that this code does not resolve the file type
> > correctly. it returns DT_REG also on ANSx.TXT files.
> >
> > Tested the fix on Ubuntu 14.04 and Mac OSX 10.9,
> > not tested on El Captain but I assume no issues there.
> >
> > This fix affects Uemis only.
> >
> > - if (entry->d_type == DT_REG) /* If the entry is a regular file */
> > + if (strstr(entry->d_name, ".TXT")) /* If the entry is a regular file */
>
> are the extensions always in uppercase?
>
I have never seen this otherwise but maybe I do a lower, just to be sure.

>
> lubomir
> --
>



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


Re: mobile ui considerations

2015-10-21 Thread Guido Lerch
Have iOS development setup and can successfully run a Hello World app :-)

What makes trouble is getting Android running, I was under the assumption
the Android
SDK would come with the installers from Qt but I cannot find them, do I
have to download
the SDK, Qt offers a button for that. Same for NDK.
[image: Inline-Bild 1]

2015-10-21 16:55 GMT+02:00 Guido Lerch <guido.le...@gmail.com>:

> Thanks Robert.
> Started to upgrade my Qt stuff.
> I'll let you know how it progresses.
>
> Regards,
> Guido
> +41 79 3217739
>
> Am 21.10.2015 um 13:17 schrieb Robert C. Helling <hell...@atdotde.de>:
>
> Guido,
>
> On 21 Oct 2015, at 12:55, Guido Lerch <guido.le...@gmail.com> wrote:
>
> I volunteer to help with iOS but would need some help as I am not an
> expert in Qt yet ...
> Tomaz, let me know when and how you would like to get this started.
> I am as keen on an iOS app as others and like to have at least a beta on
> my next trip.
> Further we should not wait too long to see how easy it is to compile/ port
> to IOS as we might be surprised.
>
>
> I would also be very interested to be able to compile (at least some
> version of) Subsurface for iOS. I think a reasonable step 0 would be use Qt
> to build some sort of Hello world application for iOS, both for the
> simulator as well as for your device. This makes sure your toolchain is
> actually working.
>
> http://doc.qt.io/qt-5/ios-support.html
>
> could be a good starting point (I remember also starting to watch a
> youtube video on the subject where it was demonstrated that this is only a
> few mouse clicks away).
>
> Once you are there, you could try to strip subsurface down so it does not
> need all these libraries (that might turn out complicated to bring to iOS
> at first) and then compile that for iOS. I guess there are already many
> compiler or better cmake options that do exactly that since that was also a
> step in the android version.
>
> In fact, at that point you probably want to make sure you can build the
> android version as well since that also tests you toolchain.
>
> And then, you start adding stuff back in.
>
> At least, that would be my plan (and as I said, I might invest some time
> here as well).
>
> Best
> Robert
>
>


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


Re: mobile ui considerations

2015-10-21 Thread Guido Lerch
2015-10-21 18:25 GMT+02:00 Joakim Bygdell <j.bygd...@gmail.com>:

>
> On 21 Oct 2015, at 18:21, Guido Lerch <guido.le...@gmail.com> wrote:
>
> Have iOS development setup and can successfully run a Hello World app :-)
>
> What makes trouble is getting Android running, I was under the assumption
> the Android
> SDK would come with the installers from Qt but I cannot find them, do I
> have to download
> the SDK, Qt offers a button for that. Same for NDK.
> 
>
>>
>>
> There is an README file under packaging/android that tells you where to
> download all the stuff needed.
>

Thanks !

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


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


Fixing warning about freediving

2015-10-21 Thread Guido Lerch
trashed my subsurface folder and started from scratch today with the last
master @  4722df8

while building I got a warning



-- 
Best regards,
Guido
From b1888cc5a96a8fd32b2fa57bfce8f013157df742 Mon Sep 17 00:00:00 2001
From: Guido Lerch <guido.le...@gmail.com>
Date: Wed, 21 Oct 2015 23:35:41 +0200
Subject: [PATCH] Fixing build warning about freediving

This just fixes an issue with freediving not being with a switch statement
that was a little annoying.

location: profice.c
function: plot_string

Signed-off-by: Guido Lerch <guido.le...@gmail.com>
---
 profile.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/profile.c b/profile.c
index 55cf629..4bfb5ff 100644
--- a/profile.c
+++ b/profile.c
@@ -1173,6 +1173,9 @@ static void plot_string(struct plot_info *pi, struct 
plot_data *entry, struct me
case AIR:
/* nothing */
break;
+   case FREEDIVING:
+   /* nothing */
+   break;
}
}
if (entry->stopdepth) {
-- 
2.3.8 (Apple Git-58)

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


GIT

2015-10-21 Thread Guido Lerch
Hi

At some point in time I would like someone to help me with GIT.
I find this confusing which is probably confusing to you.

I work on a feature, figure out a bug, when trying to fix this I am
getting my branches confused, ending up in wiping it all away,
clone subsurface, building branches, reapplying patches etc.

It can't be that difficult ... I read the FM and this didn't help.

I have no GIT-brain ... and lost many hours of dev. time to this :-(

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


Another braces warning this that I overlooked

2015-10-21 Thread Guido Lerch
-- 
Best regards,
Guido
From 6121bdb8543fd067188e793837e577edef912ede Mon Sep 17 00:00:00 2001
From: Guido Lerch <guido.le...@gmail.com>
Date: Thu, 22 Oct 2015 00:42:30 +0200
Subject: [PATCH 2/2] Fixing warnings about braces in cylindermodel.cpp-2

Morace braces needed.Sorry

Signed-off-by: Guido Lerch <guido.le...@gmail.com>
---
 qt-models/cylindermodel.cpp | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp
index c697145..7992545 100644
--- a/qt-models/cylindermodel.cpp
+++ b/qt-models/cylindermodel.cpp
@@ -111,20 +111,22 @@ QVariant CylindersModel::data(const QModelIndex , 
int role) const
}
break;
case Qt::DecorationRole:
-   if (index.column() == REMOVE)
+   if (index.column() == REMOVE) {
if (rowCount() > 1) {
ret = trashIcon();
} else {
ret = trashForbiddenIcon();
}
+   }
break;
case Qt::SizeHintRole:
-   if (index.column() == REMOVE)
+   if (index.column() == REMOVE) {
if (rowCount() > 1) {
ret = trashIcon();
} else {
ret = trashForbiddenIcon();
}
+   }
break;
 
case Qt::ToolTipRole:
-- 
2.3.8 (Apple Git-58)

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


Re: Fixing warning about freediving

2015-10-21 Thread Guido Lerch
heres another one for you to rewrite.
let me know what and why you rewrote, otherwise I wont grow.

2015-10-22 0:16 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:

> I was just about to look at that warning. Thanks for fixing it. I rewrote
> both your patch and your commit message, though :-)
>
> /D
>
> On Wed, Oct 21, 2015 at 11:40:11PM +0200, Guido Lerch wrote:
> > trashed my subsurface folder and started from scratch today with the last
> > master @  4722df8
> >
> > while building I got a warning
> >
> >
> >
> > --
> > Best regards,
> > Guido
>
> > From b1888cc5a96a8fd32b2fa57bfce8f013157df742 Mon Sep 17 00:00:00 2001
> > From: Guido Lerch <guido.le...@gmail.com>
> > Date: Wed, 21 Oct 2015 23:35:41 +0200
> > Subject: [PATCH] Fixing build warning about freediving
> >
> > This just fixes an issue with freediving not being with a switch
> statement
> > that was a little annoying.
> >
> > location: profice.c
> > function: plot_string
> >
> > Signed-off-by: Guido Lerch <guido.le...@gmail.com>
> > ---
> >  profile.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/profile.c b/profile.c
> > index 55cf629..4bfb5ff 100644
> > --- a/profile.c
> > +++ b/profile.c
> > @@ -1173,6 +1173,9 @@ static void plot_string(struct plot_info *pi,
> struct plot_data *entry, struct me
> >   case AIR:
> >   /* nothing */
> >   break;
> > + case FREEDIVING:
> > + /* nothing */
> > + break;
> >   }
> >   }
> >   if (entry->stopdepth) {
> > --
> > 2.3.8 (Apple Git-58)
> >
>
> > ___
> > subsurface mailing list
> > subsurface@subsurface-divelog.org
> > http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>
>


-- 
Best regards,
Guido
From ed3692e5fa8c12a27bd1e6035b50beb659ef8ccb Mon Sep 17 00:00:00 2001
From: Guido Lerch <guido.le...@gmail.com>
Date: Thu, 22 Oct 2015 00:17:05 +0200
Subject: [PATCH 3/3] Fixing annoying compiler warning

Adding { } to if clause to avoid dangling warning
/Users/guidolerch/src/subsurface/qt-models/cylindermodel.cpp:117:
warning: add explicit braces to avoid dangling else [-Wdangling-else]

Signed-off-by: Guido Lerch <guido.le...@gmail.com>
---
 qt-models/cylindermodel.cpp | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp
index 8c9bee8..c697145 100644
--- a/qt-models/cylindermodel.cpp
+++ b/qt-models/cylindermodel.cpp
@@ -112,17 +112,19 @@ QVariant CylindersModel::data(const QModelIndex , 
int role) const
break;
case Qt::DecorationRole:
if (index.column() == REMOVE)
-   if (rowCount() > 1)
+   if (rowCount() > 1) {
ret = trashIcon();
-   else
+   } else {
ret = trashForbiddenIcon();
+   }
break;
case Qt::SizeHintRole:
if (index.column() == REMOVE)
-   if (rowCount() > 1)
+   if (rowCount() > 1) {
ret = trashIcon();
-   else
+   } else {
ret = trashForbiddenIcon();
+   }
break;
 
case Qt::ToolTipRole:
-- 
2.3.8 (Apple Git-58)

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


Re: Fixing warning about freediving

2015-10-21 Thread Guido Lerch
2015-10-22 0:33 GMT+02:00 Tomaz Canabrava :

> I will have a bomb - patch for you guys in a few days. ;p
> since I'll probably break a ton of builds, I guess I need to say this.
>

I take shelter and help as much as I can :)

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


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


Re: GIT

2015-10-21 Thread Guido Lerch
Hi Tomaz

VERY APPRECIATED
I'll digest the details when I am sober tomorrow ... I loved the Spanish
wine I just had tooo much :-)
Thanks.
G.

2015-10-22 0:50 GMT+02:00 Tomaz Canabrava <tcanabr...@kde.org>:

>
>
> On Wed, Oct 21, 2015 at 8:35 PM, Guido Lerch <guido.le...@gmail.com>
> wrote:
>
>> Hi
>>
>> At some point in time I would like someone to help me with GIT.
>> I find this confusing which is probably confusing to you.
>>
>> I work on a feature, figure out a bug, when trying to fix this I am
>> getting my branches confused,
>>
>
> Try to use a git-helper for bash or zsh, I use oh-my-zsh, see how pretty
> my git things are:
>
> tomaz@naboo - subsurface (master) : $ git checkout cmake_fixes
> tomaz@naboo - subsurface (cmake_fixes) : $
>
> See? my terminal gives me my current branch all the time, this helps a lot.
>
> So, back to your real problem:
>
> You are working on a feature X, let's call it tomaz_is_braindead and then
> you found a bug that is on master
>
> guido@guidoland - subsurface (tomaz_is_braindead) : $ git checkout master
> guido@guidoland - subsurface (master) : $ git checkout -b fix_tomaz_bug
> guido@guidoland - subsurface (fix_tomaz_bug) : $ git checkout -b
> fix_tomaz_bug
>
> work work work
>
> guido@guidoland - subsurface (fix_tomaz_bug) : $ git commit -a -s
> guido@guidoland - subsurface (fix_tomaz_bug) : $ git format-patch master
>
> send the code you create to the ML
>
> guido@guidoland - subsurface (fix_tomaz_bug) : $ git checkout
> tomaz_is_braindead (your original branch)
>
> continue working happly knowing that you fixed a bug that is already in
> review, and try to avoid it on your current branch.
>
> at least, this is how I work.
>
> and then you found a bug on the code that is on master:
>
>> ending up in wiping it all away,
>> clone subsurface, building branches, reapplying patches etc.
>>
>> It can't be that difficult ... I read the FM and this didn't help.
>>
>> I have no GIT-brain ... and lost many hours of dev. time to this :-(
>>
>> --
>> Best regards,
>> Guido
>>
>> ___
>> subsurface mailing list
>> subsurface@subsurface-divelog.org
>> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>>
>>
>


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


Uemis patch

2015-10-21 Thread Guido Lerch
fixing an issue with loading dives on Ubuntu.

it seems that this code does not resolve the file type
correctly. it returns DT_REG also on ANSx.TXT files.

Tested the fix on Ubuntu 14.04 and Mac OSX 10.9,
not tested on El Captain but I assume no issues there.

This fix affects Uemis only.

-- 
Best regards,
Guido
From 7937e77ace8f64cb03da6fafe50cd51757c5c83a Mon Sep 17 00:00:00 2001
From: Guido Lerch <guido.le...@gmail.com>
Date: Wed, 21 Oct 2015 14:51:11 +0200
Subject: [PATCH] Uemis fix for Ubuntu

Fixing a but preventing to download files on Ubuntu.
On Ubuntu are recognized as DIR and not as regular
files.
This is a fix that works but most lilely does not address
the root cause which would need a crack to look at..

Signed-off-by: Guido Lerch <guido.le...@gmail.com>
---
 uemis-downloader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/uemis-downloader.c b/uemis-downloader.c
index b798905..16a8218 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -207,7 +207,7 @@ static int number_of_file(char *path)
entry = readdir(dirp);
if (!entry)
break;
-   if (entry->d_type == DT_REG) /* If the entry is a regular file 
*/
+   if (strstr(entry->d_name, ".TXT")) /* If the entry is a regular 
file */
 #endif
count++;
}
-- 
1.9.1

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


Re: mobile ui considerations

2015-10-21 Thread Guido Lerch


Regards,
Guido
+41 79 3217739

> Am 20.10.2015 um 09:51 schrieb Dirk Hohndel :
> 
>> On Tue, Oct 20, 2015 at 09:32:06AM +0200, Davide DB wrote:
>>> On Tue, Oct 20, 2015 at 9:17 AM, Dirk Hohndel  wrote:
>>> 
>>> Sebastian is a rather experienced Qt/QML developer so I'm sure he will get
>>> us to something ready for a beta release fairly soon. I certainly hope to
>>> be able to use Subsurface-mobile on my phone long before "next October"
>>> :-)
>> 
>> 
>> Out of curiosity...
>> 
>> Will Android be the default development OS?
>> How much difficult would be having a IOS equivalent at the same time?
> 
> I have asked Tomaz to look into what it takes to get this to build on iOS
> as well. In theory this shouldn't be hard. But we won't know until we try.

I volunteer to help with iOS but would need some help as I am not an expert in 
Qt yet ...
Tomaz, let me know when and how you would like to get this started.
I am as keen on an iOS app as others and like to have at least a beta on my 
next trip.
Further we should not wait too long to see how easy it is to compile/ port to 
IOS as we might be surprised.
> 
> /D
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Building issue

2015-10-20 Thread Guido Lerch
Hi, I was busy the last couple of days. Today I pulled the new master, ran
cmake
and get the below. Before I spend hours trial and error, anyone a
suggestion ?

Thanks for helping

[image: Inline-Bild 1]

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


For consideration for 4.5.1 or 4.6

2015-10-20 Thread Guido Lerch
adding context menu to images for multi selection deletion and deleting all
images.

ideally we add a menu for adding dives as well but I have not done this
yet, waiting for
you input.

purpose of this: usability

is someone working on getting images and eventually multi format files in
to git yet ?

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

Allowing to delete selected or all photos from the
dive images

Signed-off-by: Guido Lerch <guido.le...@gmail.com>
---
 qt-ui/maintab.cpp | 9 +
 qt-ui/maintab.h   | 1 +
 2 files changed, 10 insertions(+)

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

From bf989a642f9bb50cf6cf6f266fb0f8407f3916c9 Mon Sep 17 00:00:00 2001
From: Guido Lerch <guido.le...@gmail.com>
Date: Tue, 20 Oct 2015 21:03:53 +0200
Subject: [PATCH 2/6] Context menu support for images

Altering DivePicture model to allow deleting images
from the QListView without immediate updating of the
list. Updating is determined by an additioanl parameter

Signed-off-by: Guido Lerch <guido.le...@gmail.com>
---
 qt-models/divepicturemodel.cpp | 10 ++
 qt-models/divepicturemodel.h   |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/qt-models/divepicturemodel.cpp b/qt-models/divepicturemodel.cpp
index 1f37423..bb5db33 100644
--- a/qt-models/divepicturemodel.cpp
+++ b/qt-models/divepicturemodel.cpp
@@ -111,12 +111,14 @@ QVariant DivePictureModel::data(const QModelIndex , 
int role) const
return ret;
 }
 
-void DivePictureModel::removePicture(const QString )
+void DivePictureModel::removePicture(const QString , bool last)
 {
dive_remove_picture(fileUrl.toUtf8().data());
-   copy_dive(current_dive, _dive);
-   updateDivePictures();
-   mark_divelist_changed(true);
+   if (last) {
+   copy_dive(current_dive, _dive);
+   updateDivePictures();
+   mark_divelist_changed(true);
+   }
 }
 
 int DivePictureModel::rowCount(const QModelIndex ) const
diff --git a/qt-models/divepicturemodel.h b/qt-models/divepicturemodel.h
index d6393e4..7390fc5 100644
--- a/qt-models/divepicturemodel.h
+++ b/qt-models/divepicturemodel.h
@@ -33,7 +33,7 @@ public:
virtual int rowCount(const QModelIndex  = QModelIndex()) const;
virtual void updateDivePictures();
void updateDivePicturesWhenDone(QList<QFuture >);
-   void removePicture(const QString& fileUrl);
+   void removePicture(const QString& fileUrl, bool last);
 
 protected:
DivePictureModel();
-- 
2.3.8 (Apple Git-58)

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

removing obsolete code

Signed-off-by: Guido Lerch <guido.le...@gmail.com>
---
 qt-ui/maintab.cpp | 7 ---
 1 file changed, 7 deletions(-)

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

Context menu support for images

2015-10-20 Thread Guido Lerch
could not resist, this patch adds adding images from file and web.

-- 
Best regards,
Guido
From f7594fbbd54197abb7a20b65cc8d394afc8f07e8 Mon Sep 17 00:00:00 2001
From: Guido Lerch <guido.le...@gmail.com>
Date: Tue, 20 Oct 2015 22:36:59 +0200
Subject: [PATCH 7/7] Context menu support for images

Adding loading from file and loading from web.

Signed-off-by: Guido Lerch <guido.le...@gmail.com>
---
 qt-ui/maintab.cpp | 13 +
 qt-ui/maintab.h   |  2 ++
 2 files changed, 15 insertions(+)

diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 57e9a36..8a9f2c7 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -1584,6 +1584,16 @@ void MainTab::removeAllPhotos()
}
 }
 
+void MainTab::addPhotosFromFile()
+{
+   MainWindow::instance()->dive_list()->loadImages();
+}
+
+void MainTab::addPhotosFromURL()
+{
+   MainWindow::instance()->dive_list()->loadWebImages();
+}
+
 #define SHOW_SELECTIVE(_component) \
if (what._component)   \
ui._component->setText(displayed_dive._component);
@@ -1627,6 +1637,9 @@ void MainTab::showAndTriggerEditSelective(struct 
dive_components what)
 void MainTab::contextMenuEvent(QContextMenuEvent *event)
 {
QMenu popup(this);
+   popup.addAction(tr("Load image(s) from file(s)"), this, 
SLOT(addPhotosFromFile()));
+   popup.addAction(tr("Load image(s) from web"), this, 
SLOT(addPhotosFromURL()));
+   popup.addSeparator();
popup.addAction(tr("Delete selected images"), this, 
SLOT(removeSelectedPhotos()));
popup.addAction(tr("Delete all images"), this, SLOT(removeAllPhotos()));
QAction *actionTaken = popup.exec(event->globalPos());
diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h
index c3f6649..d4f7aaa 100644
--- a/qt-ui/maintab.h
+++ b/qt-ui/maintab.h
@@ -98,6 +98,8 @@ slots:
void photoDoubleClicked(const QString filePath);
void removeSelectedPhotos();
void removeAllPhotos();
+   void addPhotosFromFile();
+   void addPhotosFromURL();
void showLocation();
void enableGeoLookupEdition();
void disableGeoLookupEdition();
-- 
2.3.8 (Apple Git-58)

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


Re: For consideration for 4.5.1 or 4.6

2015-10-20 Thread Guido Lerch
2015-10-20 23:55 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:

> For 4.5.1 I'm not sure... it does change user visible behavior, would
> require new strings, user manual updates... I'd say no.
> But once I cut 4.5.1 I will take this for 4.6
>
I wish you could consider this for 4.5.1.
Yes it does add strings, depending on how our translation works only 2,
worst case 4.


>
> /D
>
> On Tue, Oct 20, 2015 at 10:08:29PM +0200, Guido Lerch wrote:
> > adding context menu to images for multi selection deletion and deleting
> all
> > images.
> >
> > ideally we add a menu for adding dives as well but I have not done this
> > yet, waiting for
> > you input.
> >
> > purpose of this: usability
> >
> > is someone working on getting images and eventually multi format files in
> > to git yet ?
> >
> > --
> > Best regards,
> > Guido
>
> > From 65241f94f08ebcd5165d488067b32ba64c0620dc Mon Sep 17 00:00:00 2001
> > From: Guido Lerch <guido.le...@gmail.com>
> > Date: Tue, 20 Oct 2015 21:02:41 +0200
> > Subject: [PATCH 1/6] Adding context menu to Images
> >
> > Allowing to delete selected or all photos from the
> > dive images
> >
> > Signed-off-by: Guido Lerch <guido.le...@gmail.com>
> > ---
> >  qt-ui/maintab.cpp | 9 +
> >  qt-ui/maintab.h   | 1 +
> >  2 files changed, 10 insertions(+)
> >
> > diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
> > index 0afb7b4..a1f0438 100644
> > --- a/qt-ui/maintab.cpp
> > +++ b/qt-ui/maintab.cpp
> > @@ -1610,3 +1610,12 @@ void MainTab::showAndTriggerEditSelective(struct
> dive_components what)
> >   weightModel->changed = true;
> >   }
> >  }
> > +
> > +void MainTab::contextMenuEvent(QContextMenuEvent *event)
> > +{
> > + QMenu popup(this);
> > + popup.addAction(tr("Delete selected images"), this,
> SLOT(removeSelectedPhotos()));
> > + popup.addAction(tr("Delete all images"), this,
> SLOT(removeAllPhotos()));
> > + QAction *actionTaken = popup.exec(event->globalPos());
> > + event->accept();
> > +}
> > diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h
> > index 20b4da6..7b2bb86 100644
> > --- a/qt-ui/maintab.h
> > +++ b/qt-ui/maintab.h
> > @@ -54,6 +54,7 @@ public:
> >       void refreshDisplayedDiveSite();
> >   void nextInputField(QKeyEvent *event);
> >   void showAndTriggerEditSelective(struct dive_components what);
> > + void contextMenuEvent(QContextMenuEvent *event);
> >
> >  signals:
> >   void addDiveFinished();
> > --
> > 2.3.8 (Apple Git-58)
> >
>
> > From bf989a642f9bb50cf6cf6f266fb0f8407f3916c9 Mon Sep 17 00:00:00 2001
> > From: Guido Lerch <guido.le...@gmail.com>
> > Date: Tue, 20 Oct 2015 21:03:53 +0200
> > Subject: [PATCH 2/6] Context menu support for images
> >
> > Altering DivePicture model to allow deleting images
> > from the QListView without immediate updating of the
> > list. Updating is determined by an additioanl parameter
> >
> > Signed-off-by: Guido Lerch <guido.le...@gmail.com>
> > ---
> >  qt-models/divepicturemodel.cpp | 10 ++
> >  qt-models/divepicturemodel.h   |  2 +-
> >  2 files changed, 7 insertions(+), 5 deletions(-)
> >
> > diff --git a/qt-models/divepicturemodel.cpp
> b/qt-models/divepicturemodel.cpp
> > index 1f37423..bb5db33 100644
> > --- a/qt-models/divepicturemodel.cpp
> > +++ b/qt-models/divepicturemodel.cpp
> > @@ -111,12 +111,14 @@ QVariant DivePictureModel::data(const QModelIndex
> , int role) const
> >   return ret;
> >  }
> >
> > -void DivePictureModel::removePicture(const QString )
> > +void DivePictureModel::removePicture(const QString , bool last)
> >  {
> >   dive_remove_picture(fileUrl.toUtf8().data());
> > - copy_dive(current_dive, _dive);
> > - updateDivePictures();
> > - mark_divelist_changed(true);
> > + if (last) {
> > + copy_dive(current_dive, _dive);
> > + updateDivePictures();
> > + mark_divelist_changed(true);
> > + }
> >  }
> >
> >  int DivePictureModel::rowCount(const QModelIndex ) const
> > diff --git a/qt-models/divepicturemodel.h b/qt-models/divepicturemodel.h
> > index d6393e4..7390fc5 100644
> > --- a/qt-models/divepicturemodel.h
> > +++ b/qt-models/divepicturemodel.h
> > @@ -33,7 +33,7 @@ public:
> >   virtual int rowCount(const QModelIndex  = QModelIndex())

Re: Error when executing on Ubuntu

2015-10-14 Thread Guido Lerch
I can do some tests over the weekend if others are not faster.

Regards,
Guido
+41 79 3217739

> Am 14.10.2015 um 08:30 schrieb Miika Turkia :
> 
>> On Wed, Oct 14, 2015 at 8:33 AM, Willem Ferguson 
>>  wrote:
>> I still get a single error message when running Subsurface in Ubuntu 15.04. 
>> It seems this relates to some of the changes discussed during the last week. 
>> Is this due to the code or due to my specific setup? Thank you for solving 
>> the long list of errors and warnings generated until now!
>> 
>> willem:~/src/subsurface/build$ ./subsurface 
>> QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No such 
>> file or directory willem:~/src/subsurface/build$
>> 
> 
> I do not see the same error you are getting but am getting the following 
> errors on my Ubuntu 14.04.3 LTS:
> ---8<---
> (subsurface:5895): GdkPixbuf-WARNING **: Cannot open pixbuf loader module 
> file '/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such 
> file or directory
> 
> This likely means that your installation is broken.
> Try running the command
>   gdk-pixbuf-query-loaders > 
> /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
> to make things work again for the time being.
> QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No such 
> file or directory
> QFSFileEngine::open: No file name specified
> QFSFileEngine::open: No file name specified
> Segmentation fault
> ---8<---
>  
> was there another comment about segm fault on exit? But then again, I cannot 
> reproduce the segmfault in gdb or even without.
> 
> miika
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Managed Images

2015-10-13 Thread Guido Lerch
Big fix and adding the removal of a picture if the user removes it from the
dive
if managed location is enabled.

-- 
Best regards,
Guido
From 62aa6f0a3f8333d0b4f6969fbecace1e50b23869 Mon Sep 17 00:00:00 2001
From: Guido Lerch <guido.le...@gmail.com>
Date: Tue, 13 Oct 2015 11:39:02 +0200
Subject: [PATCH 6/6] Image Management bug fix and image removal

Fixed an error with a declaration in qthelper.h

Added removal of a picture file from the managed location
if the user removes a picture.

Signed-off-by: Guido Lerch <guido.le...@gmail.com>
---
 dive.c   | 3 +++
 qthelper.cpp | 7 +++
 qthelper.h   | 1 -
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/dive.c b/dive.c
index 69b54c1..b77ac96 100644
--- a/dive.c
+++ b/dive.c
@@ -3370,6 +3370,9 @@ void dive_remove_picture(char *filename)
struct picture *temp = (*picture)->next;
picture_free(*picture);
*picture = temp;
+   // if we have managed images, let's physically remove the file
+   if (prefs.manage_images)
+   delete_file(filename);
}
 }
 
diff --git a/qthelper.cpp b/qthelper.cpp
index 3480e8c..8feb09b 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -1603,3 +1603,10 @@ extern "C" bool dir_exists(char *dir)
QDir d(dir);
return d.exists();
 }
+
+extern "C" void delete_file(char *filename)
+{
+   QFile f(filename);
+   if (f.exists())
+   f.remove();
+}
diff --git a/qthelper.h b/qthelper.h
index 05c6973..f5457b1 100644
--- a/qthelper.h
+++ b/qthelper.h
@@ -130,6 +130,5 @@ bool parseGpsText(const QString _text, double 
*latitude, double *longitude);
 QByteArray getCurrentAppState();
 void setCurrentAppState(QByteArray state);
 extern "C" bool in_planner();
-extern "C" bool dir_exists(char *dir);
 
 #endif // QTHELPER_H
-- 
2.3.8 (Apple Git-58)

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


Re: Is anyone working on an iOS app?

2015-10-13 Thread Guido Lerch
Thanks Anton

2015-10-13 10:34 GMT+02:00 Anton Lundin <gla...@acc.umu.se>:

> On 12 October, 2015 - Lubomir I. Ivanov wrote:
>
> > On 12 October 2015 at 22:20, Guido Lerch <guido.le...@gmail.com> wrote:
> > >
> > > Forgot ...
> > > Which of the Android components for QT do I need to install ?
> > >
> > >
> >
> > i think it installs different compiler toolchains depending on the
> > picks you make there.
> > what devices are you going to test this on?
> > http://forum.xda-developers.com/showthread.php?t=1596800
> >
> > it could be around 100-200MB per toolchain looking at my Android NDK
> folders.
> >
>
> Which Qt binaries to install depends on your devices / emulators you
> would like to play with.
>
> The hardware accelerated Android emulators are really nice for quick
> turnaround testing, and they are x86.
>
> Almost every modern Android device are armv7, so if you're planning on
> testing the app on a real device you need that to.
>
> Armv5 was used in some really old Android devices, and I haven't seen
> one in years, so you could safely skip that one. I didn't even bother to
> implement support for building subsurface for armv5 in the android build
> script.
>
>
> //Anton
>
>
> --
> Anton Lundin+46702-161604
>



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


Re: Image management, bug fix

2015-10-13 Thread Guido Lerch
Hi Dirk

Regards,
Guido
+41 79 3217739

> Am 13.10.2015 um 17:50 schrieb Dirk Hohndel <d...@hohndel.org>:
> 
> 
>> On Oct 13, 2015, at 8:48 AM, Guido Lerch <guido.le...@gmail.com> wrote:
>> 
>> Hi Robert
>> Before I comment point by point let me mention that is is exploratory and 
>> that I do not have all the answers yet.
>> Yes I am a photographer and my intent is to have the images available 
>> regardless off the computer I am at.
>> Hence a Dropbox location would do the job. My expectation is that people are 
>> not wildly let ssrf manage tons of images unless they provide the space.
>> Long term I have some really cool features in mind.
> 
> So I haven't paid enough attention to this, but lets state very clearly:
> 
> primary target for this should be the Subsurface cloud storage (i.e., git). 
> This is what people will use from their mobile devices, so this is where we 
> should achieve transparent and perfect image handling.
I am playing with this locally for the time being to learn more about the code 
etc.
When you say the final goal is cloud storage then you also mean the images ?
Just to be 100% clear.
> 
> /D
> 
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Is anyone working on an iOS app?

2015-10-12 Thread Guido Lerch
Hi Anton

2015-10-12 11:24 GMT+02:00 Anton Lundin <gla...@acc.umu.se>:

> On 10 October, 2015 - Dirk Hohndel wrote:
>
> >
> > > On Oct 10, 2015, at 2:27 AM, Guido Lerch <guido.le...@gmail.com>
> wrote:
> > >
> > > If you guys agree I submit this as my app, not use any ssrf code and
> just read from the cloud storage.
> > >
> > > V1 would only be dive details, no profile, hence this is reading some
> stuff and displaying.
> >
> > So I have talked to quite a few people about this and while the FSF
> seems to have
> > come out that the iTunes store is incompatible with the GPL, there are
> quite a few
> > apps in there that are GPL based and I found a couple that explained
> their rationale
> > why they thought this was acceptable.
> >
> > My plan had been to get the Android app to a reasonable state and then
> bring
> > the discussion to the mailing list. I'm inclined to say that if "the
> vast majority of
> > the contributors" agree that they can live with the FSF's objections
> (because
> > frankly, I find them rather silly), then we should add the necessary
> glue layer
> > to port Subsurface-mobile to IOS. The nice thing about the way we are
> building
> > Subsurface-mobile (with a QML UI) is that in theory this should be
> fairly simple.
> >
> > The big challenges would be the BT / FTDI download and features like
> that,
> > but the core of the app should port quite easily.
> >
>
> A quick browse on http://doc.qt.io/qt-5/qtbluetooth-index.html , it says
> that iOS is supported, so the BT code "should" work.
>
> The ftdi code is probably a no-go, but we could probably live with that.
>
> > So if you would like to investigate that, I would suggest that route
> instead
> > of starting from scratch.
> >
>
> I think building a separate iOS app in parity with what we plan to
> support on android is a insurmountable task.
>

Agreed, how can we get started with some testing. Makes sense to get the
Android app
to a good state before starting with iOS, however, waiting a couple of
weeks/ month and
then finding that it doesn't work would be a pity.
I discussed this with some divers, nobody is really expecting a full
Subsurface all on iOS, they
want to view their main dive parameters, add locations with GPS and
eventually get a signature
into their cloud storage.
Since I don't have an Android phone anymore and non of my colleagues has I
don't know what
the Android App does.

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



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


Re: Is anyone working on an iOS app?

2015-10-12 Thread Guido Lerch
Hi Miika

Regards,
Guido
+41 79 3217739

> Am 12.10.2015 um 12:25 schrieb Miika Turkia <miika.tur...@gmail.com>:
> 
>> On Mon, Oct 12, 2015 at 1:14 PM, Guido Lerch <guido.le...@gmail.com> wrote:
>> Hi Davide
>> 
>> Regards,
>> Guido
>> +41 79 3217739
>> 
>>>> Am 12.10.2015 um 12:06 schrieb Davide DB <dbdav...@gmail.com>:
>>>> 
>>>> On Mon, Oct 12, 2015 at 11:45 AM, Guido Lerch <guido.le...@gmail.com> 
>>>> wrote:
>>>> Since I don't have an Android phone anymore and non of my colleagues has I
>>>> don't know what
>>>> the Android App does.
>>> 
>>> There is a basic companion app for IOS.
>>> AFAIR it was developed for a GSOC but then never maintained.
>>> I use the Android one (and I could not live without it) but one of my
>>> buddies (who switched to IOS) use the IOS version and it works [cit.]
>>> I don't know where you can download nor the features implemented.
>> 
>> I downloaded it from the App Store.
>> All it does for me is to allow to add a dive, with the gps coordinates.
>> It does not allow adding meta data or anything else and it does not display 
>> my dives in the cloud.
>> Seems I have to scan through the sources to see what it's supposed to do.
>> The reason I haven't done this already is that I understood from Dirk that 
>> what I saw is all its supposed to do but maybe I got that wrong.
> 
> It is supposed to log the GPS coordinates during the dives. If you add
> dive manually, you are able to give it a name, otherwise it will
> default to "New Dive  " where  is a running number. It is
> quite limited in that sense, but it does log the GPS coordinates
> properly.
> 
> To use the companion app, you just log the GPS coordinates with it,
> sync them to cloud and then sync the desktop app from cloud, so you
> will have the coordinates from there and can do all the rest.
Does that mean that the dives I imported from my computer will never make it 
into the iOS app? It sounds like as the workflow is
Log in iOS with gps
Sync with ssrf
Add meta data
Sync back
Does not make sense to me at all and is not user friendly.

Apparently I don't understand this.. Hence will try to find the documentation 
and don't bother you guys any longer.
> 
> miika
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Swiss Translations

2015-10-12 Thread Guido Lerch
Hi Dirk,
I translated over 150 string for Swiss, last master does not contain those.
Any reason why?
I still have about 140 more to do though.

Regards,
Guido
+41 79 3217739
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Is anyone working on an iOS app?

2015-10-12 Thread Guido Lerch
Hi Davide

Regards,
Guido
+41 79 3217739

> Am 12.10.2015 um 12:06 schrieb Davide DB <dbdav...@gmail.com>:
> 
>> On Mon, Oct 12, 2015 at 11:45 AM, Guido Lerch <guido.le...@gmail.com> wrote:
>> Since I don't have an Android phone anymore and non of my colleagues has I
>> don't know what
>> the Android App does.
> 
> There is a basic companion app for IOS.
> AFAIR it was developed for a GSOC but then never maintained.
> I use the Android one (and I could not live without it) but one of my
> buddies (who switched to IOS) use the IOS version and it works [cit.]
> I don't know where you can download nor the features implemented.

I downloaded it from the App Store.
All it does for me is to allow to add a dive, with the gps coordinates.
It does not allow adding meta data or anything else and it does not display my 
dives in the cloud.
Seems I have to scan through the sources to see what it's supposed to do.
The reason I haven't done this already is that I understood from Dirk that what 
I saw is all its supposed to do but maybe I got that wrong.
> 
> 
> -- 
> Davide
> https://vimeo.com/bocio/videos
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Patch : fixing profile scale if zoom is selected "S"

2015-10-12 Thread Guido Lerch
I am sending this in as I believe we should consequently using the fully
available scale if the users selects "S", I have not changed the other
scales.
This patch makes changes to the x and y scale calculations if "S" is
selected.

-- 
Best regards,
Guido
From 5d2780c2fa3c8dbe51ec71c34d4c7fc2396133b7 Mon Sep 17 00:00:00 2001
From: glerch 
Date: Mon, 12 Oct 2015 11:32:57 +0200
Subject: [PATCH] Fixing profile scale if zoom selected

Despire some discussions I am sending this in as I believe we
should consequently use the full scale if the user selectes this
using the "S" button.

Signed-off-by: glerch 
---
 profile.c | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/profile.c b/profile.c
index cad7687..81bde79 100644
--- a/profile.c
+++ b/profile.c
@@ -71,10 +71,10 @@ int get_maxtime(struct plot_info *pi)
 * calculate the space dynamically.
 * This is seamless since 600/4 = 150.
 */
-   if (seconds < 600)
-   return ROUND_UP(seconds + seconds / 4, 60);
-   else
-   return ROUND_UP(seconds + 150, 60);
+   /* we should consequently allow the full available scale if
+* zoomed_plot is selected
+*/
+   return ROUND_UP(seconds, 60);
} else {
/* min 30 minutes, rounded up to 5 minutes, with at least 2.5 
minutes to spare */
return MAX(30 * 60, ROUND_UP(seconds + 150, 60 * 5));
@@ -91,7 +91,10 @@ int get_maxdepth(struct plot_info *pi)
 
if (prefs.zoomed_plot) {
/* Rounded up to 10m, with at least 3m to spare */
-   md = ROUND_UP(mm + 3000, 1);
+   /* we should consequently allow the full available scale if
+* zoomed_plot is selected
+*/
+   md = ROUND_UP(mm , 1);
} else {
/* Minimum 30m, rounded up to 10m, with at least 3m to spare */
md = MAX((unsigned)3, ROUND_UP(mm + 3000, 1));
-- 
1.9.5 (Apple Git-50.3)

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


Re: Swiss Translations

2015-10-12 Thread Guido Lerch
Hi Martin

2015-10-12 14:03 GMT+02:00 Martin Gysel <m...@bearsh.org>:

> Hi Guido
>
> Am 12.10.2015 um 11:00 schrieb Guido Lerch:
> > Hi Dirk,
> > I translated over 150 string for Swiss, last master does not contain
> those.
> > Any reason why?
> > I still have about 140 more to do though.
>
> I first started the swiss translations but at the moment lack some time
> do do any subsurface related work. My intension was to have the Swiss
> translation close to the German one but without 'ß' and without some
> words which sound very strange for me as a Swiss like
> 'Tauchgruppenleiter' (where I mostly used the English version which is,
> according to my experience well used by Swiss divers). To ease
> maintenance I always downloaded the latest Swiss and German version and
> merged them in a merge tool like kdiff3. Where needed I could easily
> modify the translation.
> I still hope I have some 30min spare to help you before the big release :)
>
That would be nice, I am new and don't know all the tools yet, hence I
switched my SSRF to German
and then changed the Swiss translations.
Apparently there is a faster way which I am not aware of.
Can't we not just copy the german transl. over the Swiss one and the use
the search to find
the the scharf s etc. ?

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



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


Re: Swiss Translations

2015-10-12 Thread Guido Lerch


Best regards,
Guido Lerch
m: +41 79 3217739

>>  
>>  That would be nice, I am new and don't know all the tools yet, hence I
>>  switched my SSRF to German
>>  and then changed the Swiss translations.
>>  Apparently there is a faster way which I am not aware of.
>>  Can't we not just copy the german transl. over the Swiss one and the use
>>  the search to find
>>  the the scharf s etc. ?
> 
> sure that would be possible but as said, in the German version there are
> a lot of expressions (ot only the 'ß') which sound very strange for me
> as a Swiss. This expressions were the main reason for me to start the
> translation, I can live with a couple of 'ß' but I really would like to
> call the diveguide 'Diveguide' and not 'Tauchgruppenleiter'
Uhh, ohh, that¹s a bummer. I also found some strange translations in the
German part
but to be realistic. Everyone here tries to add value and some English to
German translations
are tough.
I am travelling We. through Fr. so won¹t have a lot of time for SSRF but if
we could ³meet² next
week to continue the translation that would be great.
> 
> /martin
> 
> 


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


Re: Is anyone working on an iOS app?

2015-10-12 Thread Guido Lerch
Hi Dirk

I didn't want to hurt anyone's feelings.
I just asked and volunteered to spend time on this.
More below

Regards,
Guido
+41 79 3217739

> Am 12.10.2015 um 19:05 schrieb Dirk Hohndel :
> 
> On Mon, Oct 12, 2015 at 01:56:49PM +0300, Miika Turkia wrote:
>>> Does that mean that the dives I imported from my computer will never make 
>>> it into the iOS app? It sounds like as the workflow is
>>> Log in iOS with gps
>>> Sync with ssrf
>>> Add meta data
>> 
>> This is what we currently have. The iOS app only logs the GPS data and
>> that is it.
>> 
>>> Sync back
>> 
>> This is currently not possible and it was never intended to occur with
>> the existing iOS app.
>> 
>>> Does not make sense to me at all and is not user friendly.
>> 
>> Well, it depends. The current app is designed to only collect the GPS
>> information and nothing more. For that it is easy enough to use, but
>> it seems that most of the people are actually expecting more from it
>> and thus the concept is hard to grasp.
> 
> Yes - I learned that this amazingly useful app that I use on every single
> dive trip appears to make no sense to a lot of people who simply have
> convinced themselves that the app SHOULD be doing something else and then
> when I try to explain the really cool thing that it does they don't even
> listen and all they think is "but it doesn't do the thing that I WANT -
> that's STUPID"... :-)
I used it myself and it is useful but also misleading for someone that doesn't 
have all the details yet.
> 
>>> Apparently I don't understand this.. Hence will try to find the 
>>> documentation and don't bother you guys any longer.
>> 
>> Basically you should forget about the current iOS app for what you are
>> thinking. Current one only logs GPS data, it is not the app you are
>> thinking of :D
> 
> Yes. Forget the COMPANION apps. We have a companion app for Android, we
> have one for IOS. Neither are the ones that you are looking for.
> 
>> We already have a prototype for Android of a mobile app that is able
>> to sync the dives and display them on a phone/tablet. And this is what
>> we are now discussing for iOS as well. If you want to take a look at
>> the Android app, there are emulators on Android SDK where you can run
>> the app.
> 
> And that is the app we should use for IOS as well.
> 
> The way this works is (roughly) like this:
> 
> We run a big subset of the full Subsurface application on the mobile
> device including a QML based mobile UI. Qt/QML are supported both on
> Android and IOS.
> 
> There's a little "glue" layer that integrates that native app into the
> mobile OS. And THAT is the first step of what you should do and it makes
> perfect sense to do that right now. Figure out how to create an IOS
> wrapper for a native Qt/QML app. Send patches to add this to master.
> 
> For Android we have a build script that allows you to build all the
> dependencies using the android tool chain. My guess is we need this as
> well as the "wrapper" or "glue" around Subsurface to make it launch on
> IOS.
> 
> I'd start reading here: http://doc.qt.io/qt-5/ios-support.html
> 
> Did this make more sense and explain the direction I think this should be
> going in? If not, keep asking... I'd hate for you to waste time staring at
> the companion app and trying to figure out how to extend that to be what
> you want it to be and I'd hate for you to waste time developing a new UI
> when we already are working on a mobile UI in a framework that should
> allow us to reuse the vast majority of that work on IOS as well.
All makes sense. I would not have used the companion app btw, I would have 
started something from scratch.
Now as I got all this useful replies I am glad I had asked and not started 
already.

Using the android ground and the glue layer, would that not conflict with GPL?
> 
> Thanks
> 
> /D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Swiss Translations

2015-10-12 Thread Guido Lerch


Regards,
Guido
+41 79 3217739

> Am 12.10.2015 um 19:03 schrieb Joakim Bygdell :
> 
> 
>> On 12 Oct 2015, at 18:51, Dirk Hohndel  wrote:
>> 
>> One thing that I could do is fill all the missing strings with the strings
>> from German (without overwriting the existing Swiss German strings).
>> This creates a fairly complete translation, but the downside is that you
>> can no longer look for "unfinished" translations to easily figure out what
>> to work on, instead you have to go through the string to find the ones you
>> don't like and replace them with better translations for the Swiss
>> audience.
>> 
>> Would that be useful? Or would that make it harder?
> 
> Why don’t you make use of Transifex review functionality.
> Mark everything translated already as "reviewed", import the german 
> translations as “translated” and the rest will be untranslated.
> That way you have a clear distinction of which strings are in need of review 
> from a Swiss point of view and which needs to be translated from English.

Both would be very useful.
I am planning to go over the German translation as well as some translations 
sound a little clumsy.
This includes mine as sometimes the best translation comes to mind when you 
actually see it in the UI, so no criticism to any German translator.
> 
>> 
>> /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
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Is anyone working on an iOS app?

2015-10-12 Thread Guido Lerch
>> 
> 
> Which is a TON of work. This should be WAY easier and, as added benefit,
> should give us two consistent mobile apps that will benefit from any work
> done on the UI for one as it should cleanly translate to the other. That's
> the whole idea behind doing a QML UI instead of a native UI for Android
> (or IOS)
And I would have started it but what you guys suggest here makes way more sense.
> 
>> Now as I got all this useful replies I am glad I had asked and not started 
>> already.
> 
> Asking on the mailing list is always a good idea. Really. We rarely bite.
I hope :-)
> 
>> Using the android ground and the glue layer, would that not conflict with 
>> GPL?
> 
> Complicated question. And a question that doesn't have a universally
> agreed upon answer.
> 
> The quick summary is that I believe that you are not in violation because
> you continue to make the sources available and since all the tools needed
> for someone to make changes and build their own app will also be made
> available.
> 
> There are people who state with very strong arguments that the way apps
> are distributed in the iTunes store is in violation of the GPL because the
> store language says that people aren't allowed to modify the the app.
> 
> I believe that the fact that we will not just publish the app in the store
> but ALSO make it easy for people to modify and rebuild the app starting
> from our source distribution solves that problem with the terms of the
> store.
> 
> And since at this point I believe I am the majority copyright holder and
> since in previous conversations the other people with significant stake in
> Subsurface (as GPL software) have all shown little or no concern about
> this issue... I am quite comfortable that this is the direction we should
> go in.
> 
> Basically the only people who really could complain and say "Hey, this
> violates the GPL" is us, the developers. :-)
I dive into that.
> 
> /D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Adding image management

2015-10-12 Thread Guido Lerch
Sorry but I felt I need to do this after I added images to my dives - I
love this feature!!!
This patch set is not complete and needs more testing but I wanted to
throw this out for feedback. I keep on testing as I did not test this fully.

What it should do is to allow the user to point to a location where
pictures are being
copied to automatically if the users wishes to do this.
For example, while testing I created a path on my drop box, so when I add
pictures
to my dives they are automatically (when selected in the preferences)
copied to my dropbox
location.
Now I can open my could storage from any of my computers and see my
pictures :-) if the
computer(s) sync with DropBox.

Most likely there are bugs which I will remove if you guys find this
useful, if not, it was
a good lesson for me to learn more about the code.

Sorry Dirk, no idea how I could have made the first patch smaller.

This is NOT DONE YET, I basically want to know if I should continue. Lot's
of checking is
still needed.

-- 
Best regards,
Guido
From 6c064ab0e04e046d2407a62630fcc9e3c0bd7a24 Mon Sep 17 00:00:00 2001
From: Guido Lerch <guido.le...@gmail.com>
Date: Tue, 13 Oct 2015 00:20:05 +0200
Subject: [PATCH 1/2] Adding image management to preferences

Adding a feature where images can be managed by the application.
The user has to give a default path to the images, ideally something
accessible from several computers such as Box, DropBox or a NAS.

Signed-off-by: Guido Lerch <guido.le...@gmail.com>
---
 pref.h|   2 +
 qt-ui/preferences.cpp |  21 +
 qt-ui/preferences.h   |   4 +
 qt-ui/preferences.ui  | 235 ++
 qthelper.cpp  |   5 ++
 5 files changed, 249 insertions(+), 18 deletions(-)

diff --git a/pref.h b/pref.h
index 84975aa..2705a45 100644
--- a/pref.h
+++ b/pref.h
@@ -118,6 +118,8 @@ struct preferences {
geocoding_prefs_t geocoding;
enum deco_mode deco_mode;
short conservatism_level;
+   bool manage_images;
+   char *image_location;
 };
 enum unit_system_values {
METRIC,
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp
index 6450c41..c47f364 100644
--- a/qt-ui/preferences.cpp
+++ b/qt-ui/preferences.cpp
@@ -250,6 +250,10 @@ void PreferencesDialog::setUiFromPrefs()
ui.first_item->setCurrentIndex(prefs.geocoding.category[0]);
ui.second_item->setCurrentIndex(prefs.geocoding.category[1]);
ui.third_item->setCurrentIndex(prefs.geocoding.category[2]);
+
+   // Images
+   ui.manage_images->setChecked(prefs.manage_images);
+   ui.image_location->setText(prefs.image_location);
 }
 
 void PreferencesDialog::restorePrefs()
@@ -430,6 +434,12 @@ void PreferencesDialog::syncSettings()
s.setValue("cat2", ui.third_item->currentIndex());
s.endGroup();
 
+   s.beginGroup("images");
+   s.setValue("manage", ui.manage_images->isChecked());
+   s.setValue("location", ui.image_location->text());
+
+   s.endGroup();
+
loadSettings();
emit settingsChanged();
 }
@@ -557,3 +567,14 @@ void PreferencesDialog::on_cloudDefaultFile_toggled(bool 
toggle)
 {
prefs.default_file_behavior = CLOUD_DEFAULT_FILE;
 }
+
+void PreferencesDialog::on_chooseImageLocation_clicked()
+{
+   QString oldDirectory = ui.image_location->text();
+   QString choosenDirectory = QFileDialog::getExistingDirectory(this, 
tr("Open Image location"), oldDirectory, QFileDialog::ShowDirsOnly | 
QFileDialog::DontResolveSymlinks);
+   if (!choosenDirectory.isEmpty())
+   ui.image_location->setText(choosenDirectory + "/");
+   QDir di(ui.image_location->text());
+   if (!di.exists())
+   di.mkpath(ui.image_location->text());
+}
diff --git a/qt-ui/preferences.h b/qt-ui/preferences.h
index 326b1f9..d1b45a5 100644
--- a/qt-ui/preferences.h
+++ b/qt-ui/preferences.h
@@ -41,6 +41,10 @@ slots:
void facebookDisconnect();
void cloudPinNeeded();
void passwordUpdateSuccessfull();
+private slots:
+
+   void on_chooseImageLocation_clicked();
+
 private:
explicit PreferencesDialog(QWidget *parent = 0, Qt::WindowFlags f = 0);
void setUiFromPrefs();
diff --git a/qt-ui/preferences.ui b/qt-ui/preferences.ui
index de2d79b..8ec9cfe 100644
--- a/qt-ui/preferences.ui
+++ b/qt-ui/preferences.ui
@@ -6,7 +6,7 @@

 0
 0
-711
+836
 662

   
@@ -19,7 +19,16 @@

   
   
-   
+   
+5
+   
+   
+5
+   
+   
+5
+   
+   
 5


@@ -164,7 +173,7 @@
 


-4
+0


 
@@ -177,7 +186,16 @@
  
   5
  
- 
+ 
+  5
+ 
+ 
+  5
+ 
+ 
+  5
+ 
+ 
   5
  
  
@@ -186,7 +2

Image management checks

2015-10-12 Thread Guido Lerch
Adding some check's

-- 
Best regards,
Guido
From 3ee7ed771af499328c2414cabf342caa20345a5b Mon Sep 17 00:00:00 2001
From: Guido Lerch <guido.le...@gmail.com>
Date: Tue, 13 Oct 2015 00:59:05 +0200
Subject: [PATCH 3/4] Adding image management checks

Some checks and balances, making sure we have a location in the preferences.

Signed-off-by: Guido Lerch <guido.le...@gmail.com>
---
 dive.c|  2 +-
 qt-ui/preferences.cpp | 16 +++-
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/dive.c b/dive.c
index a9532ad..d9c8a5a 100644
--- a/dive.c
+++ b/dive.c
@@ -3298,7 +3298,7 @@ bool picture_check_valid(char *filename, int shift_time)
 void dive_create_picture(struct dive *dive, char *filename, int shift_time, 
bool match_all)
 {
char *new_filename;
-   if (prefs.manage_images) {
+   if (prefs.manage_images && strcmp(prefs.image_location,"")) {
copy_image_and_overwrite(filename, prefs.image_location, 
get_file_name(filename));
new_filename = 
strdup(strcat(prefs.image_location,get_file_name(filename)));
} else {
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp
index c47f364..6cc9bcb 100644
--- a/qt-ui/preferences.cpp
+++ b/qt-ui/preferences.cpp
@@ -254,6 +254,11 @@ void PreferencesDialog::setUiFromPrefs()
// Images
ui.manage_images->setChecked(prefs.manage_images);
ui.image_location->setText(prefs.image_location);
+   QString il(prefs.image_location);
+   if (!il.isEmpty())
+   ui.manage_images->setEnabled(true);
+   else
+   ui.manage_images->setEnabled(false);
 }
 
 void PreferencesDialog::restorePrefs()
@@ -437,7 +442,6 @@ void PreferencesDialog::syncSettings()
s.beginGroup("images");
s.setValue("manage", ui.manage_images->isChecked());
s.setValue("location", ui.image_location->text());
-
s.endGroup();
 
loadSettings();
@@ -572,9 +576,11 @@ void PreferencesDialog::on_chooseImageLocation_clicked()
 {
QString oldDirectory = ui.image_location->text();
QString choosenDirectory = QFileDialog::getExistingDirectory(this, 
tr("Open Image location"), oldDirectory, QFileDialog::ShowDirsOnly | 
QFileDialog::DontResolveSymlinks);
-   if (!choosenDirectory.isEmpty())
+   if (!choosenDirectory.isEmpty()) {
ui.image_location->setText(choosenDirectory + "/");
-   QDir di(ui.image_location->text());
-   if (!di.exists())
-   di.mkpath(ui.image_location->text());
+   QDir di(ui.image_location->text());
+   if (!di.exists())
+   di.mkpath(ui.image_location->text());
+   ui.manage_images->setEnabled(true);
+   }
 }
-- 
2.3.8 (Apple Git-58)

From 62cf4e9590991bbfec660f62e9df36edb57c989e Mon Sep 17 00:00:00 2001
From: Guido Lerch <guido.le...@gmail.com>
Date: Tue, 13 Oct 2015 01:13:28 +0200
Subject: [PATCH 4/4] Adding image management checks 2

More checking if the selected location is available and existing
before trying to copy the file.

Signed-off-by: Guido Lerch <guido.le...@gmail.com>
---
 dive.c   | 2 +-
 qthelper.cpp | 6 ++
 qthelper.h   | 1 +
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/dive.c b/dive.c
index d9c8a5a..4e6ef76 100644
--- a/dive.c
+++ b/dive.c
@@ -3298,7 +3298,7 @@ bool picture_check_valid(char *filename, int shift_time)
 void dive_create_picture(struct dive *dive, char *filename, int shift_time, 
bool match_all)
 {
char *new_filename;
-   if (prefs.manage_images && strcmp(prefs.image_location,"")) {
+   if (prefs.manage_images && strcmp(prefs.image_location,"") && 
dir_exists(prefs.image_location)) {
copy_image_and_overwrite(filename, prefs.image_location, 
get_file_name(filename));
new_filename = 
strdup(strcat(prefs.image_location,get_file_name(filename)));
} else {
diff --git a/qthelper.cpp b/qthelper.cpp
index da85ffe..3480e8c 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -1597,3 +1597,9 @@ extern "C" bool in_planner()
 {
return (currentApplicationState == "PlanDive" || 
currentApplicationState == "EditPlannedDive");
 }
+
+extern "C" bool dir_exists(char *dir)
+{
+   QDir d(dir);
+   return d.exists();
+}
diff --git a/qthelper.h b/qthelper.h
index f5457b1..05c6973 100644
--- a/qthelper.h
+++ b/qthelper.h
@@ -130,5 +130,6 @@ bool parseGpsText(const QString _text, double 
*latitude, double *longitude);
 QByteArray getCurrentAppState();
 void setCurrentAppState(QByteArray state);
 extern "C" bool in_planner();
+extern "C" bool dir_exists(char *dir);
 
 #endif // QTHELPER_H
-- 
2.3.8 (Apple Git-58)

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


Re: Segfault upon exit from coordinates specification

2015-10-11 Thread Guido Lerch
Hi Willem
I had similar issues, can you try the following?
Open your logbook with an xml editor, remove all duplicates.
Retry.

When doing a lot of testing and interrupting a debug, sometimes the duplication 
handling has issues when importing dives.

Regards,
Guido
+41 79 3217739

> Am 11.10.2015 um 14:19 schrieb Willem Ferguson 
> :
> 
> I do the following:
> Create new dive using log->Add dive
> I provide name for an existing dive site and hit Apply changes
> Edit coordinates in dive site info panel by hitting the globe button (these 
> happen to be existing coordinates)
> Type existing coordinates (this generates some warnings in the terminal)
> Hit Discard changes: do not accept the information
> Exit Subsurface.
> Subsurface gives segfault.
> Here is the terminal output:
> 
> Setting a New dive site
> Setting the dive site id on the dive: 304245814
> Warning, two different dive sites with same name have a different id 
> 2893376900 and 304245814
> Warning, two different dive sites with same name have a different id 
> 2893376900 and 304245814
> Warning, two different dive sites with same name have a different id 
> 2893376900 and 304245814
> Warning, two different dive sites with same name have a different id 
> 2893376900 and 304245814
> Warning, two different dive sites with same name have a different id 
> 2893376900 and 304245814
> Warning, two different dive sites with same name have a different id 
> 2893376900 and 304245814
> Warning, two different dive sites with same name have a different id 
> 2893376900 and 304245814
> Warning, two different dive sites with same name have a different id 
> 2893376900 and 304245814
> cannot open "/home/willem/subsurface/hashes"
> *** Error in `./subsurface': double free or corruption (fasttop): 
> 0x025be950 ***
> Aborted (core dumped)
> 
> Kind regards,
> willem
> 
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Patch 3 - replacing 1 and 2 - sorry

2015-10-10 Thread Guido Lerch
2015-10-09 19:25 GMT+02:00 Tomaz Canabrava <tcanabr...@kde.org>:

> looking.
>
> On Fri, Oct 9, 2015 at 2:19 PM, Dirk Hohndel <d...@hohndel.org> wrote:
>
>> On Fri, Oct 09, 2015 at 06:09:26PM +0200, Guido Lerch wrote:
>> > Finally I think on El Captain and Mavericks the main window size,
>> position
>> > and state
>> > is preserved.
>> >
>> > I have no Yosemite at this point in time, Robert, can you test ?
>> >
>> > Sorry for the first two quick shots ...
>>
>> So since you are changing generic code that runs on all platforms I'm a
>> bit worried this is not just "does it work on various flavors of Mac?"
>> but "does it work on all OSs, with all desktop environments?".
>>
>
I killed my Linux environment :-( and have to rebuild, so in the future I
will be able to
do some testing there too.
I am concerned as well, hence I asked for additional testing.
I am assuming I broke nothing as I found the changes in the last master
this morning.

>
>> Changing something as universal as this days before the release... hmmm.
>>
>> I'll need to carefully look at this and understand the exact implications.
>> Tomaz, can you take a look as well?
>>
>> /D
>> ___
>> subsurface mailing list
>> subsurface@subsurface-divelog.org
>> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>>
>
>


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


Re: Is anyone working on an iOS app?

2015-10-10 Thread Guido Lerch
If you guys agree I submit this as my app, not use any ssrf code and just read 
from the cloud storage.

V1 would only be dive details, no profile, hence this is reading some stuff and 
displaying.

Regards,
Guido
+41 79 3217739

> Am 10.10.2015 um 11:25 schrieb Robert C. Helling <hell...@atdotde.de>:
> 
> Guido,
> 
>> On 10 Oct 2015, at 10:51, Guido Lerch <guido.le...@gmail.com> wrote:
>> 
>> That would show the cloud storage stored dive details ?
>> If not I would start something - Dirk, any objections?
> 
> the main obstacle seems to be that the appstore legalise is incompatible with 
> GPL. So you should not use and GPL licensed code (e.g. the subsurface code) 
> and submit it to he Apple Appstore. Or you find a way around this.
> 
> And yes, I would love to have an iOS version of subsurface on my phone!
> 
> Best
> Robert
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Patch 3 - replacing 1 and 2 - sorry

2015-10-09 Thread Guido Lerch
Finally I think on El Captain and Mavericks the main window size, position
and state
is preserved.

I have no Yosemite at this point in time, Robert, can you test ?

Sorry for the first two quick shots ...

-- 
Best regards,
Guido
From 732f5ebbfd63bf23a2e4fb2a244491b414c1899f Mon Sep 17 00:00:00 2001
From: glerch 
Date: Fri, 9 Oct 2015 18:03:12 +0200
Subject: [PATCH] fixing main window size position and state

now size, position and state should be preserved correctly.
this replaces the last two patches I sent.

Signed-off-by: glerch 
---
 qt-ui/mainwindow.cpp | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 8759760..5d8adbc 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -1085,11 +1085,12 @@ void MainWindow::initialUiSetup()
 {
QSettings settings;
settings.beginGroup("MainWindow");
-   QSize sz = settings.value("size", 
qApp->desktop()->size()).value();
-   if (settings.value("maximized", isMaximized()).value())
+   if (settings.value("maximized", isMaximized()).value()) {
showMaximized();
-   else
-   resize(sz);
+   } else {
+   restoreGeometry(settings.value("geometry").toByteArray());
+   restoreState(settings.value("windowState", 0).toByteArray());
+   }
 
state = (CurrentState)settings.value("lastState", 0).toInt();
switch (state) {
@@ -1110,6 +,7 @@ void MainWindow::initialUiSetup()
break;
}
settings.endGroup();
+   show();
 }
 
 const char *getSetting(QSettings , QString name)
@@ -1203,10 +1205,10 @@ void MainWindow::writeSettings()
QSettings settings;
 
settings.beginGroup("MainWindow");
-   settings.setValue("lastState", (int)state);
+   settings.setValue("geometry", saveGeometry());
+   settings.setValue("windowState", saveState());
settings.setValue("maximized", isMaximized());
-   if (!isMaximized())
-   settings.setValue("size", size());
+   settings.setValue("lastState", (int)state);
if (state == VIEWALL)
saveSplitterSizes();
settings.endGroup();
-- 
1.9.5 (Apple Git-50.3)

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


Patch 2 fixing Window size and position

2015-10-09 Thread Guido Lerch
Addition to the last window size patch for El Captain.

Caviar/ not solved yet.

On Mavericks, when closing out of full screen the window will be maximized.
On El Captain window size, position, state are working as expected.

I am investigating the behaviour on Mavericks now

-- 
Best regards,
Guido
From df72c9ce756cd8548496cb25d23601ec6f367ac6 Mon Sep 17 00:00:00 2001
From: glerch 
Date: Fri, 9 Oct 2015 17:41:36 +0200
Subject: [PATCH] fixing main windows size and position

My last patch was incomplete and not fully tested on
Mavericks resulting that the window x,y, positions were
not restored. This patch has been tested on El Captain and
Mavericks.

This fix does not solve the windows state fullscreen being
preserved. If you store in full screen on Mavericks the
windows will open maximized.

Signed-off-by: glerch 
---
 qt-ui/mainwindow.cpp | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 8759760..9d9e8bf 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -1085,11 +1085,10 @@ void MainWindow::initialUiSetup()
 {
QSettings settings;
settings.beginGroup("MainWindow");
-   QSize sz = settings.value("size", 
qApp->desktop()->size()).value();
if (settings.value("maximized", isMaximized()).value())
showMaximized();
else
-   resize(sz);
+   restoreGeometry(settings.value("geometry").toByteArray());
 
state = (CurrentState)settings.value("lastState", 0).toInt();
switch (state) {
@@ -1110,6 +1109,7 @@ void MainWindow::initialUiSetup()
break;
}
settings.endGroup();
+   show();
 }
 
 const char *getSetting(QSettings , QString name)
@@ -1203,10 +1203,8 @@ void MainWindow::writeSettings()
QSettings settings;
 
settings.beginGroup("MainWindow");
-   settings.setValue("lastState", (int)state);
+   settings.setValue("geometry", saveGeometry());
settings.setValue("maximized", isMaximized());
-   if (!isMaximized())
-   settings.setValue("size", size());
if (state == VIEWALL)
saveSplitterSizes();
settings.endGroup();
-- 
1.9.5 (Apple Git-50.3)

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


Fixing window size on El Captain

2015-10-09 Thread Guido Lerch
-- 
Best regards,
Guido
From b2c032fd10b53119b06ce2b14597f17db6beff6f Mon Sep 17 00:00:00 2001
From: Guido Lerch <guido.le...@gmail.com>
Date: Fri, 9 Oct 2015 14:20:12 +0200
Subject: [PATCH] Fixing Windows size on El Captain

Bug-fix to properly restore the windows size, this was reported by
a few people that upgraded to El Captain. I am not sure whether
this fix is needed for Yosemite as well.

Signed-off-by: Guido Lerch <guido.le...@gmail.com>
---
 qt-ui/mainwindow.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 084c9f1..7a1785a 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -1110,6 +1110,7 @@ void MainWindow::initialUiSetup()
break;
}
settings.endGroup();
+   show();
 }
 
 const char *getSetting(QSettings , QString name)
-- 
2.3.8 (Apple Git-58)

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


Re: [d...@hohndel.org: updates towards 4.5]

2015-10-08 Thread Guido Lerch


From:  Dirk Hohndel <d...@hohndel.org>
Date:  Thursday 8 October 2015 09:28
To:  Guido Lerch <guido.le...@gmail.com>
Cc:  "Robert C. Helling" <hell...@atdotde.de>,
"subsurface@subsurface-divelog.org" <subsurface@subsurface-divelog.org>
Subject:  Re: [d...@hohndel.org: updates towards 4.5]

> On Thu, Oct 08, 2015 at 08:54:47AM +0200, Guido Lerch wrote:
>>  Btw. I am working on a build-mac.sh as I am having issues frequently, not
>>  sure whether I should submit
>>  that. Let me know what you think.
> 
> Today build.sh is designed to work both on Linux and Mac. Is there a
> reason that this can't continue to be the case? What Mac specific things
> aren't done in build.sh?

Nothing really, all I am trying to do is to learn and make things easier for
me (and maybe for others) Š
Checking if Xcode command line tools are properly installed ­ had tons of
issues this week because they weren¹t.
Adding QT specific directories to ccmake

> 
> /D
> 


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


Re: [d...@hohndel.org: updates towards 4.5]

2015-10-08 Thread Guido Lerch


From:  subsurface  on behalf of
"Robert C. Helling" 
Date:  Thursday 8 October 2015 06:52
To:  Dirk Hohndel 
Cc:  "subsurface@subsurface-divelog.org" 
Subject:  Re: [d...@hohndel.org: updates towards 4.5]

> Hi,
> 
> that’s how I spent last evening. Updating to El Capitan and then repairing the
> damage…
> 
>> On 08 Oct 2015, at 00:58, Dirk Hohndel  wrote:
>> 
>>> 
>>> 1# libdivecomputer
>>> atomics_cobalt.c and stunt_eonsteel.c can’t find libusb.h unless
>>> "libusb-1.0” is removed from the include statement.
>>> This is something I have seen before, but long ago so I can’t remember the
>>> cause or the fix.
>>> 
>>> 2# Subsurface
>>> -- Creating build files for Subsurface 4.4.98-46-g7bf398549b71
>>> CMake Error at 
>>> /Users/narogh/src/install-root/lib/cmake/Grantlee5/Grantlee5Config.cmake:16
>>> (find_package):
>>>  By not providing "FindQt5Gui.cmake" in CMAKE_MODULE_PATH this project has
>>>  asked CMake to find a package configuration file provided by "Qt5Gui", but
>>>  CMake did not find one.
>>> 
>>>  Could not find a package configuration file provided by "Qt5Gui" with any
>>>  of the following names:
>>> 
>>>Qt5GuiConfig.cmake
>>>qt5gui-config.cmake
>>> 
>>>  Add the installation prefix of "Qt5Gui" to CMAKE_PREFIX_PATH or set
>>>  "Qt5Gui_DIR" to a directory containing one of the above files.  If "Qt5Gui"
>>>  provides a separate development package or SDK, be sure it has been
>>>  installed.
>>> Call Stack (most recent call first):
>>>  CMakeLists.txt:159 (find_package)
>>> 
>>> 
>>> -- Configuring incomplete, errors occurred!
>>> 
>>> building via build script.
>>> 
>>> Qt5GuiConfig.cmake can be found in ~/Qt/5.5/clang_64/lib/cmake/Qt5Gui
>>> 
>>> 
>>> I’ll dig into this more tomorrow.
>> 
>> So I think Robert got this to work... since we have a few others on Mac,
>> maybe a post to the mailing list with a "what to do after you upgrade to
>> El Capitan" would be useful :-)
Had exactly the same issues, but not the one Robert explained below.
After running build.sh (it fails somewhere at the end complaining about QT),
I ran ccmake
and entered the path for Qt5Gui_dir and Core. Rerunning build.sh finalises
with two errors
that are harmless.
All works except that QT complains about shadow builds not possible but this
seems to be a QT
issue I have not found the root for.
Btw. I am working on a build-mac.sh as I am having issues frequently, not
sure whether I should submit
that. Let me know what you think.

> 
> I don’t know what in the end solved 2) but for me it works after
> 
> a) I make sure the „command line tools“ are updated as well and I ran Xcode
> once to „install additional components“ whatever that is.
> 
> b) I updated Qt to 5.5 (since problem 2) seems cmake related).
> 
> c) I deleted my source tree and got a new one (git clone subsurface and
> running the build script)
> 
> Finally, there was a problem that libxml/tree.h was not found (and that might
> be similar to your problem 1). That I could solve with
> 
> export CPATH=/usr/local/include/
> 
> (and from long ago I still have a symlink
> 
> ln -s /usr/local/include/libxml2/libxml /usr/local/include
> 
> And then it builds.
> 
> Best
> Robert
> ___ subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


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


Re: [d...@hohndel.org: updates towards 4.5]

2015-10-08 Thread Guido Lerch


Best regards,
Guido Lerch
m: +41 79 3217739

"Quality means building the customer’s point of view into every aspect of a
product from design to final recycling."

From:  Dirk Hohndel <d...@hohndel.org>
Date:  Thursday 8 October 2015 10:56
To:  Guido Lerch <guido.le...@gmail.com>
Cc:  "Robert C. Helling" <hell...@atdotde.de>,
"subsurface@subsurface-divelog.org" <subsurface@subsurface-divelog.org>
Subject:  Re: [d...@hohndel.org: updates towards 4.5]

> On Thu, Oct 08, 2015 at 09:32:55AM +0200, Guido Lerch wrote:
>>>  > On Thu, Oct 08, 2015 at 08:54:47AM +0200, Guido Lerch wrote:
>>>>  >>  Btw. I am working on a build-mac.sh as I am having issues frequently,
not
>>>>  >>  sure whether I should submit
>>>>  >>  that. Let me know what you think.
>>>  > 
>>>  > Today build.sh is designed to work both on Linux and Mac. Is there a
>>>  > reason that this can't continue to be the case? What Mac specific things
>>>  > aren't done in build.sh?
>>  
>>  Nothing really, all I am trying to do is to learn and make things easier for
>>  me (and maybe for others) �
> 
> And that's very welcome. I'm just suggesting that it would be even better
> to make sure that we continue to have one script. And it's easy enough
> (and free) to install VirtualBox and a Linux of your choice so you can
> make sure things still work.
> 
>>  Checking if Xcode command line tools are properly installed ­ had tons of
>>  issues this week because they weren¹t.
> 
> You're typing this on a Mac. I love it how on Macs with the wrong settings
> the "'" turns into a slanted "'" which then becomes a "¹" on other systems
> :-)

I wish I could work with my Ubuntu but for some reason SSRF would not
connect to the Uemis.
The Uemis “is seen” by Ubuntu but when trying to download a dive it gives an
error message
that the Uemis is not connected or not responding of this sort.
> 
> /D
> 


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


Re: Beta 3 on Mac 10.11 (El Capitan) always opens up in a small window

2015-10-08 Thread Guido Lerch


From:  subsurface  on behalf of
Tomaz Canabrava 
Date:  Thursday 8 October 2015 21:46
To:  Joakim Bygdell 
Cc:  "subsurface@subsurface-divelog.org" 
Subject:  Re: Beta 3 on Mac 10.11 (El Capitan) always opens up in a small
window

> 
> 
> On Thu, Oct 8, 2015 at 3:27 PM, Joakim Bygdell  wrote:
>> 
>>> > On 08 Oct 2015, at 20:15, JB2Cool  wrote:
>>> >
>>> > I don't know if it's since i updated from beta 2 to beta 3 or since i
>>> updated from Mac Yosemite to El Capitan (I did the beta 3 and El Capitan at
>>> similar times and didn't use Subsurface much in between) but now when i open
>>> Subsurface it opens up only half my page width. I can rezize the window and
>>> close the application but upon re-opening it's back to half width.
>>> >
>>> > Anyone else seeing this?
>> 
>> Jeep, since before beta3 and El Capitan.
>> Rather annoying that it doesn¹t remember its size.
> 
> Can you guys help track that down?
> I didn't updated to el captain ( I always wait for the first patch release )
Know the issue and will take a look tonight
> 
>  
>> 
>>> >
>>> > Jason
>>> > ___
>>> > 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
> 
> ___ subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


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


Re: Question - working on some German Translations

2015-10-07 Thread Guido Lerch
2015-10-06 22:20 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:

> On Tue, Oct 06, 2015 at 08:12:59PM +0300, Lubomir I. Ivanov wrote:
> > On 6 October 2015 at 19:02, Guido Lerch <guido.le...@gmail.com> wrote:
> > >
> > > All,
> > >
> > > Am I doing this correctly when working on translations to open the .ts
> fiel with QA Linguist ?
> > > When doing this and when only saving the file after open (no changes)
> a git diff gives me
> > > tons of changes - hence a simple patch would have lot of changes and
> Dirk will tell me worse :-)
> >
> > we use Transifex for translations:
> > https://www.transifex.com/subsurface/subsurface/
> >
> > you could register an account there and join "subsurface team".
> > if you have already done your work in linguist, transifex allows
> > uploading files; never tried that option - i just use their web
> > interface when translating.
>
> Yes, doing translations in transifex really makes my life much easier.
>

Ok, looking at the translation in transifex tells me German is 100%
translated which I dispute as "download from cloud storage"
is not German :-)
Another thing to learn as I have no clue how transifex works but I'll read
myself though it.

>
> > if the upload doesn't work. just consult with Dirk and send the
> > translation as a patch, i guess.
> > haven't seen translation patches sent to the mailing list in a while...
>
> Correct - whenever people do that I take them and deal with them and then
> request that they switch to doing the work on transifex.
>
> So the same offer is of course valid for Guido. I'll take a patch and deal
> with making it work. But I'd really prefer to have you just work on
> transifex.
>

Ok, Linguistic is really easy though, the huge diffs come from the xml tags
because transifex used /> to terinate
and Linguistic uses .
Of course I deal with what you want as you are the maintainer but IMHO
Linguistic is a lot easier, at least from what
I can see now.

>
> Thanks
>
> /D
>



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


Re: Issues building install with Marble

2015-10-07 Thread Guido Lerch
2015-10-06 22:22 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:

> On Tue, Oct 06, 2015 at 05:58:45PM +0200, Guido Lerch wrote:
> > Copied the maps and bitmaps directory into subsurface/marbledata, this
> > fixed it.
>
> So I did some more testing and tweaking. The latest master should remove
> your build/marbledata directory and replace it with a symbolic link to the
> ~/src/subsurface/marbledata directory...
>

I read articles that cmake 3.3.1 has issues with symlinks, have you had
issues with this ?
Seems MAC specific.

>
> /D
>
> PS: a gentle reminder... we REALLY prefer inline email style. Top post
> responses are not really good at creating a cohesive conversation.
>
> I cant to this on all computers, sorry. I find it disturbing as it's
sometimes hard for me to
find the comment between all the text but I am happy to comply which what
you guys
prefer.
For me the inline editing works only nicely if I logon to Google mail 

>
> > 2015-10-05 23:57 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:
> >
> > > On Tue, Oct 06, 2015 at 08:54:34AM +1100, Rick Walsh wrote:
> > > > >>>>> Here is what I am usually doing
> > > > >>>>> $ git pull
> > > > >>>>> $ make -j4
> > > > >>>>> $ make install
> > > > >>>>>
> > > > >>>>> make install complains about not finding  /marbledata/maps
> > > > >>>>>
> > > > There is an issue with the cmake files not copying the marbledata
> > > > directory.  Until it is fixed, you can manually copy it from the
> source
> > > > directory to the build directory. Works on Linux at least.
> > >
> > > That's different on Mac - there you have to run make install in order
> to
> > > get a working app bundle that you can run.
> > >
> > > My initial guess would be that something got messed up in Guido's
> source
> > > tree...
> > >
> > > /D
> > >
> >
> >
> >
> > --
> > Best regards,
> > Guido
>



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


Re: Issues building install with Marble

2015-10-07 Thread Guido Lerch
2015-10-07 13:16 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:

> On Wed, Oct 07, 2015 at 12:57:44PM +0200, Guido Lerch wrote:
> > > So I did some more testing and tweaking. The latest master should
> remove
> > > your build/marbledata directory and replace it with a symbolic link to
> the
> > > ~/src/subsurface/marbledata directory...
> >
> > I read articles that cmake 3.3.1 has issues with symlinks, have you had
> > issues with this ?
> > Seems MAC specific.
>
> It works for me :-)
>
> > > PS: a gentle reminder... we REALLY prefer inline email style. Top post
> > > responses are not really good at creating a cohesive conversation.
> >
> > I cant to this on all computers, sorry. I find it disturbing as it's
> > sometimes hard for me to
> > find the comment between all the text but I am happy to comply which what
> > you guys
> > prefer.
> > For me the inline editing works only nicely if I logon to Google mail
> 
>
> So many of us do a LOT of email. And the studies show quite clearly how
> much better inline responding is. Admittedly it works better if people
> consistently edit emails down so that the context makes sense but isn't
> excessive and not everyone does it.
>
> My phrasing was intentional. It's a gentle reminder and a strong
> preference. You will see emails from me that are top post when I'm in a
> rush and respond from my phone. But even there I usually try to respond
> inline. It's just the much better practice.
>

No worries, I can easily integrate if I know what the expectations are :-)
Maybe an update to the contribution page would help, I have seen mails
from people having the same issues as myself when I started aka white
spaces.

>
> /D
>



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


Re: Bug report

2015-10-07 Thread Guido Lerch
2015-10-07 13:42 GMT+02:00 Lubomir I. Ivanov <neolit...@gmail.com>:

> On 7 October 2015 at 14:39, Guido Lerch <guido.le...@gmail.com> wrote:
> >
> >
> > 2015-10-07 13:27 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:
> >>
> >> On Wed, Oct 07, 2015 at 01:23:12PM +0200, Guido Lerch wrote:
> >> > All,
> >> > Tried to get a Track account but got rejected :-(
> >>
> >> Interesting. Can you tell me more what you tried and what happened? We
> >> have people create trac accounts several times a week and it turns to
> work
> >> quite well - we do a minimal captcha to get rid of some of the spam
> bots,
> >> but it should reject you :-)
> >>
> >> > Printing on a MAC iOS 10.9.5 does not print the dive meta data, the
> >> > profiles are printed but
> >> > in a really bad quality.
> >> >
> >> > Printed an example to a PDF, attached.
> >>
> >> Is this built from source or with the Beta 3 / latest daily build?
> >> The reason I'm asking is that there is a bit of black magic involved to
> >> really get the bundle to work exactly as intended and it can easily pick
> >> up incorrect libraries if you aren't careful...
> >
> >
> > With Beta-3 is works ! Now is the question on how I can reproducible
> build
> > from
> > source using the correct libraries.
> > Next test is to use the build script.
> >>
>
> which Qt version are you using to build locally?
> we encourage 5.5, or the latest possible...
>

I am using 5.5 but frankly have tons of questions and ask myself if I have
set this up properly - I am still a newbie to this.

For example:
- I am getting messages that the build is done in the source tree and that
that is not recommended, however build.sh does build in the source tree
itself ...
- Trying to move the build location gives issues as the makefiles and the
cmake stuff is not in the new location ...

As said I am new and somehow hesitant to ask those questions as the cracks
might think I am a complete dummy ...

So far I always got stuff to work but I am not confident at all that
everything is setup 100% correctly, hence I might
see weird behaviour like marble woking one pull but not at the next or
printing works with Beta-3 but not when building
with the last master.


>
> lubomir
> --
>



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


Re: Question - working on some German Translations

2015-10-07 Thread Guido Lerch
2015-10-07 13:13 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:

> On Wed, Oct 07, 2015 at 12:55:22PM +0200, Guido Lerch wrote:
> > you don't sleep, do you ? :-)
>
> Sadly that is often true as I at times suffer from bad insomnia... but
> right now I'm in Dublin so this is actually daytime for me :-)
>
> > 2015-10-07 9:57 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:
> >
> > > On Wed, Oct 07, 2015 at 09:53:54AM +0200, Guido Lerch wrote:
> > > >
> > > > Ok, looking at the translation in transifex tells me German is 100%
> > > > translated which I dispute as "download from cloud storage"
> > > > is not German :-)
> > >
> > > What this means is that we missed marking this string for translation
> :-(
> > >
> > > Can you send a patch?
> >
> > No sure what happened, I did something wrong - please disregard.
> > Transifex works nicely.
>
> Oh good. I wouldn't be surprised if we missed a string or three. Happens
> with every release.
>
> > Did some translations this morning, how do I get them too you ? Don't
> want
> > to do anything wrong.
>
> That's the easy thing. You do NOTHING. :-)
>

Cool.

>
> Once you save them on the website, the next time I pull translations I
> will automatically get ALL the new translations.
>
> I occasionally check the status and I am excited to report that right now
> people are working on Chinese, Estonian, Danish, French and (of course)
> Swiss German... additionally Jan kindly signed up to work on the Dutch
> translation so this is all coming together beautifully.
>
> /D
>
>


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


Bug report

2015-10-07 Thread Guido Lerch
All,
Tried to get a Track account but got rejected :-(

Printing on a MAC iOS 10.9.5 does not print the dive meta data, the
profiles are printed but
in a really bad quality.

Printed an example to a PDF, attached.

-- 
Best regards,
Guido


2 dives.pdf
Description: Adobe PDF document
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Bug report

2015-10-07 Thread Guido Lerch
2015-10-07 13:27 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:

> On Wed, Oct 07, 2015 at 01:23:12PM +0200, Guido Lerch wrote:
> > All,
> > Tried to get a Track account but got rejected :-(
>
> Interesting. Can you tell me more what you tried and what happened? We
> have people create trac accounts several times a week and it turns to work
> quite well - we do a minimal captcha to get rid of some of the spam bots,
> but it should reject you :-)
>

gave user id, password (twice), mail, filled the captcha box, my name, no
details.
got a reject message -  I am NO spam :-)

>
> > Printing on a MAC iOS 10.9.5 does not print the dive meta data, the
> > profiles are printed but
> > in a really bad quality.
> >
> > Printed an example to a PDF, attached.
>
> Is this built from source or with the Beta 3 / latest daily build?
> The reason I'm asking is that there is a bit of black magic involved to
> really get the bundle to work exactly as intended and it can easily pick
> up incorrect libraries if you aren't careful...
>

build from source, just ran a git pull, make -j4, make install just before
I reported the issue.
downloading the beta-3 now.

>
> /D
>



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


Re: Issues building install with Marble

2015-10-06 Thread Guido Lerch
Copied the maps and bitmaps directory into subsurface/marbledata, this
fixed it.

2015-10-05 23:57 GMT+02:00 Dirk Hohndel :

> On Tue, Oct 06, 2015 at 08:54:34AM +1100, Rick Walsh wrote:
> > > Here is what I am usually doing
> > > $ git pull
> > > $ make -j4
> > > $ make install
> > >
> > > make install complains about not finding  /marbledata/maps
> > >
> > There is an issue with the cmake files not copying the marbledata
> > directory.  Until it is fixed, you can manually copy it from the source
> > directory to the build directory. Works on Linux at least.
>
> That's different on Mac - there you have to run make install in order to
> get a working app bundle that you can run.
>
> My initial guess would be that something got messed up in Guido's source
> tree...
>
> /D
>



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


Re: Issues building install with Marble

2015-10-05 Thread Guido Lerch
2015-10-05 23:41 GMT+02:00 Tomaz Canabrava <tcanabr...@kde.org>:

>
>
> On Mon, Oct 5, 2015 at 6:37 PM, Guido Lerch <guido.le...@gmail.com> wrote:
>
>> All,
>>
>> I would appreciate some help and some instructions on how to download
>> the latest master and reproducibly make marble to work.
>>
>> Here is what I am usually doing
>> $ git pull
>> $ make -j4
>> $ make install
>>
>> make install complains about not finding  /marbledata/maps
>>
>> I am on MAC Yosemite
>>
>> looking at the subsurface directory /marbledata was there as a broken
>> alias, recreating doesnt help.
>>
>
> Did you tried to run scripts/build.sh ?
> it should download all libraries necessaries, build marble, build
> subsurface.
>

Yes, I did that too but the maps still dont work. They used to before I got
the last master but not anymore.

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


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


Re: Issues building install with Marble

2015-10-05 Thread Guido Lerch
Sure

2015-10-05 23:44 GMT+02:00 Tomaz Canabrava <tcanabr...@kde.org>:

> Then I'll ask you to wait a bit - I'll try to test this at home on the
> Mac.
>
> Em seg, 5 de out de 2015 18:43, Guido Lerch <guido.le...@gmail.com>
> escreveu:
>
>> 2015-10-05 23:41 GMT+02:00 Tomaz Canabrava <tcanabr...@kde.org>:
>>
>>>
>>>
>>> On Mon, Oct 5, 2015 at 6:37 PM, Guido Lerch <guido.le...@gmail.com>
>>> wrote:
>>>
>>>> All,
>>>>
>>>> I would appreciate some help and some instructions on how to download
>>>> the latest master and reproducibly make marble to work.
>>>>
>>>> Here is what I am usually doing
>>>> $ git pull
>>>> $ make -j4
>>>> $ make install
>>>>
>>>> make install complains about not finding  /marbledata/maps
>>>>
>>>> I am on MAC Yosemite
>>>>
>>>> looking at the subsurface directory /marbledata was there as a broken
>>>> alias, recreating doesnt help.
>>>>
>>>
>>> Did you tried to run scripts/build.sh ?
>>> it should download all libraries necessaries, build marble, build
>>> subsurface.
>>>
>>
>> Yes, I did that too but the maps still dont work. They used to before I
>> got the last master but not anymore.
>>
>>>
>>>
>>>> Any suggestions
>>>>
>>>> --
>>>> Best regards,
>>>> Guido
>>>>
>>>> ___
>>>> subsurface mailing list
>>>> subsurface@subsurface-divelog.org
>>>> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>>>>
>>>>
>>>
>>
>>
>> --
>> Best regards,
>> Guido
>>
>


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


Lost most of my divesites

2015-10-05 Thread Guido Lerch
All,

I downloaded the new master today, built it and ran SubSurface, after that
I loaded
a new dive from the Uemis and saved the log.

After this most of my dive sites are gone showing the dive site name as
"from Uemis".
I havent had this issue during my stay in Egypt where I loaded 15 dives
from the
DC into SubSurface.

Has anyone seen similar or the same issues ?

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


Re: Current 4.5 plans

2015-10-02 Thread Guido Lerch

Hi Dirk,
I am still in Egypt and can't do a lot of testing despite confirming that I 
found no issues with the uemis downloads and that Linus' patch for the SAC and 
environment details work nicely.

What I noted is that when one selects multiple dives and changes any of the 
meta data such as weight, buddy, etc. not always all dives that are selected 
get updated.
Unfortunately I cannot do more testing to find the root or provide screen shots 
before next week.

Also I reported an issue with printing where I get a huge list of print 
templates from which it is not obvious on what to select.
Also when printing it does not print the selected dives, it tries to print 
always all and on the paper is nothing.

Not sure if this is just for me or if someone else had similar issues.

I have time to test the release for sure over then next weeks.

G. Lerch


Donnerstag, 1. Oktober 2015 13:48 +0200 von Dirk Hohndel  :
>So we aren't really getting a lot of new issues reported for 4.5
>and my logs show fewer than a hundred people have tried Beta 2.
>
>My thinking is that I'll do Beta 3 this weekend, mostly just to get all
>things built and at least the installers tested, etc. And then release 4.5
>next week knowing full well that this is when actual testing will begin
>and planning for a 4.5.1 after users find all the bugs we provided for
>their entertainment (and we fixed them).
>
>So if you haven't started testing, yet, or if you know of an issue that
>you really want to be fixed BEFORE 4.5 goes out, please point it out
>now...
>
>Tomaz, I sent you the screen video of the odd bug that I found with
>location completion and the globe going to a completely bogus place, it
>would be nice to have this fixed, but it really isn't critical.
>
>Oh, and based on some discussion with Linus and some issues I had with
>that function myself lately, I'll change the behavior of the globe when
>called with no GPS coordinates. It simply won't move at all insteaf of
>zooming out. If anyone has super strong feelings about this, please let me
>know. Willem, I haven't checked if this is something that you mention in
>the user manual, either.
>
>Thanks
>
>/D
>___
>subsurface mailing list
>subsurface@subsurface-divelog.org
>http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re[2]: Equipment info wrong

2015-09-28 Thread Guido Lerch

Hi Dirk

I am fine, of course, with Linus' patch.
I dispute however that I was ever against the threshold unless I misunderstand 
something here. I also did no changes to any code concerning threshold. My work 
was focussed on getting the raw data in trying to deal with all uemis oddities.

You and I never discussed a threshold, that must have been someone else.

Nevertheless I'll try to get the last master with my lousy internet connection 
here in Egypt and continue testing.

I still suffer from not knowing the code too well and need to still learn a lot.
For example while trying to implement the pressure drop approach I found that 
even changing the base64 string wouldn't to anything to the equipment data nor 
the sac calculations. I spend 2 hours and didn't find out why because I am 
still so new to anything that is outside the uemis loader that I start to 
wonder whether I am useful at all.

G. Lerch


Montag, 28. September 2015 13:58 +0200 von Dirk Hohndel  <d...@hohndel.org>:
>On Mon, Sep 28, 2015 at 01:56:24PM +0300, Guido Lerch wrote:
>> 
>> Hi Linus,
>> 
>> I just realized the same, none of my code changes do anything to the
>> events
>
>This has nothing to do with events. Remember how we talked about the fact
>that you didn't like it that my original code dropped all the samples that
>had a depth smaller than SURFACE_THRESHOLD? The fact that we no longer
>doing that is what causes the effect that Linus observed.
>
>> but I am working on a patch to detect pressure drops that happen
>> if you decouple the regulator before the uemis has finished its dive
>> which is usually 2-3 minutes after you surface.
>
>I think that Linus existing solution has some merit independently of what
>you are proposing. Yes, detecting such pressure drops helps with an oddity
>that the Uemis creates because it keeps storing samples for such a long
>time after the end of the dive and that possibly other dive computers
>might cause as well.
>
>But Linus' patch fundamentally changes the way we consider SAC - it only
>starts the calculation at the first sample where the diver is under water
>and ends at the last sample where the diver is under water. On a computer
>with a slow sample rate this might introduce a small inaccuracy (as you
>might be missing as much as the first and last minute of your dive), but
>for most current dive computers that tend to sample at 30s or faster it's
>just a hand full of breaths and the overall result is likely more accurate
>as it also misses the initial cooling of the tank.
>
>> If you have done some fixes already please let me know so we do not
>> duplicate efforts. If you haven't it's a good learning for me but will
>> take some time as I don't know that part of the code yet.
>
>Linus' patch is in master - I pushed it earlier.
>
>/D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re[2]: Uemis Patch - display message if no files present to download

2015-09-25 Thread Guido Lerch

I am.
Frankly I can't believe I wrote files ... Not sure where my brain was ... Maybe 
too fried here with 38 degrees C.

G. Lerch


Freitag, 25. September 2015 23:02 +0200 von Dirk Hohndel  <d...@hohndel.org>:
>On Fri, Sep 25, 2015 at 11:55:27PM +0300, Guido Lerch wrote:
>> 
>> Can you make a suggestion what it should be ?
>
>I did. "No new dives to download"
>
>If you are OK with that message I can just fix your commit
>
>/D
>
>> Freitag, 25. September 2015 18:59 +0200 von Dirk Hohndel  < d...@hohndel.org 
>> >:
>> >> +#define ERR_NO_FILES QT_TRANSLATE_NOOP("gettextFromC", "No files to 
>> >> download.")
>> >> +#define BUFLEN 2048
>> >>  #define BUFLEN 2048
>> >
>> >As already pointed out - that just gives you a warning.
>> >
>> >But I also question the message... shouldn't it be "No new dives to
>> >download"? Divers don't really think about this in the context of files.
>> >
>> >/D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re[2]: Uemis Patch - display message if no files present to download

2015-09-25 Thread Guido Lerch

Can you make a suggestion what it should be ?

G. Lerch


Freitag, 25. September 2015 18:59 +0200 von Dirk Hohndel  <d...@hohndel.org>:
>On Fri, Sep 25, 2015 at 04:32:25PM +0200, Guido Lerch wrote:
>> -- 
>> Best regards,
>> Guido
>
>> From 9b6b28534e2102da18cdfed5b0d3401953217648 Mon Sep 17 00:00:00 2001
>> From: Guido Lerch < guido.le...@gmail.com >
>> Date: Thu, 24 Sep 2015 19:26:35 +0200
>> Subject: [PATCH] Uemis-display message if no dives to download
>> 
>> Display an error message if no new files are there for
>> download.
>> 
>> Signed-off-by: Guido Lerch < guido.le...@gmail.com >
>> ---
>>  uemis-downloader.c | 4 
>>  1 file changed, 4 insertions(+)
>> 
>> diff --git a/uemis-downloader.c b/uemis-downloader.c
>> index 3b8ddf9..deb82a9 100644
>> --- a/uemis-downloader.c
>> +++ b/uemis-downloader.c
>> @@ -27,6 +27,8 @@
>>  #define ERR_FS_ALMOST_FULL QT_TRANSLATE_NOOP("gettextFromC", "Uemis Zurich: 
>> the file system is almost full.\nDisconnect/reconnect the dive computer\nand 
>> click 'Retry'")
>>  #define ERR_FS_FULL QT_TRANSLATE_NOOP("gettextFromC", "Uemis Zurich: the 
>> file system is full.\nDisconnect/reconnect the dive computer\nand click 
>> Retry")
>>  #define ERR_FS_SHORT_WRITE QT_TRANSLATE_NOOP("gettextFromC", "Short write 
>> to req.txt file.\nIs the Uemis Zurich plugged in correctly?")
>> +#define ERR_NO_FILES QT_TRANSLATE_NOOP("gettextFromC", "No files to 
>> download.")
>> +#define BUFLEN 2048
>>  #define BUFLEN 2048
>
>As already pointed out - that just gives you a warning.
>
>But I also question the message... shouldn't it be "No new dives to
>download"? Divers don't really think about this in the context of files.
>
>/D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Uemis Patch - display message if no files present to download

2015-09-25 Thread Guido Lerch
-- 
Best regards,
Guido
From 9b6b28534e2102da18cdfed5b0d3401953217648 Mon Sep 17 00:00:00 2001
From: Guido Lerch <guido.le...@gmail.com>
Date: Thu, 24 Sep 2015 19:26:35 +0200
Subject: [PATCH] Uemis-display message if no dives to download

Display an error message if no new files are there for
download.

Signed-off-by: Guido Lerch <guido.le...@gmail.com>
---
 uemis-downloader.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/uemis-downloader.c b/uemis-downloader.c
index 3b8ddf9..deb82a9 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -27,6 +27,8 @@
 #define ERR_FS_ALMOST_FULL QT_TRANSLATE_NOOP("gettextFromC", "Uemis Zurich: 
the file system is almost full.\nDisconnect/reconnect the dive computer\nand 
click \'Retry\'")
 #define ERR_FS_FULL QT_TRANSLATE_NOOP("gettextFromC", "Uemis Zurich: the file 
system is full.\nDisconnect/reconnect the dive computer\nand click Retry")
 #define ERR_FS_SHORT_WRITE QT_TRANSLATE_NOOP("gettextFromC", "Short write to 
req.txt file.\nIs the Uemis Zurich plugged in correctly?")
+#define ERR_NO_FILES QT_TRANSLATE_NOOP("gettextFromC", "No files to download.")
+#define BUFLEN 2048
 #define BUFLEN 2048
 #define NUM_PARAM_BUFS 10
 
@@ -1345,5 +1347,7 @@ bail:
}
free(deviceid);
free(reqtxt_path);
+   if (!data->download_table->nr)
+   result = translate("gettextFromC", ERR_NO_FILES);
return result;
 }
-- 
2.3.8 (Apple Git-58)

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


Equipment info wrong

2015-09-21 Thread Guido Lerch

all
Has someone recently changed something to the equipment info.
Reading a dive from my Uemis today the first time since I test the end pressure 
in the equipment info is wrong.
Screen shots attached.

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


Re: [PATCH 2/2] uemis downloader: start downloading using the correct dive IDavoid NULL pointer dereference

2015-09-21 Thread Guido Lerch

Tested this today. Works with my 240 dives I have by now on the Uemis.

Also the blindly strstr was obvious and an overlook on my side.

The initial object id wasn't from me :-)

So I am happy with my newbie contributions :-)

The code to update selected dives is ready but requires a UI change. I suppose 
you don't want this for 4.5.

G. Lerch


Sonntag, 20. September 2015 06:14 +0200 von Linus Torvalds  
:
>
>From: Linus Torvalds < torva...@linux-foundation.org >
>Date: Sat, 19 Sep 2015 21:09:58 -0700
>Subject: [PATCH 2/2] uemis downloader: start downloading using the correct 
>dive ID
>
>The logic to pick the initial dive ID for the uemis downloader was very
>confused, and did not work at all when restarting a download when the
>Uemis filled up, and the "Force download all dives" flag was set.  It
>also required a rather odd Uemis-specific callback from the download UI
>because of how it picked the initial ID.
>
>This changes the logic to just look at the list of downloaded dives when
>restarting, which simplifies the logic a lot, gets rid of the odd
>special callback, and also means that the whole "Force download" issue
>just goes away.  It seems to work now.
>
>Signed-off-by: Linus Torvalds < torva...@linux-foundation.org >
>---
> dive.h |  2 +-
> qt-ui/downloadfromdivecomputer.cpp |  8 
> uemis-downloader.c | 40 +-
> uemis.h|  1 -
> 4 files changed, 23 insertions(+), 28 deletions(-)
>
>diff --git a/dive.h b/dive.h
>index fa95f6721631..4eb44cfc9c8d 100644
>--- a/dive.h
>+++ b/dive.h
>@@ -498,7 +498,7 @@ struct dive_table {
>   struct dive **dives;
> };
> 
>-extern struct dive_table dive_table;
>+extern struct dive_table dive_table, downloadTable;
> extern struct dive displayed_dive;
> extern struct dive_site displayed_dive_site;
> extern int selected_dive;
>diff --git a/qt-ui/downloadfromdivecomputer.cpp 
>b/qt-ui/downloadfromdivecomputer.cpp
>index 7e18dae70baa..1fef9f6bff1e 100644
>--- a/qt-ui/downloadfromdivecomputer.cpp
>+++ b/qt-ui/downloadfromdivecomputer.cpp
>@@ -298,14 +298,6 @@ void 
>DownloadFromDCWidget::on_downloadCancelRetryButton_clicked()
>   diveImportedModel->clearTable();
>   clear_table();
>   }
>-  if (ui.vendor->currentText() == "Uemis") {
>-  if (currentState == ERROR && downloadTable.nr > 0)
>-  // let the uemis code know how far we've gotten
>-  
>uemis_set_max_diveid_from_dialog(downloadTable.dives[downloadTable.nr - 
>1]->dc.diveid);
>-  else
>-  // fresh download, so only look at what's in the 
>dive_table
>-  uemis_set_max_diveid_from_dialog(0);
>-  }
>   updateState(DOWNLOADING);
> 
>   // you cannot cancel the dialog, just the download
>diff --git a/uemis-downloader.c b/uemis-downloader.c
>index 70cc3f78d449..3b8ddf900e89 100644
>--- a/uemis-downloader.c
>+++ b/uemis-downloader.c
>@@ -928,23 +928,32 @@ static bool process_raw_buffer(device_data_t *devdata, 
>uint32_t deviceid, char *
>   return true;
> }
> 
>-static int max_diveid_from_dialog;
>-
>-void uemis_set_max_diveid_from_dialog(int diveid)
>-{
>-  max_diveid_from_dialog = diveid;
>-}
>-
>-static char *uemis_get_divenr(char *deviceidstr)
>+static char *uemis_get_divenr(char *deviceidstr, int force)
> {
>   uint32_t deviceid, maxdiveid = 0;
>   int i;
>   char divenr[10];
>-
>+  struct dive_table *table;
>   deviceid = atoi(deviceidstr);
>-  struct dive *d;
>-  for_each_dive (i, d) {
>+
>+  /*
>+   * If we are are retrying after a disconnect/reconnect, we
>+   * will look up the highest dive number in the dives we
>+   * already have.
>+   *
>+   * Also, if "force_download" is true, do this even if we
>+   * don't have any dives (maxdiveid will remain zero)
>+   */
>+  if (force || downloadTable.nr)
>+  table = 
>+  else
>+  table = _table;
>+
>+  for (i = 0; i < table->nr; i++) {
>+  struct dive *d = table->dives[i];
>   struct divecomputer *dc;
>+  if (!d)
>+  continue;
>   for_each_dc (d, dc) {
>   if (dc->model && !strcmp(dc->model, "Uemis Zurich") &&
>   (dc->deviceid == 0 || dc->deviceid == 0x7fff || 
>dc->deviceid == deviceid) &&
>@@ -952,7 +961,7 @@ static char *uemis_get_divenr(char *deviceidstr)
>   maxdiveid = dc->diveid;
>   }
>   }
>-  snprintf(divenr, 10, "%d", maxdiveid > max_diveid_from_dialog ? 
>maxdiveid : max_diveid_from_dialog);
>+  snprintf(divenr, 10, "%d", maxdiveid);
>   return strdup(divenr);
> }
> 
>@@ -1215,12 +1224,7 @@ const char *do_uemis_import(device_data_t *data)
>   goto bail;
> 
>   param_buff[1] = 

Re[2]: UEMIS Patch fixing alternating dive details

2015-09-20 Thread Guido Lerch

Hi Linus

Thanks. Since I am new to C , given the fact I haven't coded in C for over 20 
years I expected some finds.

Unfortunately, where I am right now I don't think I can load the last master. 
No internet or at least flakey here in Egypt.

I try and test if I can.

G. Lerch


Sonntag, 20. September 2015 06:15 +0200 von Linus Torvalds  
:
>On Sat, Sep 19, 2015 at 9:04 PM, Dirk Hohndel < d...@hohndel.org > wrote:
>> Can I get this as a patch with good commit message and SOB, please?
>
>Ok, done, but I do think more testing would be good.
>
>And hey, I think the code looks more obvious, but extra review isn't a
>bad idea either.
>
>Linus
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: UEMIS Patch fixing alternating dive details

2015-09-18 Thread Guido Lerch
Not much improvement but reading a few dive spots less.

2015-09-18 19:34 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:

> On Fri, Sep 18, 2015 at 08:30:01PM +0300, Guido Lerch wrote:
> >
> > Keep to see your cleanup, I know I am still struggling to forget about
> c# :-)
>
> It's small stuff, and not necessarily caused by your code. Just working on
> this again after such a long time reminded me how horrible my own original
> code was which you modified...
>
> > I think the code is good but have a small patch later today, I am still
> > testing. This might avoid a few reads but not a lot.
>
> Cool.
>
> > Over the past two days I read another 10 times all my dives while trying
> > to do some stupid things here and there such as canceling in the middle
> > etc. found no issues but with the Uemis you never know.
> >
> > Heading out to marsa alam tomorrow , if I find someone with an Uemis
> > I'll read that to if I am allowed. This should give us some more data.
> >
> > How did the tests with you Uemis go?
>
> Very successfully. I hope Linus will give it another try before our next
> dive trip (we are leaving next week).
>
> Thanks
>
> /D
>



-- 
Best regards,
Guido


0001-Uemis-reduce-the-amount-of-dive-stops-to-be-read.patch
Description: Binary data
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Bluetooth

2015-09-18 Thread Guido Lerch

I have seen several people discussing this and don't know what I miss 
My OSTC 3 does not have blue tooth does it ?

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


Re: almost Beta 2

2015-09-18 Thread Guido Lerch

I will certainly on board with testing but with probing I have issues.
Whenever I select print the list of templates shows me everything in the 
subsurface directory.
Not checked over that past week of this have changed but definitely only valid 
templates should be shown in the drop down.

G. Lerch


Freitag, 18. September 2015 22:52 +0200 von Dirk Hohndel  :
>Just a quick update. I'm waiting for patches from Tomaz. I just kicked of
>daily builds so people who want to test have something to test.
>The weekend will be rather busy with family activities, so if I don't get
>Beta 2 today I'm not sure when it will go out, but as far as I'm concerned
>we have now entered the final stage.
>
>We need to test, translate, document, and fix bugs and issues that pop up.
>
>It would be really nice if more of the 200+ people on this list would
>participate in this effort. Beta 1 binaries have been tested on a total of
>90 systema / VMss. And that includes all the folks who aren't on this list
>who saw the various announcements. Cloud storage has been tested by fewer
>than 50 people.
>
>All the bugs and issues we don't find now will be found by our users. And
>that really is a shame.
>
>/D
>
>___
>subsurface mailing list
>subsurface@subsurface-divelog.org
>http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re[2]: UEMIS Patch fixing alternating dive details

2015-09-18 Thread Guido Lerch

Have you seen my small patch ?

Will work on top of what you do :-)

G. Lerch


Freitag, 18. September 2015 22:13 +0200 von Dirk Hohndel  <d...@hohndel.org>:
>On Fri, Sep 18, 2015 at 11:05:41PM +0300, Guido Lerch wrote:
>> 
>> Can't tell, have only seen 1 or above and -1 if you have no spot assigned.
>> IMHO this is good for 4.5 beta so we have a couple of people looking at it.
>> I am fully equipped to deliver patches while in Egypt and keen to do some 
>> more. :-)
>
>OK, then I'll push my small changes out so you can work on top of them
>
>/D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re[2]: UEMIS Patch fixing alternating dive details

2015-09-18 Thread Guido Lerch

Can't tell, have only seen 1 or above and -1 if you have no spot assigned.
IMHO this is good for 4.5 beta so we have a couple of people looking at it.
I am fully equipped to deliver patches while in Egypt and keen to do some more. 
:-)

G. Lerch


Freitag, 18. September 2015 21:29 +0200 von Dirk Hohndel  <d...@hohndel.org>:
>On Fri, Sep 18, 2015 at 09:25:48PM +0200, Guido Lerch wrote:
>> Not much improvement but reading a few dive spots less.
>
>Yeah, that was one of the things that I had looked at. I was going to ask
>you - can there ever be a divespot #0? Or do those start with 1?
>
>/D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: UEMIS Patch fixing alternating dive details

2015-09-18 Thread Guido Lerch
All good now.

I looked into avoiding to read all the dive-spots but this is not possible
unless the divespot was read in a current import
already. The reason on why we cannot compare already stored dives from the
xml is that we don't store the dive spot
id. I don't think we should implement this just for the uemis.

What I am doing already is to avoid duplication of dive spots, and not
doing anything with dive-spots if the uemus dive-spot
id is -1. So Dirk, in your case not a single dive-spot is being read :-)
For me about 80.

I keep on thinking however on how to make the import faster and allow
partial imports while I am on vacation :-)

If someone is testing and finds an issue, please let me know.

G.

2015-09-17 17:55 GMT+02:00 Guido Lerch <guido.le...@gmail.com>:

> I'll send the patches later, on the wrong computer
>
> 2015-09-17 17:46 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:
>
>>
>> On Sep 17, 2015, at 8:40 AM, Guido Lerch <guido.le...@gmail.com> wrote:
>>
>> Another this, sorry
>>
>> Just switched back to the master and pulled, none of my last patches are
>> there ? Any idea ?
>> Just ran
>>
>> git checkout master
>> git pull
>>
>>
>> Any errors? What's the SHA of the top commit that you have (you can see
>> this with git show)
>>
>
> I'll take a look later
>
>>
>>
>> QT Creator asks to reload all the files, I say yes, all seems to be at
>> least 3-4 days old.
>>
>>
>> Well, let's look at
>> http://git.subsurface-divelog.org/?p=subsurface.git=search=HEAD=commit=glerch
>>
>
> This looks good
>
>>
>> Can you resend the patches that are missing?
>>
>> /D
>>
>>
>
>
> --
> Best regards,
> Guido
>



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


Re[2]: UEMIS Patch fixing alternating dive details

2015-09-18 Thread Guido Lerch

Hi Dirk

Keep to see your cleanup, I know I am still struggling to forget about c# :-)

I think the code is good but have a small patch later today, I am still 
testing. This might avoid a few reads but not a lot.

Over the past two days I read another 10 times all my dives while trying to do 
some stupid things here and there such as canceling in the middle etc. found no 
issues but with the Uemis you never know.

Heading out to marsa alam tomorrow , if I find someone with an Uemis I'll read 
that to if I am allowed. This should give us some more data.

How did the tests with you Uemis go?

G. Lerch


Freitag, 18. September 2015 17:35 +0200 von Dirk Hohndel  <d...@hohndel.org>:
>On Fri, Sep 18, 2015 at 05:26:42PM +0200, Guido Lerch wrote:
>> All good now.
>> 
>> I looked into avoiding to read all the dive-spots but this is not possible
>> unless the divespot was read in a current import
>> already. The reason on why we cannot compare already stored dives from the
>> xml is that we don't store the dive spot
>> id. I don't think we should implement this just for the uemis.
>> 
>> What I am doing already is to avoid duplication of dive spots, and not
>> doing anything with dive-spots if the uemus dive-spot
>> id is -1. So Dirk, in your case not a single dive-spot is being read :-)
>> For me about 80.
>> 
>> I keep on thinking however on how to make the import faster and allow
>> partial imports while I am on vacation :-)
>> 
>> If someone is testing and finds an issue, please let me know.
>
>So if I read this correctly you think that the current code is "good to
>go" for 4.5?
>
>I may make a couple of tiny adjustments here and there (let's call them
>"cleanup"), but nothing significant.
>
>I'm planning to release Beta 2 today.
>
>/D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Re[2]: Re[2]: testing the Uemis code [was Re: UEMIS-bug fix: fixing the dialog message when the memory us full]

2015-09-17 Thread Guido Lerch
2015-09-16 19:43 GMT+02:00 Guido Lerch <guido.le...@gmail.com>:

> Hi Dirk
> I'll digest this later, I am on the road now.
>
> I might send you and Linus a special patch that writes down the Uemis and
> files to disc.
> As said I tested with two computer and both worked fine and fast.
> If the download is slow it typically means that we cannot match the log
> entries to the dive details and typically you run out of memory with no
> results.
> My hope is that with that special patch I see how different out dive logs
> and dive details are and amend the algorithm.
>
>
> G. Lerch
>
>
> Mittwoch, 16. September 2015 16:34 +0200 von Dirk Hohndel <
> d...@hohndel.org>:
>
> Good morning Guido...
>
> On Wed, Sep 16, 2015 at 09:02:11AM +0200, Guido Lerch wrote:
> > > My results were not as good as Linus'
> > > After 8h connected to a charger it finally came back to life.
> > >
> > > When trying to download (empty dive file, so start from the oldest
> dive)
> > > it loads the first set of dives and then ping-pongs between details
> for #2
> > > and details for #3 back and forth and back and forth until the memory
> is
> > > full.
> >
> > This is exactly what happened to me with the old code where the offset
> was
> > calculated,
> > I completely re-did that part and tested it on 2 different Uemis computed
> > which worked like a charm.
>
> That's the problem with trial and error bug fixing / coding. We don't
> understand exactly how the two different ids are related. I think they
> possibly aren't at all. So you need to figure out the offset by trial and
> error. With the three Uemis SDA that I had access to the offset was always
> fixed, but I don't even know if that is true.
>
> Here is the relevant excerpt from the debug log (I can send you the whole
> log if you think there's anything else in there that's interesting, but I
> don't think there is
>
> d_u_i after download and parse start 3 end 12 newmax 12 progress 0.19
> ::w req.txt
> "n07680054getDive{90d179077baa3186643ea3d84ac93499{notempty{3{{{"
> :tr n0769 (after seeks)
> ::t /run/media/hohndel/UEMISSDA/ANS/ANS768.TXT
> "1mn{dive{1.0{dive-conditions{1.0{dive-gear{1.0{dive-buddies{1.0{computer_id{int{20719{user_id{int{2{"
> :tr n0770 (after seeks)
> added
> "{dive{1.0{dive-conditions{1.0{dive-gear{1.0{dive-buddies{1.0{computer_id{int{20719{user_id{int{2{object_id{int{3{remote_object_id{int{0{sync_id{int{
> {deleted{bool{false{ctime{ts{2014-05-13T07:24:32{dive_no{int{3{logfilenr{int{5{date{ts{2014-05-13T16:22:53{duration{float{58.00{depth{int{1466{altitude{int{1005{decoindex{int{-99{consumption{int{12{gas{int{1{water{int{1{divetype{int{0{diveactivity{int{0{training{int{0{conditions{u8Clouds{int{1{u8Deposit{int{1{u8Wind{int{1{u8Waves{int{1{u8Current{int{1{u8"
> to buffer - new length 510
> buf |object_id{int{3{remote_object_id{int{0{sync_id{in|
> reading details for #
>  3
>  
> {dive{1.0{dive-conditions{1.0{dive-gear{1.0{dive-buddies{1.0{computer_id{int{20719{user_id{int{2{object_id{int{3{remote_object_id{int{0{sync_id{int{
> {deleted{bool{false{ctime{ts{2014-05-13T07:24:32{dive_no{int{3{logfilenr{int{5{date{ts{2014-05-13T16:22:53{duration{float{58.00{depth{int{1466{altitude{int{1005{decoindex{int{-99{consumption{int{12{gas{int{1{water{int{1{divetype{int{0{diveactivity{int{0{training{int{0{conditions{u8Clouds{int{1{u8Deposit{int{1{u8Wind{int{1{u8Waves{int{1{u8Current{int{1{u8
> ::t /run/media/hohndel/UEMISSDA/ANS/ANS769.TXT
> "1meVisibility{int{1{gear{u8DiveSuit{int{0{u8DiveSuitType{int{0{u8SuitThickness{int{0{f32Weight{float"
> added
> "Visibility{int{1{gear{u8DiveSuit{int{0{u8DiveSuitType{int{0{u8SuitThickness{int{0{f32Weight{float{0.00{u8BCD{int{0{u8Light{int{0{u8Camera{int{0{u8BottomTankType{int{0{u8TravelTankType{int{0{u8DecoTankType{int{0{u8ScubaSet{int{0{u8Other{string{
> {divespot_id{int{-1{buddies{notes{string{
> 000"
> to buffer - new length 1019
> :r: (null)
> ::w req.txt
> "n07700054getDive{90d179077baa3186643ea3d84ac93499{notempty{2{{{"
> :tr n0771 (after seeks)
> ::t /run/media/hohndel/UEMISSDA/ANS/ANS770.TXT
> "1mn{dive{1.0{dive-conditions{1.0{dive-gear{1.0{dive-buddies{1.0{computer_id{int{20719{user_id{int{2{"
> :tr n0772 (after seeks)
> added
> "{dive{1.0{dive-conditions{1.0{dive-gear{1.0{dive-buddies{1.0{computer_id{int{20719{user_id{int{2{object_id{int{2{remote_object_id{int{0{sync_id{int{
> {deleted{bool{false{

Re: Re[2]: Re[2]: testing the Uemis code [was Re: UEMIS-bug fix: fixing the dialog message when the memory us full]

2015-09-17 Thread Guido Lerch
2015-09-17 14:20 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:

> On Thu, Sep 17, 2015 at 12:13:06PM +0200, Guido Lerch wrote:
> > >
> > >
> > weird debug output, you have logfilenr 5, then logfilenr 4 then again
> > logfilenr 5 
>
> Yes, indeed. Your existing code in master will alternate between those two
> files until the memory runs out. Which is because you are comparing the
> wrong two values. You compare the # that you ask for with the number that
> you want. You never parse (or use) the number that you got:
>

interesting, I think your Uemis is unique in that. even I cleaned up the
code, got
rid of the weird thing below I am not sure if my new patch can handle
alternating
logfilenr.

I will implement your suggestion below and see what it does to mine since
you
original code did alternate on my uemis between two dives till the memory
ran
out too - so the question is, is my Uemis f..u.. or your's :-)


>
> if (*dive_to_read >= dive->dc.diveid)
> *dive_to_read = (*dive_to_read - 2 >= 0 ? *dive_to_read - 2 : 0);
>
> So in my case where *dive_to_read and dive->dc.diveid are the same this
> condition is true the first time and *dive_to_read gets decremented.
> The next time around *dive_to_read is smaller and gets incremented.
> Then it's the same as the dc.diveid again and gets decremented.
>
> What you need to do instead is basically this:
>
> uint32_t nr_found = 0;
> char *logfilenr = strstr(mbuf, "logfilenr");
> if (logfilenr)
> sscanf(logfilenr, "logfilenr{int{%u", _found);
>
> So figure out which logfilenr you got and then
>
> if (nr_found >= dive->dc.diveid)
> *dive_to_read = *dive_to_read - 2;
> if (*dive_to_read < -1) // this will be incremented below so this
> way we can get to zero
> *dive_to_read = -1;
>
> (easier on the eyes than your :? statement, IMHO)
>
> This way we compare what we found against what we want and decrement what
> we ask for until we get what we want.
>

the issue is that if we only decrement it will not work on my, so I need to
find some way to determine
whether the Uemis in use needs an increment or decrement - clearly funky
design by Uemis Zurich

>
> > anyway, I think I understand what the difference is with your and my
> offset
> > and will send a patch soon.
>
> Cool.
>
> /D
>



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


Re: UEMIS Patch fixing alternating dive details

2015-09-17 Thread Guido Lerch
2015-09-17 17:06 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:

> Ok, let's talk about learning :-)
>
> On Thu, Sep 17, 2015 at 04:51:33PM +0200, Guido Lerch wrote:
> > From cd5c20831b006fcb5da6397301026ac056fa949d Mon Sep 17 00:00:00 2001
> > From: glerch <guido.le...@gmail.com>
> > Date: Thu, 17 Sep 2015 16:46:02 +0200
> > Subject: [PATCH 7/7] UEMIS-fix alternating dive details
>
> I am rewriting the subject of most of your commits to fit the pattern:
>
> Uemis divelog: . (starting with lower case)
>
> > Implemented suggestion from Dir on how to deal with dive details
>  ^
> > not being found.
>
> Proof-reading :-)
>

hä ?

>
> > I also cleaned up some unused variables, got rid of the last_log_file_nr
> > because it's not needed anymore.
>
> Should this have been two commits? Maybe not.
>
> > I kept the UEMIS_DEBUG flags active on purpose.
>
> Don't. Ideally they should just be passed in when calling cmake:
>
> CFLAGS=-DUEMIS_DEBUG=7 cmake .
>

THANKS, I was waiting for this tip without actually ever asking directly
:-)

>
> If you really want them in the C file for your tests then remove them
> before you send patches to me.
> >
> > One thing ins question I still need to check and this is whether we
> really
> ^^^
> proof reading
>
> > need to decrease the dive_to_read if we find deleted dive details, this
> is
> > still in but I dont think it's really needed.
> >
> > Signed-off-by: glerch <guido.le...@gmail.com>
> > ---
> >  uemis-downloader.c | 51
> ++-
> >  1 file changed, 26 insertions(+), 25 deletions(-)
> >
> > diff --git a/uemis-downloader.c b/uemis-downloader.c
> > index 0981f4b..43bda9b 100644
> > --- a/uemis-downloader.c
> > +++ b/uemis-downloader.c
> > @@ -31,7 +31,7 @@
> >  #define NUM_PARAM_BUFS 10
> >
> >  // debugging setup
> > -// #define UEMIS_DEBUG 1 + 2 + 4 + 8 + 16 + 32
> > +#define UEMIS_DEBUG 1 + 2 + 4
> >
> >  #define UEMIS_MAX_FILES 4000
> >  #define UEMIS_MEM_FULL 1
> > @@ -69,6 +69,7 @@ static int mbuf_size = 0;
> >
> >  static int max_mem_used = -1;
> >  static int next_table_index = 0;
> > +static int dive_to_read = 0;
> >
> >  /* helper function to parse the Uemis data structures */
> >  static void uemis_ts(char *buffer, void *_when)
> > @@ -367,7 +368,7 @@ static void buffer_add(char **buffer, int
> *buffer_size, char *buf)
> >   *buffer = realloc(*buffer, *buffer_size);
> >   strcat(*buffer, buf);
> >   }
> > -#if UEMIS_DEBUG & 16
> > +#if UEMIS_DEBUG & 8
>
> Stuff like this mixed into a patch makes it much harder to see what you
> are actually changing in the patch. That's why I encourage you to do
> smaller commits that do just one thing.
>

I know, I was rushing though as I wanted this out, with proper testing,
before I leave on Saturday.

>
> If you look at everything above, the only real change is yet another
> global variable that you added.
>
> And it continues like this, the next two hunks are also just noise.
>
> > - /* Ugly, need something better
> than this
> > -  * essentially, if we start
> reading divelogs not from the start
> > -  * we have no idea on how many log
> entries are there that have no
> > -  * valid dive details */
> > - if (*dive_to_read >=
> dive->dc.diveid)
> > - *dive_to_read =
> (*dive_to_read - 2 >= 0 ? *dive_to_read - 2 : 0);
> > + uint32_t nr_found = 0;
> > + char *logfilenr = strstr(mbuf,
> "logfilenr");
> > + if (logfilenr) {
> > + sscanf(logfilenr,
> "logfilenr{int{%u", _found);
> > + if (nr_found >=
> dive->dc.diveid)
> > + dive_to_read =
> dive_to_read - 2;
> > + if (dive_to_read < -1)
> > + dive_to_read = -1;
> > + }
> >   }
> >   }
> > - *dive_to_read = *dive_to_read + 1;
> > + dive_to_read++;
>
> Yep, that should work with my Uemis. I'll test it next.
>
> And I'll take your commit as it is (minus the part where you turn on
> debugging by default). So no need to resubmit.
>
> /D
>



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


Re: UEMIS Patch fixing alternating dive details

2015-09-17 Thread Guido Lerch
Another this, sorry

Just switched back to the master and pulled, none of my last patches are
there ? Any idea ?
Just ran

git checkout master
git pull

QT Creator asks to reload all the files, I say yes, all seems to be at
least 3-4 days old.

G.

2015-09-17 17:36 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:

> On Thu, Sep 17, 2015 at 05:34:06PM +0200, Guido Lerch wrote:
> > >
> > > After every single dive ("details for #xxx) it reads divespot #0. That
> > > seems completely silly to me. I think I set the divespot on a single
> dive
> > > for this Uemis (I find the interface for this completely ridiculous and
> > > stupid - and why would I ever want to have this on my dive computer if
> the
> > > dive computer has no map and no GPS? mind boggles) - anyway, I don't
> see
> > > why it would have to read divespots at all - and if it DID have to read
> > > divespots, then it should read #0 exactly once and remember that it
> did so
> > > and not doing it over and over again. This certainly adds to the
> > > perception that things are going a lot slower now than they used to.
> >
> > In your orignal code it was worse, sorry to say, but you read always all
> > divespots with every depending on the diveid.
>
> Ha. Since I have only one divespot on my Uemis (see my comment above) that
> still meant 10x fewer reads than your code :-)
>
> > Next optimization is a real check if the spot is there already and the
> > omitt the reading, that's another patch and some work for me tonight and
> > tomorrow.
>
> Cool
>
> > Hope you are happy with my contributions, even if it's still a little
> bumpy
> > :-)
>
> I'm really happy. Bumpy is normal. You are well within the bell curve when
> it comes to that.
>
> /D
>



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


Re: UEMIS Patch fixing alternating dive details

2015-09-17 Thread Guido Lerch
2015-09-17 17:26 GMT+02:00 Dirk Hohndel :

> On Thu, Sep 17, 2015 at 08:06:18AM -0700, Dirk Hohndel wrote:
> >
> > Yep, that should work with my Uemis. I'll test it next.
>
> As expected, it seems to work. I'll push this, soon.
>
> One comment.
>
> After every single dive ("details for #xxx) it reads divespot #0. That
> seems completely silly to me. I think I set the divespot on a single dive
> for this Uemis (I find the interface for this completely ridiculous and
> stupid - and why would I ever want to have this on my dive computer if the
> dive computer has no map and no GPS? mind boggles) - anyway, I don't see
> why it would have to read divespots at all - and if it DID have to read
> divespots, then it should read #0 exactly once and remember that it did so
> and not doing it over and over again. This certainly adds to the
> perception that things are going a lot slower now than they used to.
>

In your orignal code it was worse, sorry to say, but you read always all
divespots
with every depending on the diveid.
Next optimization is a real check if the spot is there already and the
omitt the
reading, that's another patch and some work for me tonight and tomorrow.

Hope you are happy with my contributions, even if it's still a little bumpy
:-)

>
> /D
>



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


Re: Re[2]: Re[2]: testing the Uemis code [was Re: UEMIS-bug fix: fixing the dialog message when the memory us full]

2015-09-17 Thread Guido Lerch
2015-09-17 15:31 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:

> On Thu, Sep 17, 2015 at 03:24:39PM +0200, Guido Lerch wrote:
> > 2015-09-17 14:20 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:
> >
> > > On Thu, Sep 17, 2015 at 12:13:06PM +0200, Guido Lerch wrote:
> > > > >
> > > > >
> > > > weird debug output, you have logfilenr 5, then logfilenr 4 then again
> > > > logfilenr 5 
> > >
> > > Yes, indeed. Your existing code in master will alternate between those
> two
> > > files until the memory runs out. Which is because you are comparing the
> > > wrong two values. You compare the # that you ask for with the number
> that
> > > you want. You never parse (or use) the number that you got:
> > >
> >
> > interesting, I think your Uemis is unique in that. even I cleaned up the
> > code, got
> > rid of the weird thing below I am not sure if my new patch can handle
> > alternating
> > logfilenr.
>
> NO. Please read what I wrote. This happened because of a bug in your code.
> With my patches (that I haven't pushed) my Uemis is read just fine.
>

I read what you wrote, the first code I installed, no changes from me,
alternated between
two dives till the memory was full.
My code has a bug, indeed, and to explain would take a long time, hence I
skip this till I
have more time - please trust me.

I implemented your suggestion and are at dive 200 now for importing, hence
it works with mine
but the line where we decrement is never called but will most likely be
called with your uemis.

>
> > I will implement your suggestion below and see what it does to mine since
> > you
> > original code did alternate on my uemis between two dives till the memory
> > ran
> > out too - so the question is, is my Uemis f..u.. or your's :-)
>
> I don't think so. Would you like me to push what I have so you can test
> it? Maybe that's easier then having you try to figure this out. It sounded
> earlier as if you were ready to submit a patch and I didn't want to step
> on your work, but if you haven't fixed this yet I can simply take my own
> fixes and have you work on top of that.
>

please wait, I am sending the patch soon, I spend the last 2 hour or so
testing it with all
my dives. With retry, with accepting, and mixed.

>
> > the issue is that if we only decrement it will not work on my, so I need
> to
> > find some way to determine
> > whether the Uemis in use needs an increment or decrement - clearly funky
> > design by Uemis Zurich
>
> No, it checks in either direction in my code. Why don't I just push my
> fixes. OK?
>

where is my learning ? :-) you'll have my patch soon.

>
> /D
>



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


UEMIS Patch fixing alternating dive details

2015-09-17 Thread Guido Lerch
I hope this works nor for you too, Dirk.

-- 
Best regards,
Guido
From cd5c20831b006fcb5da6397301026ac056fa949d Mon Sep 17 00:00:00 2001
From: glerch 
Date: Thu, 17 Sep 2015 16:46:02 +0200
Subject: [PATCH 7/7] UEMIS-fix alternating dive details

Implemented suggestion from Dir on how to deal with dive details
not being found.

I also cleaned up some unused variables, got rid of the last_log_file_nr
because it's not needed anymore.

I kept the UEMIS_DEBUG flags active on purpose.

One thing ins question I still need to check and this is whether we really
need to decrease the dive_to_read if we find deleted dive details, this is
still in but I dont think it's really needed.

Signed-off-by: glerch 
---
 uemis-downloader.c | 51 ++-
 1 file changed, 26 insertions(+), 25 deletions(-)

diff --git a/uemis-downloader.c b/uemis-downloader.c
index 0981f4b..43bda9b 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -31,7 +31,7 @@
 #define NUM_PARAM_BUFS 10
 
 // debugging setup
-// #define UEMIS_DEBUG 1 + 2 + 4 + 8 + 16 + 32
+#define UEMIS_DEBUG 1 + 2 + 4
 
 #define UEMIS_MAX_FILES 4000
 #define UEMIS_MEM_FULL 1
@@ -69,6 +69,7 @@ static int mbuf_size = 0;
 
 static int max_mem_used = -1;
 static int next_table_index = 0;
+static int dive_to_read = 0;
 
 /* helper function to parse the Uemis data structures */
 static void uemis_ts(char *buffer, void *_when)
@@ -367,7 +368,7 @@ static void buffer_add(char **buffer, int *buffer_size, 
char *buf)
*buffer = realloc(*buffer, *buffer_size);
strcat(*buffer, buf);
}
-#if UEMIS_DEBUG & 16
+#if UEMIS_DEBUG & 8
fprintf(debugfile, "added \"%s\" to buffer - new length %d\n", buf, 
*buffer_size);
 #endif
 }
@@ -435,7 +436,7 @@ static void show_progress(char *buf, const char *what)
char *val = first_object_id_val(buf);
if (val) {
 /* let the user know what we are working on */
-#if UEMIS_DEBUG & 16
+#if UEMIS_DEBUG & 8
fprintf(debugfile, "reading %s\n %s\n %s\n", what, val, buf);
 #endif
uemis_info(translate("gettextFromC", "%s %s"), what, val);
@@ -789,7 +790,7 @@ static bool process_raw_buffer(device_data_t *devdata, 
uint32_t deviceid, char *
struct dive *dive = NULL;
char dive_no[10];
 
-#if UEMIS_DEBUG & 4
+#if UEMIS_DEBUG & 8
fprintf(debugfile, "p_r_b %s\n", inbuf);
 #endif
if (for_dive)
@@ -1085,18 +1086,19 @@ static void get_uemis_divespot(const char *mountpath, 
int divespot_id, struct di
}
 }
 
-static bool get_matching_dive(int idx, int *dive_to_read, int 
*last_found_log_file_nr, int *deleted_files, char *newmax, int 
*uemis_mem_status, struct device_data_t *data, const char* mountpath, const 
char deviceidnr)
+static bool get_matching_dive(int idx, char *newmax, int *uemis_mem_status, 
struct device_data_t *data, const char* mountpath, const char deviceidnr)
 {
struct dive *dive = data->download_table->dives[idx];
char log_file_no_to_find[20];
char dive_to_read_buf[10];
bool found = false;
+   int deleted_files = 0;
 
snprintf(log_file_no_to_find, sizeof(log_file_no_to_find), 
"logfilenr{int{%d", dive->dc.diveid);
while (!found) {
if (import_thread_cancelled)
break;
-   snprintf(dive_to_read_buf, sizeof(dive_to_read_buf), "%d", 
*dive_to_read);
+   snprintf(dive_to_read_buf, sizeof(dive_to_read_buf), "%d", 
dive_to_read);
param_buff[2] = dive_to_read_buf;
(void)uemis_get_answer(mountpath, "getDive", 3, 0, NULL);
 #if UEMIS_DEBUG & 16
@@ -1122,9 +1124,8 @@ static bool get_matching_dive(int idx, int *dive_to_read, 
int *last_found_log_fi
 * UEMIS unfortunately deletes 
dives by deleting the dive details and not the logs. */
 #if UEMIS_DEBUG & 2
d_time = 
get_dive_date_c_string(dive->when);
-   fprintf(debugfile, "Matching 
divelog id %d from %s with dive details %d\n", dive->dc.diveid, d_time, 
*dive_to_read);
+   fprintf(debugfile, "Matching 
divelog id %d from %s with dive details %d\n", dive->dc.diveid, d_time, 
dive_to_read);
 #endif
-   *last_found_log_file_nr = 
*dive_to_read;
int divespot_id = 
uemis_get_divespot_id_by_diveid(dive->dc.diveid);
get_uemis_divespot(mountpath, 
divespot_id, dive);
 
@@ -1132,26 +1133,28 @@ static bool get_matching_dive(int idx, int 
*dive_to_read, int *last_found_log_fi
/* in this case we found a 
deleted file, so let's increment */
 #if UEMIS_DEBUG & 2
  

Uemis patch - bug fix - make sure import reacts on cancel button

2015-09-16 Thread Guido Lerch
-- 
Best regards,
Guido
From 9744dc1269058bce56020a494eab1d79dec13f6a Mon Sep 17 00:00:00 2001
From: glerch 
Date: Wed, 16 Sep 2015 09:10:56 +0200
Subject: [PATCH 4/4] UEMIS-bugfix-import reacting on cancel

Fixed a bug where the import did not react on the cancel
button by adding the check into the helper function as
well.

Signed-off-by: glerch 
---
 uemis-downloader.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/uemis-downloader.c b/uemis-downloader.c
index 92b221a..2f2f346 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -1094,6 +1094,8 @@ static bool get_matching_dive(int idx, int *dive_to_read, 
int *last_found_log_fi
 
snprintf(log_file_no_to_find, sizeof(log_file_no_to_find), 
"logfilenr{int{%d", dive->dc.diveid);
while (!found) {
+   if (import_thread_cancelled)
+   break;
snprintf(dive_to_read_buf, sizeof(dive_to_read_buf), "%d", 
*dive_to_read);
param_buff[2] = dive_to_read_buf;
(void)uemis_get_answer(mountpath, "getDive", 3, 0, NULL);
@@ -1273,6 +1275,8 @@ const char *do_uemis_import(device_data_t *data)
bool success  = get_matching_dive(i, 
_to_read, _found_log_file_nr, _files, newmax, 
_mem_status, data, mountpath, deviceidnr);
if (!success)
break;
+   if (import_thread_cancelled)
+   break;
}
 
start = end;
-- 
1.9.5 (Apple Git-50.3)

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


Uemis patch - code cleanup

2015-09-16 Thread Guido Lerch
removing one unused variable

-- 
Best regards,
Guido
From 9674bfab0b8440bced10c2ead75d3f28a905fb6a Mon Sep 17 00:00:00 2001
From: glerch 
Date: Wed, 16 Sep 2015 09:22:11 +0200
Subject: [PATCH 5/5] UEMIS-Code cleanup

Removing an unused variable

Signed-off-by: glerch 
---
 uemis-downloader.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/uemis-downloader.c b/uemis-downloader.c
index 2f2f346..0981f4b 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -1180,7 +1180,6 @@ const char *do_uemis_import(device_data_t *data)
int deleted_files = 0;
int last_found_log_file_nr = 0;
int match_dive_and_log = 0;
-   int start_cleanup = 0;
int uemis_mem_status = UEMIS_MEM_OK;
 
 #if UEMIS_DEBUG
@@ -1230,7 +1229,7 @@ const char *do_uemis_import(device_data_t *data)
fprintf(debugfile, "d_u_i inner loop start %d end %d newmax 
%s\n", start, end, newmax);
 #endif
/* start at the last filled download table index */
-   start_cleanup = match_dive_and_log = data->download_table->nr;
+   match_dive_and_log = data->download_table->nr;
sprintf(newmax, "%d", start);
param_buff[2] = newmax;
param_buff[3] = 0;
-- 
1.9.5 (Apple Git-50.3)

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


Re: Re[2]: testing the Uemis code [was Re: UEMIS-bug fix: fixing the dialog message when the memory us full]

2015-09-16 Thread Guido Lerch
2015-09-16 3:55 GMT+02:00 Dirk Hohndel :

> > Anyway, it looks like the uemis support is usable, but has a few
> > warts. I'm assuming those are the patches you're working on.
>
> My results were not as good as Linus'
> After 8h connected to a charger it finally came back to life.
>
> When trying to download (empty dive file, so start from the oldest dive)
> it loads the first set of dives and then ping-pongs between details for #2
> and details for #3 back and forth and back and forth until the memory is
> full.
>

This is exactly what happened to me with the old code where the offset was
calculated,
I completely re-did that part and tested it on 2 different Uemis computed
which worked
like a charm.

>
> Progress seems even slower than before if that's even possible.
>
> Reading through the code I don't see what happened to the offset we used
> to have there to deal with the fact that the Uemis idiotically doesn't use
> the same id as keys in its different data bases. I didn't have the time to
> dig down into where exactly the bug is but it clearly gets stuck trying to
> load the correct dive details with GetDive, but I don't think the logic
> used to adjust "dive_to_read" is sound.
>

Ca you do me a favour and switch on UEMIS debugging and send me the dump
files ? This will help me to analyse how your object_id and logfile_nr
differ from
mine which will help fixing the matching that obviously doesn't work on you
Uemis.

>
> Cancelling the download from the dialog doesn't appear to work, either.
> Subsurface is simply hung when doing that.
>

A bad on my side that I'll fix.

>
> I'd say there is still room for some improvement.
>
> /D
>



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


Uemis patch : make sure force download is unchecked after the first round of loading dives

2015-09-16 Thread Guido Lerch
-- 
Best regards,
Guido
From 6231c844fc1eb15373a506ec3e31108df38b55bb Mon Sep 17 00:00:00 2001
From: glerch 
Date: Wed, 16 Sep 2015 20:29:44 +0200
Subject: [PATCH 6/6] UEMIS-uncheck the force download

This changes assures we uncheck the forcedownload flag after the
first round of reading to assure the uemis downloader doesnt go
in cyrcles.

Please check if this patch has any negative impact on
other computers.

Signed-off-by: glerch 
---
 qt-ui/downloadfromdivecomputer.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/qt-ui/downloadfromdivecomputer.cpp 
b/qt-ui/downloadfromdivecomputer.cpp
index 7e18dae..d9d0dc9 100644
--- a/qt-ui/downloadfromdivecomputer.cpp
+++ b/qt-ui/downloadfromdivecomputer.cpp
@@ -443,6 +443,9 @@ void DownloadFromDCWidget::onDownloadThreadFinished()
}
ui.downloadCancelRetryButton->setText(tr("Retry"));
ui.downloadCancelRetryButton->setEnabled(true);
+   // make sure we uncheck this flag otherwise the UEMIS is going in 
cyrcles
+   // if we get here the download table should have existing dives anyway
+   ui.forceDownload->setChecked(false);
// regardless, if we got dives, we should show them to the user
if (downloadTable.nr) {
diveImportedModel->setImportedDivesIndexes(0, downloadTable.nr 
- 1);
-- 
1.9.5 (Apple Git-50.3)

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


Re: Re[2]: testing the Uemis code [was Re: UEMIS-bug fix: fixing the dialog message when the memory us full]

2015-09-16 Thread Guido Lerch
Hi Dirk,

You didn't tell me the trick but I could have thought about this myself ...

2015-09-16 19:53 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:

> On Wed, Sep 16, 2015 at 08:43:45PM +0300, Guido Lerch wrote:
> >
> > Hi Dirk
> > I'll digest this later, I am on the road now.
> >
> > I might send you and Linus a special patch that writes down the Uemis
> and files to disc.
>
> I though I told you this trick before. Once you are done with one round
> (i.e., before you unplug the Uemis) you can simply tar up the mounted FS.
> And then you can put this somewhere else on your machine and run your code
> against it again. This is wonderful for debugging because then you can
> turn off all the delays and the code runs at full speed. Of course the
> conserved data mean that you cannot see what happens if you send different
> commands to the dive computer - but for analysis of what's going wrong at
> any specific time it's really good.
>
> /D
>



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


Re: Re[2]: testing the Uemis code [was Re: UEMIS-bug fix: fixing the dialog message when the memory us full]

2015-09-16 Thread Guido Lerch
Hi Dirk,

one comment below but I have another problem ...

I went through another round of test and wanted to print out the dive list,
when trying to do that
I need to select a template but the drop down shows me the entire
subsurface directory with
all kinds of files. Is there a template that only prints my list and if so
what is it's name ?

A weird behaviour I found and I think this is just recently ... is that
once I finished all the loading of
my 230+ dives the divespots are there, once I click save, some disappear
and the location is named
from Uemis, if I close the app and reopen all divespots are back

2015-09-17 5:51 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:

> Hi Guido
>
> On Thu, Sep 17, 2015 at 05:38:24AM +0200, Guido Lerch wrote:
> > >
> > > So I've been reading your code again and I struggle to understand the
> > > logic here...
> > >
> > > static bool get_matching_dive(int idx, int *dive_to_read, int
> > > *last_found_log_file_nr, int *deleted_files, char *newmax,
> > >   int *uemis_mem_status, struct
> device_data_t
> > > *data, const char* mountpath, const char deviceidnr)
> > >
> > > What's the purpose of dive_to_read vs. last_found_log_file_nr ?
> > > You start out (when you first call the function) with dive_to_read
> being
> > > one bigger than last_found_log_file_nr (if we have a
> > > loast_found_log_file_nr)
> > > and otherwise dive_to_read = start and last_found_log_file_nr = 0.
> > > start is the first dive nr we are trying to match here.
> >
> > Basically none now but I haven't cleaned it up since. If have to make a
> > few changes to the whole function
> > as some things became obsolete when I moved the code out of the
> > do_uemis_import to the helper.
>
> Hmm - since you said you were going on vacation I have since cleaned up
> this code myself and have it working nicely with my Uemis.
>
> But if you have patches ready I can toss what I did and wait for yours.
>
> > > Then, when the log_file_no_to_find isn't found in the mbuf, we do this:
> > >
> > > if (*dive_to_read >= dive->dc.diveid)
> > > *dive_to_read = (*dive_to_read - 2 >= 0 ?
> *dive_to_read -
> > > 2 : 0);
> > >
> >
> > the object_id of the divelogs and the dive details don't match, this
> means
> > that when you want the dive
> > detail of divelog object_id 2, you have to look for the dive detail that
> > has logfilenr 2. In my Uemis the
> > first object_id is 2 which matches with dive details object_id 3 that
> has a
> > divelognr 2.
>
> And in mine the offset is 2 - which could never happen with your code.
> Fundamentally the if condition above is bogus. You need to parse the
> logfilenr that was in the response from the Uemis and compare THAT to the
> dc.diveid
>

Thats exactly what I am doing, I am just starting off the wrong index.

>
> That's what I did in my code (and some other cleanups) and then things
> work as expected.
>
> > Never the less the code you complain about above is crap and I have
> stated
> > this in my comments, it
> > need a re-write that I am working on as we speak.
>
> OK, I'll wait for your patches and not push mine
>
> I have more than a dozen patches pending in master as I was still testing
> things before real life intervened...
>
> /D
>



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


Re[2]: Re[2]: testing the Uemis code [was Re: UEMIS-bug fix: fixing the dialog message when the memory us full]

2015-09-16 Thread Guido Lerch

Hi Dirk
I'll digest this later, I am on the road now.

I might send you and Linus a special patch that writes down the Uemis and files 
to disc.
As said I tested with two computer and both worked fine and fast.
If the download is slow it typically means that we cannot match the log entries 
to the dive details and typically you run out of memory with no results.
My hope is that with that special patch I see how different out dive logs and 
dive details are and amend the algorithm.


G. Lerch


Mittwoch, 16. September 2015 16:34 +0200 von Dirk Hohndel  <d...@hohndel.org>:
>Good morning Guido...
>
>On Wed, Sep 16, 2015 at 09:02:11AM +0200, Guido Lerch wrote:
>> > My results were not as good as Linus'
>> > After 8h connected to a charger it finally came back to life.
>> >
>> > When trying to download (empty dive file, so start from the oldest dive)
>> > it loads the first set of dives and then ping-pongs between details for #2
>> > and details for #3 back and forth and back and forth until the memory is
>> > full.
>> 
>> This is exactly what happened to me with the old code where the offset was
>> calculated,
>> I completely re-did that part and tested it on 2 different Uemis computed
>> which worked like a charm.
>
>That's the problem with trial and error bug fixing / coding. We don't
>understand exactly how the two different ids are related. I think they
>possibly aren't at all. So you need to figure out the offset by trial and
>error. With the three Uemis SDA that I had access to the offset was always
>fixed, but I don't even know if that is true.
>
>Here is the relevant excerpt from the debug log (I can send you the whole
>log if you think there's anything else in there that's interesting, but I
>don't think there is
>
>d_u_i after download and parse start 3 end 12 newmax 12 progress 0.19
>::w req.txt 
>"n07680054getDive{90d179077baa3186643ea3d84ac93499{notempty{3{{{"
>:tr n0769 (after seeks)
>::t /run/media/hohndel/UEMISSDA/ANS/ANS768.TXT 
>"1mn{dive{1.0{dive-conditions{1.0{dive-gear{1.0{dive-buddies{1.0{computer_id{int{20719{user_id{int{2{"
>:tr n0770 (after seeks)
>added 
>"{dive{1.0{dive-conditions{1.0{dive-gear{1.0{dive-buddies{1.0{computer_id{int{20719{user_id{int{2{object_id{int{3{remote_object_id{int{0{sync_id{int{
> 
>{deleted{bool{false{ctime{ts{2014-05-13T07:24:32{dive_no{int{3{logfilenr{int{5{date{ts{2014-05-13T16:22:53{duration{float{58.00{depth{int{1466{altitude{int{1005{decoindex{int{-99{consumption{int{12{gas{int{1{water{int{1{divetype{int{0{diveactivity{int{0{training{int{0{conditions{u8Clouds{int{1{u8Deposit{int{1{u8Wind{int{1{u8Waves{int{1{u8Current{int{1{u8"
> to buffer - new length 510
>buf |object_id{int{3{remote_object_id{int{0{sync_id{in|
>reading details for #
> 3
> 
>{dive{1.0{dive-conditions{1.0{dive-gear{1.0{dive-buddies{1.0{computer_id{int{20719{user_id{int{2{object_id{int{3{remote_object_id{int{0{sync_id{int{
> 
>{deleted{bool{false{ctime{ts{2014-05-13T07:24:32{dive_no{int{3{logfilenr{int{5{date{ts{2014-05-13T16:22:53{duration{float{58.00{depth{int{1466{altitude{int{1005{decoindex{int{-99{consumption{int{12{gas{int{1{water{int{1{divetype{int{0{diveactivity{int{0{training{int{0{conditions{u8Clouds{int{1{u8Deposit{int{1{u8Wind{int{1{u8Waves{int{1{u8Current{int{1{u8
>::t /run/media/hohndel/UEMISSDA/ANS/ANS769.TXT 
>"1meVisibility{int{1{gear{u8DiveSuit{int{0{u8DiveSuitType{int{0{u8SuitThickness{int{0{f32Weight{float"
>added 
>"Visibility{int{1{gear{u8DiveSuit{int{0{u8DiveSuitType{int{0{u8SuitThickness{int{0{f32Weight{float{0.00{u8BCD{int{0{u8Light{int{0{u8Camera{int{0{u8BottomTankType{int{0{u8TravelTankType{int{0{u8DecoTankType{int{0{u8ScubaSet{int{0{u8Other{string{
> {divespot_id{int{-1{buddies{notes{string{ 
>000"
> to buffer - new length 1019
>:r: (null)
>::w req.txt 
>"n07700054getDive{90d179077baa3186643ea3d84ac93499{notempty{2{{{"
>:tr n0771 (after seeks)
>::t /run/media/hohndel/UEMISSDA/ANS/ANS770.TXT 
>"1mn{dive{1.0{dive-conditions{1.0{dive-gear{1.0{dive-buddies{1.0{computer_id{int{20719{user_id{int{2{"
>:tr n0772 (after seeks)
>added 
>"{dive{1.0{dive-conditions{1.0{dive-gear{1.0{dive-buddies{1.0{computer_id{int{20719{user_id{int{2{object_id{int{2{remote_object_id{int{0{sync_id{int{
> 
>{deleted{bool{false{ctime{ts{2014-05-12T03:39:37{dive_no{int{2{logfilenr{int{4{date{ts{2014-05-12T12:32:36{duration{float{64.00{depth{int{1718{altitude{int{996{decoindex{int{-52{consumption{int{11{gas{int{1{water{int{1{divetype{in

Re: testing the Uemis code [was Re: UEMIS-bug fix: fixing the dialog message when the memory us full]

2015-09-15 Thread Guido Lerch
Hi Linus

2015-09-15 20:43 GMT+02:00 Linus Torvalds :

> On Tue, Sep 15, 2015 at 11:13 AM, Dirk Hohndel  wrote:
> >
> > Linus, could you test the latest Subsurface with the dives on your Uemis?
>
> Current head (4a19145e) seems to be downloading things for me. But
> it's still running because I did a "force download all" to check the
> whole "you need to unplug and replug" thing too, so it will be a while
> before I actually can say "yes, that worked".
>
> Linus
>

Same here ... what I did while testing was
1. delete all the dives in a test logbook
2. skip force download because this is only needed if you have dives already
3. if you unplug and replug the Uemis and forget to uncheck the force
checkbox you will be downloading the same 10 dives over and over, I still
need to fix this.

To load my 240 dives I have with the Uemis I need to unplug and plug about
6 times.

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


Re: testing the Uemis code [was Re: UEMIS-bug fix: fixing the dialog message when the memory us full]

2015-09-15 Thread Guido Lerch
Good :-)

I will try to fix the Uemis oddities one after one, at this point in the
the force download
challenges me as I have not looked into the form code yet.

What we should do from the code is to uncheck the force download checkbox
after the
first round of divelogs, otherwise you keep on loading the first 10 dives
over and over :-(

I am not sure where else I am useful for this project, hence I currently
focus on making the
UEMIS as stable as possible.

I have a Nemo Wide , Mares Puk Pro and and OSTC 3 too - so if someone wants
me to take
a look, please let me know but I certainly don't want to interrupt or
disturb someone work

2015-09-15 21:00 GMT+02:00 Linus Torvalds :

> On Tue, Sep 15, 2015 at 11:43 AM, Linus Torvalds
>  wrote:
> >
> > Current head (4a19145e) seems to be downloading things for me. But
> > it's still running because I did a "force download all" to check the
> > whole "you need to unplug and replug" thing too, so it will be a while
> > before I actually can say "yes, that worked".
>
> Actually, it seems that I don't even h ave enough dives on that Uemis
> for the "remove and retry" thing to trigger. I guess the firmware
> update reset my dives (or did we switch dive computers around? I
> forget), so now it can download all the dives I have in one go.
>
> So I think Guido's testing is actually more useful, because he clearly
> hits the unplug special case.
>
> The download seems successful.
>
> The Uemis downloader still gives those insane cylinder sizes (because
> Uemis has some odd notion of how imperial naming works), and still
> gives that insane "drysuit" suit (since I can't imagine that anybody
> ever has the energy to edit those fields), but those are all old and
> known issues, and have more to do with uemis than with us.
>
>   Linus
>



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


Uemis Patch - cleaning up debugging

2015-09-15 Thread Guido Lerch
-- 
Best regards,
Guido
From 21589cd6985b791169a6630c984ee2f1a12bd5d7 Mon Sep 17 00:00:00 2001
From: glerch 
Date: Tue, 15 Sep 2015 10:09:24 +0200
Subject: [PATCH] Uemis - fixup debugging

No actualy code changes, just some small chnages within the debugging
such as removing reference from my /User/glerch/ home dir etc.

Signed-off-by: glerch 
---
 uemis-downloader.c | 51 +++
 1 file changed, 27 insertions(+), 24 deletions(-)

diff --git a/uemis-downloader.c b/uemis-downloader.c
index 5ddee7a..4c6a537 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -31,13 +31,19 @@
 #define NUM_PARAM_BUFS 10
 
 // debugging setup
-//#define UEMIS_DEBUG 1 + 2
+// #define UEMIS_DEBUG 1 + 2 + 4 + 8 + 16 + 32
 
 #define UEMIS_MAX_FILES 4000
 #define UEMIS_MEM_FULL 3
 #define UEMIS_MEM_CRITICAL 1
 #define UEMIS_MEM_OK 0
 
+#if UEMIS_DEBUG
+const char *home, * user, *d_time;
+static int debug_round = 0;
+#define debugfile stderr
+#endif
+
 #if UEMIS_DEBUG & 64   /* we are reading from a copy of the 
filesystem, not the device - no need to wait */
 #define UEMIS_TIMEOUT 50   /* 50ns */
 #define UEMIS_LONG_TIMEOUT 500 /* 500ns */
@@ -48,10 +54,6 @@
 #define UEMIS_MAX_TIMEOUT 200  /* 2s */
 #endif
 
-#ifdef UEMIS_DEBUG
-#define debugfile stderr
-#endif
-
 static char *param_buff[NUM_PARAM_BUFS];
 static char *reqtxt_path;
 static int reqtxt_file;
@@ -429,7 +431,7 @@ static void show_progress(char *buf, const char *what)
if (val) {
 /* let the user know what we are working on */
 #if UEMIS_DEBUG & 16
-   fprintf(debugfile, "reading %s\n %s\ %s\n", what, val, buf);
+   fprintf(debugfile, "reading %s\n %s\n %s\n", what, val, buf);
 #endif
uemis_info(translate("gettextFromC", "%s %s"), what, val);
free(val);
@@ -948,8 +950,9 @@ static char *uemis_get_divenr(char *deviceidstr)
return strdup(divenr);
 }
 
+#if UEMIS_DEBUG
 static int bufCnt = 0;
-static bool do_dump_buffer_to_file(char *buf, char *prefix, int round)
+static bool do_dump_buffer_to_file(char *buf, char *prefix)
 {
char path[100];
char date[40];
@@ -974,7 +977,7 @@ static bool do_dump_buffer_to_file(char *buf, char *prefix, 
int round)
char *pobid = next_token();
pobid = next_token();
pobid = next_token();
-   snprintf(path, sizeof(path), "/Users/glerch/UEMIS 
Dump/%s_%s_Uemis_dump_%s_in_round_%d_%d.txt", prefix, pdate, pobid, round, 
bufCnt);
+   snprintf(path, sizeof(path), "/%s/%s/UEMIS 
Dump/%s_%s_Uemis_dump_%s_in_round_%d_%d.txt", home, user, prefix, pdate, pobid, 
debug_round, bufCnt);
int dumpFile = subsurface_open(path, O_RDWR | O_CREAT, 0666);
if (dumpFile == -1)
return false;
@@ -983,6 +986,7 @@ static bool do_dump_buffer_to_file(char *buf, char *prefix, 
int round)
bufCnt++;
return true;
 }
+#endif
 
 /* do some more sophisticated calculations here to try and predict if the next 
round of
  * divelog/divedetail reads will fit into the UEMIS buffer,
@@ -1030,7 +1034,7 @@ static bool load_uemis_divespot(const char *mountpath, 
int divespot_id)
bool success = uemis_get_answer(mountpath, "getDivespot", 3, 0, NULL);
if (mbuf && success) {
 #if UEMIS_DEBUG & 16
-   do_dump_buffer_to_file(mbuf, "Spot", round);
+   do_dump_buffer_to_file(mbuf, "Spot");
 #endif
return parse_divespot(mbuf);
}
@@ -1080,7 +1084,7 @@ static bool get_matching_dive(int idx, int *dive_to_read, 
int *last_found_log_fi
param_buff[2] = dive_to_read_buf;
(void)uemis_get_answer(mountpath, "getDive", 3, 0, NULL);
 #if UEMIS_DEBUG & 16
-   do_dump_buffer_to_file(mbuf, "Dive", round);
+   do_dump_buffer_to_file(mbuf, "Dive");
 #endif
*uemis_mem_status = get_memory(data->download_table);
if (*uemis_mem_status == UEMIS_MEM_OK || *uemis_mem_status == 
UEMIS_MEM_CRITICAL) {
@@ -1101,7 +1105,8 @@ static bool get_matching_dive(int idx, int *dive_to_read, 
int *last_found_log_fi
 * have the same or higher 
logfile number.
 * UEMIS unfortunately deletes 
dives by deleting the dive details and not the logs. */
 #if UEMIS_DEBUG & 2
-   fprintf(debugfile, "Matching 
divelog id %d from %s with dive details %d\n", dive->dc.diveid, dTime, 
iDiveToRead);
+   d_time = 
get_dive_date_c_string(dive->when);
+   fprintf(debugfile, "Matching 
divelog id %d from %s with dive details %d\n", dive->dc.diveid, d_time, 
*dive_to_read);
 #endif
*last_found_log_file_nr = 
*dive_to_read;
 

Re[2]: UEMIS-bug fix: fixing the dialog message when the memory us full

2015-09-15 Thread Guido Lerch

Thanks.
I missed the message, otherwise I would have included it right away.

Please let me know if the code works for other too, I only had two Uemis to 
test and found no issues but I might have missed something.

G. Lerch


Dienstag, 15. September 2015 18:13 +0200 von Dirk Hohndel  <d...@hohndel.org>:
>Yet more excellent patches from you. I decided to merge this one with the
>previous commit as you literally just introduced that message there. So
>doing it right the first time seemed to make more sense.
>
>This still brings you to 30 commits in your short tenure as Subsurface
>developer. Quite impressive, Guido. Keep them coming.
>
>/D
>
>On Tue, Sep 15, 2015 at 04:56:06PM +0200, Guido Lerch wrote:
>> Subject: [PATCH 3/3] UEMIS-bug fix, fixing dialog message
>> 
>> I prefer to use the almost full message because in general the progress
>> bar is not at the end when I determine that nomore logs can be loaded.
>> 
>> Signed-off-by: glerch < guido.le...@gmail.com >
>> ---
>>  uemis-downloader.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/uemis-downloader.c b/uemis-downloader.c
>> index 1bfd766..92b221a 100644
>> --- a/uemis-downloader.c
>> +++ b/uemis-downloader.c
>> @@ -1324,7 +1324,7 @@ const char *do_uemis_import(device_data_t *data)
>>  }
>> 
>>  if (uemis_mem_status != UEMIS_MEM_OK)
>> -result = translate("gettextFromC", ERR_FS_FULL);
>> +result = translate("gettextFromC", ERR_FS_ALMOST_FULL);
>> 
>>  bail:
>>  (void)uemis_get_answer(mountpath, "terminateSync", 0, 3, );
>> -- 
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re[2]: testing the Uemis code [was Re: UEMIS-bug fix: fixing the dialog message when the memory us full]

2015-09-15 Thread Guido Lerch

Thanks Dirk.

I will test as much as possible.
Testing is my main domain besides project management.

I don't want to hurt anyone's feelings here but I don't see a structure 
approach to testing.
If I am wrong my apologies. I am new to this project.

I try to send you a patch for the force download issue on the Uemis tomorrow.

Late here now.

G. Lerch


Dienstag, 15. September 2015 21:12 +0200 von Dirk Hohndel  <d...@hohndel.org>:
>On Tue, Sep 15, 2015 at 09:05:49PM +0200, Guido Lerch wrote:
>> Good :-)
>> 
>> I will try to fix the Uemis oddities one after one, at this point in the
>> the force download
>> challenges me as I have not looked into the form code yet.
>> 
>> What we should do from the code is to uncheck the force download checkbox
>> after the
>> first round of divelogs, otherwise you keep on loading the first 10 dives
>> over and over :-(
>
>Yes, true. That's a Uemis oddity since no other dive computer requires
>multiple attempts to download...
>
>> I am not sure where else I am useful for this project, hence I currently
>> focus on making the
>> UEMIS as stable as possible.
>
>Which I am extremely grateful for.
>
>> I have a Nemo Wide , Mares Puk Pro and and OSTC 3 too - so if someone wants
>> me to take
>> a look, please let me know but I certainly don't want to interrupt or
>> disturb someone work
>
>Those are mostly covered in libdivecomputer.
>
>But if you want more things to work on, we have tons of stuff where help
>would be welcome. Right now it's all about testing. With all four dive
>computers, with the cloud service, with printing, with all the new
>features.
>
>And then, after 4.5, let's talk about where else you can help :-)
>
>Thanks
>
>/D
>
>
>> 
>> 2015-09-15 21:00 GMT+02:00 Linus Torvalds < torva...@linux-foundation.org >:
>> 
>> > On Tue, Sep 15, 2015 at 11:43 AM, Linus Torvalds
>> > < torva...@linux-foundation.org > wrote:
>> > >
>> > > Current head (4a19145e) seems to be downloading things for me. But
>> > > it's still running because I did a "force download all" to check the
>> > > whole "you need to unplug and replug" thing too, so it will be a while
>> > > before I actually can say "yes, that worked".
>> >
>> > Actually, it seems that I don't even h ave enough dives on that Uemis
>> > for the "remove and retry" thing to trigger. I guess the firmware
>> > update reset my dives (or did we switch dive computers around? I
>> > forget), so now it can download all the dives I have in one go.
>> >
>> > So I think Guido's testing is actually more useful, because he clearly
>> > hits the unplug special case.
>> >
>> > The download seems successful.
>> >
>> > The Uemis downloader still gives those insane cylinder sizes (because
>> > Uemis has some odd notion of how imperial naming works), and still
>> > gives that insane "drysuit" suit (since I can't imagine that anybody
>> > ever has the energy to edit those fields), but those are all old and
>> > known issues, and have more to do with uemis than with us.
>> >
>> >   Linus
>> >
>> 
>> 
>> 
>> -- 
>> Best regards,
>> Guido
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re[2]: testing the Uemis code [was Re: UEMIS-bug fix: fixing the dialog message when the memory us full]

2015-09-15 Thread Guido Lerch

Hi Linus

It does work BUT you cannot use the force download at this time.
Also you need the last master because you seem not to have the latest patch I 
sent.

Don't waste your time, I let you know once it's worth testing again.

Sorry for this, I never used force download because it wasn't working and I 
completely ignored that issue. Shame on me.

G. Lerch


Dienstag, 15. September 2015 21:35 +0200 von Linus Torvalds  
:
>On Tue, Sep 15, 2015 at 12:10 PM, Dirk Hohndel < d...@hohndel.org > wrote:
>>
>> Can you check in the marvelous on board log book? We can do this when I
>> come by later - it's a bit of a pain to get to :-)
>
>You're right, it doesn't actually download all dives at all.
>
>It downloaded 38 dives out of 214, which is presumably the "memory
>full - continue" case. I didn't get the "unplug and replog" message,
>but the second time I tried it I did get a "Cannot read req.txt" or
>similar window.
>
>So no, the uemis downloader doesn't seem to work as-is. And manually
>re-downloading seems to start from scratch again (even without the
>"force all dives" button checked), so there also seems to be some
>problem with remembering the dive ID's.
>
> Linus
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


UEMIS-patch new memory calculation

2015-09-15 Thread Guido Lerch
-- 
Best regards,
Guido
From 7ed10cfa3a86a1765d6c425b1455afa5c33b9ecf Mon Sep 17 00:00:00 2001
From: glerch 
Date: Tue, 15 Sep 2015 16:46:20 +0200
Subject: [PATCH 2/2] UEMIS-new memory calculation

New calculation doing better UEMIS memory handling leading into more
dives being loaded at the same time while assuring we are not overrunning
the memory.

Also added the dialog message back, this was actually a bug I missed
introduced in one of the earlier patches

Signed-off-by: glerch 
---
 uemis-downloader.c | 61 +++---
 1 file changed, 35 insertions(+), 26 deletions(-)

diff --git a/uemis-downloader.c b/uemis-downloader.c
index 4c6a537..1bfd766 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -34,9 +34,14 @@
 // #define UEMIS_DEBUG 1 + 2 + 4 + 8 + 16 + 32
 
 #define UEMIS_MAX_FILES 4000
-#define UEMIS_MEM_FULL 3
-#define UEMIS_MEM_CRITICAL 1
+#define UEMIS_MEM_FULL 1
 #define UEMIS_MEM_OK 0
+#define UEMIS_SPOT_BLOCK_SIZE 1
+#define UEMIS_DIVE_DETAILS_SIZE 2
+#define UEMIS_LOG_BLOCK_SIZE 10
+#define UEMIS_CHECK_LOG 1
+#define UEMIS_CHECK_DETAILS 2
+#define UEMIS_CHECK_SINGLE_DIVE 3
 
 #if UEMIS_DEBUG
 const char *home, * user, *d_time;
@@ -997,20 +1002,29 @@ static bool do_dump_buffer_to_file(char *buf, char 
*prefix)
  *  UEMIS_MEM_CRITICAL if the memory is good for reading the dive logs
  *  UEMIS_MEM_FULL if the memory is exhaused
  */
-static int get_memory(struct dive_table *td)
+static int get_memory(struct dive_table *td, int checkpoint)
 {
-
-   if (td->nr == 0)
+   if (td->nr <= 0)
return UEMIS_MEM_OK;
 
-   if (filenr / td->nr > max_mem_used)
-   max_mem_used = filenr / td->nr;
-   /* predict based on the max_mem_used value if the set of next 11 
divelogs plus details
-* fit into the memory before we have to disconnect the UEMIS and 
continuem. To be on
-* the safe side we calculate using 12 dives. */
-   if (max_mem_used * 10 > UEMIS_MAX_FILES - filenr) {
-   /* we continue reading the divespots */
-   return UEMIS_MEM_CRITICAL;
+   switch (checkpoint) {
+   case UEMIS_CHECK_LOG:
+   if (filenr / td->nr > max_mem_used)
+   max_mem_used = filenr / td->nr;
+
+   /* check if a full block of dive logs + dive details and dive 
spot fit into the UEMIS buffer */
+   if (max_mem_used * UEMIS_LOG_BLOCK_SIZE > UEMIS_MAX_FILES - 
filenr)
+   return UEMIS_MEM_FULL;
+   break;
+   case UEMIS_CHECK_DETAILS:
+   /* check if the next set of dive details and dive spot fit into 
the UEMIS buffer */
+   if ((UEMIS_DIVE_DETAILS_SIZE + UEMIS_SPOT_BLOCK_SIZE) * 
UEMIS_LOG_BLOCK_SIZE > UEMIS_MAX_FILES - filenr)
+   return UEMIS_MEM_FULL;
+   break;
+   case UEMIS_CHECK_SINGLE_DIVE:
+   if (UEMIS_DIVE_DETAILS_SIZE + UEMIS_SPOT_BLOCK_SIZE > 
UEMIS_MAX_FILES - filenr)
+   return UEMIS_MEM_FULL;
+   break;
}
return UEMIS_MEM_OK;
 }
@@ -1086,8 +1100,8 @@ static bool get_matching_dive(int idx, int *dive_to_read, 
int *last_found_log_fi
 #if UEMIS_DEBUG & 16
do_dump_buffer_to_file(mbuf, "Dive");
 #endif
-   *uemis_mem_status = get_memory(data->download_table);
-   if (*uemis_mem_status == UEMIS_MEM_OK || *uemis_mem_status == 
UEMIS_MEM_CRITICAL) {
+   *uemis_mem_status = get_memory(data->download_table, 
UEMIS_CHECK_SINGLE_DIVE);
+   if (*uemis_mem_status == UEMIS_MEM_OK) {
/* if the memory isn's completely full we can try to 
read more divelog vs. dive details
 * UEMIS_MEM_CRITICAL means not enough space for a full 
round but the dive details
 * and the divespots should fit into the UEMIS memory
@@ -1147,9 +1161,6 @@ static bool get_matching_dive(int idx, int *dive_to_read, 
int *last_found_log_fi
 * we are not missing any valid matches when processing subsequent logs 
*/
*dive_to_read = (dive_to_read - deleted_files > 0 ? dive_to_read - 
deleted_files : 0);
*deleted_files = 0;
-   if (*uemis_mem_status == UEMIS_MEM_FULL)
-   /* game over, not enough memory left */
-   return false;
return true;
 }
 
@@ -1222,7 +1233,7 @@ const char *do_uemis_import(device_data_t *data)
param_buff[2] = newmax;
param_buff[3] = 0;
success = uemis_get_answer(mountpath, "getDivelogs", 3, 0, 
);
-   uemis_mem_status = get_memory(data->download_table);
+   uemis_mem_status = get_memory(data->download_table, 
UEMIS_CHECK_DETAILS);
if (success && mbuf && uemis_mem_status != UEMIS_MEM_FULL) {
 #if UEMIS_DEBUG & 16

UEMIS-bug fix: fixing the dialog message when the memory us full

2015-09-15 Thread Guido Lerch
-- 
Best regards,
Guido
From 97b3fb1d88a6f3795b2c419ce7b06c2a3dfa9c1b Mon Sep 17 00:00:00 2001
From: glerch 
Date: Tue, 15 Sep 2015 16:54:14 +0200
Subject: [PATCH 3/3] UEMIS-bug fix, fixing dialog message

I prefer to use the almost full message because in general the progress
bar is not at the end when I determine that nomore logs can be loaded.

Signed-off-by: glerch 
---
 uemis-downloader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/uemis-downloader.c b/uemis-downloader.c
index 1bfd766..92b221a 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -1324,7 +1324,7 @@ const char *do_uemis_import(device_data_t *data)
}
 
if (uemis_mem_status != UEMIS_MEM_OK)
-   result = translate("gettextFromC", ERR_FS_FULL);
+   result = translate("gettextFromC", ERR_FS_ALMOST_FULL);
 
 bail:
(void)uemis_get_answer(mountpath, "terminateSync", 0, 3, );
-- 
1.9.5 (Apple Git-50.3)

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


Uemis patch - bug fix

2015-09-14 Thread Guido Lerch
This is kind of an embarrassing one :-(

-- 
Best regards,
Guido
From a060aa2c94ab5625603cbcf4933c5baaea29c9e2 Mon Sep 17 00:00:00 2001
From: glerch 
Date: Mon, 14 Sep 2015 22:29:18 +0200
Subject: [PATCH 6/6] Uemis - bugfix wrong variable addressing

Made a mistage when adressing a referenced variable

Signed-off-by: glerch 
---
 uemis-downloader.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/uemis-downloader.c b/uemis-downloader.c
index 2f88c97..8dc5a36 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -1070,7 +1070,6 @@ static void get_uemis_divespot(const char *mountpath, int 
divespot_id, struct di
 static bool get_matching_dive(int idx, int *dive_to_read, int 
*last_found_log_file_nr, int *deleted_files, char *newmax, int 
*uemis_mem_status, struct device_data_t *data, const char* mountpath, const 
char deviceidnr)
 {
struct dive *dive = data->download_table->dives[idx];
-   const char *dTime = get_dive_date_c_string(dive->when);
char log_file_no_to_find[20];
char dive_to_read_buf[10];
bool found = false;
@@ -1113,7 +1112,7 @@ static bool get_matching_dive(int idx, int *dive_to_read, 
int *last_found_log_fi
 #if UEMIS_DEBUG & 2
fprintf(debugfile, "TRY 
matching divelog id %d from %s with dive details %d but details are deleted\n", 
dive->dc.diveid, dTime, iDiveToRead);
 #endif
-   deleted_files++;
+   *deleted_files = *deleted_files 
+ 1;
/* mark this log entry as 
deleted and cleanup later, otherwise we mess up our array */
dive->downloaded = false;
 #if UEMIS_DEBUG & 2
@@ -1141,7 +1140,7 @@ static bool get_matching_dive(int idx, int *dive_to_read, 
int *last_found_log_fi
/* decrement iDiveToRead by the amount of deleted entries found to 
assure
 * we are not missing any valid matches when processing subsequent logs 
*/
*dive_to_read = (dive_to_read - deleted_files > 0 ? dive_to_read - 
deleted_files : 0);
-   deleted_files = 0;
+   *deleted_files = 0;
if (*uemis_mem_status == UEMIS_MEM_FULL)
/* game over, not enough memory left */
return false;
-- 
1.9.5 (Apple Git-50.3)

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


Re: Uemis patches

2015-09-14 Thread Guido Lerch
Thanks Dirk, sometimes by brain doesnt catch those things. Will send
another bugfix soon.

2015-09-14 22:26 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:

> Hi Guido,
>
> I did some minor changes (commit messages plus a small convention issue...
> you need the (void)f() cast if you call a function that returns a value
> and you then ignore it. But your new helper in patch 4 is of type void, so
> you don't need to cast to (void).
>
> Pushed.
>
> /D
>
> On Mon, Sep 14, 2015 at 10:09:23PM +0200, Guido Lerch wrote:
> > One bug fix,
> > 2 code simplifications that done have real algorithm changes.
>



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


Re: Uemis patches

2015-09-14 Thread Guido Lerch
The last patch I sent you puts the case back, wait a second I fix that.

2015-09-14 22:35 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:

> On Mon, Sep 14, 2015 at 10:27:57PM +0200, Guido Lerch wrote:
> > Thanks Dirk, sometimes by brain doesnt catch those things. Will send
> > another bugfix soon.
>
> I fixed it as I committed this. no biggie
>
> /D
>
> >
> > 2015-09-14 22:26 GMT+02:00 Dirk Hohndel <d...@hohndel.org>:
> >
> > > Hi Guido,
> > >
> > > I did some minor changes (commit messages plus a small convention
> issue...
> > > you need the (void)f() cast if you call a function that returns a value
> > > and you then ignore it. But your new helper in patch 4 is of type
> void, so
> > > you don't need to cast to (void).
> > >
> > > Pushed.
> > >
> > > /D
> > >
> > > On Mon, Sep 14, 2015 at 10:09:23PM +0200, Guido Lerch wrote:
> > > > One bug fix,
> > > > 2 code simplifications that done have real algorithm changes.
> > >
> >
> >
> >
> > --
> > Best regards,
> > Guido
>



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


  1   2   >