* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <glib/gi18n.h>
#include "modest-account-view.h"
/* include other impl specific header files */
sizeof(ModestAccountView),
1, /* n_preallocs */
(GInstanceInitFunc) modest_account_view_init,
+ NULL
};
my_type = g_type_register_static (GTK_TYPE_TREE_VIEW,
"ModestAccountView",
return MODEST_ACCOUNT_VIEW(obj);
}
+const gchar *
+modest_account_view_get_selected_account (ModestAccountView *self)
+{
+ const gchar *account_name = NULL;
+ GtkTreeSelection *sel;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+
+ g_return_val_if_fail (MODEST_IS_ACCOUNT_VIEW (self), NULL);
+
+ sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (self));
+ if (gtk_tree_selection_get_selected (sel, &model, &iter)) {
+ gtk_tree_model_get (model, &iter,
+ NAME_COLUMN, &account_name,
+ -1);
+ }
+
+ return account_name;
+}