summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-12-05 18:28:28 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-12-09 15:51:17 +0200
commit586971256972337f68ce1c9e07083343b585fac6 (patch)
treef7c40d38d0a0ac7ca746181443e63d7964453201 /qt-ui
parentbe16ade0383813949e82491de5a26f42752c3e0f (diff)
downloadsubsurface-586971256972337f68ce1c9e07083343b585fac6.tar.gz
Divelogs.de: add a divelist context menu item for upload
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'qt-ui')
-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);