diff options
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | desktop-widgets/divecomponentselection.ui | 63 | ||||
-rw-r--r-- | desktop-widgets/divelogexportdialog.cpp | 10 | ||||
-rw-r--r-- | desktop-widgets/divelogexportdialog.h | 2 | ||||
-rw-r--r-- | desktop-widgets/divelogexportdialog.ui | 2 |
5 files changed, 48 insertions, 31 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index bfa0a728f..73ac81407 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -- Export option for profile picture +- Desktop: Add export option for profile picture [#1962] - Export: fix picture thumbnails [#1963] - Desktop: remove support for the "Share on Facebook" feature. Rationale: It is fairly easy to share images on Facebook, thus it was decided diff --git a/desktop-widgets/divecomponentselection.ui b/desktop-widgets/divecomponentselection.ui index ba58c546b..05e989174 100644 --- a/desktop-widgets/divecomponentselection.ui +++ b/desktop-widgets/divecomponentselection.ui @@ -49,7 +49,7 @@ </sizepolicy> </property> <property name="title"> - <string>Which components would you like to copy</string> + <string>Which components would you like to copy?</string> </property> <layout class="QGridLayout" name="gridLayout"> <property name="leftMargin"> @@ -67,52 +67,52 @@ <property name="spacing"> <number>0</number> </property> - <item row="0" column="0"> - <widget class="QCheckBox" name="divesite"> + <item row="1" column="1"> + <widget class="QCheckBox" name="tags"> <property name="text"> - <string>Dive site</string> + <string>Tags</string> </property> </widget> </item> - <item row="0" column="1"> - <widget class="QCheckBox" name="suit"> + <item row="3" column="1"> + <widget class="QCheckBox" name="weights"> <property name="text"> - <string>Suit</string> + <string>Weights</string> </property> </widget> </item> - <item row="5" column="0"> - <widget class="QCheckBox" name="visibility"> + <item row="0" column="0"> + <widget class="QCheckBox" name="divesite"> <property name="text"> - <string>Visibility</string> + <string>Dive site</string> </property> </widget> </item> - <item row="6" column="0"> - <widget class="QCheckBox" name="notes"> + <item row="5" column="0"> + <widget class="QCheckBox" name="visibility"> <property name="text"> - <string>Notes</string> + <string>Visibility</string> </property> </widget> </item> - <item row="1" column="1"> - <widget class="QCheckBox" name="tags"> + <item row="2" column="1"> + <widget class="QCheckBox" name="cylinders"> <property name="text"> - <string>Tags</string> + <string>Cylinders</string> </property> </widget> </item> - <item row="3" column="1"> - <widget class="QCheckBox" name="weights"> + <item row="2" column="0"> + <widget class="QCheckBox" name="buddy"> <property name="text"> - <string>Weights</string> + <string>Buddy</string> </property> </widget> </item> - <item row="2" column="1"> - <widget class="QCheckBox" name="cylinders"> + <item row="6" column="0"> + <widget class="QCheckBox" name="notes"> <property name="text"> - <string>Cylinders</string> + <string>Notes</string> </property> </widget> </item> @@ -123,10 +123,10 @@ </property> </widget> </item> - <item row="2" column="0"> - <widget class="QCheckBox" name="buddy"> + <item row="0" column="1"> + <widget class="QCheckBox" name="suit"> <property name="text"> - <string>Buddy</string> + <string>Suit</string> </property> </widget> </item> @@ -141,6 +141,19 @@ </widget> </item> <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>You can paste these to another dive or as text to another application.</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> <widget class="QDialogButtonBox" name="buttonBox"> <property name="orientation"> <enum>Qt::Horizontal</enum> diff --git a/desktop-widgets/divelogexportdialog.cpp b/desktop-widgets/divelogexportdialog.cpp index 04f0b03de..3e712fc5d 100644 --- a/desktop-widgets/divelogexportdialog.cpp +++ b/desktop-widgets/divelogexportdialog.cpp @@ -96,6 +96,8 @@ void DiveLogExportDialog::showExplanation() ui->description->setText(tr("Write dive as TeX macros to file.")); } else if (ui->exportLaTeX->isChecked()) { ui->description->setText(tr("Write dive as LaTeX macros to file.")); + } else if (ui->exportProfile->isChecked()) { + ui->description->setText(tr("Write the profile image as PNG file.")); } } @@ -170,7 +172,7 @@ void DiveLogExportDialog::on_buttonBox_accepted() if (!filename.isNull() && !filename.isEmpty()) export_TeX(qPrintable(filename), ui->exportSelected->isChecked(), ui->exportTeX->isChecked()); } else if (ui->exportProfile->isChecked()) { - filename = QFileDialog::getSaveFileName(this, tr("Save image depths"), lastDir); + filename = QFileDialog::getSaveFileName(this, tr("Save profile image"), lastDir); if (!filename.isNull() && !filename.isEmpty()) exportProfile(qPrintable(filename), ui->exportSelected->isChecked()); } @@ -233,18 +235,20 @@ void DiveLogExportDialog::export_depths(const char *filename, const bool selecte free_buffer(&buf); } -void DiveLogExportDialog::exportProfile(const QString filename, const bool selected_only) +void DiveLogExportDialog::exportProfile(QString filename, const bool selected_only) { struct dive *dive; int i; int count = 0; + if (!filename.endsWith(".png", Qt::CaseInsensitive)) + filename = filename.append(".png"); QFileInfo fi(filename); for_each_dive (i, dive) { if (selected_only && !dive->selected) continue; if (count) - saveProfile(dive, fi.completeBaseName().append(QString("-%1.").arg(count)).append(fi.suffix())); + saveProfile(dive, fi.path() + QDir::separator() + fi.completeBaseName().append(QString("-%1.").arg(count)) + fi.suffix()); else saveProfile(dive, filename); ++count; diff --git a/desktop-widgets/divelogexportdialog.h b/desktop-widgets/divelogexportdialog.h index d7905dd94..ce6106be0 100644 --- a/desktop-widgets/divelogexportdialog.h +++ b/desktop-widgets/divelogexportdialog.h @@ -34,7 +34,7 @@ private: void exportHtmlInit(const QString &filename); void export_depths(const char *filename, const bool selected_only); void export_TeX(const char *filename, const bool selected_only, bool plain); - void exportProfile(const QString filename, const bool selected_only); + void exportProfile(QString filename, const bool selected_only); void saveProfile(const struct dive *dive, const QString filename); }; diff --git a/desktop-widgets/divelogexportdialog.ui b/desktop-widgets/divelogexportdialog.ui index fe4827060..9080c647f 100644 --- a/desktop-widgets/divelogexportdialog.ui +++ b/desktop-widgets/divelogexportdialog.ui @@ -184,7 +184,7 @@ <item> <widget class="QRadioButton" name="exportProfile"> <property name="text"> - <string>dive profile</string> + <string>Dive profile</string> </property> <attribute name="buttonGroup"> <string notr="true">exportGroup</string> |