}
#endif
+#endif
+
MidoriExtension*
extension_init (void)
{
MidoriExtension* extension = g_object_new (MIDORI_TYPE_EXTENSION,
"name", _("Advertisement blocker"),
"description", _("Block advertisements according to a filter list"),
+ #if WEBKIT_CHECK_VERSION (1, 1, 14)
"version", "0.1",
+ #endif
"authors", "Christian Dywan <christian@twotoasts.de>",
NULL);
+ #if WEBKIT_CHECK_VERSION (1, 1, 14)
midori_extension_install_string_list (extension, "filters", NULL, G_MAXSIZE);
g_signal_connect (extension, "activate",
G_CALLBACK (adblock_activate_cb), NULL);
+ #endif
return extension;
}
-
-#endif
gtk_tree_model_get (model, iter, 0, &extension, -1);
- g_object_set (renderer, "active", midori_extension_is_active (extension), NULL);
+ g_object_set (renderer,
+ "activatable", midori_extension_is_prepared (extension),
+ "active", midori_extension_is_active (extension),
+ NULL);
g_object_unref (extension);
}
name = katze_object_get_string (extension, "name");
version = katze_object_get_string (extension, "version");
desc = katze_object_get_string (extension, "description");
- text = g_markup_printf_escaped ("<b>%s</b> %s\n%s", name, version, desc);
+ text = g_markup_printf_escaped ("<b>%s</b> %s\n%s",
+ name, version && *version ? version : "", desc);
g_free (name);
g_free (version);
g_free (desc);
- g_object_set (renderer, "markup", text, NULL);
+ g_object_set (renderer,
+ "markup", text,
+ "sensitive", midori_extension_is_prepared (extension),
+ NULL);
g_free (text);
g_object_unref (extension);
gtk_tree_model_get (model, &iter, 0, &extension, -1);
if (midori_extension_is_active (extension))
midori_extension_deactivate (extension);
- else
+ else if (midori_extension_is_prepared (extension))
g_signal_emit_by_name (extension, "activate", extensions->app);
g_object_unref (extension);
if (katze_tree_view_get_selected_iter (GTK_TREE_VIEW (widget), &model, &iter))
{
- MidoriExtension *extension;
+ MidoriExtension* extension;
gtk_tree_model_get (model, &iter, 0, &extension, -1);
model = gtk_tree_view_get_model (GTK_TREE_VIEW (extensions->treeview));
if (gtk_tree_model_get_iter_from_string (model, &iter, path))
{
- MidoriExtension *extension;
+ MidoriExtension* extension;
gtk_tree_model_get (model, &iter, 0, &extension, -1);
if (midori_extension_is_active (extension))
midori_extension_deactivate (extension);
- else
+ else if (midori_extension_is_prepared (extension))
g_signal_emit_by_name (extension, "activate", extensions->app);
g_object_unref (extension);
name1 = katze_object_get_string (e1, "name");
name2 = katze_object_get_string (e2, "name");
+ g_object_unref (e1);
+ g_object_unref (e2);
+
result = g_strcmp0 (name1, name2);
g_free (name1);