mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Added option to choose between different depth grid quantization schema.
This allows having 3m depth grid for metric users. * All original properties ( named diferently ) were renamed to three_m_based_grid everywhere to be consistent. * Plus other small changes requested during review. Signed-off-by: Vlad A. <elf128@gmail.com> Signed-off-by: Vlad A <elf128@gmail.com>
This commit is contained in:
parent
15f3918171
commit
30a964c508
10 changed files with 85 additions and 8 deletions
|
|
@ -92,6 +92,7 @@ struct preferences default_prefs = {
|
|||
.auto_recalculate_thumbnails = true,
|
||||
.extract_video_thumbnails = true,
|
||||
.extract_video_thumbnails_position = 20, // The first fifth seems like a reasonable place
|
||||
.three_m_based_grid = false,
|
||||
};
|
||||
|
||||
/* copy a preferences block, including making copies of all included strings */
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ struct preferences {
|
|||
double font_size;
|
||||
double mobile_scale;
|
||||
bool show_developer;
|
||||
bool three_m_based_grid;
|
||||
|
||||
// ********** Equipment tab *******
|
||||
const char *default_cylinder;
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ void qPrefDisplay::loadSync(bool doSync)
|
|||
load_lastState();
|
||||
load_singleColumnPortrait();
|
||||
}
|
||||
disk_three_m_based_grid(doSync);
|
||||
}
|
||||
|
||||
void qPrefDisplay::set_divelist_font(const QString &value)
|
||||
|
|
@ -148,6 +149,8 @@ HANDLE_PREFERENCE_BOOL(Display, "displayinvalid", display_invalid_dives);
|
|||
|
||||
HANDLE_PREFERENCE_BOOL(Display, "show_developer", show_developer);
|
||||
|
||||
HANDLE_PREFERENCE_BOOL(Display, "three_m_based_grid", three_m_based_grid);
|
||||
|
||||
void qPrefDisplay::setCorrectFont()
|
||||
{
|
||||
// get the font from the settings or our defaults
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ class qPrefDisplay : public QObject {
|
|||
Q_PROPERTY(QByteArray windowState READ windowState WRITE set_windowState NOTIFY windowStateChanged)
|
||||
Q_PROPERTY(int lastState READ lastState WRITE set_lastState NOTIFY lastStateChanged)
|
||||
Q_PROPERTY(bool singleColumnPortrait READ singleColumnPortrait WRITE set_singleColumnPortrait NOTIFY singleColumnPortraitChanged)
|
||||
Q_PROPERTY(bool three_m_based_grid READ three_m_based_grid WRITE set_three_m_based_grid NOTIFY three_m_based_gridChanged)
|
||||
|
||||
public:
|
||||
static qPrefDisplay *instance();
|
||||
|
|
@ -52,6 +53,7 @@ public:
|
|||
static QByteArray windowState() { return st_windowState; }
|
||||
static int lastState() { return st_lastState; }
|
||||
static bool singleColumnPortrait() { return st_singleColumnPortrait; }
|
||||
static bool three_m_based_grid() { return prefs.three_m_based_grid; }
|
||||
|
||||
public slots:
|
||||
static void set_animation_speed(int value);
|
||||
|
|
@ -71,6 +73,7 @@ public slots:
|
|||
static void set_windowState(const QByteArray& value);
|
||||
static void set_lastState(int value);
|
||||
static void set_singleColumnPortrait(bool value);
|
||||
static void set_three_m_based_grid(bool value);
|
||||
|
||||
signals:
|
||||
void animation_speedChanged(int value);
|
||||
|
|
@ -90,6 +93,7 @@ signals:
|
|||
void windowStateChanged(const QByteArray& value);
|
||||
void lastStateChanged(int value);
|
||||
void singleColumnPortraitChanged(bool value);
|
||||
void three_m_based_gridChanged(bool value);
|
||||
|
||||
private:
|
||||
qPrefDisplay() {}
|
||||
|
|
@ -101,6 +105,7 @@ private:
|
|||
static void disk_mobile_scale(bool doSync);
|
||||
static void disk_display_invalid_dives(bool doSync);
|
||||
static void disk_show_developer(bool doSync);
|
||||
static void disk_three_m_based_grid(bool doSync);
|
||||
|
||||
// functions to handle class variables
|
||||
static void load_lastDir();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue