a batch of a few simple patches here.

For the 0003, I couldn't catch the usage of the progress_text_bar. I
don't think it will interfere on error handling, but a second look would
be good.

--
Danilo Cesar
From 618044af75a75003036fc35d79df30cfbae79676 Mon Sep 17 00:00:00 2001
From: Danilo Cesar Lemes de Paula <[email protected]>
Date: Wed, 26 Feb 2014 13:37:13 -0300
Subject: [PATCH 3/3] reseting progress_bar_text for new downloads

if the user tries to redownload something from its dive computer
the interface will be stuck since progress_bar_text won't be empty in
the second run.

Even if I don't really like this idea of that value being changed by
downloadfromdivecomputer.cpp and libdivecomputer.c, that value needs to
be reset by someone.

Signed-off-by: Danilo Cesar Lemes de Paula <[email protected]>
---
 qt-ui/downloadfromdivecomputer.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp
index d8a49e7..69d42d9 100644
--- a/qt-ui/downloadfromdivecomputer.cpp
+++ b/qt-ui/downloadfromdivecomputer.cpp
@@ -51,6 +51,8 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget* parent, Qt::WindowFlags f) :
 	ui.progressBar->setMinimum(0);
 	ui.progressBar->setMaximum(100);
 
+	progress_bar_text = "";
+
 	fill_device_list();
 	fill_computer_list();
 
-- 
1.9.0

From 2e61a4cd88aa7ac465b41eb7d9e604bf5783df45 Mon Sep 17 00:00:00 2001
From: Danilo Cesar Lemes de Paula <[email protected]>
Date: Wed, 26 Feb 2014 10:34:16 -0300
Subject: [PATCH 2/3] set the download progress bar to zero after a download

Before that, the behaviour was that in case of an error or a
re-download, the progress bar would appear for a few milliseconds with
the old value.

Signed-off-by: Danilo Cesar Lemes de Paula <[email protected]>
---
 libdivecomputer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libdivecomputer.c b/libdivecomputer.c
index 7cc3894..9f4f545 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -710,8 +710,10 @@ static const char *do_device_import(device_data_t *data)
 		rc = dc_device_foreach(device, dive_cb, data);
 	}
 
-	if (rc != DC_STATUS_SUCCESS)
+	if (rc != DC_STATUS_SUCCESS) {
+		progress_bar_fraction = 0.0;
 		return translate("gettextFromC","Dive data import error");
+	}
 
 	/* All good */
 	return NULL;
-- 
1.9.0

From 038beddd2f01469c50328e17a7d01c2cce8086a5 Mon Sep 17 00:00:00 2001
From: Danilo Cesar Lemes de Paula <[email protected]>
Date: Sat, 22 Feb 2014 11:44:50 -0300
Subject: [PATCH 1/3] disable buttons while downloading

Simple patch to enable/disable extra buttons while downloading.
The UI should be blocked during the download.

Signed-off-by: Danilo Cesar Lemes de Paula <[email protected]>
---
 qt-ui/downloadfromdivecomputer.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp
index 87eb501..d8a49e7 100644
--- a/qt-ui/downloadfromdivecomputer.cpp
+++ b/qt-ui/downloadfromdivecomputer.cpp
@@ -390,6 +390,10 @@ void DownloadFromDCWidget::markChildrenAsDisabled()
 	ui.preferDownloaded->setDisabled(true);
 	ui.ok->setDisabled(true);
 	ui.search->setDisabled(true);
+	ui.logToFile->setDisabled(true);
+	ui.dumpToFile->setDisabled(true);
+	ui.chooseLogFile->setDisabled(true);
+	ui.chooseDumpFile->setDisabled(true);
 }
 
 void DownloadFromDCWidget::markChildrenAsEnabled()
@@ -402,6 +406,10 @@ void DownloadFromDCWidget::markChildrenAsEnabled()
 	ui.ok->setDisabled(false);
 	ui.cancel->setDisabled(false);
 	ui.search->setDisabled(false);
+	ui.logToFile->setDisabled(false);
+	ui.dumpToFile->setDisabled(false);
+	ui.chooseLogFile->setDisabled(false);
+	ui.chooseDumpFile->setDisabled(false);
 }
 
 static void fillDeviceList(const char *name, void *data)
-- 
1.9.0

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
subsurface mailing list
[email protected]
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to