Mercurial > pidgin.yaz
comparison src/gtkplugin.c @ 12695:0bc110c7ab91
[gaim-migrate @ 15038]
Let's display outdated plugins in the plugins dialog, but grey them out. This way, the user can find out which plugins need to be updated. They will also be able to view the website address so they know where to get a new version.
Inspired by SF Feature Request #1395058 from Daniel Beardsmore (uilleann).
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Tue, 03 Jan 2006 12:03:02 +0000 |
parents | e856f985a0b9 |
children | ba7834d6e2c9 |
comparison
equal
deleted
inserted
replaced
12694:ebed1bbedb04 | 12695:0bc110c7ab91 |
---|---|
128 plug->info->version, | 128 plug->info->version, |
129 _(plug->info->summary)); | 129 _(plug->info->summary)); |
130 gtk_list_store_set(ls, &iter, | 130 gtk_list_store_set(ls, &iter, |
131 0, gaim_plugin_is_loaded(plug), | 131 0, gaim_plugin_is_loaded(plug), |
132 1, desc, | 132 1, desc, |
133 2, plug, -1); | 133 2, plug, |
134 3, gaim_plugin_is_unloadable(plug), | |
135 -1); | |
134 g_free(desc); | 136 g_free(desc); |
135 } | 137 } |
136 } | 138 } |
137 | 139 |
138 static void pref_dialog_response_cb(GtkWidget *d, int response, GaimPlugin *plug) | 140 static void pref_dialog_response_cb(GtkWidget *d, int response, GaimPlugin *plug) |
157 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | 159 GtkTreePath *path = gtk_tree_path_new_from_string(pth); |
158 GaimPlugin *plug; | 160 GaimPlugin *plug; |
159 gchar buf[1024]; | 161 gchar buf[1024]; |
160 gchar *name = NULL, *description = NULL; | 162 gchar *name = NULL, *description = NULL; |
161 GtkWidget *dialog = NULL; | 163 GtkWidget *dialog = NULL; |
162 | 164 GdkCursor *wait; |
163 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); | 165 |
166 gtk_tree_model_get_iter (model, &iter, path); | |
167 gtk_tree_model_get (model, &iter, 2, &plug, -1); | |
168 | |
169 /* Apparently, GTK+ won't honor the sensitive flag on cell renderers for booleans. */ | |
170 if (gaim_plugin_is_unloadable(plug)) | |
171 return; | |
172 | |
173 wait = gdk_cursor_new (GDK_WATCH); | |
164 gdk_window_set_cursor(plugin_dialog->window, wait); | 174 gdk_window_set_cursor(plugin_dialog->window, wait); |
165 gdk_cursor_unref(wait); | 175 gdk_cursor_unref(wait); |
166 | |
167 gtk_tree_model_get_iter (model, &iter, path); | |
168 gtk_tree_model_get (model, &iter, 2, &plug, -1); | |
169 | 176 |
170 if (!gaim_plugin_is_loaded(plug)) | 177 if (!gaim_plugin_is_loaded(plug)) |
171 gaim_plugin_load(plug); | 178 gaim_plugin_load(plug); |
172 else { | 179 else { |
173 if (plugin_pref_dialogs != NULL && | 180 if (plugin_pref_dialogs != NULL && |
270 "<span weight=\"bold\">Written by:</span>\t%s\n" | 277 "<span weight=\"bold\">Written by:</span>\t%s\n" |
271 "<span weight=\"bold\">Web site:</span>\t\t%s\n" | 278 "<span weight=\"bold\">Web site:</span>\t\t%s\n" |
272 "<span weight=\"bold\">File name:</span>\t%s"), | 279 "<span weight=\"bold\">File name:</span>\t%s"), |
273 pdesc ? pdesc : "", pdesc ? "\n\n" : "", | 280 pdesc ? pdesc : "", pdesc ? "\n\n" : "", |
274 pauth ? pauth : "", pweb ? pweb : "", plug->path); | 281 pauth ? pauth : "", pweb ? pweb : "", plug->path); |
282 | |
283 if (plug->error != NULL) | |
284 { | |
285 char *tmp = g_strdup_printf( | |
286 _("%s\n" | |
287 "<span foreground=\"#ff0000\" weight=\"bold\">Error: %s</span>"), | |
288 buf, plug->error); | |
289 g_free(buf); | |
290 buf = tmp; | |
291 } | |
275 | 292 |
276 gtk_widget_set_sensitive(pref_button, | 293 gtk_widget_set_sensitive(pref_button, |
277 gaim_plugin_is_loaded(plug) | 294 gaim_plugin_is_loaded(plug) |
278 && ((GAIM_IS_GTK_PLUGIN(plug) && plug->info->ui_info | 295 && ((GAIM_IS_GTK_PLUGIN(plug) && plug->info->ui_info |
279 && GAIM_GTK_PLUGIN_UI_INFO(plug)->get_config_frame) | 296 && GAIM_GTK_PLUGIN_UI_INFO(plug)->get_config_frame) |
397 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); | 414 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
398 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | 415 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
399 | 416 |
400 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(plugin_dialog)->vbox), sw, TRUE, TRUE, 0); | 417 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(plugin_dialog)->vbox), sw, TRUE, TRUE, 0); |
401 | 418 |
402 ls = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); | 419 ls = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN); |
403 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls), | 420 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls), |
404 1, GTK_SORT_ASCENDING); | 421 1, GTK_SORT_ASCENDING); |
405 | 422 |
406 update_plugin_list(ls); | 423 update_plugin_list(ls); |
407 | 424 |
421 gtk_tree_view_column_set_sort_column_id(col, 0); | 438 gtk_tree_view_column_set_sort_column_id(col, 0); |
422 g_signal_connect (G_OBJECT(rend), "toggled", | 439 g_signal_connect (G_OBJECT(rend), "toggled", |
423 G_CALLBACK(plugin_load), ls); | 440 G_CALLBACK(plugin_load), ls); |
424 | 441 |
425 rendt = gtk_cell_renderer_text_new(); | 442 rendt = gtk_cell_renderer_text_new(); |
443 g_object_set(rendt, | |
444 "foreground", "#c0c0c0", | |
445 NULL); | |
426 col = gtk_tree_view_column_new_with_attributes (_("Name"), | 446 col = gtk_tree_view_column_new_with_attributes (_("Name"), |
427 rendt, | 447 rendt, |
428 "markup", 1, | 448 "markup", 1, |
449 "foreground-set", 3, | |
429 NULL); | 450 NULL); |
430 #if GTK_CHECK_VERSION(2,6,0) | 451 #if GTK_CHECK_VERSION(2,6,0) |
431 gtk_tree_view_column_set_expand (col, TRUE); | 452 gtk_tree_view_column_set_expand (col, TRUE); |
432 g_object_set(rendt, "ellipsize", PANGO_ELLIPSIZE_END, NULL); | 453 g_object_set(rendt, "ellipsize", PANGO_ELLIPSIZE_END, NULL); |
433 #endif | 454 #endif |