summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/divelistview.cpp8
-rw-r--r--qt-ui/divelistview.h1
-rw-r--r--qt-ui/subsurfacewebservices.h3
3 files changed, 11 insertions, 1 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp
index a1c4cf7fc..06b691c17 100644
--- a/qt-ui/divelistview.cpp
+++ b/qt-ui/divelistview.cpp
@@ -8,6 +8,7 @@
#include "models.h"
#include "modeldelegates.h"
#include "mainwindow.h"
+#include "subsurfacewebservices.h"
#include "../display.h"
#include <QApplication>
#include <QHeaderView>
@@ -726,6 +727,8 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event)
popup.addAction(tr("export As UDDF"), this, SLOT(exportSelectedDivesAsUDDF()));
popup.addAction(tr("shift times"), this, SLOT(shiftTimes()));
}
+ if (d)
+ popup.addAction(tr("upload dive(s) to divelogs.de"), this, SLOT(uploadToDivelogsDE()));
// "collapse all" really closes all trips,
// "collapse" keeps the trip with the selected dive open
QAction * actionTaken = popup.exec(event->globalPos());
@@ -781,3 +784,8 @@ void DiveListView::shiftTimes()
{
ShiftTimesDialog::instance()->show();
}
+
+void DiveListView::uploadToDivelogsDE()
+{
+ DivelogsDeWebServices::instance()->prepareDivesForUpload();
+}
diff --git a/qt-ui/divelistview.h b/qt-ui/divelistview.h
index c20b6e822..f65a6780b 100644
--- a/qt-ui/divelistview.h
+++ b/qt-ui/divelistview.h
@@ -49,6 +49,7 @@ public slots:
void saveSelectedDivesAs();
void exportSelectedDivesAsUDDF();
void shiftTimes();
+ void uploadToDivelogsDE();
signals:
void currentDiveChanged(int divenr);
diff --git a/qt-ui/subsurfacewebservices.h b/qt-ui/subsurfacewebservices.h
index 3c41b08d1..07f902b8f 100644
--- a/qt-ui/subsurfacewebservices.h
+++ b/qt-ui/subsurfacewebservices.h
@@ -66,7 +66,7 @@ class DivelogsDeWebServices : public WebServices {
public:
static DivelogsDeWebServices * instance();
void downloadDives();
- void uploadDives(QIODevice *dldContent);
+ void prepareDivesForUpload();
private slots:
void startDownload();
@@ -79,6 +79,7 @@ private slots:
void uploadError(QNetworkReply::NetworkError error);
void startUpload();
private:
+ void uploadDives(QIODevice *dldContent);
explicit DivelogsDeWebServices (QWidget* parent = 0, Qt::WindowFlags f = 0);
void setStatusText(int status);
void download_dialog_traverse_xml(xmlNodePtr node, unsigned int *download_status);