mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Enable the weightsystem info and move the declarations to dive.h
Having the tank_info declared in models.cpp seemed unintuitive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
641db88a2c
commit
ecbcd4db47
3 changed files with 13 additions and 9 deletions
13
dive.h
13
dive.h
|
@ -726,9 +726,9 @@ void get_gas_string(int o2, int he, char *buf, int len);
|
||||||
struct event *get_next_event(struct event *event, char *name);
|
struct event *get_next_event(struct event *event, char *name);
|
||||||
|
|
||||||
|
|
||||||
/* this struct holds the information that
|
/* these structs holds the information that
|
||||||
* describes the cylinders of air.
|
* describes the cylinders / weight systems.
|
||||||
* it is a global variable initialized in equipment.c
|
* they are global variables initialized in equipment.c
|
||||||
* used to fill the combobox in the add/edit cylinder
|
* used to fill the combobox in the add/edit cylinder
|
||||||
* dialog
|
* dialog
|
||||||
*/
|
*/
|
||||||
|
@ -737,6 +737,13 @@ struct tank_info {
|
||||||
const char *name;
|
const char *name;
|
||||||
int cuft, ml, psi, bar;
|
int cuft, ml, psi, bar;
|
||||||
};
|
};
|
||||||
|
extern struct tank_info tank_info[100];
|
||||||
|
|
||||||
|
struct ws_info {
|
||||||
|
const char *name;
|
||||||
|
int grams;
|
||||||
|
};
|
||||||
|
extern struct ws_info ws_info[100];
|
||||||
|
|
||||||
extern bool cylinder_nodata(cylinder_t *cyl);
|
extern bool cylinder_nodata(cylinder_t *cyl);
|
||||||
extern bool cylinder_none(void *_data);
|
extern bool cylinder_none(void *_data);
|
||||||
|
|
|
@ -909,15 +909,13 @@ bad_tank_info:
|
||||||
fprintf(stderr, "Bad tank info for '%s'\n", info->name);
|
fprintf(stderr, "Bad tank info for '%s'\n", info->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* USE_GTK_UI */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We hardcode the most common weight system types
|
* We hardcode the most common weight system types
|
||||||
* This is a bit odd as the weight system types don't usually encode weight
|
* This is a bit odd as the weight system types don't usually encode weight
|
||||||
*/
|
*/
|
||||||
static struct ws_info {
|
struct ws_info ws_info[100] = {
|
||||||
const char *name;
|
|
||||||
int grams;
|
|
||||||
} ws_info[100] = {
|
|
||||||
{ N_("integrated"), 0 },
|
{ N_("integrated"), 0 },
|
||||||
{ N_("belt"), 0 },
|
{ N_("belt"), 0 },
|
||||||
{ N_("ankle"), 0 },
|
{ N_("ankle"), 0 },
|
||||||
|
@ -925,6 +923,7 @@ static struct ws_info {
|
||||||
{ N_("clip-on"), 0 },
|
{ N_("clip-on"), 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if USE_GTK_UI
|
||||||
static void fill_ws_list(GtkListStore *store)
|
static void fill_ws_list(GtkListStore *store)
|
||||||
{
|
{
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
|
|
|
@ -14,8 +14,6 @@
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
|
||||||
extern struct tank_info tank_info[100];
|
|
||||||
|
|
||||||
CylindersModel::CylindersModel(QObject* parent): QAbstractTableModel(parent), current(0), rows(0)
|
CylindersModel::CylindersModel(QObject* parent): QAbstractTableModel(parent), current(0), rows(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue