aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/divelistview.cpp6
-rw-r--r--qt-ui/maintab.cpp3
-rw-r--r--qt-ui/mainwindow.cpp14
-rw-r--r--qt-ui/mainwindow.h1
-rw-r--r--qt-ui/profile/profilewidget2.cpp4
-rw-r--r--qt-ui/profile/profilewidget2.h2
-rw-r--r--qt-ui/subsurfacewebservices.cpp20
7 files changed, 37 insertions, 13 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp
index 2ee5f5dcd..90d0b4627 100644
--- a/qt-ui/divelistview.cpp
+++ b/qt-ui/divelistview.cpp
@@ -22,6 +22,7 @@
#include "divelistview.h"
#include "divepicturemodel.h"
#include "metrics.h"
+#include "helpers.h"
// # Date Rtg Dpth Dur Tmp Wght Suit Cyl Gas SAC OTU CNS Loc
static int defaultWidth[] = { 70, 140, 90, 50, 50, 50, 50, 70, 50, 50, 70, 50, 50, 500};
@@ -575,12 +576,12 @@ static bool can_merge(const struct dive *a, const struct dive *b, enum asked_use
if (a->when > b->when)
return false;
/* Don't merge dives if there's more than half an hour between them */
- if (a->when + a->duration.seconds + 30 * 60 < b->when) {
+ if (dive_endtime(a) + 30 * 60 < b->when) {
if (*have_asked == NOTYET) {
if (QMessageBox::warning(MainWindow::instance(),
MainWindow::instance()->tr("Warning"),
MainWindow::instance()->tr("Trying to merge dives with %1min interval in between").arg(
- (b->when - a->when - a->duration.seconds) / 60),
+ (b->when - dive_endtime(a)) / 60),
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Cancel) {
*have_asked = DONTMERGE;
return false;
@@ -611,6 +612,7 @@ void DiveListView::mergeDives()
}
}
}
+ MainWindow::instance()->refreshProfile();
MainWindow::instance()->refreshDisplay();
}
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index d1b635095..f9aeabd0d 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -736,7 +736,8 @@ void MainTab::updateDiveInfo(bool clear)
else
ui.cylinders->view()->hideColumn(CylindersModel::USE);
- qDebug() << "Set the current dive site:" << displayed_dive.dive_site_uuid;
+ if (verbose)
+ qDebug() << "Set the current dive site:" << displayed_dive.dive_site_uuid;
emit diveSiteChanged(get_dive_site_by_uuid(displayed_dive.dive_site_uuid));
}
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 1678cd6d4..9feb8f684 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -648,15 +648,19 @@ bool MainWindow::plannerStateClean()
return true;
}
+void MainWindow::refreshProfile()
+{
+ showProfile();
+ graphics()->replot(get_dive(selected_dive));
+ DivePictureModel::instance()->updateDivePictures();
+}
+
void MainWindow::planCanceled()
{
// while planning we might have modified the displayed_dive
// let's refresh what's shown on the profile
- showProfile();
- graphics()->replot();
+ refreshProfile();
refreshDisplay(false);
- graphics()->plotDive(get_dive(selected_dive));
- DivePictureModel::instance()->updateDivePictures();
}
void MainWindow::planCreated()
@@ -1570,6 +1574,7 @@ void MainWindow::loadFiles(const QStringList fileNames)
QByteArray fileNamePtr;
QStringList failedParses;
+ showProgressBar();
for (int i = 0; i < fileNames.size(); ++i) {
int error;
@@ -1588,6 +1593,7 @@ void MainWindow::loadFiles(const QStringList fileNames)
failedParses.append(fileNames.at(i));
}
}
+ hideProgressBar();
if (!showWarning)
getNotificationWidget()->hideNotification();
process_dives(false, false);
diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h
index 9ff2a2041..25c9b3eba 100644
--- a/qt-ui/mainwindow.h
+++ b/qt-ui/mainwindow.h
@@ -189,6 +189,7 @@ slots:
void refreshDisplay(bool doRecreateDiveList = true);
void recreateDiveList();
void showProfile();
+ void refreshProfile();
void editCurrentDive();
void planCanceled();
void planCreated();
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index 514edcfc5..5b7c3832a 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -342,12 +342,12 @@ void ProfileWidget2::setupItemOnScene()
replotEnabled = true;
}
-void ProfileWidget2::replot()
+void ProfileWidget2::replot(struct dive *d)
{
if (!replotEnabled)
return;
dataModel->clear();
- plotDive(0, true); // simply plot the displayed_dive again
+ plotDive(d, true);
}
void ProfileWidget2::setupItemSizes()
diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h
index 1127b8498..7e038edc3 100644
--- a/qt-ui/profile/profilewidget2.h
+++ b/qt-ui/profile/profilewidget2.h
@@ -109,7 +109,7 @@ slots: // Necessary to call from QAction's signals.
void pointsRemoved(const QModelIndex &, int start, int end);
void plotPictures();
void setReplot(bool state);
- void replot();
+ void replot(dive *d = 0);
/* this is called for every move on the handlers. maybe we can speed up this a bit? */
void recreatePlannedDive();
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index e2e3b3e78..c34ddd7bf 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -1069,8 +1069,22 @@ void CloudStorageAuthenticate::uploadError(QNetworkReply::NetworkError error)
void CloudStorageAuthenticate::sslErrors(QList<QSslError> errorList)
{
- qDebug() << "Received error response trying to set up https connection with cloud storage backend:";
- Q_FOREACH (QSslError err, errorList) {
- qDebug() << err.errorString();
+ if (verbose) {
+ qDebug() << "Received error response trying to set up https connection with cloud storage backend:";
+ Q_FOREACH (QSslError err, errorList) {
+ qDebug() << err.errorString();
+ }
+ }
+ QSslConfiguration conf = reply->sslConfiguration();
+ QSslCertificate cert = conf.peerCertificate();
+ QByteArray hexDigest = cert.digest().toHex();
+ if (reply->url().toString().contains(prefs.cloud_base_url) &&
+ hexDigest == "13ff44c62996cfa5cd69d6810675490e") {
+ if (verbose)
+ qDebug() << "Overriding SSL check as I recognize the certificate digest" << hexDigest;
+ reply->ignoreSslErrors();
+ } else {
+ if (verbose)
+ qDebug() << "got invalid SSL certificate with hex digest" << hexDigest;
}
}