[Pkg-running-devel] [openambit] 92/131: added logDetail view, partially adresses #19

Christian Perrier bubulle at moszumanska.debian.org
Thu Jul 17 20:19:14 UTC 2014


This is an automated email from the git hooks/post-receive script.

bubulle pushed a commit to branch master
in repository openambit.

commit 67ac68a0cee0cc3d95c2e1f4f109d5f6eb8ef295
Author: Marco Bernasocchi <marco at opengis.ch>
Date:   Tue Feb 25 20:52:17 2014 +0100

    added logDetail view, partially adresses #19
---
 src/openambit/logentry.cpp   | 41 +++++++++++++++++++++++++++++++++++++++++
 src/openambit/logentry.h     |  3 +++
 src/openambit/mainwindow.cpp |  1 +
 src/openambit/mainwindow.ui  | 16 +++++-----------
 4 files changed, 50 insertions(+), 11 deletions(-)

diff --git a/src/openambit/logentry.cpp b/src/openambit/logentry.cpp
index 57131a6..351585f 100644
--- a/src/openambit/logentry.cpp
+++ b/src/openambit/logentry.cpp
@@ -136,3 +136,44 @@ LogEntry::~LogEntry()
 
     logEntry = NULL;
 }
+
+bool LogEntry::isUploaded(){
+    if (this->movescountId == NULL){
+        return false;
+    }
+    return true;
+}
+
+QString LogEntry::toHtml(){
+    QString log_html;
+
+    log_html += "<h1>" + QString(this->logEntry->header.activity_name) + "</h1>";
+    if (this->isUploaded()){
+        log_html += "<a href='http://www.movescount.com/moves/move" + this->movescountId + "'>see on movescount.com</a>";
+    }
+    else {
+        log_html += "Not uploaded yet";
+    }
+    log_html += "<h2>Details</h2>";
+    log_html += "<h4>" + this->time.toString() + "</h4>";
+    log_html += "<h4>Duration: " + QTime(0, 0, 0,0 ).addMSecs(this->logEntry->header.duration).toString("HH:mm:ss") + "</h4>";
+    log_html += "<h4>Distance: " + QString::number(this->logEntry->header.distance) + " m</h4>";
+    log_html += "<h2>Training values</h2>";
+    log_html += "<h4>Avg HR: " + QString::number(this->logEntry->header.heartrate_avg) + " bpm</h4>";
+    log_html += "<h4>Max HR: " + QString::number(this->logEntry->header.heartrate_max) + " bpm</h4>";
+    log_html += "<h4>Min HR: " + QString::number(this->logEntry->header.heartrate_min) + " bpm</h4>";
+    log_html += "<h4>PTE: " + QString::number(this->logEntry->header.peak_training_effect/10.0) + "</h4>";
+    log_html += "<h2>Device</h2>";
+    log_html += "<h4>Name: " + QString(this->deviceInfo->name) + "</h4>";
+    log_html += "<h4>Variant: " + QString(this->deviceInfo->model) + "</h4>";
+    log_html += "<h4>Serial: " + QString(this->deviceInfo->serial) + "</h4>";
+    //log_string += "Device info: " + QString::number(this->deviceInfo->fw_version) + "\n";
+    //log_string += "Device info: " + QString::number(this->deviceInfo->hw_version) + "\n";
+
+    //log_string += "Personal Settings: " + this->personalSettings + "\n";
+
+
+    return log_html;
+}
+
+
diff --git a/src/openambit/logentry.h b/src/openambit/logentry.h
index 73f08c4..7ed148f 100644
--- a/src/openambit/logentry.h
+++ b/src/openambit/logentry.h
@@ -34,6 +34,9 @@ public:
 
     LogEntry& operator=(const LogEntry &rhs);
 
+    QString toHtml();
+    bool isUploaded();
+
     QString device;
     QDateTime time;
     QString movescountId;
diff --git a/src/openambit/mainwindow.cpp b/src/openambit/mainwindow.cpp
index d91fa81..0c8af67 100644
--- a/src/openambit/mainwindow.cpp
+++ b/src/openambit/mainwindow.cpp
@@ -382,6 +382,7 @@ void MainWindow::logItemSelected(QListWidgetItem *current,QListWidgetItem *previ
 
     if (current != NULL) {
         logEntry = logStore.read(current->data(Qt::UserRole).toString());
+        ui->logDetail->setHtml(logEntry->toHtml());
 
         delete logEntry;
     }
diff --git a/src/openambit/mainwindow.ui b/src/openambit/mainwindow.ui
index 4308c32..83f0215 100644
--- a/src/openambit/mainwindow.ui
+++ b/src/openambit/mainwindow.ui
@@ -30,17 +30,11 @@
      </widget>
     </item>
     <item>
-     <spacer name="horizontalSpacer">
-      <property name="orientation">
-       <enum>Qt::Horizontal</enum>
+     <widget class="QTextBrowser" name="logDetail">
+      <property name="openExternalLinks">
+       <bool>true</bool>
       </property>
-      <property name="sizeHint" stdset="0">
-       <size>
-        <width>40</width>
-        <height>20</height>
-       </size>
-      </property>
-     </spacer>
+     </widget>
     </item>
     <item>
      <widget class="QWidget" name="deviceSyncWidget" native="true">
@@ -337,7 +331,7 @@
      <x>0</x>
      <y>0</y>
      <width>872</width>
-     <height>21</height>
+     <height>25</height>
     </rect>
    </property>
    <widget class="QMenu" name="menuOpenambit">

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-running/openambit.git



More information about the Pkg-running-devel mailing list