champlain-enum-types.h \
champlain-tile.h \
champlain-map-source.h \
- champlain-network-map-source.h \
- champlain-settings.h
+ champlain-network-map-source.h
libchamplain_0_3_la_SOURCES = \
champlain-zoom-level.c \
champlain-tile.c \
champlain-map-source.c \
- champlain-network-map-source.c \
- champlain-settings.c
+ champlain-network-map-source.c
noinst_HEADERS = \
champlain-debug.h \
champlain-network-map-source.h \
champlain-tile.h \
champlain-zoom-level.h \
- champlain-marker.h \
- champlain-settings.h
+ champlain-marker.h
libchamplain_0_3_la_LIBADD = $(DEPS_LIBS) ../tidy/libtidy-1.0.la
#include "champlain-map-source.h"
#include "champlain-marshal.h"
#include "champlain-private.h"
-#include "champlain-settings.h"
#include "champlain-zoom-level.h"
#include <glib.h>
#include "champlain-map-source.h"
#include "champlain-marshal.h"
#include "champlain-private.h"
-#include "champlain-settings.h"
#include "champlain-zoom-level.h"
#include <errno.h>
enum
{
PROP_0,
- PROP_URI_FORMAT
+ PROP_URI_FORMAT,
+ PROP_OFFLINE
};
/* static guint champlain_network_map_source_signals[LAST_SIGNAL] = { 0, }; */
struct _ChamplainNetworkMapSourcePrivate
{
+ gboolean offline;
gchar *uri_format;
};
case PROP_URI_FORMAT:
g_value_set_string (value, priv->uri_format);
break;
+ case PROP_OFFLINE:
+ g_value_set_boolean (value, priv->offline);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
case PROP_URI_FORMAT:
priv->uri_format = g_value_dup_string (value);
break;
+ case PROP_OFFLINE:
+ priv->offline = g_value_get_boolean (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
(G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class, PROP_URI_FORMAT, pspec);
+ /**
+ * ChamplainNetworkMapSource:offline
+ *
+ * If the network map source can access network
+ *
+ * Since: 0.4
+ */
+ pspec = g_param_spec_boolean ("offline",
+ "Offline",
+ "Offline",
+ FALSE,
+ (G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ g_object_class_install_property (object_class, PROP_OFFLINE, pspec);
}
static void
g_object_unref (tile);
g_object_unref (zoom_level);
}
- else if (champlain_settings_is_online ())
+ else if (!priv->offline)
{
SoupMessage *msg;
gchar *uri;
+++ /dev/null
-
-/*
- * Copyright (C) 2009 Pierre-Luc Beaudoin <pierre-luc@pierlux.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "champlain-settings.h"
-
-static gboolean global_offline = TRUE;
-
-gboolean
-champlain_settings_is_online ()
-{
- return global_offline;
-}
-
-gboolean
-champlain_settings_set_online (gboolean value)
-{
- global_offline = value;
-}
+++ /dev/null
-/*
- * Copyright (C) 2008 Pierre-Luc Beaudoin <pierre-luc@pierlux.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#if !defined (__CHAMPLAIN_CHAMPLAIN_H_INSIDE__) && !defined (CHAMPLAIN_COMPILATION)
-#error "Only <champlain/champlain.h> can be included directly."
-#endif
-
-#ifndef CHAMPLAIN_SETTINGS_H
-#define CHAMPLAIN_SETTINGS_H
-
-#include <glib.h>
-
-gboolean champlain_settings_is_online ();
-gboolean champlain_settings_set_online (gboolean value);
-
-#endif
* url="http://www.openstreetmap.org">OpenStreetMap</ulink>). Maps are divided
* in tiles for each zoom level. When a tile is requested, #ChamplainView will
* first check if it is in cache (in the user's cache dir under champlain). If
- * an error occurs during download, an error tile will be displayed (if not in
- * offline mode).
+ * an error occurs during download, an error tile will be displayed.
*
* The button-press-event and button-release-event signals are emitted each
* time a mouse button is pressed on the @view. Coordinates can be converted
PROP_LATITUDE,
PROP_ZOOM_LEVEL,
PROP_MAP_SOURCE,
- PROP_OFFLINE,
PROP_DECEL_RATE,
PROP_SCROLL_MODE,
PROP_KEEP_CENTER_ON_RESIZE,
case PROP_SCROLL_MODE:
g_value_set_enum (value, priv->scroll_mode);
break;
- case PROP_OFFLINE:
- g_value_set_boolean (value, !champlain_settings_is_online ());
- break;
case PROP_DECEL_RATE:
{
gdouble decel;
g_object_set (G_OBJECT (priv->finger_scroll), "mode",
priv->scroll_mode, NULL);
break;
- case PROP_OFFLINE:
- champlain_settings_set_online (!g_value_get_boolean (value));
- break;
case PROP_DECEL_RATE:
{
gdouble decel = g_value_get_double (value);
CHAMPLAIN_TYPE_MAP_SOURCE,
CHAMPLAIN_PARAM_READWRITE));
- /**
- * ChamplainView:offline:
- *
- * If true, will fetch tiles from the Internet, otherwise, will only use
- * cached content.
- *
- * Since: 0.2
- */
- g_object_class_install_property (object_class,
- PROP_OFFLINE,
- g_param_spec_boolean ("offline",
- "Offline Mode",
- "If viewer is in offline mode.",
- FALSE, CHAMPLAIN_PARAM_READWRITE));
-
/**
* ChamplainView:scroll-mode:
*
#include "champlain/champlain-enum-types.h"
#include "champlain/champlain-map-source.h"
#include "champlain/champlain-network-map-source.h"
-#include "champlain/champlain-settings.h"
#undef __CHAMPLAIN_CHAMPLAIN_H_INSIDE__