Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanups #1

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions cmake/Modules/MacOSXBundleInfo.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -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>
98 changes: 50 additions & 48 deletions core/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions desktop-widgets/about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}

Expand Down
2 changes: 1 addition & 1 deletion desktop-widgets/btdeviceselectiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

Expand Down
6 changes: 3 additions & 3 deletions desktop-widgets/divelogexportdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions desktop-widgets/divelogimportdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
4 changes: 2 additions & 2 deletions desktop-widgets/divesiteimportdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions desktop-widgets/downloadfromdivecomputer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
8 changes: 4 additions & 4 deletions desktop-widgets/kmessagewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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;
}

Expand Down
12 changes: 6 additions & 6 deletions desktop-widgets/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion desktop-widgets/notificationwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions desktop-widgets/notificationwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -25,7 +25,7 @@ public
slots:
void showError(QString message);
private:
QFutureWatcher<void> future_watcher;
QFutureWatcher<int> future_watcher;

private
slots:
Expand Down
4 changes: 2 additions & 2 deletions desktop-widgets/qtwaitingspinner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,15 @@ 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);
qreal resultAlpha = color.alphaF() - gradient * countDistance;

// 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;
}
Expand Down
12 changes: 0 additions & 12 deletions desktop-widgets/shifttimes.ui
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Loading