Re: I want to contribute to Brasero Development



Hi,

Thanks any help is always greatly appreciated.

Le lundi 30 novembre 2009 à 10:33 +0530, Ratnadeep Debnath a écrit :
Hi,

I am trying to understand the brasero source code. I am not
able to understand how the session contents are loaded
when I open a data-disc project. This will help me in my effort
to find the solution to brasero bug no. 602888 and learn.

Sorry for the late answer. I'm not sure but if I understand your question well: you want to know how the contents of a data project is displayed to the user, the missing link between the model and the view, right?

If that so, then here is the trick:
For display, brasero uses a basic GtkTreeView. As you may know the contents of a GtkTreeView are contained by an GObject that must implement the GtkTreeModel interface. And that's what the BraseroTrackDataCfg object does. Not only does it have its own API (mainly for adding URIs, ...) but it also implements the GtkTreeModel interface. That allows for simple uses such as:

track = brasero_track_data_cfg_new ();
tree = gtk_tree_view_new_with_model (GTK_TREE_MODEL (track));

brasero_track_data_cfg_add_uri (track, uri);

and the uri will show up automatically in the treeview.

Every time a project type is chosen by the user (through menus for example), the BraseroProject is responsible for passing a (new) internal BraseroBurnSession to BraseroAudioProject, BraseroVideoProject or BraseroDataProject through the BraseroDisc interface. As for the BraseroDataProject (which is basically a GtkVBox with a GtkTreeView inside) it extracts from the BraseroBurnSession object the BraseroTrackDataCfg and uses gtk_tree_view_set_model (priv->tree, GTK_TREE_MODEL (track));

and here it is; the contents of track get displayed in the GtkTreeView.

I hope this helps,

Philippe

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]