gint snap_value = SNAP_NONE_VALUE;
- section->snap_button = _build_snap_to_grid ();
-
section->ini = g_key_file_new ();
if (!g_key_file_load_from_file (section->ini, TRANSITIONS,
return;
}
- snap_value = g_key_file_get_integer (section->ini, "edit_mode",
- "snap_grid_size", NULL);
-
- if (snap_value < SNAP_SMALL_VALUE)
- {
- hildon_picker_button_set_active
- (HILDON_PICKER_BUTTON (section->snap_button), SNAP_NONE);
- }
- else if (snap_value < SNAP_LARGE_VALUE)
- {
- hildon_picker_button_set_active
- (HILDON_PICKER_BUTTON (section->snap_button), SNAP_SMALL);
- }
- else if (snap_value < SNAP_HUGE_VALUE)
+ if (g_key_file_has_key (section->ini, "edit_mode", "snap_grid_size",
+ NULL))
{
- hildon_picker_button_set_active
- (HILDON_PICKER_BUTTON (section->snap_button), SNAP_LARGE);
- }
- else
- {
- hildon_picker_button_set_active
- (HILDON_PICKER_BUTTON (section->snap_button), SNAP_HUGE);
- }
+ section->snap_button = _build_snap_to_grid ();
+
+ snap_value = g_key_file_get_integer (section->ini, "edit_mode",
+ "snap_grid_size", NULL);
+ if (snap_value < SNAP_SMALL_VALUE)
+ {
+ hildon_picker_button_set_active
+ (HILDON_PICKER_BUTTON (section->snap_button), SNAP_NONE);
+ }
+ else if (snap_value < SNAP_LARGE_VALUE)
+ {
+ hildon_picker_button_set_active
+ (HILDON_PICKER_BUTTON (section->snap_button), SNAP_SMALL);
+ }
+ else if (snap_value < SNAP_HUGE_VALUE)
+ {
+ hildon_picker_button_set_active
+ (HILDON_PICKER_BUTTON (section->snap_button), SNAP_LARGE);
+ }
+ else
+ {
+ hildon_picker_button_set_active
+ (HILDON_PICKER_BUTTON (section->snap_button), SNAP_HUGE);
+ }
+ }
section->gconf = gconf_client_get_default ();
section->bookmarks_button = _build_bookmarks_button (section);
iface = TWEAKR_SECTION (section);
iface->name = _("Desktop");
iface->widget = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (iface->widget), section->snap_button,
- FALSE, FALSE, 0);
+
+ if (section->snap_button)
+ {
+ gtk_box_pack_start (GTK_BOX (iface->widget), section->snap_button,
+ FALSE, FALSE, 0);
+ }
if (section->bookmarks_button)
{
gtk_box_pack_start (GTK_BOX (iface->widget),
--- /dev/null
+/*
+ * vim:ts=4:sw=4:et:cindent:cino=(0
+ */
+
+#include <config.h>
+#include <glib.h>
+#include <glib/gi18n-lib.h>
+
+#include <gtk/gtk.h>
+#include <hildon/hildon-picker-button.h>
+#include <hildon/hildon-touch-selector.h>
+#include <hildon/hildon-button.h>
+#include <hildon/hildon-entry.h>
+#include <hildon/hildon-pannable-area.h>
+#include <hildon/hildon-defines.h>
+#include <gconf/gconf-client.h>
+
+#include "libtweakr-section/tweakr-section.h"
+#include "libtweakr-section/tweakr-module.h"
+
+
+#define TWEAKR_TYPE_PROFILE_SECTION \
+ (tweakr_profile_section_type)
+#define TWEAKR_PROFILE_SECTION(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ TWEAKR_TYPE_PROFILE_SECTION, \
+ TweakrProfileSection))
+#define TWEAKR_PROFILE_SECTION_CLASS(k) \
+ (G_TYPE_CHECK_CLASS_CAST((k), \
+ TWEAKR_TYPE_PROFILE_SECTION, \
+ TweakrProfileSectionClass))
+#define TWEAKR_IS_PROFILE_SECTION(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ TWEAKR_TYPE_PROFILE_SECTION))
+
+typedef struct _TweakrProfileSection TweakrProfileSection;
+typedef struct _TweakrProfileSectionClass
+ TweakrProfileSectionClass;
+
+struct _TweakrProfileSection
+{
+ TweakrSection parent_instance;
+};
+
+struct _TweakrProfileSectionClass
+{
+ TweakrSectionClass parent_class;
+};
+
+
+static GType tweakr_profile_section_get_type (GTypeModule *module);
+static void tweakr_profile_section_class_init
+ (TweakrProfileSectionClass *class);
+static void tweakr_profile_section_init
+ (TweakrProfileSection *section);
+static void tweakr_profile_section_dispose (GObject *obj);
+
+static gboolean _save (TweakrSection *section,
+ gboolean *requires_restart);
+
+static GType tweakr_profile_section_type = 0;
+static TweakrSectionClass *
+ tweakr_profile_section_parent_class = NULL;
+
+
+G_MODULE_EXPORT void
+tweakr_module_load (TweakrModule *module)
+{
+ tweakr_profile_section_get_type (G_TYPE_MODULE (module));
+}
+
+G_MODULE_EXPORT void
+tweakr_module_unload (TweakrModule *module)
+{
+}
+
+static GType
+tweakr_profile_section_get_type (GTypeModule *module)
+{
+ if (!tweakr_profile_section_type)
+ {
+ static const GTypeInfo section_info =
+ {
+ sizeof (TweakrProfileSectionClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) tweakr_profile_section_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TweakrProfileSection),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) tweakr_profile_section_init
+ };
+
+ tweakr_profile_section_type =
+ g_type_module_register_type (module, TWEAKR_TYPE_SECTION,
+ "TweakrProfileSection",
+ §ion_info, 0);
+ }
+
+ return tweakr_profile_section_type;
+}
+
+static void
+tweakr_profile_section_class_init
+ (TweakrProfileSectionClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ TweakrSectionClass *section_class =
+ TWEAKR_SECTION_CLASS (klass);
+
+ tweakr_profile_section_parent_class =
+ g_type_class_peek_parent (klass);
+
+ section_class->name = "_Profile";
+ section_class->save = _save;
+
+ object_class->dispose = tweakr_profile_section_dispose;
+}
+
+static void
+tweakr_profile_section_init (TweakrProfileSection *section)
+{
+ TweakrSection *iface;
+
+ iface = TWEAKR_SECTION (section);
+ iface->name = _("Profile");
+}
+
+static void
+tweakr_profile_section_dispose (GObject *obj)
+{
+ G_OBJECT_CLASS (tweakr_profile_section_parent_class)->dispose (obj);
+}
+
+static gboolean _save (TweakrSection *section, gboolean *requires_restart)
+{
+ return TRUE;
+}
+