2013-05-07 03:50:30 +00:00
|
|
|
/*
|
|
|
|
* helpers.h
|
|
|
|
*
|
|
|
|
* header file for random helper functions of Subsurface
|
|
|
|
*
|
|
|
|
*/
|
2014-02-11 18:14:46 +00:00
|
|
|
#ifndef HELPERS_H
|
|
|
|
#define HELPERS_H
|
2013-05-07 03:50:30 +00:00
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include "dive.h"
|
2013-06-17 22:58:26 +00:00
|
|
|
#include "qthelper.h"
|
2013-05-07 03:50:30 +00:00
|
|
|
|
2013-09-22 19:37:49 +00:00
|
|
|
QString get_depth_string(depth_t depth, bool showunit = false, bool showdecimal = true);
|
|
|
|
QString get_depth_string(int mm, bool showunit = false, bool showdecimal = true);
|
2013-06-18 17:48:46 +00:00
|
|
|
QString get_depth_unit();
|
|
|
|
QString get_weight_string(weight_t weight, bool showunit = false);
|
|
|
|
QString get_weight_unit();
|
2013-10-03 14:50:38 +00:00
|
|
|
QString get_cylinder_used_gas_string(cylinder_t *cyl, bool showunit = false);
|
2013-06-18 17:48:46 +00:00
|
|
|
QString get_temperature_string(temperature_t temp, bool showunit = false);
|
|
|
|
QString get_temp_unit();
|
2014-05-29 20:13:11 +00:00
|
|
|
QString get_volume_string(volume_t volume, bool showunit = false, int mbar = 0);
|
2013-06-18 17:48:46 +00:00
|
|
|
QString get_volume_unit();
|
|
|
|
QString get_pressure_string(pressure_t pressure, bool showunit = false);
|
|
|
|
QString get_pressure_unit();
|
2013-05-23 06:24:33 +00:00
|
|
|
void set_default_dive_computer(const char *vendor, const char *product);
|
|
|
|
void set_default_dive_computer_device(const char *name);
|
2013-05-30 21:26:08 +00:00
|
|
|
QString getSubsurfaceDataPath(QString folderToFind);
|
2013-06-17 22:58:26 +00:00
|
|
|
extern const QString get_dc_nickname(const char *model, uint32_t deviceid);
|
2014-07-17 03:23:15 +00:00
|
|
|
int gettimezoneoffset(time_t when = 0);
|
2014-02-28 04:09:57 +00:00
|
|
|
int parseTemperatureToMkelvin(const QString &text);
|
2013-10-16 22:00:17 +00:00
|
|
|
QString get_dive_date_string(timestamp_t when);
|
|
|
|
QString get_short_dive_date_string(timestamp_t when);
|
|
|
|
QString get_trip_date_string(timestamp_t when, int nr);
|
2014-06-06 19:10:34 +00:00
|
|
|
QString uiLanguage(QLocale *callerLoc);
|
2014-06-28 15:35:59 +00:00
|
|
|
QLocale getLocale();
|
2014-07-16 16:35:22 +00:00
|
|
|
QString getDateFormat();
|
2014-06-10 05:45:44 +00:00
|
|
|
void selectedDivesGasUsed(QVector<QPair<QString, int> > &gasUsed);
|
2013-06-17 22:58:26 +00:00
|
|
|
|
2013-11-21 12:23:10 +00:00
|
|
|
#if defined __APPLE__
|
2014-02-28 04:09:57 +00:00
|
|
|
#define TITLE_OR_TEXT(_t, _m) "", _t + "\n" + _m
|
2013-11-21 12:23:10 +00:00
|
|
|
#else
|
2014-02-28 04:09:57 +00:00
|
|
|
#define TITLE_OR_TEXT(_t, _m) _t, _m
|
2013-11-21 12:23:10 +00:00
|
|
|
#endif
|
2014-02-11 18:14:46 +00:00
|
|
|
#endif // HELPERS_H
|