Re: binaries for Beta 1

2016-10-12 Thread Tomaz Canabrava
No Jokes this time.

you all now how busy I am, but this is no excuse.
I have a bunch of patches to send and $life was getting in the way, I need
to make life be at my side, not against me.


On Wed, Oct 12, 2016 at 10:42 AM, Tomaz Canabrava 
wrote:

> Bad Tomaz.
>
> On Wed, Oct 12, 2016 at 7:01 AM, Dirk Hohndel  wrote:
>
>> On Tue, Oct 04, 2016 at 12:18:37PM +1100, Rick Walsh wrote:
>> > Hi Dirk,
>> >
>> > On 4 October 2016 at 06:43, Dirk Hohndel  wrote:
>> >
>> > > On Mon, Oct 03, 2016 at 09:31:03PM +0200, Robert Helling wrote:
>> > > > Dear friends,
>> > > >
>> > > > > Am 03.10.2016 um 18:06 schrieb Robert C. Helling <
>> > > rob...@euve10195.vserver.de>:
>> > > > >
>> > > > > I have three patches on my laptop, one of which is a bugfix.  Will
>> > > send tonight with proper internet connection. Hold the horses.
>> > > >
>> > > > back home, so here we go:
>> > > >
>> > > >
>> > > >
>> > > > These three patches are of different character:
>> > > >
>> > > > There is no 0001.
>> > > >
>> > > > 0002 is something I hacked so I can switch between Buehlmann and
>> VPM-B
>> > > > from the preferences (rather than just from the planner). It is a
>> bit
>> > > > rough (and should also grey out those preferences which do not
>> apply to
>> > > > the active model, to be added later). We should have something like
>> > > > this, but this patch might need a bit more work and Tomaz promised
>> > > > something along these lines anyway.
>> > >
>> > > So this should wait until after Beta 1?
>> > >
>> >
>> > If you plan on releasing Beta 1 prior to Tomaz's promised preferences
>> > patches, can you include note that there are known bugs with pending
>> > fixes?  E.g. preference to switch between Buhlmann and VPM-B for profile
>> > display (patch by Robert or Tomaz), and not saving the planner settings
>> (I
>> > believe there is a pending fix by Tomaz).
>>
>> No, I'm still waiting for Tomaz to send these patches. Much as I'd like to
>> get the Beta out, it seems silly not to include fixes that apparently have
>> already been written and just not sent out, yet.
>>
>> /D
>>
>
>
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: binaries for Beta 1

2016-10-12 Thread Tomaz Canabrava
Bad Tomaz.

On Wed, Oct 12, 2016 at 7:01 AM, Dirk Hohndel  wrote:

> On Tue, Oct 04, 2016 at 12:18:37PM +1100, Rick Walsh wrote:
> > Hi Dirk,
> >
> > On 4 October 2016 at 06:43, Dirk Hohndel  wrote:
> >
> > > On Mon, Oct 03, 2016 at 09:31:03PM +0200, Robert Helling wrote:
> > > > Dear friends,
> > > >
> > > > > Am 03.10.2016 um 18:06 schrieb Robert C. Helling <
> > > rob...@euve10195.vserver.de>:
> > > > >
> > > > > I have three patches on my laptop, one of which is a bugfix.  Will
> > > send tonight with proper internet connection. Hold the horses.
> > > >
> > > > back home, so here we go:
> > > >
> > > >
> > > >
> > > > These three patches are of different character:
> > > >
> > > > There is no 0001.
> > > >
> > > > 0002 is something I hacked so I can switch between Buehlmann and
> VPM-B
> > > > from the preferences (rather than just from the planner). It is a bit
> > > > rough (and should also grey out those preferences which do not apply
> to
> > > > the active model, to be added later). We should have something like
> > > > this, but this patch might need a bit more work and Tomaz promised
> > > > something along these lines anyway.
> > >
> > > So this should wait until after Beta 1?
> > >
> >
> > If you plan on releasing Beta 1 prior to Tomaz's promised preferences
> > patches, can you include note that there are known bugs with pending
> > fixes?  E.g. preference to switch between Buhlmann and VPM-B for profile
> > display (patch by Robert or Tomaz), and not saving the planner settings
> (I
> > believe there is a pending fix by Tomaz).
>
> No, I'm still waiting for Tomaz to send these patches. Much as I'd like to
> get the Beta out, it seems silly not to include fixes that apparently have
> already been written and just not sent out, yet.
>
> /D
>
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: binaries for Beta 1

2016-10-11 Thread Dirk Hohndel
On Tue, Oct 04, 2016 at 12:18:37PM +1100, Rick Walsh wrote:
> Hi Dirk,
> 
> On 4 October 2016 at 06:43, Dirk Hohndel  wrote:
> 
> > On Mon, Oct 03, 2016 at 09:31:03PM +0200, Robert Helling wrote:
> > > Dear friends,
> > >
> > > > Am 03.10.2016 um 18:06 schrieb Robert C. Helling <
> > rob...@euve10195.vserver.de>:
> > > >
> > > > I have three patches on my laptop, one of which is a bugfix.  Will
> > send tonight with proper internet connection. Hold the horses.
> > >
> > > back home, so here we go:
> > >
> > >
> > >
> > > These three patches are of different character:
> > >
> > > There is no 0001.
> > >
> > > 0002 is something I hacked so I can switch between Buehlmann and VPM-B
> > > from the preferences (rather than just from the planner). It is a bit
> > > rough (and should also grey out those preferences which do not apply to
> > > the active model, to be added later). We should have something like
> > > this, but this patch might need a bit more work and Tomaz promised
> > > something along these lines anyway.
> >
> > So this should wait until after Beta 1?
> >
> 
> If you plan on releasing Beta 1 prior to Tomaz's promised preferences
> patches, can you include note that there are known bugs with pending
> fixes?  E.g. preference to switch between Buhlmann and VPM-B for profile
> display (patch by Robert or Tomaz), and not saving the planner settings (I
> believe there is a pending fix by Tomaz).

No, I'm still waiting for Tomaz to send these patches. Much as I'd like to
get the Beta out, it seems silly not to include fixes that apparently have
already been written and just not sent out, yet.

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


[PATCH]Re: binaries for Beta 1

2016-10-04 Thread Robert Helling
Hi,Am 04.10.2016 um 14:20 schrieb Robert Helling :indeed, yesterday’s patch was a stub. Here is something which is actually functional:<0001-Export-to-TeX-file-initialized.txt>I still need to learn how to write the profile to a png and how to use the taxonomy (see IRC).and another one: Now, thanks to glance, including the profile.BestRobertFrom f3d17af9c62b86b6b991937e630a330dd468997f Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" 
Date: Mon, 3 Oct 2016 17:08:02 +0200
Subject: [PATCH] Export to TeX file initialized
To: subsurface@subsurface-divelog.org

This does the basic export as a TeX file including a template.

It still lacks proper location parsing.

Signed-off-by: Robert C. Helling 
---
 desktop-widgets/divelogexportdialog.cpp | 86 +
 desktop-widgets/divelogexportdialog.h   |  1 +
 desktop-widgets/divelogexportdialog.ui  | 12 -
 subsurfacetemplate.tex  | 62 
 4 files changed, 160 insertions(+), 1 deletion(-)
 create mode 100644 subsurfacetemplate.tex

diff --git a/desktop-widgets/divelogexportdialog.cpp 
b/desktop-widgets/divelogexportdialog.cpp
index 5b58d0c..9d3d271 100644
--- a/desktop-widgets/divelogexportdialog.cpp
+++ b/desktop-widgets/divelogexportdialog.cpp
@@ -11,6 +11,8 @@
 #include "core/worldmap-save.h"
 #include "core/save-html.h"
 #include "desktop-widgets/mainwindow.h"
+#include "profile-widget/profilewidget2.h"
+
 
 #define GET_UNIT(name, field, f, t)   \
v = settings.value(QString(name));\
@@ -86,6 +88,8 @@ void DiveLogExportDialog::showExplanation()
ui->description->setText(tr("Subsurface native XML format."));
} else if (ui->exportImageDepths->isChecked()) {
ui->description->setText(tr("Write depths of images to file."));
+   } else if (ui->exportTeX->isChecked()) {
+   ui->description->setText(tr("Write dive as TeX macros to 
file."));
}
 }
 
@@ -162,6 +166,10 @@ void DiveLogExportDialog::on_buttonBox_accepted()
filename = QFileDialog::getSaveFileName(this, tr("Save 
image depths"), lastDir);
if (!filename.isNull() && !filename.isEmpty())
export_depths(filename.toUtf8().data(), 
ui->exportSelected->isChecked());
+   } else if (ui->exportTeX->isChecked()) {
+   filename = QFileDialog::getSaveFileName(this, 
tr("Export to TeX file"), lastDir, tr("TeX files (*.tex)"));
+   if (!filename.isNull() && !filename.isEmpty())
+   export_TeX(filename.toUtf8().data(), 
ui->exportSelected->isChecked());
}
break;
case 1:
@@ -223,3 +231,81 @@ void DiveLogExportDialog::export_depths(const char 
*filename, const bool selecte
}
free_buffer(&buf);
 }
+
+void DiveLogExportDialog::export_TeX(const char *filename, const bool 
selected_only)
+{
+   FILE *f;
+   struct dive *dive;
+   depth_t depth;
+   int i;
+   const char *unit = NULL;
+   bool need_pagebreak = false;
+
+   struct membuffer buf = {};
+
+   put_format(&buf, "\\input subsurfacetemplate\n");
+   put_format(&buf, "%% This is a plain TeX file. Compile with pdftex, not 
pdflatex!\n");
+   put_format(&buf, "%% You will also need a subsurfacetemplate.tex in the 
current directory.\n");
+   put_format(&buf, "%% You can downlaod an example from 
http://www.atdotde.de/~robert/subsurfacetemplate\n%%\n";);
+   for_each_dive (i, dive) {
+   if (selected_only && !dive->selected)
+   continue;
+
+   QString filename = "profile%1.png";
+   ProfileWidget2 *profile = MainWindow::instance()->graphics();
+   profile->plotDive(dive, true);
+   profile->setToolTipVisibile(false);
+   QPixmap pix = QPixmap::grabWidget(profile);
+   profile->setToolTipVisibile(true);
+   pix.save(filename.arg(dive->number));
+
+
+
+   struct tm tm;
+   utc_mkdate(dive->when, &tm);
+
+   dive_site *site = get_dive_site_by_uuid(dive->dive_site_uuid);;
+
+   pressure_t delta_p = {.mbar = 0};
+
+   QString star = "*";
+   QString viz = star.repeated(dive->visibility);
+   int i;
+
+   for (i = 0; i < MAX_CYLINDERS; i++)
+   if (is_cylinder_used(dive, i))
+   delta_p.mbar += dive->cylinder[i].start.mbar - 
dive->cylinder[i].end.mbar;
+
+   if (need_pagebreak)
+   put_format(&buf, "\\vfill\\eject\n");
+   need_pagebreak = true;
+   put_format(&buf, "\\def\\date{%04u-%02u-%02u}\n",
+ tm.tm_year, tm.tm_mon+1, tm.tm_mday);
+   put_format(&buf, "\\def\\number{%d}\n", dive->number);
+ 

Re: binaries for Beta 1

2016-10-04 Thread Robert Helling
Hi Dirk,Am 03.10.2016 um 21:50 schrieb Dirk Hohndel :Ummm. There is more TeX somewhere, right?indeed, yesterday’s patch was a stub. Here is something which is actually functional:From a3f76d92720a9ec817f73b571ae3a8a1c683d19e Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" 
Date: Mon, 3 Oct 2016 17:08:02 +0200
Subject: [PATCH] Export to TeX file initialized
To: subsurface@subsurface-divelog.org

This does the basic export as a TeX file including a template.

It still lacks proper location parsing and saving of the profile.

Signed-off-by: Robert C. Helling 
---
 desktop-widgets/divelogexportdialog.cpp | 87 +
 desktop-widgets/divelogexportdialog.h   |  1 +
 desktop-widgets/divelogexportdialog.ui  | 12 -
 subsurfacetemplate.tex  | 62 +++
 4 files changed, 161 insertions(+), 1 deletion(-)
 create mode 100644 subsurfacetemplate.tex

diff --git a/desktop-widgets/divelogexportdialog.cpp 
b/desktop-widgets/divelogexportdialog.cpp
index 5b58d0c..f39cdc9 100644
--- a/desktop-widgets/divelogexportdialog.cpp
+++ b/desktop-widgets/divelogexportdialog.cpp
@@ -86,6 +86,8 @@ void DiveLogExportDialog::showExplanation()
ui->description->setText(tr("Subsurface native XML format."));
} else if (ui->exportImageDepths->isChecked()) {
ui->description->setText(tr("Write depths of images to file."));
+   } else if (ui->exportTeX->isChecked()) {
+   ui->description->setText(tr("Write dive as TeX macros to 
file."));
}
 }
 
@@ -162,6 +164,10 @@ void DiveLogExportDialog::on_buttonBox_accepted()
filename = QFileDialog::getSaveFileName(this, tr("Save 
image depths"), lastDir);
if (!filename.isNull() && !filename.isEmpty())
export_depths(filename.toUtf8().data(), 
ui->exportSelected->isChecked());
+   } else if (ui->exportTeX->isChecked()) {
+   filename = QFileDialog::getSaveFileName(this, 
tr("Export to TeX file"), lastDir, tr("TeX files (*.tex)"));
+   if (!filename.isNull() && !filename.isEmpty())
+   export_TeX(filename.toUtf8().data(), 
ui->exportSelected->isChecked());
}
break;
case 1:
@@ -223,3 +229,84 @@ void DiveLogExportDialog::export_depths(const char 
*filename, const bool selecte
}
free_buffer(&buf);
 }
+
+void DiveLogExportDialog::export_TeX(const char *filename, const bool 
selected_only)
+{
+   FILE *f;
+   struct dive *dive;
+   depth_t depth;
+   int i;
+   const char *unit = NULL;
+   bool need_pagebreak = false;
+
+   struct membuffer buf = {};
+
+   put_format(&buf, "\\input subsurfacetemplate\n");
+   put_format(&buf, "%% This is a plain TeX file. Compile with pdftex, not 
pdflatex!\n");
+   put_format(&buf, "%% You will also need a subsurfacetemplate.tex in the 
current directory.\n");
+   put_format(&buf, "%% You can downlaod an example from 
http://www.atdotde.de/~robert/subsurfacetemplate\n%%\n";);
+   for_each_dive (i, dive) {
+   if (selected_only && !dive->selected)
+   continue;
+
+// This used to work, but does not anymore, since 
Mainwindow.instance()->graphics() is no longer a ProfileGraphicsView.
+// Probably similiar gymnasitics as in Printer::render(int Pages = 0) is 
needed, but I tried to immitate that without success.
+// Giving up for now.
+// Tomaz?!?
+// ProfileGraphicsView *profile = 
MainWindow.instance()->graphics();
+// profile->plot(dive,true);
+// QString fileName = "profile.png";
+// QPixmap pixmap = QPixmap::grabWidget(profile);
+// pixMap.save(fileName);
+
+
+
+   struct tm tm;
+   utc_mkdate(dive->when, &tm);
+
+   dive_site *site = get_dive_site_by_uuid(dive->dive_site_uuid);;
+
+   pressure_t delta_p = {.mbar = 0};
+
+   QString star = "*";
+   QString viz = star.repeated(dive->visibility);
+   int i;
+
+   for (i = 0; i < MAX_CYLINDERS; i++)
+   if (is_cylinder_used(dive, i))
+   delta_p.mbar += dive->cylinder[i].start.mbar - 
dive->cylinder[i].end.mbar;
+
+   if (need_pagebreak)
+   put_format(&buf, "\\vfill\\eject\n");
+   need_pagebreak = true;
+   put_format(&buf, "\\def\\date{%04u-%02u-%02u}\n",
+ tm.tm_year, tm.tm_mon+1, tm.tm_mday);
+   put_format(&buf, "\\def\\number{%d}\n", dive->number);
+   put_format(&buf, "\\def\\place{%s}\n", site->name);
+   put_format(&buf, "\\def\\spot{}\n");
+   put_format(&buf, "\\def\\country{}\n");
+   put_format(&buf, "\\def\\entrance{}\n");
+   

Re: binaries for Beta 1

2016-10-03 Thread Rick Walsh
Hi Dirk,

On 4 October 2016 at 06:43, Dirk Hohndel  wrote:

> On Mon, Oct 03, 2016 at 09:31:03PM +0200, Robert Helling wrote:
> > Dear friends,
> >
> > > Am 03.10.2016 um 18:06 schrieb Robert C. Helling <
> rob...@euve10195.vserver.de>:
> > >
> > > I have three patches on my laptop, one of which is a bugfix.  Will
> send tonight with proper internet connection. Hold the horses.
> >
> > back home, so here we go:
> >
> >
> >
> > These three patches are of different character:
> >
> > There is no 0001.
> >
> > 0002 is something I hacked so I can switch between Buehlmann and VPM-B
> > from the preferences (rather than just from the planner). It is a bit
> > rough (and should also grey out those preferences which do not apply to
> > the active model, to be added later). We should have something like
> > this, but this patch might need a bit more work and Tomaz promised
> > something along these lines anyway.
>
> So this should wait until after Beta 1?
>

If you plan on releasing Beta 1 prior to Tomaz's promised preferences
patches, can you include note that there are known bugs with pending
fixes?  E.g. preference to switch between Buhlmann and VPM-B for profile
display (patch by Robert or Tomaz), and not saving the planner settings (I
believe there is a pending fix by Tomaz).

Cheers,

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


Re: binaries for Beta 1

2016-10-03 Thread Dirk Hohndel
So I'm not opposed to adding this... but reading the code I can't help but
feel that this is a bit incomplete...

On Mon, Oct 03, 2016 at 09:31:03PM +0200, Robert Helling wrote:
> 
> diff --git a/desktop-widgets/divelogexportdialog.cpp 
> b/desktop-widgets/divelogexportdialog.cpp
> index 5b58d0c..395c494 100644
> --- a/desktop-widgets/divelogexportdialog.cpp
> +++ b/desktop-widgets/divelogexportdialog.cpp
> @@ -86,6 +86,8 @@ void DiveLogExportDialog::showExplanation()
>   ui->description->setText(tr("Subsurface native XML format."));
>   } else if (ui->exportImageDepths->isChecked()) {
>   ui->description->setText(tr("Write depths of images to file."));
> + } else if (ui->exportTeX->isChecked()) {
> + ui->description->setText(tr("Write dive as TeX macros to 
> file."));
>   }
>  }
>  
> @@ -162,6 +164,10 @@ void DiveLogExportDialog::on_buttonBox_accepted()
>   filename = QFileDialog::getSaveFileName(this, tr("Save 
> image depths"), lastDir);
>   if (!filename.isNull() && !filename.isEmpty())
>   export_depths(filename.toUtf8().data(), 
> ui->exportSelected->isChecked());
> + } else if (ui->exportTeX->isChecked()) {
> + filename = QFileDialog::getSaveFileName(this, 
> tr("Export to TeX file"), lastDir, tr("TeX files(*.tex)"));
> + if (!filename.isNull() && !filename.isEmpty())
> + export_TeX(filename.toUtf8().data(), 
> ui->exportSelected->isChecked());
>   }
>   break;
>   case 1:

OK, so we add the UI handling

> @@ -223,3 +229,30 @@ void DiveLogExportDialog::export_depths(const char 
> *filename, const bool selecte
>   }
>   free_buffer(&buf);
>  }
> +
> +void DiveLogExportDialog::export_TeX(const char *filename, const bool 
> selected_only)
> +{
> + FILE *f;
> + struct dive *dive;
> + depth_t depth;
> + int i;
> + const char *unit = NULL;
> +
> + struct membuffer buf = {};
> +
> + for_each_dive (i, dive) {
> + if (selected_only && !dive->selected)
> + continue;
> +
> + put_format(&buf, "\\number{%d}\n", dive->number);
> + }
> +
> + f = subsurface_fopen(filename, "w+");
> + if (!f) {
> + report_error(tr("Can't open file %s").toUtf8().data(), 
> filename);
> + } else {
> + flush_buffer(&buf, f); /*check for writing errors? */
> + fclose(f);
> + }
> + free_buffer(&buf);
> +}

We write the dive numbers.

> diff --git a/desktop-widgets/divelogexportdialog.h 
> b/desktop-widgets/divelogexportdialog.h
> index e7cde31..5d5ad14 100644
> --- a/desktop-widgets/divelogexportdialog.h
> +++ b/desktop-widgets/divelogexportdialog.h
> @@ -33,6 +33,7 @@ private:
>   void showExplanation();
>   void exportHtmlInit(const QString &filename);
>   void export_depths(const char *filename, const bool selected_only);
> + void export_TeX(const char *filename, const bool selected_only);
>  };
>  
>  #endif // DIVELOGEXPORTDIALOG_H
> diff --git a/desktop-widgets/divelogexportdialog.ui 
> b/desktop-widgets/divelogexportdialog.ui
> index 4713bf0..d01f817 100644
> --- a/desktop-widgets/divelogexportdialog.ui
> +++ b/desktop-widgets/divelogexportdialog.ui
> @@ -192,6 +192,16 @@
> 
>
>
> +   
> +
> + TeX
> +
> +
> + exportGroup
> +
> +   
> +  
> +  
> 
>  
>   I&mage depths

Add the UI


Ummm. There is more TeX somewhere, right?

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


Re: binaries for Beta 1

2016-10-03 Thread Dirk Hohndel
On Mon, Oct 03, 2016 at 09:31:03PM +0200, Robert Helling wrote:
> Dear friends,
> 
> > Am 03.10.2016 um 18:06 schrieb Robert C. Helling 
> > :
> > 
> > I have three patches on my laptop, one of which is a bugfix.  Will send 
> > tonight with proper internet connection. Hold the horses.
> 
> back home, so here we go:
> 
> 
> 
> These three patches are of different character:
> 
> There is no 0001.
> 
> 0002 is something I hacked so I can switch between Buehlmann and VPM-B
> from the preferences (rather than just from the planner). It is a bit
> rough (and should also grey out those preferences which do not apply to
> the active model, to be added later). We should have something like
> this, but this patch might need a bit more work and Tomaz promised
> something along these lines anyway.

So this should wait until after Beta 1?

> 0003 fixes a bug with the heat map when using VPM-B. The scale for the
> colors is set by the Buehlmann m-value, so we need to compute that even
> when not using Buehlmann. Yesterday, his bug was found by Willem.

This I'll look at and push now, before Beta 1

> 0004 is a stub for a CFD: Sometime ago, before starting with our
> template based printing, I had submitted some patches to print via TeX.
> Those were turned down because we don’t want to add TeX as a dependency,
> which I can understand. For my own use to print paper logbook pages, I
> kept rebasing this branch and use it for my own build. Now, I realized I
> presented this in the wrong way: This is not about printing. This should
> be presented as another file format we export to. There is no dependency
> to anything, this just writes a text file with data from the dive in the
> form of TeX macros. This can then be used to print out the dive, but
> only if the user wants to. So, philosophically, this is like many of the
> other exports: Those make only sense to use if the user has the other
> thing to reimport the data. This patch is only a stub with no real
> functionality (it exports only the dive number). The actual code to
> write TeX, I did not have with me when I wrote this earlier today on a
> train, but I will add this tomorrow if I don’t hear strong opinions to
> the opposite.

That makes sense to me. I guess I should just take this as well assuming
it doesn't break any existing functionality...

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


Re: binaries for Beta 1

2016-10-03 Thread Robert Helling
Dear friends,Am 03.10.2016 um 18:06 schrieb Robert C. Helling :I have three patches on my laptop, one of which is a bugfix.  Will send tonight with proper internet connection. Hold the horses.back home, so here we go:From 546d752a4379050eaa8d9056bf1b3b0de88d91e4 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" 
Date: Mon, 3 Oct 2016 16:25:48 +0200
Subject: [PATCH 2/5] Add preference to change deco model
To: subsurface@subsurface-divelog.org

Signed-off-by: Robert C. Helling 
---
 core/subsurface-qt/SettingsObjectWrapper.cpp  |  21 
 core/subsurface-qt/SettingsObjectWrapper.h|   4 +
 desktop-widgets/preferences/preferences_graph.cpp |  17 +++
 desktop-widgets/preferences/preferences_graph.h   |   3 +-
 desktop-widgets/preferences/preferences_graph.ui  | 123 --
 5 files changed, 114 insertions(+), 54 deletions(-)

diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp 
b/core/subsurface-qt/SettingsObjectWrapper.cpp
index 437bf7f..8303afa 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -299,6 +299,11 @@ bool TechnicalDetailsSettings::calcndltts() const
return prefs.calcndltts;
 }
 
+bool TechnicalDetailsSettings::buehlmann() const
+{
+   return (prefs.deco_mode == BUEHLMANN);
+}
+
 int TechnicalDetailsSettings::gflow() const
 {
return prefs.gflow;
@@ -499,6 +504,17 @@ void TechnicalDetailsSettings::setCalcndltts(bool value)
emit calcndlttsChanged(value);
 }
 
+void TechnicalDetailsSettings::setBuehlmann(bool value)
+{
+   if (value == (prefs.deco_mode == BUEHLMANN))
+   return;
+   QSettings s;
+   s.beginGroup(group);
+   s.setValue("buehlmann", value);
+   prefs.deco_mode = value ? BUEHLMANN : VPMB;
+   emit buehlmannChanged(value);
+}
+
 void TechnicalDetailsSettings::setGflow(int value)
 {
if (value == prefs.gflow)
@@ -2105,6 +2121,11 @@ void SettingsObjectWrapper::load()
GET_BOOL("tankbar", tankbar);
GET_BOOL("RulerBar", rulergraph);
GET_BOOL("percentagegraph", percentagegraph);
+   v = s.value("buehlmann");
+   if (v.isValid())
+   prefs.deco_mode = v.toBool() ? BUEHLMANN : VPMB;
+   else
+   prefs.deco_mode = BUEHLMANN;
GET_INT("gflow", gflow);
GET_INT("gfhigh", gfhigh);
GET_INT("vpmb_conservatism", vpmb_conservatism);
diff --git a/core/subsurface-qt/SettingsObjectWrapper.h 
b/core/subsurface-qt/SettingsObjectWrapper.h
index 1ab3208..8097fc3 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.h
+++ b/core/subsurface-qt/SettingsObjectWrapper.h
@@ -116,6 +116,7 @@ class TechnicalDetailsSettings : public QObject {
Q_PROPERTY(bool calcceiling3mREAD calcceiling3m   WRITE 
setCalcceiling3m   NOTIFY calcceiling3mChanged)
Q_PROPERTY(bool calcalltissues   READ calcalltissues  WRITE 
setCalcalltissues  NOTIFY calcalltissuesChanged)
Q_PROPERTY(bool calcndltts   READ calcndltts  WRITE 
setCalcndltts  NOTIFY calcndlttsChanged)
+   Q_PROPERTY(bool buehlmannREAD buehlmann   WRITE 
setBuehlmann   NOTIFY buehlmannChanged)
Q_PROPERTY(int gflowREAD gflow   WRITE setGflow 
  NOTIFY gflowChanged)
Q_PROPERTY(int gfhigh   READ gfhigh  WRITE setGfhigh
  NOTIFY gfhighChanged)
Q_PROPERTY(short vpmb_conservatism READ vpmbConservatism WRITE 
setVpmbConservatism NOTIFY vpmbConservatismChanged)
@@ -143,6 +144,7 @@ public:
bool calcceiling3m() const;
bool calcalltissues() const;
bool calcndltts() const;
+   bool buehlmann() const;
int gflow() const;
int gfhigh() const;
short vpmbConservatism() const;
@@ -169,6 +171,7 @@ public slots:
void setCalcceiling3m(bool value);
void setCalcalltissues(bool value);
void setCalcndltts(bool value);
+   void setBuehlmann(bool value);
void setGflow(int value);
void setGfhigh(int value);
void setVpmbConservatism(short);
@@ -195,6 +198,7 @@ signals:
void calcceiling3mChanged(bool value);
void calcalltissuesChanged(bool value);
void calcndlttsChanged(bool value);
+   void buehlmannChanged(bool value);
void gflowChanged(int value);
void gfhighChanged(int value);
void vpmbConservatismChanged(short value);
diff --git a/desktop-widgets/preferences/preferences_graph.cpp 
b/desktop-widgets/preferences/preferences_graph.cpp
index c13915e..8f3e5e7 100644
--- a/desktop-widgets/preferences/preferences_graph.cpp
+++ b/desktop-widgets/preferences/preferences_graph.cpp
@@ -25,6 +25,13 @@ void PreferencesGraph::refreshSettings()
ui->maxpo2->setValue(prefs.modpO2);
ui->red_ceiling->setChecked(prefs.redceiling);
 
+   if (prefs.deco_mode == BUEHLMANN) {
+   ui->buehlmann->setChecked(true);
+   ui->vpm

Re: binaries for Beta 1

2016-10-03 Thread Adric Norris
The 4.5.95 AppImage is able to access cloud storage normally on Ubuntu
16.04.1 (Xenial). :) This is the only outstanding issue I had encountered
with the previous build, and thus far everything else seems to be working
as expected.

I'll spend some time playing with the Linux and Windows builds tonight.

On Mon, Oct 3, 2016 at 10:46 AM, Dirk Hohndel  wrote:

> In downloads/daily are Linux/Mac/Windows binaries for 4.6 Beta 1.
>
> I'd appreciate if people could give them some more testing. I haven't
> pushed the tag, yet, so if we find anything stupid we can still fix it
> before I officially release Beta 1 :-)
>
> /D
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>



-- 
"In the beginning the Universe was created. This has made a lot of people
very angry and been widely regarded as a bad move." -Douglas Adams
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: binaries for Beta 1

2016-10-03 Thread Robert C. Helling
Hi,

> Am 03.10.2016 um 17:46 schrieb Dirk Hohndel :
> 
> In downloads/daily are Linux/Mac/Windows binaries for 4.6 Beta 1.
> 
> I'd appreciate if people could give them some more testing. I haven't
> pushed the tag, yet, so if we find anything stupid we can still fix it
> before I officially release Beta 1 :-)
> 
> /D
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

I have three patches on my laptop, one of which is a bugfix.  Will send tonight 
with proper internet connection. Hold the horses.

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