mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Don't use gconf on Windows
So far this just removes the gconf code - so no preferences for Windows. It also removes the unsused gconf references in main.c Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8961033574
commit
bf7d70fe8b
2 changed files with 11 additions and 7 deletions
13
gtk-gui.c
13
gtk-gui.c
|
@ -8,7 +8,9 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
#include <gconf/gconf-client.h>
|
#include <gconf/gconf-client.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "dive.h"
|
#include "dive.h"
|
||||||
#include "divelist.h"
|
#include "divelist.h"
|
||||||
|
@ -26,10 +28,12 @@ int error_count;
|
||||||
#define DIVELIST_DEFAULT_FONT "Sans 8"
|
#define DIVELIST_DEFAULT_FONT "Sans 8"
|
||||||
const char *divelist_font;
|
const char *divelist_font;
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
GConfClient *gconf;
|
GConfClient *gconf;
|
||||||
struct units output_units;
|
|
||||||
|
|
||||||
#define GCONF_NAME(x) "/apps/subsurface/" #x
|
#define GCONF_NAME(x) "/apps/subsurface/" #x
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct units output_units;
|
||||||
|
|
||||||
static GtkWidget *dive_profile;
|
static GtkWidget *dive_profile;
|
||||||
|
|
||||||
|
@ -400,6 +404,7 @@ static void preferences_dialog(GtkWidget *w, gpointer data)
|
||||||
update_dive_list_units();
|
update_dive_list_units();
|
||||||
repaint_dive();
|
repaint_dive();
|
||||||
update_dive_list_col_visibility();
|
update_dive_list_col_visibility();
|
||||||
|
#ifndef WIN32
|
||||||
gconf_client_set_bool(gconf, GCONF_NAME(feet), output_units.length == FEET, NULL);
|
gconf_client_set_bool(gconf, GCONF_NAME(feet), output_units.length == FEET, NULL);
|
||||||
gconf_client_set_bool(gconf, GCONF_NAME(psi), output_units.pressure == PSI, NULL);
|
gconf_client_set_bool(gconf, GCONF_NAME(psi), output_units.pressure == PSI, NULL);
|
||||||
gconf_client_set_bool(gconf, GCONF_NAME(cuft), output_units.volume == CUFT, NULL);
|
gconf_client_set_bool(gconf, GCONF_NAME(cuft), output_units.volume == CUFT, NULL);
|
||||||
|
@ -410,6 +415,7 @@ static void preferences_dialog(GtkWidget *w, gpointer data)
|
||||||
gconf_client_set_bool(gconf, GCONF_NAME(SAC), visible_cols.sac, NULL);
|
gconf_client_set_bool(gconf, GCONF_NAME(SAC), visible_cols.sac, NULL);
|
||||||
gconf_client_set_bool(gconf, GCONF_NAME(OTU), visible_cols.otu, NULL);
|
gconf_client_set_bool(gconf, GCONF_NAME(OTU), visible_cols.otu, NULL);
|
||||||
gconf_client_set_string(gconf, GCONF_NAME(divelist_font), divelist_font, NULL);
|
gconf_client_set_string(gconf, GCONF_NAME(divelist_font), divelist_font, NULL);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
gtk_widget_destroy(dialog);
|
gtk_widget_destroy(dialog);
|
||||||
}
|
}
|
||||||
|
@ -706,6 +712,8 @@ void init_ui(int argc, char **argv)
|
||||||
gtk_settings_set_long_property(settings, "gtk_tooltip_timeout", 10, "subsurface setting");
|
gtk_settings_set_long_property(settings, "gtk_tooltip_timeout", 10, "subsurface setting");
|
||||||
|
|
||||||
g_type_init();
|
g_type_init();
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
gconf = gconf_client_get_default();
|
gconf = gconf_client_get_default();
|
||||||
|
|
||||||
if (gconf_client_get_bool(gconf, GCONF_NAME(feet), NULL))
|
if (gconf_client_get_bool(gconf, GCONF_NAME(feet), NULL))
|
||||||
|
@ -724,6 +732,7 @@ void init_ui(int argc, char **argv)
|
||||||
visible_cols.sac = gconf_client_get_bool(gconf, GCONF_NAME(SAC), NULL);
|
visible_cols.sac = gconf_client_get_bool(gconf, GCONF_NAME(SAC), NULL);
|
||||||
|
|
||||||
divelist_font = gconf_client_get_string(gconf, GCONF_NAME(divelist_font), NULL);
|
divelist_font = gconf_client_get_string(gconf, GCONF_NAME(divelist_font), NULL);
|
||||||
|
#endif
|
||||||
if (!divelist_font)
|
if (!divelist_font)
|
||||||
divelist_font = DIVELIST_DEFAULT_FONT;
|
divelist_font = DIVELIST_DEFAULT_FONT;
|
||||||
|
|
||||||
|
|
5
main.c
5
main.c
|
@ -4,16 +4,11 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include <gconf/gconf-client.h>
|
|
||||||
|
|
||||||
#include "dive.h"
|
#include "dive.h"
|
||||||
#include "divelist.h"
|
#include "divelist.h"
|
||||||
|
|
||||||
GConfClient *gconf;
|
|
||||||
struct units output_units;
|
struct units output_units;
|
||||||
|
|
||||||
#define GCONF_NAME(x) "/apps/subsurface/" #x
|
|
||||||
|
|
||||||
/* random helper functions, used here or elsewhere */
|
/* random helper functions, used here or elsewhere */
|
||||||
static int sortfn(const void *_a, const void *_b)
|
static int sortfn(const void *_a, const void *_b)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue