root / trunk / client / gui / gui_plugins.c @ 1863
History | View | Annotate | Download (12.4 KB)
| 1 | 
                  /* 
                 | 
              
|---|---|
| 2 | 
                  Copyright (C) 2005-2010 Erik van Pienbroek  | 
              
| 3 | 
                   | 
              
| 4 | 
                  This program is free software; you can redistribute it and/or modify  | 
              
| 5 | 
                  it under the terms of the GNU General Public License as published by  | 
              
| 6 | 
                  the Free Software Foundation; either version 2 of the License, or  | 
              
| 7 | 
                  (at your option) any later version.  | 
              
| 8 | 
                   | 
              
| 9 | 
                  This program is distributed in the hope that it will be useful,  | 
              
| 10 | 
                  but WITHOUT ANY WARRANTY; without even the implied warranty of  | 
              
| 11 | 
                  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  | 
              
| 12 | 
                  GNU General Public License for more details.  | 
              
| 13 | 
                   | 
              
| 14 | 
                  You should have received a copy of the GNU General Public License  | 
              
| 15 | 
                  along with this program; if not, write to the Free Software  | 
              
| 16 | 
                  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA  | 
              
| 17 | 
                  */  | 
              
| 18 | 
                   | 
              
| 19 | 
                  #include  | 
              
| 20 | 
                  #include "gui.h"  | 
              
| 21 | 
                  #include "config_gui.h"  | 
              
| 22 | 
                   | 
              
| 23 | 
                  enum {
                 | 
              
| 24 | 
                  FIELD_PLUGIN_NAME,  | 
              
| 25 | 
                  FIELD_ENABLED,  | 
              
| 26 | 
                  FIELD_AUTO_LOAD,  | 
              
| 27 | 
                  LAST_FIELD  | 
              
| 28 | 
                  };  | 
              
| 29 | 
                  static GtkTreeViewColumn *columns[LAST_FIELD] = { 0, 0, 0 };  | 
              
| 30 | 
                   | 
              
| 31 | 
                  G_MODULE_EXPORT void
                 | 
              
| 32 | 
                  on_btnWindowPluginsClose_clicked(GtkWidget *caller, gpointer data)  | 
              
| 33 | 
                  {
                 | 
              
| 34 | 
                      GtkWidget *windowPlugins = nntpgrab_gui_base_get_widget("windowPlugins");
                 | 
              
| 35 | 
                   | 
              
| 36 | 
                  gtk_widget_hide(windowPlugins);  | 
              
| 37 | 
                  }  | 
              
| 38 | 
                   | 
              
| 39 | 
                  G_MODULE_EXPORT gboolean  | 
              
| 40 | 
                  on_windowPlugins_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data)  | 
              
| 41 | 
                  {
                 | 
              
| 42 | 
                  gtk_widget_hide(widget);  | 
              
| 43 | 
                   | 
              
| 44 | 
                      return TRUE;
                 | 
              
| 45 | 
                  }  | 
              
| 46 | 
                   | 
              
| 47 | 
                  static void  | 
              
| 48 | 
                  on_tree_view_select (GtkTreeSelection *selection, gpointer user_data)  | 
              
| 49 | 
                  {
                 | 
              
| 50 | 
                  NNTPGrabPluginInfo info;  | 
              
| 51 | 
                  char *plugin_name = NULL;  | 
              
| 52 | 
                      GtkTreeModel *model = NULL;
                 | 
              
| 53 | 
                  GtkTreeIter iter;  | 
              
| 54 | 
                      GtkWidget *labelPluginName = nntpgrab_gui_base_get_widget("labelPluginName");
                 | 
              
| 55 | 
                      GtkWidget *labelPluginAuthor = nntpgrab_gui_base_get_widget("labelPluginAuthor");
                 | 
              
| 56 | 
                      GtkWidget *labelPluginVersion = nntpgrab_gui_base_get_widget("labelPluginVersion");
                 | 
              
| 57 | 
                      GtkWidget *linkbuttonPluginURL = nntpgrab_gui_base_get_widget("linkbuttonPluginURL");
                 | 
              
| 58 | 
                      GtkWidget *labelPluginDesc = nntpgrab_gui_base_get_widget("labelPluginDesc");
                 | 
              
| 59 | 
                  char name[128];  | 
              
| 60 | 
                   | 
              
| 61 | 
                  if (gtk_tree_selection_count_selected_rows(selection) == 0) {  | 
              
| 62 | 
                          // No items selected, blank everything
                 | 
              
| 63 | 
                          gtk_label_set_text(GTK_LABEL(labelPluginName), "");
                 | 
              
| 64 | 
                          gtk_label_set_text(GTK_LABEL(labelPluginAuthor), "");
                 | 
              
| 65 | 
                          gtk_label_set_text(GTK_LABEL(labelPluginVersion), "");
                 | 
              
| 66 | 
                  gtk_widget_set_sensitive(linkbuttonPluginURL, FALSE);  | 
              
| 67 | 
                          gtk_button_set_label(GTK_BUTTON(linkbuttonPluginURL), "");
                 | 
              
| 68 | 
                          gtk_label_set_text(GTK_LABEL(labelPluginDesc), "");
                 | 
              
| 69 | 
                          return;
                 | 
              
| 70 | 
                  }  | 
              
| 71 | 
                   | 
              
| 72 | 
                  gtk_tree_selection_get_selected(selection, &model, &iter);  | 
              
| 73 | 
                      gtk_tree_model_get(model, &iter, FIELD_PLUGIN_NAME, &plugin_name, -1);
                 | 
              
| 74 | 
                   | 
              
| 75 | 
                  memset(&info, 0, sizeof(info));  | 
              
| 76 | 
                      if (!nntpgrab_glue_plugins_get_plugin_info(glue, plugin_name, &info)) {
                 | 
              
| 77 | 
                          g_print(__FILE__ ":%i Unable to retrieve plugin information for plugin '%s'\n", __LINE__, plugin_name);
                 | 
              
| 78 | 
                  g_free(plugin_name);  | 
              
| 79 | 
                          return;
                 | 
              
| 80 | 
                  }  | 
              
| 81 | 
                   | 
              
| 82 | 
                  memset(&name, 0, sizeof(name));  | 
              
| 83 | 
                  snprintf(name, sizeof(name) - 1, "%s", info.name);  | 
              
| 84 | 
                   | 
              
| 85 | 
                  gtk_label_set_markup(GTK_LABEL(labelPluginName), name);  | 
              
| 86 | 
                  gtk_label_set_text(GTK_LABEL(labelPluginAuthor), info.author);  | 
              
| 87 | 
                  gtk_label_set_text(GTK_LABEL(labelPluginVersion), info.version);  | 
              
| 88 | 
                  gtk_widget_set_sensitive(linkbuttonPluginURL, TRUE);  | 
              
| 89 | 
                  gtk_link_button_set_uri(GTK_LINK_BUTTON(linkbuttonPluginURL), info.url);  | 
              
| 90 | 
                  gtk_button_set_label(GTK_BUTTON(linkbuttonPluginURL), info.url);  | 
              
| 91 | 
                  gtk_label_set_text(GTK_LABEL(labelPluginDesc), info.description);  | 
              
| 92 | 
                  }  | 
              
| 93 | 
                   | 
              
| 94 | 
                  static void  | 
              
| 95 | 
                  on_plugin_loaded (NntpgrabGlue *obj, const char *plugin_name, gboolean is_persistent)  | 
              
| 96 | 
                  {
                 | 
              
| 97 | 
                      GtkWidget *treePlugins = nntpgrab_gui_base_get_widget("treePlugins");
                 | 
              
| 98 | 
                  GtkTreeModel *store = gtk_tree_view_get_model(GTK_TREE_VIEW(treePlugins));  | 
              
| 99 | 
                  GtkTreeIter iter;  | 
              
| 100 | 
                   | 
              
| 101 | 
                      if (!gtk_tree_model_get_iter_first(store, &iter)) {
                 | 
              
| 102 | 
                          /* Huh? Empty tree */
                 | 
              
| 103 | 
                          return;
                 | 
              
| 104 | 
                  }  | 
              
| 105 | 
                   | 
              
| 106 | 
                      do {
                 | 
              
| 107 | 
                  char *plugin_name_store = NULL;  | 
              
| 108 | 
                   | 
              
| 109 | 
                          gtk_tree_model_get(store, &iter, FIELD_PLUGIN_NAME, &plugin_name_store, -1);
                 | 
              
| 110 | 
                   | 
              
| 111 | 
                          if (!strcmp(plugin_name, plugin_name_store)) {
                 | 
              
| 112 | 
                              gtk_list_store_set(GTK_LIST_STORE(store), &iter, FIELD_ENABLED, TRUE, -1);
                 | 
              
| 113 | 
                  g_free(plugin_name_store);  | 
              
| 114 | 
                              return;
                 | 
              
| 115 | 
                  }  | 
              
| 116 | 
                   | 
              
| 117 | 
                  g_free(plugin_name_store);  | 
              
| 118 | 
                      } while (gtk_tree_model_iter_next(store, &iter));
                 | 
              
| 119 | 
                  }  | 
              
| 120 | 
                   | 
              
| 121 | 
                  static void  | 
              
| 122 | 
                  on_plugin_unloaded (NntpgrabGlue *obj, const char *plugin_name)  | 
              
| 123 | 
                  {
                 | 
              
| 124 | 
                      GtkWidget *treePlugins = nntpgrab_gui_base_get_widget("treePlugins");
                 | 
              
| 125 | 
                  GtkTreeModel *store = gtk_tree_view_get_model(GTK_TREE_VIEW(treePlugins));  | 
              
| 126 | 
                  GtkTreeIter iter;  | 
              
| 127 | 
                   | 
              
| 128 | 
                      if (!gtk_tree_model_get_iter_first(store, &iter)) {
                 | 
              
| 129 | 
                          /* Huh? Empty tree */
                 | 
              
| 130 | 
                          return;
                 | 
              
| 131 | 
                  }  | 
              
| 132 | 
                   | 
              
| 133 | 
                      do {
                 | 
              
| 134 | 
                  char *plugin_name_store = NULL;  | 
              
| 135 | 
                   | 
              
| 136 | 
                          gtk_tree_model_get(store, &iter, FIELD_PLUGIN_NAME, &plugin_name_store, -1);
                 | 
              
| 137 | 
                   | 
              
| 138 | 
                          if (!strcmp(plugin_name, plugin_name_store)) {
                 | 
              
| 139 | 
                              gtk_list_store_set(GTK_LIST_STORE(store), &iter, FIELD_ENABLED, FALSE, -1);
                 | 
              
| 140 | 
                  g_free(plugin_name_store);  | 
              
| 141 | 
                              return;
                 | 
              
| 142 | 
                  }  | 
              
| 143 | 
                   | 
              
| 144 | 
                  g_free(plugin_name_store);  | 
              
| 145 | 
                      } while (gtk_tree_model_iter_next(store, &iter));
                 | 
              
| 146 | 
                  }  | 
              
| 147 | 
                   | 
              
| 148 | 
                  static void  | 
              
| 149 | 
                  enabled_check_toggled(GtkWidget *caller, gchar *path, gpointer data)  | 
              
| 150 | 
                  {
                 | 
              
| 151 | 
                  gboolean value;  | 
              
| 152 | 
                  GtkTreeIter iter;  | 
              
| 153 | 
                  GtkWidget *treePlugins;  | 
              
| 154 | 
                  GtkWidget *windowPlugins;  | 
              
| 155 | 
                  GtkTreeModel *model;  | 
              
| 156 | 
                  char *plugin_name = NULL;  | 
              
| 157 | 
                  char *errmsg = NULL;  | 
              
| 158 | 
                   | 
              
| 159 | 
                      treePlugins = nntpgrab_gui_base_get_widget("treePlugins");
                 | 
              
| 160 | 
                      windowPlugins = nntpgrab_gui_base_get_widget("windowPlugins");
                 | 
              
| 161 | 
                   | 
              
| 162 | 
                  model = gtk_tree_view_get_model(GTK_TREE_VIEW(treePlugins));  | 
              
| 163 | 
                   | 
              
| 164 | 
                      if (gtk_tree_model_get_iter_from_string(model, &iter, path)) {
                 | 
              
| 165 | 
                          gtk_tree_model_get(model, &iter, FIELD_ENABLED, &value, FIELD_PLUGIN_NAME, &plugin_name, -1);
                 | 
              
| 166 | 
                          if (value) {
                 | 
              
| 167 | 
                              /* Unload the plugin */
                 | 
              
| 168 | 
                              if (!nntpgrab_glue_plugins_unload_plugin(glue, plugin_name, &errmsg)) {
                 | 
              
| 169 | 
                  char msg[1024];  | 
              
| 170 | 
                   | 
              
| 171 | 
                  memset(&msg, 0, sizeof(msg));  | 
              
| 172 | 
                  snprintf(msg, sizeof(msg) - 1, _("Unable to unload plugin '%s': %s"), plugin_name, errmsg);  | 
              
| 173 | 
                  nntpgrab_gui_base_dialog_show(windowPlugins, msg, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK);  | 
              
| 174 | 
                  g_free(errmsg);  | 
              
| 175 | 
                  }  | 
              
| 176 | 
                          } else {
                 | 
              
| 177 | 
                              /* Load the plugin */
                 | 
              
| 178 | 
                              if (!nntpgrab_glue_plugins_load_plugin(glue, plugin_name, &errmsg)) {
                 | 
              
| 179 | 
                  char msg[1024];  | 
              
| 180 | 
                   | 
              
| 181 | 
                  memset(&msg, 0, sizeof(msg));  | 
              
| 182 | 
                  snprintf(msg, sizeof(msg) - 1, _("Unable to load plugin '%s': %s"), plugin_name, errmsg);  | 
              
| 183 | 
                  nntpgrab_gui_base_dialog_show(windowPlugins, msg, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK);  | 
              
| 184 | 
                  g_free(errmsg);  | 
              
| 185 | 
                  }  | 
              
| 186 | 
                  }  | 
              
| 187 | 
                   | 
              
| 188 | 
                          /* There's no need to update the store here as it will happen automatically when an event is emit */
                 | 
              
| 189 | 
                   | 
              
| 190 | 
                  g_free(plugin_name);  | 
              
| 191 | 
                  }  | 
              
| 192 | 
                  }  | 
              
| 193 | 
                   | 
              
| 194 | 
                  static void  | 
              
| 195 | 
                  persistent_check_toggled(GtkWidget *caller, gchar *path, gpointer data)  | 
              
| 196 | 
                  {
                 | 
              
| 197 | 
                  gboolean value;  | 
              
| 198 | 
                  GtkTreeIter iter;  | 
              
| 199 | 
                  GtkWidget *treePlugins;  | 
              
| 200 | 
                  GtkTreeModel *model;  | 
              
| 201 | 
                   | 
              
| 202 | 
                      treePlugins = nntpgrab_gui_base_get_widget("treePlugins");
                 | 
              
| 203 | 
                  model = gtk_tree_view_get_model(GTK_TREE_VIEW(treePlugins));  | 
              
| 204 | 
                   | 
              
| 205 | 
                      if (gtk_tree_model_get_iter_from_string(model, &iter, path)) {
                 | 
              
| 206 | 
                  char *plugin_name = NULL;  | 
              
| 207 | 
                  ConfigGUIOpts opts;  | 
              
| 208 | 
                  GList *list;  | 
              
| 209 | 
                   | 
              
| 210 | 
                  opts = config_gui_get_opts();  | 
              
| 211 | 
                          gtk_tree_model_get(model, &iter, FIELD_AUTO_LOAD, &value, FIELD_PLUGIN_NAME, &plugin_name, -1);
                 | 
              
| 212 | 
                          if (value) {
                 | 
              
| 213 | 
                  list = opts.auto_load_plugins;  | 
              
| 214 | 
                              while (list) {
                 | 
              
| 215 | 
                                  char *plugin_name2 = list->data;
                 | 
              
| 216 | 
                   | 
              
| 217 | 
                                  if (!strcmp(plugin_name, plugin_name2)) {
                 | 
              
| 218 | 
                  opts.auto_load_plugins = g_list_remove(opts.auto_load_plugins, plugin_name2);  | 
              
| 219 | 
                  g_free(plugin_name2);  | 
              
| 220 | 
                                      break;
                 | 
              
| 221 | 
                  }  | 
              
| 222 | 
                   | 
              
| 223 | 
                  list = g_list_next(list);  | 
              
| 224 | 
                  }  | 
              
| 225 | 
                   | 
              
| 226 | 
                  value = FALSE;  | 
              
| 227 | 
                          } else {
                 | 
              
| 228 | 
                  opts.auto_load_plugins = g_list_append(opts.auto_load_plugins, g_strdup(plugin_name));  | 
              
| 229 | 
                  value = TRUE;  | 
              
| 230 | 
                  }  | 
              
| 231 | 
                   | 
              
| 232 | 
                  config_gui_set_opts(opts);  | 
              
| 233 | 
                          gtk_list_store_set(GTK_LIST_STORE(model), &iter, FIELD_AUTO_LOAD, value, -1);
                 | 
              
| 234 | 
                  g_free(plugin_name);  | 
              
| 235 | 
                  }  | 
              
| 236 | 
                  }  | 
              
| 237 | 
                   | 
              
| 238 | 
                  static gboolean
                 | 
              
| 239 | 
                  foreach_mark_auto_load_func(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)  | 
              
| 240 | 
                  {
                 | 
              
| 241 | 
                  char *plugin_name = NULL;  | 
              
| 242 | 
                      char *plugin_name2 = data;
                 | 
              
| 243 | 
                   | 
              
| 244 | 
                      gtk_tree_model_get(model, iter, FIELD_PLUGIN_NAME, &plugin_name, -1);
                 | 
              
| 245 | 
                   | 
              
| 246 | 
                      if (!strcmp(plugin_name, plugin_name2)) {
                 | 
              
| 247 | 
                          gtk_list_store_set(GTK_LIST_STORE(model), iter, FIELD_AUTO_LOAD, TRUE, -1);
                 | 
              
| 248 | 
                          return TRUE;
                 | 
              
| 249 | 
                  }  | 
              
| 250 | 
                   | 
              
| 251 | 
                      return FALSE;
                 | 
              
| 252 | 
                  }  | 
              
| 253 | 
                   | 
              
| 254 | 
                  void
                 | 
              
| 255 | 
                  gui_plugins_initialize(void)
                 | 
              
| 256 | 
                  {
                 | 
              
| 257 | 
                  GtkListStore *store;  | 
              
| 258 | 
                  GtkCellRenderer *cellRenderer;  | 
              
| 259 | 
                  GtkTreeSelection *selection;  | 
              
| 260 | 
                  NGList *plugins, *list;  | 
              
| 261 | 
                      GtkWidget *treePlugins = nntpgrab_gui_base_get_widget("treePlugins");
                 | 
              
| 262 | 
                  ngboolean beenhere = FALSE;  | 
              
| 263 | 
                  ConfigGUIOpts opts;  | 
              
| 264 | 
                  GList *list2;  | 
              
| 265 | 
                   | 
              
| 266 | 
                  cellRenderer = gtk_cell_renderer_toggle_new();  | 
              
| 267 | 
                  columns[FIELD_ENABLED] = gtk_tree_view_column_new_with_attributes(_("Enabled"), cellRenderer, "active", FIELD_ENABLED, NULL);  | 
              
| 268 | 
                  gtk_tree_view_column_set_resizable(columns[FIELD_ENABLED], TRUE);  | 
              
| 269 | 
                  gtk_tree_view_column_set_reorderable(columns[FIELD_ENABLED], TRUE);  | 
              
| 270 | 
                      gtk_tree_view_insert_column(GTK_TREE_VIEW(treePlugins), columns[FIELD_ENABLED], -1);
                 | 
              
| 271 | 
                  g_signal_connect((gpointer) cellRenderer, "toggled", G_CALLBACK(enabled_check_toggled), NULL);  | 
              
| 272 | 
                   | 
              
| 273 | 
                  cellRenderer = gtk_cell_renderer_toggle_new();  | 
              
| 274 | 
                  columns[FIELD_AUTO_LOAD] = gtk_tree_view_column_new_with_attributes(_("Load on startup"), cellRenderer, "active", FIELD_AUTO_LOAD, NULL);  | 
              
| 275 | 
                  gtk_tree_view_column_set_resizable(columns[FIELD_AUTO_LOAD], TRUE);  | 
              
| 276 | 
                  gtk_tree_view_column_set_reorderable(columns[FIELD_AUTO_LOAD], TRUE);  | 
              
| 277 | 
                      gtk_tree_view_insert_column(GTK_TREE_VIEW(treePlugins), columns[FIELD_AUTO_LOAD], -1);
                 | 
              
| 278 | 
                  g_signal_connect((gpointer) cellRenderer, "toggled", G_CALLBACK(persistent_check_toggled), NULL);  | 
              
| 279 | 
                   | 
              
| 280 | 
                  cellRenderer = gtk_cell_renderer_text_new();  | 
              
| 281 | 
                  columns[FIELD_PLUGIN_NAME] = gtk_tree_view_column_new_with_attributes(_("Plugin name"), cellRenderer, "text", FIELD_PLUGIN_NAME, NULL);  | 
              
| 282 | 
                  gtk_tree_view_column_set_resizable(columns[FIELD_PLUGIN_NAME], TRUE);  | 
              
| 283 | 
                  gtk_tree_view_column_set_reorderable(columns[FIELD_PLUGIN_NAME], TRUE);  | 
              
| 284 | 
                      gtk_tree_view_insert_column(GTK_TREE_VIEW(treePlugins), columns[FIELD_PLUGIN_NAME], -1);
                 | 
              
| 285 | 
                   | 
              
| 286 | 
                  store = gtk_list_store_new( LAST_FIELD,  | 
              
| 287 | 
                                                  G_TYPE_STRING    /* FIELD_PLUGIN_NAME */,
                 | 
              
| 288 | 
                                                  G_TYPE_BOOLEAN   /* FIELD_ENABLED */,
                 | 
              
| 289 | 
                                                  G_TYPE_BOOLEAN); /* FIELD_AUTO_LOAD */
                 | 
              
| 290 | 
                   | 
              
| 291 | 
                  gtk_tree_view_set_model(GTK_TREE_VIEW(treePlugins), GTK_TREE_MODEL(store));  | 
              
| 292 | 
                   | 
              
| 293 | 
                  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treePlugins));  | 
              
| 294 | 
                  gtk_tree_selection_set_mode(GTK_TREE_SELECTION(selection), GTK_SELECTION_BROWSE);  | 
              
| 295 | 
                   | 
              
| 296 | 
                      /* Fill the tree view with items */
                 | 
              
| 297 | 
                  list = plugins = nntpgrab_glue_plugins_get_avail_plugins(glue);  | 
              
| 298 | 
                      while (list) {
                 | 
              
| 299 | 
                  const char *plugin_name = list->data;  | 
              
| 300 | 
                  NNTPGrabPluginInfo info;  | 
              
| 301 | 
                  GtkTreeIter iter;  | 
              
| 302 | 
                   | 
              
| 303 | 
                  memset(&info, 0, sizeof(info));  | 
              
| 304 | 
                          if (!nntpgrab_glue_plugins_get_plugin_info(glue, plugin_name, &info)) {
                 | 
              
| 305 | 
                              g_print(__FILE__ ":%i Unable to retrieve plugin information for plugin '%s'\n", __LINE__, plugin_name);
                 | 
              
| 306 | 
                  list = ng_list_next(list);  | 
              
| 307 | 
                              continue;
                 | 
              
| 308 | 
                  }  | 
              
| 309 | 
                   | 
              
| 310 | 
                  gtk_list_store_append(store, &iter);  | 
              
| 311 | 
                  gtk_list_store_set( GTK_LIST_STORE(store), &iter,  | 
              
| 312 | 
                  FIELD_PLUGIN_NAME, info.name,  | 
              
| 313 | 
                  FIELD_ENABLED, info.is_loaded,  | 
              
| 314 | 
                  FIELD_AUTO_LOAD, info.is_persistent,  | 
              
| 315 | 
                                              -1);
                 | 
              
| 316 | 
                   | 
              
| 317 | 
                          if (!beenhere) {
                 | 
              
| 318 | 
                  beenhere = TRUE;  | 
              
| 319 | 
                  gtk_tree_selection_select_iter(selection, &iter);  | 
              
| 320 | 
                  }  | 
              
| 321 | 
                   | 
              
| 322 | 
                  list = ng_list_next(list);  | 
              
| 323 | 
                  }  | 
              
| 324 | 
                  nntpgrab_glue_plugins_free_avail_plugins(glue, plugins);  | 
              
| 325 | 
                   | 
              
| 326 | 
                      /* Mark the auto-load plugins */
                 | 
              
| 327 | 
                  opts = config_gui_get_opts();  | 
              
| 328 | 
                  list2 = opts.auto_load_plugins;  | 
              
| 329 | 
                      while (list2) {
                 | 
              
| 330 | 
                          char *plugin_name = list2->data;
                 | 
              
| 331 | 
                   | 
              
| 332 | 
                  gtk_tree_model_foreach(GTK_TREE_MODEL(store), foreach_mark_auto_load_func, plugin_name);  | 
              
| 333 | 
                   | 
              
| 334 | 
                  list2 = g_list_next(list2);  | 
              
| 335 | 
                  }  | 
              
| 336 | 
                   | 
              
| 337 | 
                  g_signal_connect(selection, "changed", G_CALLBACK(on_tree_view_select), NULL);  | 
              
| 338 | 
                      on_tree_view_select(selection, NULL);
                 | 
              
| 339 | 
                   | 
              
| 340 | 
                  nntpgrab_glue_signal_connect(glue, "plugin_loaded", NG_CALLBACK(on_plugin_loaded), NULL);  | 
              
| 341 | 
                  nntpgrab_glue_signal_connect(glue, "plugin_unloaded", NG_CALLBACK(on_plugin_unloaded), NULL);  | 
              
| 342 | 
                  }  | 
              
NNTPGrab

