Mercurial > pidgin
comparison src/gtkprefs.c @ 6928:6ed0a1c045b4
[gaim-migrate @ 7475]
Added support for invisible plugins.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Wed, 24 Sep 2003 01:28:33 +0000 |
parents | 4ae5d9c3d9ec |
children | 31c45d99e1a8 |
comparison
equal
deleted
inserted
replaced
6927:ee51189dfe76 | 6928:6ed0a1c045b4 |
---|---|
1 /*** | 1 /** |
2 * @file gtkprefs.c GTK+ Preferences | 2 * @file gtkprefs.c GTK+ Preferences |
3 * @ingroup gtkui | 3 * @ingroup gtkui |
4 * | 4 * |
5 * gaim | 5 * gaim |
6 * | 6 * |
1609 GtkTreeIter iter; | 1609 GtkTreeIter iter; |
1610 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | 1610 GtkTreePath *path = gtk_tree_path_new_from_string(pth); |
1611 GaimPlugin *plug; | 1611 GaimPlugin *plug; |
1612 gchar buf[1024]; | 1612 gchar buf[1024]; |
1613 gchar *name = NULL, *description = NULL; | 1613 gchar *name = NULL, *description = NULL; |
1614 | 1614 |
1615 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); | 1615 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); |
1616 gdk_window_set_cursor(prefs->window, wait); | 1616 gdk_window_set_cursor(prefs->window, wait); |
1617 gdk_cursor_unref(wait); | 1617 gdk_cursor_unref(wait); |
1618 | 1618 |
1619 gtk_tree_model_get_iter (model, &iter, path); | 1619 gtk_tree_model_get_iter (model, &iter, path); |
1620 gtk_tree_model_get (model, &iter, 2, &plug, -1); | 1620 gtk_tree_model_get (model, &iter, 2, &plug, -1); |
1621 | 1621 |
1622 if (!gaim_plugin_is_loaded(plug)) { | 1622 if (!gaim_plugin_is_loaded(plug)) { |
1623 gaim_plugin_load(plug); | 1623 gaim_plugin_load(plug); |
1624 | 1624 |
1625 /* | 1625 /* |
1626 * NOTE: This is basically the same check as before | 1626 * NOTE: This is basically the same check as before |
1649 if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(prefstree), | 1649 if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(prefstree), |
1650 &plugin_iter) == 1) { | 1650 &plugin_iter) == 1) { |
1651 | 1651 |
1652 /* Expand the tree for the first plugin added */ | 1652 /* Expand the tree for the first plugin added */ |
1653 GtkTreePath *path2; | 1653 GtkTreePath *path2; |
1654 | 1654 |
1655 path2 = gtk_tree_model_get_path(GTK_TREE_MODEL(prefstree), | 1655 path2 = gtk_tree_model_get_path(GTK_TREE_MODEL(prefstree), |
1656 &plugin_iter); | 1656 &plugin_iter); |
1657 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_v), | 1657 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_v), |
1658 path2, TRUE); | 1658 path2, TRUE); |
1659 gtk_tree_path_free(path2); | 1659 gtk_tree_path_free(path2); |
1698 g_free(description); | 1698 g_free(description); |
1699 | 1699 |
1700 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | 1700 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
1701 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, | 1701 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, |
1702 gaim_plugin_is_loaded(plug), -1); | 1702 gaim_plugin_is_loaded(plug), -1); |
1703 | 1703 |
1704 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | 1704 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
1705 gtk_tree_path_free(path); | 1705 gtk_tree_path_free(path); |
1706 | 1706 |
1707 gaim_gtk_plugins_save(); | 1707 gaim_gtk_plugins_save(); |
1708 } | 1708 } |
1717 | 1717 |
1718 gtk_list_store_clear(ls); | 1718 gtk_list_store_clear(ls); |
1719 | 1719 |
1720 for (probes = gaim_plugins_get_all(); | 1720 for (probes = gaim_plugins_get_all(); |
1721 probes != NULL; | 1721 probes != NULL; |
1722 probes = probes->next) { | 1722 probes = probes->next) |
1723 | 1723 { |
1724 plug = probes->data; | 1724 plug = probes->data; |
1725 | 1725 |
1726 if (plug->info->type != GAIM_PLUGIN_STANDARD) | 1726 if (plug->info->type != GAIM_PLUGIN_STANDARD || |
1727 (plug->info->flags & GAIM_PLUGIN_INVISIBLE)) | |
1728 { | |
1727 continue; | 1729 continue; |
1730 } | |
1728 | 1731 |
1729 gtk_list_store_append (ls, &iter); | 1732 gtk_list_store_append (ls, &iter); |
1730 gtk_list_store_set(ls, &iter, | 1733 gtk_list_store_set(ls, &iter, |
1731 0, gaim_plugin_is_loaded(plug), | 1734 0, gaim_plugin_is_loaded(plug), |
1732 1, plug->info->name ? _(plug->info->name) : plug->path, | 1735 1, plug->info->name ? _(plug->info->name) : plug->path, |
1733 2, plug, -1); | 1736 2, plug, -1); |
1734 } | 1737 } |
1735 } | 1738 } |
1736 | 1739 |
1737 static GtkWidget *plugin_page () | 1740 static GtkWidget *plugin_page () |