Re: GSoC Status - Week 3 (Android Port)

2015-06-21 Thread Grace Karanja
On Sun, Jun 21, 2015 at 12:53 AM, Dirk Hohndel d...@hohndel.org wrote:

 On Thu, Jun 18, 2015 at 06:26:51PM +0300, Grace Karanja wrote:
  On Sun, Jun 14, 2015 at 11:55 PM, Tomaz Canabrava tcanabr...@kde.org
  wrote:
 
   Grace, always do a rebase from master so your work is not hard to merge
   later.
   I'm doing the review right now.
  
  
  
  Here are patches containing the work done so far.
 
  To compile the mobile executable, call cmake with
 -DSUBSURFACE_MOBILE=True.
  This
  will result in a subsurface-mobile executable.

 Grace,

 this is really good work. I have only tried it on the desktop as there is
 no infrastructure to build for Android, yet, but it clearly goes in the
 right direction.

Thanks!


 There are two things that I would like to see

 a) having a File menu is of course a desktop thing - why would you do this
 in a mobile app. So let's get rid of this and instead show a big button
 that offers to open a data file

 b) but then, of course, the idea of working with a file on a mobile
 device is IMHO wrong to begin with. Could you instead implement a
 preferences dialog where the user can enter their email address and
 password and then have a button Open cloud storage which does just that?
 I think that would be a lot more realistic for a mobile app.

 But overall this is a great start, please keep up the good work!


I will implement it this week.



 /D




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


Re: GSoC Status - Week 3 (Android Port)

2015-06-20 Thread Dirk Hohndel
On Thu, Jun 18, 2015 at 06:26:51PM +0300, Grace Karanja wrote:
 On Sun, Jun 14, 2015 at 11:55 PM, Tomaz Canabrava tcanabr...@kde.org
 wrote:
 
  Grace, always do a rebase from master so your work is not hard to merge
  later.
  I'm doing the review right now.
 
 
 
 Here are patches containing the work done so far.
 
 To compile the mobile executable, call cmake with -DSUBSURFACE_MOBILE=True.
 This
 will result in a subsurface-mobile executable.

Grace,

this is really good work. I have only tried it on the desktop as there is
no infrastructure to build for Android, yet, but it clearly goes in the
right direction.

There are two things that I would like to see

a) having a File menu is of course a desktop thing - why would you do this
in a mobile app. So let's get rid of this and instead show a big button
that offers to open a data file

b) but then, of course, the idea of working with a file on a mobile
device is IMHO wrong to begin with. Could you instead implement a
preferences dialog where the user can enter their email address and
password and then have a button Open cloud storage which does just that?
I think that would be a lot more realistic for a mobile app.

But overall this is a great start, please keep up the good work!

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


Re: GSoC Status - Week 3 (Android Port)

2015-06-19 Thread Tomaz Canabrava
Dirk, Series Acked.

On Thu, Jun 18, 2015 at 12:30 PM, Tomaz Canabrava tcanabr...@kde.org
wrote:

 Dirk,
 I'll do a proof read of them before you can apply
 wait for my ack.

 On Thu, Jun 18, 2015 at 12:26 PM, Grace Karanja 
 gracie.karanj...@gmail.com wrote:



 On Sun, Jun 14, 2015 at 11:55 PM, Tomaz Canabrava tcanabr...@kde.org
 wrote:

 Grace, always do a rebase from master so your work is not hard to merge
 later.
 I'm doing the review right now.



 Here are patches containing the work done so far.

 To compile the mobile executable, call cmake with
 -DSUBSURFACE_MOBILE=True. This
 will result in a subsurface-mobile executable.



 --
 --
 Grace K



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


Re: GSoC Status - Week 3 (Android Port)

2015-06-18 Thread Grace Karanja
On Sun, Jun 14, 2015 at 11:55 PM, Tomaz Canabrava tcanabr...@kde.org
wrote:

 Grace, always do a rebase from master so your work is not hard to merge
 later.
 I'm doing the review right now.



Here are patches containing the work done so far.

To compile the mobile executable, call cmake with -DSUBSURFACE_MOBILE=True.
This
will result in a subsurface-mobile executable.



-- 
--
Grace K
From faf064b4b7e8b7b931e84ff2f3995a5169e1ac61 Mon Sep 17 00:00:00 2001
From: Grace Karanja gracie.karanj...@gmail.com
Date: Thu, 18 Jun 2015 09:13:30 +0300
Subject: [PATCH 21/22] Display more details

Show more dive info in the extended view of the dive.

Signed-off-by: Grace Karanja gracie.karanj...@gmail.com
---
 qt-mobile/main.qml | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/qt-mobile/main.qml b/qt-mobile/main.qml
index e257477..8af0a9e 100644
--- a/qt-mobile/main.qml
+++ b/qt-mobile/main.qml
@@ -107,7 +107,13 @@ ApplicationWindow {
 		contentHeight: detailsView.height
 		clip: true
 		Row {
-			Text { text: 'bNotes:/bbr/' + notes; wrapMode: Text.WordWrap; width: details.width }
+			Text { text:
+'bLocation: /b' + location +
+'brbAir temp: /b' + airtemp + ' b Water temp: /b' + watertemp +
+'brbSuit: /b' + suit +
+'brbBuddy: /b' + buddy +
+'brbDive Master: /b' + divemaster +
+'br/bNotes:/bbr/' + notes; wrapMode: Text.WordWrap; width: details.width }
 		}
 	}
 }
-- 
2.4.4

From 49d59bdf3d4f61fc45f9dcb994d18715705c08f6 Mon Sep 17 00:00:00 2001
From: Grace Karanja gracie.karanj...@gmail.com
Date: Thu, 18 Jun 2015 09:12:52 +0300
Subject: [PATCH 20/22] Add more dive details to the DiveListModel

Add some more details to the model.

Signed-off-by: Grace Karanja gracie.karanj...@gmail.com
---
 qt-models/divelistmodel.cpp | 80 +
 qt-models/divelistmodel.h   | 27 ---
 2 files changed, 88 insertions(+), 19 deletions(-)

diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp
index ad36096..add5af5 100644
--- a/qt-models/divelistmodel.cpp
+++ b/qt-models/divelistmodel.cpp
@@ -17,13 +17,7 @@ Dive::Dive(dive *d)
 	setDepth(get_depth_string(d-maxdepth));
 	setDuration(get_dive_duration_string(d-duration.seconds, h:,min));
 
-	if (!d-watertemp.mkelvin)
-		m_depth = ;
-
-	if (get_units()-temperature == units::CELSIUS)
-		m_depth = QString::number(mkelvin_to_C(d-watertemp.mkelvin), 'f', 1);
-	else
-		m_depth = QString::number(mkelvin_to_F(d-watertemp.mkelvin), 'f', 1);
+	setupDiveTempDetails();
 
 	weight_t tw = { total_weight(d) };
 	setWeight(weight_string(tw.grams));
@@ -33,6 +27,8 @@ Dive::Dive(dive *d)
 	setSac(QString::number(d-sac));
 	setLocation(get_dive_location(d));
 	setNotes(d-notes);
+	setBuddy(d-buddy);
+	setDivemaster(d-divemaster);
 }
 
 QString Dive::date() const
@@ -98,14 +94,14 @@ void Dive::setWeight(const QString weight)
 {
 	m_weight = weight;
 }
-QString Dive::temp() const
+QString Dive::airtemp() const
 {
-	return m_temp;
+	return m_airtemp;
 }
 
-void Dive::setTemp(const QString temp)
+void Dive::setAirTemp(const QString airtemp)
 {
-	m_temp = temp;
+	m_airtemp = airtemp;
 }
 QString Dive::duration() const
 {
@@ -170,6 +166,53 @@ void Dive::setTrip(const QString trip)
 {
 	m_trip = trip;
 }
+QString Dive::buddy() const
+{
+return m_buddy;
+}
+
+void Dive::setBuddy(const QString buddy)
+{
+m_buddy = buddy;
+}
+QString Dive::divemaster() const
+{
+return m_divemaster;
+}
+
+void Dive::setDivemaster(const QString divemaster)
+{
+m_divemaster = divemaster;
+}
+QString Dive::watertemp() const
+{
+	return m_watertemp;
+}
+
+void Dive::setWatertemp(const QString watertemp)
+{
+	m_watertemp = watertemp;
+}
+
+void Dive::setupDiveTempDetails()
+{
+	const char *unit;
+	double d_airTemp, d_waterTemp;
+
+	d_airTemp = get_temp_units(m_thisDive-airtemp.mkelvin, unit);
+	d_waterTemp = get_temp_units(m_thisDive-watertemp.mkelvin, unit);
+
+	setAirTemp(QString::number(d_airTemp) + unit);
+	setWatertemp(QString::number(d_waterTemp) + unit);
+
+	if (!m_thisDive-airtemp.mkelvin)
+		setAirTemp();
+
+	if (!m_thisDive-watertemp.mkelvin)
+		setWatertemp();
+}
+
+
 
 
 
@@ -212,8 +255,10 @@ QVariant DiveListModel::data(const QModelIndex index, int role) const
 		return dive.depth();
 	else if (role == DiveDurationRole)
 		return dive.duration();
-	else if (role == DiveTemperatureRole)
-		return dive.temp();
+	else if (role == DiveAirTemperatureRole)
+		return dive.airtemp();
+	else if (role == DiveWaterTemperatureRole)
+		return dive.watertemp();
 	else if (role == DiveWeightRole)
 		return dive.weight();
 	else if (role == DiveSuitRole)
@@ -228,6 +273,10 @@ QVariant DiveListModel::data(const QModelIndex index, int role) const
 		return dive.location();
 	else if (role == DiveNotesRole)
 		return dive.notes();
+	else if (role == DiveBuddyRole)
+		return dive.buddy();
+	else if (role == DiveMasterRole)
+		return 

Re: GSoC Status - Week 3 (Android Port)

2015-06-18 Thread Tomaz Canabrava
Dirk,
I'll do a proof read of them before you can apply
wait for my ack.

On Thu, Jun 18, 2015 at 12:26 PM, Grace Karanja gracie.karanj...@gmail.com
wrote:



 On Sun, Jun 14, 2015 at 11:55 PM, Tomaz Canabrava tcanabr...@kde.org
 wrote:

 Grace, always do a rebase from master so your work is not hard to merge
 later.
 I'm doing the review right now.



 Here are patches containing the work done so far.

 To compile the mobile executable, call cmake with
 -DSUBSURFACE_MOBILE=True. This
 will result in a subsurface-mobile executable.



 --
 --
 Grace K

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


GSoC Status - Week 3 (Android Port)

2015-06-14 Thread Grace Karanja
Hello everyone,

This past week, I managed to: -

 - Enhance the displaying of the dive log, grouped in trips
 - Add the ability to tap on a dive and display some basic details.

Now I am focussing on adding more details to the dive info page and
also the ability to edit and save dive details.

Once Tomaz approves my work, I think, what I have done so far is ready
for master.

My code is at: https://github.com/gracie89/subsurface, in the devel branch.

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


Re: GSoC Status - Week 3 (Android Port)

2015-06-14 Thread Tomaz Canabrava
Grace, always do a rebase from master so your work is not hard to merge
later.
I'm doing the review right now.

On Sun, Jun 14, 2015 at 10:51 AM, Grace Karanja gracie.karanj...@gmail.com
wrote:

 Hello everyone,

 This past week, I managed to: -

  - Enhance the displaying of the dive log, grouped in trips
  - Add the ability to tap on a dive and display some basic details.

 Now I am focussing on adding more details to the dive info page and
 also the ability to edit and save dive details.

 Once Tomaz approves my work, I think, what I have done so far is ready
 for master.

 My code is at: https://github.com/gracie89/subsurface, in the devel
 branch.

 --
 Grace K

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