mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
mobile/export: remove most of the export options
A tablet or phone is not a computer. What would you do with a CSV or TeX/LaTeX file on a phone. Yeah, I get it, feature parity. This should never have been merged. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b8c02c9b03
commit
0178f0c7e7
4 changed files with 7 additions and 112 deletions
|
@ -12,6 +12,7 @@
|
|||
#include "core/divesite.h"
|
||||
#include "exportfuncs.h"
|
||||
|
||||
#if !defined(SUBSURFACE_MOBILE)
|
||||
void exportProfile(QString filename, bool selected_only)
|
||||
{
|
||||
struct dive *dive;
|
||||
|
@ -32,7 +33,6 @@ void exportProfile(QString filename, bool selected_only)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void export_TeX(const char *filename, bool selected_only, bool plain)
|
||||
{
|
||||
FILE *f;
|
||||
|
@ -269,6 +269,7 @@ void export_depths(const char *filename, bool selected_only)
|
|||
}
|
||||
free_buffer(&buf);
|
||||
}
|
||||
#endif /* ! SUBSURFACE_MOBILE */
|
||||
|
||||
std::vector<const dive_site *> getDiveSitesToExport(bool selectedOnly)
|
||||
{
|
||||
|
|
|
@ -166,79 +166,6 @@ Kirigami.ScrollablePage {
|
|||
explain.text = qsTr("Send the dive data to dive-share.appspot.com website.")
|
||||
}
|
||||
}
|
||||
RadioButton {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Export CSV dive profile")
|
||||
exclusiveGroup: radioGroup
|
||||
onClicked: {
|
||||
selectedExport = ExportType.EX_CSV_DIVE_PROFILE
|
||||
explain.text = qsTr("Comma separated values describing the dive profile.")
|
||||
}
|
||||
}
|
||||
RadioButton {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Export CSV dive details")
|
||||
exclusiveGroup: radioGroup
|
||||
onClicked: {
|
||||
selectedExport = ExportType.EX_CSV_DETAILS
|
||||
explain.text = qsTr("Comma separated values of the dive information. This includes most of the dive details but no profile information.")
|
||||
}
|
||||
}
|
||||
RadioButton {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Export CSV profile data")
|
||||
exclusiveGroup: radioGroup
|
||||
onClicked: {
|
||||
selectedExport = ExportType.EX_CSV_PROFILE
|
||||
explain.text = qsTr("Write profile data to a CSV file.")
|
||||
}
|
||||
}
|
||||
RadioButton {
|
||||
Layout.fillWidth: true
|
||||
visible: false // TEMPORARY MEASURE, until a non UI PNG generation is ready
|
||||
text: qsTr("Export Dive profile")
|
||||
exclusiveGroup: radioGroup
|
||||
onClicked: {
|
||||
selectedExport = ExportType.EX_PROFILE_PNG
|
||||
explain.text = qsTr("Write the profile image as PNG file.")
|
||||
}
|
||||
}
|
||||
RadioButton {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Export Worldmap")
|
||||
exclusiveGroup: radioGroup
|
||||
onClicked: {
|
||||
selectedExport = ExportType.EX_WORLD_MAP
|
||||
explain.text = qsTr("HTML export of the dive locations, visualized on a world map.")
|
||||
}
|
||||
}
|
||||
RadioButton {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Export TeX")
|
||||
exclusiveGroup: radioGroup
|
||||
onClicked: {
|
||||
selectedExport = ExportType.EX_TEX
|
||||
explain.text = qsTr("Write dive as TeX macros to file.")
|
||||
}
|
||||
}
|
||||
RadioButton {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Export LaTeX")
|
||||
exclusiveGroup: radioGroup
|
||||
onClicked: {
|
||||
selectedExport = ExportType.EX_LATEX
|
||||
explain.text = qsTr("Write dive as LaTeX macros to file.")
|
||||
}
|
||||
}
|
||||
RadioButton {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Export Image depths")
|
||||
exclusiveGroup: radioGroup
|
||||
onClicked: {
|
||||
selectedExport = ExportType.EX_IMAGE_DEPTHS
|
||||
explain.text = qsTr("Write depths of images to file.")
|
||||
}
|
||||
}
|
||||
Text {
|
||||
id: explain
|
||||
Layout.fillWidth: true
|
||||
|
|
|
@ -2124,6 +2124,7 @@ void QMLManager::appInitialized()
|
|||
#endif
|
||||
}
|
||||
|
||||
#if !defined(Q_OS_ANDROID)
|
||||
void QMLManager::exportToFile(export_types type, QString dir, bool anonymize)
|
||||
{
|
||||
// dir starts with "file://" e.g. "file:///tmp"
|
||||
|
@ -2144,40 +2145,12 @@ void QMLManager::exportToFile(export_types type, QString dir, bool anonymize)
|
|||
case EX_UDDF:
|
||||
exportUsingStyleSheet(fileName + ".uddf", true, 0, "uddf-export.xslt", anonymize);
|
||||
break;
|
||||
case EX_CSV_DIVE_PROFILE:
|
||||
exportUsingStyleSheet(fileName + ".uddf", true, 0, "xml2csv.xslt", anonymize);
|
||||
break;
|
||||
case EX_CSV_DETAILS:
|
||||
exportUsingStyleSheet(fileName + ".uddf", true, 0, "xml2manualcsv.xslt", anonymize);
|
||||
break;
|
||||
case EX_CSV_PROFILE:
|
||||
save_profiledata(qPrintable(fileName + ".csv"), true);
|
||||
break;
|
||||
case EX_PROFILE_PNG:
|
||||
exportProfile(qPrintable(fileName + ".png"), false);
|
||||
break;
|
||||
case EX_WORLD_MAP:
|
||||
export_worldmap_HTML(qPrintable(fileName + ".html"), true);
|
||||
break;
|
||||
case EX_TEX:
|
||||
export_TeX(qPrintable(fileName + ".tex"), true, true);
|
||||
break;
|
||||
case EX_LATEX:
|
||||
export_TeX(qPrintable(fileName + ".tex"), true, false);
|
||||
break;
|
||||
case EX_IMAGE_DEPTHS:
|
||||
export_depths(qPrintable(fileName), false);
|
||||
break;
|
||||
default:
|
||||
qDebug() << "export to unknown type " << type << " using " << dir << " remove names " << anonymize;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void exportProfile(const struct dive *, const QString)
|
||||
{
|
||||
// TBD
|
||||
}
|
||||
#endif
|
||||
|
||||
void QMLManager::exportToWEB(export_types type, QString userId, QString password, bool anonymize)
|
||||
{
|
||||
|
|
|
@ -61,18 +61,12 @@ public:
|
|||
EX_DIVE_SITES_XML,
|
||||
EX_UDDF,
|
||||
EX_DIVELOGS_DE,
|
||||
EX_DIVESHARE,
|
||||
EX_CSV_DIVE_PROFILE,
|
||||
EX_CSV_DETAILS,
|
||||
EX_CSV_PROFILE,
|
||||
EX_PROFILE_PNG,
|
||||
EX_WORLD_MAP,
|
||||
EX_TEX,
|
||||
EX_LATEX,
|
||||
EX_IMAGE_DEPTHS
|
||||
EX_DIVESHARE
|
||||
};
|
||||
Q_ENUM(export_types)
|
||||
#if !defined(Q_OS_ANDROID)
|
||||
Q_INVOKABLE void exportToFile(export_types type, QString directory, bool anonymize);
|
||||
#endif
|
||||
Q_INVOKABLE void exportToWEB(export_types type, QString userId, QString password, bool anonymize);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue