* Use update method in case of account changes. Open: restore current view if possible.
pmo-trunk-r289
g_type_class_add_private (gobject_class, sizeof(ModestUIPrivate));
- /* signal definitions go here, e.g.: */
-/* signals[MY_SIGNAL_1] = */
-/* g_signal_new ("my_signal_1",....); */
-/* signals[MY_SIGNAL_2] = */
-/* g_signal_new ("my_signal_2",....); */
-/* etc. */
}
{
ModestUIPrivate *priv = user_data;
-
+ g_return_if_fail (MODEST_IS_TNY_FOLDER_TREE_VIEW (priv->folder_view));
+
+ modest_tny_folder_tree_view_update_model(priv->folder_view, account_store);
}
parent_class = g_type_class_peek_parent (klass);
gobject_class->finalize = modest_tny_folder_tree_view_finalize;
+
+ klass->update_model = modest_tny_folder_tree_view_update_model;
g_type_class_add_private (gobject_class,
sizeof(ModestTnyFolderTreeViewPrivate));
static gboolean
-update_model (ModestTnyFolderTreeView *self,TnyAccountStoreIface *iface)
+update_model (ModestTnyFolderTreeView *self, TnyAccountStoreIface *iface)
{
const GList *accounts;
TnyAccountTreeModel *folder_model;
}
-
-
+gboolean
+modest_tny_folder_tree_view_update_model(ModestTnyFolderTreeView *self,
+ TnyAccountStoreIface *iface)
+{
+ g_return_val_if_fail (MODEST_IS_TNY_FOLDER_TREE_VIEW (self), FALSE);
+
+ return update_model (self, iface);
+}
void (*folder_selected) (ModestTnyFolderTreeView* self,
TnyMsgFolderIface *folder,
gpointer user_data);
+
+ gboolean (*update_model) (ModestTnyFolderTreeView *self,
+ TnyAccountStoreIface *iface);
+
};
gboolean modest_tny_folder_tree_view_is_empty (ModestTnyFolderTreeView *self);
+/**
+ * modest_tny_folder_tree_view_update_model:
+ * @self: a #ModestTnyFolderTreeView instance
+ * @iface: a #TnyAccountStoreIface instance
+ *
+ * Update the thee model from a given account store.
+ *
+ * Returns: TRUE on success, FALSE otherwise
+ */
+gboolean modest_tny_folder_tree_view_update_model(ModestTnyFolderTreeView *self,
+ TnyAccountStoreIface *iface);
+
+
G_END_DECLS
#endif /* __MODEST_TNY_FOLDER_TREE_VIEW_H__ */