API change in TnyGtkAccountTreeModel
- From: Philip Van Hoof <spam pvanhoof be>
- To: tinymail-devel-list gnome org
- Cc: dirk jan-binnema nokia com
- Subject: API change in TnyGtkAccountTreeModel
- Date: Wed, 13 Sep 2006 14:53:03 +0200
This one probably affects Modest, Dirk.
The instance column of the tree isn't always a folder anymore. It can
also be a account instance. You can use the type column to known what
type of instance you'll get before asking for the instance:
gtk_tree_model_get (model, &iter,
TNY_GTK_ACCOUNT_TREE_MODEL_TYPE_COLUMN,
&type, -1);
if (type == TNY_FOLDER_TYPE_ROOT)
{
TnyFolder *folder;
gtk_tree_model_get (model, &iter,
TNY_GTK_ACCOUNT_TREE_MODEL_INSTANCE_COLUMN,
&folder, -1);
g_object_unref (G_OBJECT (folder));
} else {
TnyAccount *account;
gtk_tree_model_get (model, &iter,
TNY_GTK_ACCOUNT_TREE_MODEL_INSTANCE_COLUMN,
&account, -1);
g_object_unref (G_OBJECT (account));
}
I have also created a TnyGtkAccountListModel and a TnyGtkFolderTreeModel
The TnyGtkAccountListModel can be used as for example the model for a
GtkComboBox (a flat list with accounts and no displaying of its folders
like what the TnyGtkAccountTreeModel does).
The idea is to also have a TnyGtkFolderTreeModel that will display a
TnyFolderStore. I might rename the current type to TnyFolderStore once I
get the concept actually working.
The idea is to make it possible to pick the get-folders method that the
type should use. Which can then be the async or the sync one. The async
one would then, upon expanding the row of the tree, launch a background
thread which will in GMainLoop fill up the tree.
Funky crazy ideas, I know. But that is the idea indeed. I hope some Gtk+
GtkTreeView warriors will join me on this one ;-)
Anyway, therefore isn't TnyGtkFolderTreeModel ready yet. But TnyGtk-
AccountListModel is. The demo-ui now shows a GtkComboBox with the store
accounts (that can of course also be the transport accounts).
--
Philip Van Hoof, software developer at x-tend
home: me at pvanhoof dot be
gnome: pvanhoof at gnome dot org
work: vanhoof at x-tend dot be
http://www.pvanhoof.be - http://www.x-tend.be
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]