void cb_about_module(GtkAction *action)
{
    Shell *shell = shell_get_main_shell();
    GSList *modules = shell->tree->modules;
    ModuleAbout *ma;
    gchar *name;
    
    g_object_get(G_OBJECT(action), "tooltip", &name, NULL);
    
    for (; modules; modules = modules->next) {
        ShellModule *sm = (ShellModule *)modules->data;
        
        if (!g_str_equal(sm->name, name))
            continue;
            
        if ((ma = module_get_about(sm))) {
            GtkWidget *about;

            about = gtk_about_dialog_new();
            gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(about),
                                      idle_free(g_strdup_printf("%s Module", sm->name)));
            gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about), ma->version);
            gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(about),
                                           idle_free(g_strdup_printf("Written by %s\n"
                                                     "Licensed under %s",
                                                     ma->author,
                                                     ma->license)));

            if (ma->description)
                gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(about),
                                              ma->description);
                                          
            gtk_about_dialog_set_logo(GTK_ABOUT_DIALOG(about), sm->icon);
            gtk_dialog_run(GTK_DIALOG(about));
            gtk_widget_destroy(about);
        } else {
            g_warning("No about information is associated with the %s module.", name);
        }
        
        break;
    }
    
    g_free(name);
}
Example #2
0
gchar *get_processor_name(void)
{
    scan_processors(FALSE);

    Processor *p = (Processor *) processors->data;

    if (g_slist_length(processors) > 1) {
	return idle_free(g_strdup_printf("%dx %s",
					 g_slist_length(processors),
					 p->model_name));
    } else {
	return p->model_name;
    }
}
GdkPixbuf *icon_cache_get_pixbuf(const gchar * file)
{
    GdkPixbuf *icon;

    if (!cache)
	icon_cache_init();

    icon = g_hash_table_lookup(cache, file);

    if (!icon) {
	icon =
	    gdk_pixbuf_new_from_file(idle_free
				     (g_build_filename
				      (params.path_data, "pixmaps", file,
				       NULL)), NULL);
	g_hash_table_insert(cache, g_strdup(file), icon);
    }

    g_object_ref(icon);

    return icon;
}