mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-08 00:36:16 +00:00
Simplistic filtering by tags
This only allows for a logical "AND" - so only dives that all of the selected tags are displayed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2aabcf398a
commit
d5af4e2ff9
3 changed files with 9 additions and 2 deletions
1
dive.h
1
dive.h
|
@ -53,6 +53,7 @@
|
||||||
/* defined in statistics.c */
|
/* defined in statistics.c */
|
||||||
extern char *dtag_names[DTAG_NR];
|
extern char *dtag_names[DTAG_NR];
|
||||||
extern int dtag_shown[DTAG_NR];
|
extern int dtag_shown[DTAG_NR];
|
||||||
|
extern int dive_mask;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some silly typedefs to make our units very explicit.
|
* Some silly typedefs to make our units very explicit.
|
||||||
|
|
|
@ -695,7 +695,8 @@ static void fill_dive_list(void)
|
||||||
while (--i >= 0) {
|
while (--i >= 0) {
|
||||||
struct dive *dive = get_dive(i);
|
struct dive *dive = get_dive(i);
|
||||||
dive_trip_t *trip;
|
dive_trip_t *trip;
|
||||||
if ((dive->dive_tags & DTAG_INVALID) && !prefs.display_invalid_dives)
|
if (((dive->dive_tags & DTAG_INVALID) && !prefs.display_invalid_dives) ||
|
||||||
|
(dive->dive_tags & dive_mask) != dive_mask)
|
||||||
continue;
|
continue;
|
||||||
trip = dive->divetrip;
|
trip = dive->divetrip;
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ const char *existing_filename;
|
||||||
typedef enum { PANE_INFO, PANE_PROFILE, PANE_LIST, PANE_THREE } pane_conf_t;
|
typedef enum { PANE_INFO, PANE_PROFILE, PANE_LIST, PANE_THREE } pane_conf_t;
|
||||||
static pane_conf_t pane_conf;
|
static pane_conf_t pane_conf;
|
||||||
|
|
||||||
int dtag_shown[DTAG_NR];
|
int dive_mask, dtag_shown[DTAG_NR];
|
||||||
static struct device_info *holdnicknames = NULL;
|
static struct device_info *holdnicknames = NULL;
|
||||||
static GtkWidget *dive_profile_widget(void);
|
static GtkWidget *dive_profile_widget(void);
|
||||||
static void import_files(GtkWidget *, gpointer);
|
static void import_files(GtkWidget *, gpointer);
|
||||||
|
@ -1159,6 +1159,11 @@ static void selecttags_dialog(GtkWidget *w, gpointer data)
|
||||||
repaint_dive();
|
repaint_dive();
|
||||||
}
|
}
|
||||||
gtk_widget_destroy(dialog);
|
gtk_widget_destroy(dialog);
|
||||||
|
dive_mask = 0;
|
||||||
|
for (i = 0; i < DTAG_NR; i++)
|
||||||
|
if (dtag_shown[i])
|
||||||
|
dive_mask |= (1 << i);
|
||||||
|
dive_list_update_dives();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void selectevents_dialog(GtkWidget *w, gpointer data)
|
static void selectevents_dialog(GtkWidget *w, gpointer data)
|
||||||
|
|
Loading…
Add table
Reference in a new issue