struct _MidoriPreferences
{
KatzePreferences parent_instance;
+
+ gpointer settings;
};
G_DEFINE_TYPE (MidoriPreferences, midori_preferences, KATZE_TYPE_PREFERENCES);
* MidoriPreferences:settings:
*
* The settings to proxy properties from.
- *
- * Since 0.2.1 the property is only writable.
*/
g_object_class_install_property (gobject_class,
PROP_SETTINGS,
"Settings",
"Settings instance to provide properties",
MIDORI_TYPE_WEB_SETTINGS,
- G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void
midori_preferences_init (MidoriPreferences* preferences)
{
- /* Nothing to do */
+ preferences->settings = NULL;
}
static void
GValue* value,
GParamSpec* pspec)
{
+ MidoriPreferences* preferences = MIDORI_PREFERENCES (object);
+
switch (prop_id)
{
+ case PROP_SETTINGS:
+ g_value_set_object (value, preferences->settings);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
* Note: This must not be called more than once.
*
* Since 0.1.2 this is equal to setting #MidoriPreferences:settings:.
- *
- * Since 0.2.1 this can be called multiple times.
**/
void
midori_preferences_set_settings (MidoriPreferences* preferences,
g_return_if_fail (MIDORI_IS_PREFERENCES (preferences));
g_return_if_fail (MIDORI_IS_WEB_SETTINGS (settings));
- gtk_container_foreach (GTK_CONTAINER (GTK_DIALOG (preferences)->vbox), (GtkCallback)gtk_widget_destroy, NULL);
+ g_return_if_fail (!preferences->settings);
+
+ preferences->settings = settings;
g_object_get (preferences, "transient-for", &parent, NULL);
icon_name = parent ? gtk_window_get_icon_name (parent) : NULL;