Compare commits

...

12 Commits

Author SHA1 Message Date
Dirk Hohndel
008f8ad21e cleanup: prevent distracing conversion warnings
We do want the -Wfloat-conversion warnings where they point out
potential bugs. But they are very distracting when they are triggered by
floating point literals (which the standard defines as double) passed to
a function expecting float arguments.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-02-15 16:53:26 -08:00
Dirk Hohndel
4b539ef044 macOS: fix broken .pc file for libmtp
This has bugged me forever. The existing file creates a warning on every single
compiler invocation. I really need to figure out if I can get this fixed
upstream. But while I'm at it, I submitted it here to make it easier to spot
warnings in the build output.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-02-15 16:53:26 -08:00
Dirk Hohndel
47acf2b3dd cleanup: fix incorrect QFuture return value
I'm a abit confused why that didn't cause an error with Qt5.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-02-15 16:53:26 -08:00
Dirk Hohndel
0318c6c2de cleanup: don't add QKeySequence values
These should be handled as logical OR operations as they are bits.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-02-15 16:53:26 -08:00
Dirk Hohndel
34489fe7db cleanup: remove duplicate connections in .ui files
These no longer compile with Qt6 - but they are already duplicated in C++ code,
anyway. So we can simply remove them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-02-15 16:53:26 -08:00
Dirk Hohndel
210ed3896d cleanup: remove unused argument and private member
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-02-15 16:53:26 -08:00
Dirk Hohndel
2790b837d4 build-system: small cleanups for the CMakeLists.txt
Simply removing outdated things that will be in the way.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-02-15 16:53:26 -08:00
Dirk Hohndel
7633ef16aa build-system: correctly build OpenSSL on ARM Macs
The OpenSSL configure script requires us to pass in the correct build spec.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-02-15 16:53:26 -08:00
Dirk Hohndel
4fd8814212 build-system: update to current OpenSSL version
This is required to compile it on ARM64 Macs (and of course also is
the right thing to do overall).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-02-15 16:53:26 -08:00
Dirk Hohndel
79b2860ea1 build-system: update libusb version
If we are building our own version of libusb, let's build a current one
(because current libmtp relies on that).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-02-15 16:53:26 -08:00
Dirk Hohndel
92d7280105 cleanup: use already defined constant
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-02-15 16:53:26 -08:00
Dirk Hohndel
cb25bc341a macOS: remove unused Info.plist
This was confusing - the file in packaging macos hasn't been used since we
switched to building with cmake something like seven years ago.
Also add missing keys to the actual Info.plist skeleton.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-02-15 16:53:26 -08:00
29 changed files with 135 additions and 151 deletions

View File

@ -49,7 +49,7 @@ option(NO_PRINTING "disable the printing support" OFF)
option(NO_USERMANUAL "don't include a viewer for the user manual" OFF)
#Options regarding enabling parts of subsurface
option(BTSUPPORT "enable support for QtBluetooth (requires Qt5.4 or newer)" ON)
option(BTSUPPORT "enable support for QtBluetooth" ON)
option(FTDISUPPORT "enable support for libftdi based serial" OFF)
# Options regarding What should we build on subsurface
@ -505,9 +505,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
install(CODE "execute_process(COMMAND mkdir -p ${PLUGINDIR}/geoservices)")
install(CODE "execute_process(COMMAND cp ${_qt5Core_install_prefix}/plugins/geoservices/libqtgeoservices_googlemaps.dylib ${PLUGINDIR}/geoservices ERROR_QUIET)")
install(CODE "execute_process(COMMAND cp ${CMAKE_SOURCE_DIR}/../install-root/${_qt5Core_install_prefix}/plugins/geoservices/libqtgeoservices_googlemaps.dylib ${PLUGINDIR}/geoservices ERROR_QUIET)")
# this is a hack - but I don't know how else to find the macdeployqt program if it's not in the PATH
string(REPLACE moc macdeployqt MACDEPLOYQT ${QT_MOC_EXECUTABLE})
install(CODE "execute_process(COMMAND ${MACDEPLOYQT} ${APP_BUNDLE_DIR} -no-strip ${MACDEPLOY_ARGS})")
# this will fail is macdeployqt isn't in the PATH - that seemed to happen in the past, but not recently
install(CODE "execute_process(COMMAND macdeployqt ${APP_BUNDLE_DIR} -no-strip ${MACDEPLOY_ARGS})")
# the next hack is here to delete the sqlite plugin that get's installed even though it isn't needed
install(CODE "execute_process(COMMAND rm -rf ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/PlugIns/sqldrivers)")
# and another hack to get the QML Components in the right place

View File

@ -34,5 +34,9 @@
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Subsurface needs access to your Bluetooth peripherals in order to download dive information directly from BLE enabled dive computers.</string>
</dict>
</plist>

View File

@ -7,65 +7,67 @@
#include <QColor>
#define MAKEQCOLOR(r,g,b,a) QColor::fromRgbF((float)(r), (float)(b), (float)(g), (float)(a))
// Greens
#define CAMARONE1 QColor::fromRgbF(0.0, 0.4, 0.0, 1)
#define FUNGREEN1 QColor::fromRgbF(0.0, 0.4, 0.2, 1)
#define FUNGREEN1_HIGH_TRANS QColor::fromRgbF(0.0, 0.4, 0.2, 0.25)
#define KILLARNEY1 QColor::fromRgbF(0.2, 0.4, 0.2, 1)
#define APPLE1 QColor::fromRgbF(0.2, 0.6, 0.2, 1)
#define APPLE1_MED_TRANS QColor::fromRgbF(0.2, 0.6, 0.2, 0.5)
#define APPLE1_HIGH_TRANS QColor::fromRgbF(0.2, 0.6, 0.2, 0.25)
#define LIMENADE1 QColor::fromRgbF(0.4, 0.8, 0.0, 1)
#define ATLANTIS1 QColor::fromRgbF(0.4, 0.8, 0.2, 1)
#define ATLANTIS2 QColor::fromRgbF(0.6, 0.8, 0.2, 1)
#define RIOGRANDE1 QColor::fromRgbF(0.8, 0.8, 0.0, 1)
#define EARLSGREEN1 QColor::fromRgbF(0.8, 0.8, 0.2, 1)
#define FORESTGREEN1 QColor::fromRgbF(0.1, 0.5, 0.1, 1)
#define NITROX_GREEN QColor::fromRgbF(0, 0.54, 0.375, 1)
#define CAMARONE1 MAKEQCOLOR(0.0, 0.4, 0.0, 1)
#define FUNGREEN1 MAKEQCOLOR(0.0, 0.4, 0.2, 1)
#define FUNGREEN1_HIGH_TRANS MAKEQCOLOR(0.0, 0.4, 0.2, 0.25)
#define KILLARNEY1 MAKEQCOLOR(0.2, 0.4, 0.2, 1)
#define APPLE1 MAKEQCOLOR(0.2, 0.6, 0.2, 1)
#define APPLE1_MED_TRANS MAKEQCOLOR(0.2, 0.6, 0.2, 0.5)
#define APPLE1_HIGH_TRANS MAKEQCOLOR(0.2, 0.6, 0.2, 0.25)
#define LIMENADE1 MAKEQCOLOR(0.4, 0.8, 0.0, 1)
#define ATLANTIS1 MAKEQCOLOR(0.4, 0.8, 0.2, 1)
#define ATLANTIS2 MAKEQCOLOR(0.6, 0.8, 0.2, 1)
#define RIOGRANDE1 MAKEQCOLOR(0.8, 0.8, 0.0, 1)
#define EARLSGREEN1 MAKEQCOLOR(0.8, 0.8, 0.2, 1)
#define FORESTGREEN1 MAKEQCOLOR(0.1, 0.5, 0.1, 1)
#define NITROX_GREEN MAKEQCOLOR(0, 0.54, 0.375, 1)
// Reds
#define PERSIANRED1 QColor::fromRgbF(0.8, 0.2, 0.2, 1)
#define TUSCANY1 QColor::fromRgbF(0.8, 0.4, 0.2, 1)
#define PIRATEGOLD1 QColor::fromRgbF(0.8, 0.5, 0.0, 1)
#define PIRATEGOLD1_MED_TRANS QColor::fromRgbF(0.8, 0.5, 0.0, 0.75)
#define HOKEYPOKEY1 QColor::fromRgbF(0.8, 0.6, 0.2, 1)
#define CINNABAR1 QColor::fromRgbF(0.9, 0.3, 0.2, 1)
#define REDORANGE1 QColor::fromRgbF(1.0, 0.2, 0.2, 1)
#define REDORANGE1_HIGH_TRANS QColor::fromRgbF(1.0, 0.2, 0.2, 0.25)
#define REDORANGE1_MED_TRANS QColor::fromRgbF(1.0, 0.2, 0.2, 0.5)
#define RED1_MED_TRANS QColor::fromRgbF(1.0, 0.0, 0.0, 0.5)
#define RED1 QColor::fromRgbF(1.0, 0.0, 0.0, 1)
#define PERSIANRED1 MAKEQCOLOR(0.8, 0.2, 0.2, 1)
#define TUSCANY1 MAKEQCOLOR(0.8, 0.4, 0.2, 1)
#define PIRATEGOLD1 MAKEQCOLOR(0.8, 0.5, 0.0, 1)
#define PIRATEGOLD1_MED_TRANS MAKEQCOLOR(0.8, 0.5, 0.0, 0.75)
#define HOKEYPOKEY1 MAKEQCOLOR(0.8, 0.6, 0.2, 1)
#define CINNABAR1 MAKEQCOLOR(0.9, 0.3, 0.2, 1)
#define REDORANGE1 MAKEQCOLOR(1.0, 0.2, 0.2, 1)
#define REDORANGE1_HIGH_TRANS MAKEQCOLOR(1.0, 0.2, 0.2, 0.25)
#define REDORANGE1_MED_TRANS MAKEQCOLOR(1.0, 0.2, 0.2, 0.5)
#define RED1_MED_TRANS MAKEQCOLOR(1.0, 0.0, 0.0, 0.5)
#define RED1 MAKEQCOLOR(1.0, 0.0, 0.0, 1)
// Monochromes
#define BLACK1 QColor::fromRgbF(0.0, 0.0, 0.0, 1)
#define BLACK1_LOW_TRANS QColor::fromRgbF(0.0, 0.0, 0.0, 0.75)
#define BLACK1_HIGH_TRANS QColor::fromRgbF(0.0, 0.0, 0.0, 0.25)
#define TUNDORA1_MED_TRANS QColor::fromRgbF(0.3, 0.3, 0.3, 0.5)
#define MED_GRAY_HIGH_TRANS QColor::fromRgbF(0.5, 0.5, 0.5, 0.25)
#define MERCURY1_MED_TRANS QColor::fromRgbF(0.9, 0.9, 0.9, 0.5)
#define CONCRETE1_LOWER_TRANS QColor::fromRgbF(0.95, 0.95, 0.95, 0.9)
#define WHITE1_MED_TRANS QColor::fromRgbF(1.0, 1.0, 1.0, 0.5)
#define WHITE1 QColor::fromRgbF(1.0, 1.0, 1.0, 1)
#define BLACK1 MAKEQCOLOR(0.0, 0.0, 0.0, 1)
#define BLACK1_LOW_TRANS MAKEQCOLOR(0.0, 0.0, 0.0, 0.75)
#define BLACK1_HIGH_TRANS MAKEQCOLOR(0.0, 0.0, 0.0, 0.25)
#define TUNDORA1_MED_TRANS MAKEQCOLOR(0.3, 0.3, 0.3, 0.5)
#define MED_GRAY_HIGH_TRANS MAKEQCOLOR(0.5, 0.5, 0.5, 0.25)
#define MERCURY1_MED_TRANS MAKEQCOLOR(0.9, 0.9, 0.9, 0.5)
#define CONCRETE1_LOWER_TRANS MAKEQCOLOR(0.95, 0.95, 0.95, 0.9)
#define WHITE1_MED_TRANS MAKEQCOLOR(1.0, 1.0, 1.0, 0.5)
#define WHITE1 MAKEQCOLOR(1.0, 1.0, 1.0, 1)
// Blues
#define GOVERNORBAY2 QColor::fromRgbF(0.2, 0.2, 0.7, 1)
#define GOVERNORBAY1_MED_TRANS QColor::fromRgbF(0.2, 0.2, 0.8, 0.5)
#define ROYALBLUE2 QColor::fromRgbF(0.2, 0.2, 0.9, 1)
#define ROYALBLUE2_LOW_TRANS QColor::fromRgbF(0.2, 0.2, 0.9, 0.75)
#define AIR_BLUE QColor::fromRgbF(0.25, 0.75, 1.0, 1)
#define AIR_BLUE_TRANS QColor::fromRgbF(0.25, 0.75, 1.0, 0.5)
#define GOVERNORBAY2 MAKEQCOLOR(0.2, 0.2, 0.7, 1)
#define GOVERNORBAY1_MED_TRANS MAKEQCOLOR(0.2, 0.2, 0.8, 0.5)
#define ROYALBLUE2 MAKEQCOLOR(0.2, 0.2, 0.9, 1)
#define ROYALBLUE2_LOW_TRANS MAKEQCOLOR(0.2, 0.2, 0.9, 0.75)
#define AIR_BLUE MAKEQCOLOR(0.25, 0.75, 1.0, 1)
#define AIR_BLUE_TRANS MAKEQCOLOR(0.25, 0.75, 1.0, 0.5)
// Yellows / BROWNS
#define SPRINGWOOD1 QColor::fromRgbF(0.95, 0.95, 0.9, 1)
#define SPRINGWOOD1_MED_TRANS QColor::fromRgbF(0.95, 0.95, 0.9, 0.5)
#define BROOM1_LOWER_TRANS QColor::fromRgbF(1.0, 1.0, 0.1, 0.9)
#define PEANUT QColor::fromRgbF(0.5, 0.2, 0.1, 1.0)
#define PEANUT_MED_TRANS QColor::fromRgbF(0.5, 0.2, 0.1, 0.5)
#define NITROX_YELLOW QColor::fromRgbF(0.98, 0.89, 0.07, 1.0)
#define SPRINGWOOD1 MAKEQCOLOR(0.95, 0.95, 0.9, 1)
#define SPRINGWOOD1_MED_TRANS MAKEQCOLOR(0.95, 0.95, 0.9, 0.5)
#define BROOM1_LOWER_TRANS MAKEQCOLOR(1.0, 1.0, 0.1, 0.9)
#define PEANUT MAKEQCOLOR(0.5, 0.2, 0.1, 1.0)
#define PEANUT_MED_TRANS MAKEQCOLOR(0.5, 0.2, 0.1, 0.5)
#define NITROX_YELLOW MAKEQCOLOR(0.98, 0.89, 0.07, 1.0)
// Magentas
#define MEDIUMREDVIOLET1_HIGHER_TRANS QColor::fromRgbF(0.7, 0.2, 0.7, 0.1)
#define MAGENTA QColor::fromRgbF(1.0, 0.0, 1.0, 1.0)
#define MEDIUMREDVIOLET1_HIGHER_TRANS MAKEQCOLOR(0.7, 0.2, 0.7, 0.1)
#define MAGENTA MAKEQCOLOR(1.0, 0.0, 1.0, 1.0)
#define SAC_COLORS_START_IDX SAC_1
#define SAC_COLORS 9

View File

@ -19,9 +19,9 @@ SubsurfaceAbout::SubsurfaceAbout(QWidget *parent) : QDialog(parent, QFlag(0))
"Linus Torvalds, Dirk Hohndel, Tomaz Canabrava, Berthold Stoeger, and others, 2011-2022"
"</span>").arg(versionString));
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_W), this);
connect(close, SIGNAL(activated()), this, SLOT(close()));
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
connect(quit, SIGNAL(activated()), parent, SLOT(close()));
}

View File

@ -18,7 +18,7 @@ BtDeviceSelectionDialog::BtDeviceSelectionDialog(QWidget *parent) :
ui->setupUi(this);
// Quit button callbacks
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
connect(quit, SIGNAL(activated()), this, SLOT(reject()));
connect(ui->quit, SIGNAL(clicked()), this, SLOT(reject()));

View File

@ -37,9 +37,9 @@ DiveLogExportDialog::DiveLogExportDialog(QWidget *parent) : QDialog(parent),
{
ui->setupUi(this);
showExplanation();
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
connect(quit, SIGNAL(activated()), MainWindow::instance(), SLOT(close()));
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_W), this);
connect(close, SIGNAL(activated()), this, SLOT(close()));
/* the names are not the actual values exported to the json files,The font-family property should hold several
@ -246,7 +246,7 @@ void DiveLogExportDialog::on_buttonBox_accepted()
qPrefDisplay::set_lastDir(fileInfo.dir().path());
// the non XSLT exports are called directly above, the XSLT based ons are called here
if (!stylesheet.isEmpty()) {
QFuture<void> future = exportUsingStyleSheet(filename, ui->exportSelected->isChecked(),
QFuture<int> future = exportUsingStyleSheet(filename, ui->exportSelected->isChecked(),
ui->CSVUnits_2->currentIndex(), stylesheet.toUtf8(), ui->anonymize->isChecked());
MainWindow::instance()->getNotificationWidget()->showNotification(tr("Please wait, exporting..."), KMessageWidget::Information);
MainWindow::instance()->getNotificationWidget()->setFuture(future);

View File

@ -380,9 +380,9 @@ DiveLogImportDialog::DiveLogImportDialog(QStringList fn, QWidget *parent) : QDia
loadFileContents(-1, INITIAL);
/* manually import CSV file */
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_W), this);
connect(close, SIGNAL(activated()), this, SLOT(close()));
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
connect(quit, SIGNAL(activated()), parent, SLOT(close()));
connect(ui->CSVSeparator, SIGNAL(currentIndexChanged(int)), this, SLOT(loadFileContentsSeperatorSelected(int)));

View File

@ -16,8 +16,8 @@
DivesiteImportDialog::DivesiteImportDialog(struct dive_site_table &imported, QString source, QWidget *parent) : QDialog(parent),
importedSource(source)
{
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_W), this);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
divesiteImportedModel = new DivesiteImportedModel(this);

View File

@ -31,8 +31,8 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent) : QDialog(parent, QF
{
diveImportedModel = new DiveImportedModel(this);
vendorModel.setStringList(vendorList);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_W), this);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
int startingWidth = defaultModelFont().pointSize();

View File

@ -250,9 +250,9 @@ KMessageWidget::MessageType KMessageWidget::messageType() const
static QColor darkShade(QColor c)
{
qreal contrast = 0.7; // taken from kcolorscheme for the dark shade
double contrast = 0.7; // taken from kcolorscheme for the dark shade
qreal darkAmount;
double darkAmount;
if (c.lightnessF() < 0.006) { /* too dark */
darkAmount = 0.02 + 0.40 * contrast;
} else if (c.lightnessF() > 0.93) { /* too bright */
@ -261,9 +261,9 @@ static QColor darkShade(QColor c)
darkAmount = (-c.lightnessF()) * (0.55 + contrast * 0.35);
}
qreal v = c.lightnessF() + darkAmount;
double v = c.lightnessF() + darkAmount;
v = v > 0.0 ? (v < 1.0 ? v : 1.0) : 0.0;
c.setHsvF(c.hslHueF(), c.hslSaturationF(), v);
c.setHsvF(c.hslHueF(), c.hslSaturationF(), (float)v);
return c;
}

View File

@ -210,8 +210,8 @@ MainWindow::MainWindow() : QMainWindow(),
updateManager = new UpdateManager(this);
undoAction = Command::undoAction(this);
redoAction = Command::redoAction(this);
undoAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Z));
redoAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Z));
undoAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Z));
redoAction->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_Z));
ui.menu_Edit->addActions({ undoAction, redoAction });
#ifndef NO_PRINTING
@ -570,8 +570,8 @@ void MainWindow::enableShortcuts()
redoAction->setEnabled(true);
ui.actionPreviousDC->setShortcut(Qt::Key_Left);
ui.actionNextDC->setShortcut(Qt::Key_Right);
ui.copy->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_C));
ui.paste->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_V));
ui.copy->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_C));
ui.paste->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_V));
}
void MainWindow::showProfile()
@ -724,9 +724,9 @@ void MainWindow::on_actionYearlyStatistics_triggered()
l->addWidget(view);
d.resize(lrint(width() * .8), height() / 2);
d.move(lrint(width() * .1), height() / 4);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), &d);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_W), &d);
connect(close, SIGNAL(activated()), &d, SLOT(close()));
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), &d);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), &d);
connect(quit, SIGNAL(activated()), this, SLOT(close()));
d.setWindowFlags(Qt::Window | Qt::CustomizeWindowHint
| Qt::WindowCloseButtonHint | Qt::WindowTitleHint | Qt::WindowMaximizeButtonHint);

View File

@ -31,7 +31,7 @@ QString NotificationWidget::getNotificationText()
return text();
}
void NotificationWidget::setFuture(const QFuture<void> &future)
void NotificationWidget::setFuture(const QFuture<int> &future)
{
future_watcher.setFuture(future);
}

View File

@ -16,7 +16,7 @@ class NotificationWidget : public KMessageWidget {
public:
explicit NotificationWidget(QWidget *parent = 0);
void setFuture(const QFuture<void> &future);
void setFuture(const QFuture<int> &future);
void showNotification(QString message, KMessageWidget::MessageType type);
void hideNotification();
QString getNotificationText();
@ -25,7 +25,7 @@ public
slots:
void showError(QString message);
private:
QFutureWatcher<void> future_watcher;
QFutureWatcher<int> future_watcher;
private
slots:

View File

@ -272,7 +272,7 @@ QColor QtWaitingSpinner::currentLineColor(int countDistance, int totalNrOfLines,
int distanceThreshold =
static_cast<int>(ceil((totalNrOfLines - 1) * trailFadePerc / 100.0));
if (countDistance > distanceThreshold) {
color.setAlphaF(minAlphaF);
color.setAlphaF((float)minAlphaF);
} else {
qreal alphaDiff = color.alphaF() - minAlphaF;
qreal gradient = alphaDiff / static_cast<qreal>(distanceThreshold + 1);
@ -280,7 +280,7 @@ QColor QtWaitingSpinner::currentLineColor(int countDistance, int totalNrOfLines,
// If alpha is out of bounds, clip it.
resultAlpha = std::min(1.0, std::max(0.0, resultAlpha));
color.setAlphaF(resultAlpha);
color.setAlphaF((float)resultAlpha);
}
return color;
}

View File

@ -198,17 +198,5 @@
</hint>
</hints>
</connection>
<connection>
<sender>timeEdit</sender>
<signal>timeChanged(const QTime)</signal>
<receiver>ShiftTimesDialog</receiver>
<slot>changeTime()</slot>
</connection>
<connection>
<sender>backwards</sender>
<signal>toggled(bool)</signal>
<receiver>ShiftTimesDialog</receiver>
<slot>changeTime()</slot>
</connection>
</connections>
</ui>

View File

@ -45,9 +45,9 @@ RenumberDialog::RenumberDialog(bool selectedOnlyIn, QWidget *parent) : QDialog(p
{
ui.setupUi(this);
connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_W), this);
connect(close, SIGNAL(activated()), this, SLOT(close()));
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
connect(quit, SIGNAL(activated()), parent, SLOT(close()));
if (selectedOnly && amount_selected == 1)
@ -72,9 +72,9 @@ SetpointDialog::SetpointDialog(struct dive *dIn, int dcNrIn, int seconds) : QDia
{
ui.setupUi(this);
connect(ui.buttonBox, &QDialogButtonBox::clicked, this, &SetpointDialog::buttonClicked);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_W), this);
connect(close, &QShortcut::activated, this, &QDialog::close);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
connect(quit, &QShortcut::activated, MainWindow::instance(), &QWidget::close);
}
@ -116,9 +116,9 @@ ShiftTimesDialog::ShiftTimesDialog(QWidget *parent) : QDialog(parent),
connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
connect(ui.timeEdit, SIGNAL(timeChanged(const QTime)), this, SLOT(changeTime()));
connect(ui.backwards, SIGNAL(toggled(bool)), this, SLOT(changeTime()));
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_W), this);
connect(close, SIGNAL(activated()), this, SLOT(close()));
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
connect(quit, SIGNAL(activated()), parent, SLOT(close()));
}
@ -271,9 +271,9 @@ void ShiftImageTimesDialog::backwardsChanged(bool)
URLDialog::URLDialog(QWidget *parent) : QDialog(parent)
{
ui.setupUi(this);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_W), this);
connect(close, SIGNAL(activated()), this, SLOT(close()));
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
connect(quit, SIGNAL(activated()), parent, SLOT(close()));
}
@ -317,9 +317,9 @@ DiveComponentSelection::DiveComponentSelection(QWidget *parent, struct dive *tar
UI_FROM_COMPONENT(number);
UI_FROM_COMPONENT(when);
connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_W), this);
connect(close, SIGNAL(activated()), this, SLOT(close()));
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
connect(quit, SIGNAL(activated()), parent, SLOT(close()));
}

View File

@ -259,9 +259,9 @@ DivelogsDeWebServices::DivelogsDeWebServices(QWidget *parent) : WebServices(pare
ui.password->setText(qPrefCloudStorage::divelogde_pass());
ui.saveUidLocal->hide();
hideUpload();
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_W), this);
connect(close, SIGNAL(activated()), this, SLOT(close()));
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
connect(quit, SIGNAL(activated()), parent, SLOT(close()));
}

View File

@ -10,9 +10,9 @@ TripSelectionDialog::TripSelectionDialog(QWidget *parent) : QDialog(parent)
ui.setupUi(this);
connect(ui.trips, &QListWidget::itemSelectionChanged, this, &TripSelectionDialog::selectionChanged);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_W), this);
connect(close, &QShortcut::activated, this, &QDialog::close);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
connect(quit, &QShortcut::activated, parent, &QWidget::close);
// We could use a model, but it seems barely worth the hassle.

View File

@ -11,4 +11,4 @@ ANDROID_PLATFORMS=android-29
ANDROID_NDK=ndk/${NDK_VERSION}
# OpenSSL also has an entry in get-dep-lib.sh line 103
# that needs to be updated as well.
OPENSSL_VERSION=1.1.1h
OPENSSL_VERSION=1.1.1m

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>CFBundleIconFile</key>
<string>Subsurface.icns</string>
<key>CFBundleName</key>
<string>Subsurface</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleExecutable</key>
<string>subsurface</string>
<key>CFBundleIdentifier</key>
<string>org.hohndel.subsurface</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleVersion</key>
<string>@SHORT_VERSION@</string>
<key>NSSupportsAutomaticGraphicsSwitching</key><true/>
</dict>
</plist>

View File

@ -6,8 +6,8 @@
#include <array>
DivePercentageItem::DivePercentageItem(const DiveCartesianAxis &hAxis, const DiveCartesianAxis &vAxis, double dpr) :
hAxis(hAxis), vAxis(vAxis), dpr(dpr)
DivePercentageItem::DivePercentageItem(const DiveCartesianAxis &hAxis, const DiveCartesianAxis &vAxis) :
hAxis(hAxis), vAxis(vAxis)
{
}
@ -52,29 +52,30 @@ static std::array<int, num_tissues> calcLinesPerTissue(int size)
return res;
}
#define SETHSVF(h, s, v) setHsvF((float)(h), (float)(s), (float)(v))
static QRgb colorScale(double value, int inert)
{
QColor color;
double scaledValue = value / (AMB_PERCENTAGE * inert) * 1000.0;
if (scaledValue < 0.8) // grade from cyan to blue to purple
color.setHsvF(0.5 + 0.25 * scaledValue / 0.8, 1.0, 1.0);
color.SETHSVF(0.5 + 0.25 * scaledValue / 0.8, 1.0, 1.0);
else if (scaledValue < 1.0) // grade from magenta to black
color.setHsvF(0.75, 1.0, (1.0 - scaledValue) / 0.2);
color.SETHSVF(0.75, 1.0, (1.0 - scaledValue) / 0.2);
else if (value < AMB_PERCENTAGE) // grade from black to bright green
color.setHsvF(0.333, 1.0, (value - AMB_PERCENTAGE * inert / 1000.0) / (AMB_PERCENTAGE - AMB_PERCENTAGE * inert / 1000.0));
color.SETHSVF(0.333, 1.0, (value - AMB_PERCENTAGE * inert / 1000.0) / (AMB_PERCENTAGE - AMB_PERCENTAGE * inert / 1000.0));
else if (value < 65) // grade from bright green (0% M) to yellow-green (30% M)
color.setHsvF(0.333 - 0.133 * (value - AMB_PERCENTAGE) / (65.0 - AMB_PERCENTAGE), 1.0, 1.0);
color.SETHSVF(0.333 - 0.133 * (value - AMB_PERCENTAGE) / (65.0 - AMB_PERCENTAGE), 1.0, 1.0);
else if (value < 85) // grade from yellow-green (30% M) to orange (70% M)
color.setHsvF(0.2 - 0.1 * (value - 65.0) / 20.0, 1.0, 1.0);
color.SETHSVF(0.2 - 0.1 * (value - 65.0) / 20.0, 1.0, 1.0);
else if (value < 100) // grade from orange (70% M) to red (100% M)
color.setHsvF(0.1 * (100.0 - value) / 15.0, 1.0, 1.0);
color.SETHSVF(0.1 * (100.0 - value) / 15.0, 1.0, 1.0);
else if (value < 120) // M value exceeded - grade from red to white
color.setHsvF(0.0, 1 - (value - 100.0) / 20.0, 1.0);
color.SETHSVF(0.0, 1 - (value - 100.0) / 20.0, 1.0);
else // white
color.setHsvF(0.0, 0.0, 1.0);
color.SETHSVF(0.0, 0.0, 1.0);
return color.rgba();
}
#undef SETHSVF
void DivePercentageItem::replot(const dive *d, const struct divecomputer *dc, const plot_info &pi)
{
auto [minX, maxX] = hAxis.screenMinMax();

View File

@ -10,12 +10,11 @@ class DiveCartesianAxis;
class DivePercentageItem : public QGraphicsPixmapItem {
public:
DivePercentageItem(const DiveCartesianAxis &hAxis, const DiveCartesianAxis &vAxis, double dpr);
DivePercentageItem(const DiveCartesianAxis &hAxis, const DiveCartesianAxis &vAxis);
void replot(const dive *d, const divecomputer *dc, const plot_info &pi);
private:
const DiveCartesianAxis &hAxis;
const DiveCartesianAxis &vAxis;
double dpr;
};
#endif

View File

@ -49,7 +49,7 @@ DivePixmaps::DivePixmaps(int dpr) : dpr(dpr)
// The transparen pixmap is a very obscure feature to enable tooltips without showing a pixmap.
// See code in diveeventitem.cpp. This should probably be replaced by a different mechanism.
QPixmap transparentPixmap(lrint(4 * dprf), lrint(20 * dprf));
transparentPixmap.fill(QColor::fromRgbF(1.0, 1.0, 1.0, 0.01));
transparentPixmap.fill(QColor::fromRgbF(1.0f, 1.0f, 1.0f, 0.01f));
}
static std::vector<std::shared_ptr<const DivePixmaps>> cache;

View File

@ -144,7 +144,7 @@ ProfileScene::ProfileScene(double dpr, bool printMode, bool isGrayscale) :
heartBeatItem(createItem<DiveHeartrateItem>(*heartBeatAxis,
[](const plot_data &item) { return (double)item.heartbeat; },
1, dpr)),
percentageItem(new DivePercentageItem(*timeAxis, *percentageAxis, dpr)),
percentageItem(new DivePercentageItem(*timeAxis, *percentageAxis)),
tankItem(new TankItem(*timeAxis, dpr)),
pixmaps(getDivePixmaps(dpr))
{

View File

@ -348,7 +348,8 @@ if [[ $PLATFORM = Darwin && "$BUILD_DEPS" == "1" ]] ; then
pushd openssl
mkdir -p build
cd build
../Configure --prefix="$INSTALL_ROOT" --openssldir="$INSTALL_ROOT" "$OLDER_MAC" darwin64-x86_64-cc
if [ $(arch) == "arm64" ] ; then OS_ARCH=darwin64-arm64-cc ; else OS_ARCH=darwin64-x86_64-cc; fi
../Configure --prefix="$INSTALL_ROOT" --openssldir="$INSTALL_ROOT" "$OLDER_MAC" $OS_ARCH
make depend
# all the tests fail because the assume that openssl is already installed. Odd? Still thinks work
make -j4 -k
@ -436,6 +437,7 @@ if [[ $PLATFORM = Darwin && "$BUILD_DEPS" == "1" ]] ; then
./${SRC_DIR}/scripts/get-dep-lib.sh single . libmtp
pushd libmtp
patch -p1 < ../${SRC_DIR}/scripts/libmtp.patch
echo 'N' | NOCONFIGURE="1" bash ./autogen.sh
mkdir -p build
cd build

View File

@ -6,8 +6,8 @@ CURRENT_LIBZ="v1.2.11"
CURRENT_LIBZIP="rel-1-5-1"
CURRENT_LIBGIT2="v1.0.1"
CURRENT_LIBCURL="curl-7_54_1"
CURRENT_LIBUSB="v1.0.21"
CURRENT_OPENSSL="OpenSSL_1_1_1h"
CURRENT_LIBUSB="v1.0.25"
CURRENT_OPENSSL="OpenSSL_1_1_1m"
CURRENT_LIBSSH2="libssh2-1.8.0"
CURRENT_XSLT="v1.1.34"
CURRENT_SQLITE="3190200"
@ -103,7 +103,7 @@ fi
# FIX FOR ANDROID,
if [ "$PLATFORM" == "singleAndroid" ] ; then
CURRENT_OPENSSL="OpenSSL_1_1_1h"
CURRENT_OPENSSL="OpenSSL_1_1_1m"
# If changing the openSSL version here, make sure to change it in packaging/android/variables.sh also.
fi
# no curl and old libs (never version breaks)

13
scripts/libmtp.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/libmtp.pc.in b/libmtp.pc.in
index 93c7bbf..ff817e1 100644
--- a/libmtp.pc.in
+++ b/libmtp.pc.in
@@ -10,6 +10,6 @@ Description: libmtp is a library for accessing Media Transfer Protocol devices
Version: @VERSION@
Requires.private: @LIBUSB_REQUIRES@
Conflicts:
-Libs: -L${libdir} -lmtp
+Libs: -L${libdir} -lmtp @OSFLAGS@
Libs.private: @LIBS@
-Cflags: -I${includedir} @OSFLAGS@
+Cflags: -I${includedir}

View File

@ -87,7 +87,7 @@ void RegressionItem::updatePosition()
img->fill(Qt::transparent);
if (confidence) {
QColor col(regressionItemColor);
col.setAlphaF(reg.r2);
col.setAlphaF((float)reg.r2);
painter->setPen(Qt::NoPen);
painter->setBrush(QBrush(col));
painter->drawPolygon(poly);

View File

@ -113,7 +113,7 @@ template<> int invalid_value<int>()
}
template<> double invalid_value<double>()
{
return std::numeric_limits<double>::quiet_NaN();
return NaN;
}
template<> QString invalid_value<QString>()
{
@ -121,7 +121,6 @@ template<> QString invalid_value<QString>()
}
template<> StatsQuartiles invalid_value<StatsQuartiles>()
{
double NaN = std::numeric_limits<double>::quiet_NaN();
return { std::vector<dive *>(), NaN, NaN, NaN, NaN, NaN };
}