[anjal] Fix the cursor move on delete/undelete
- From: Srinivasa Ragavan <sragavan src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [anjal] Fix the cursor move on delete/undelete
- Date: Wed, 29 Jul 2009 13:14:09 +0000 (UTC)
commit f9ec6592f11a0daa050d08cfd2119962e835a46c
Author: Srinivasa Ragavan <sragavan novell com>
Date: Wed Jul 29 18:43:14 2009 +0530
Fix the cursor move on delete/undelete
src/mail-folder-view.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/mail-folder-view.c b/src/mail-folder-view.c
index f5550be..a092d1f 100644
--- a/src/mail-folder-view.c
+++ b/src/mail-folder-view.c
@@ -280,6 +280,18 @@ mail_folder_view_init (MailFolderView *shell)
shell->priv->sort_ascending = FALSE;
}
+static void
+mfv_row_del (GtkTreeModel *model, GtkTreePath *path, MailFolderView *mfv)
+{
+ GtkTreeSelection *sel = gtk_tree_view_get_selection(mfv->tree);
+
+ if (gtk_tree_path_prev(path)) {
+ gtk_tree_selection_select_path (sel, path);
+ } else {
+ gtk_tree_selection_select_path (sel, path);
+ }
+}
+
static void
mail_folder_view_finalize (GObject *object)
{
@@ -306,6 +318,7 @@ mail_folder_view_finalize (GObject *object)
if (mfv->priv->folder) {
camel_object_unref (mfv->priv->folder);
}
+ g_signal_handlers_disconnect_by_func (mfv->model, mfv_row_del, mfv);
g_object_unref (mfv->model);
g_free (mfv->uri);
@@ -406,10 +419,12 @@ mfv_got_folder(char *uri, CamelFolder *folder, void *data)
if (mfv->priv->folder) {
mfv_save(mfv);
+ g_signal_handlers_disconnect_by_func (mfv->model, mfv_row_del, mfv);
gtk_tree_view_set_model (GTK_TREE_VIEW (mfv->tree), NULL);
camel_object_unref (mfv->priv->folder);
mfv->priv->folder= NULL;
g_object_unref (mfv->model);
+
if (mfv->priv->light)
mfv->model = mail_sqlite_store_new ();
else {
@@ -505,6 +520,7 @@ mail_folder_view_set_folder (MailFolderView *mfv, CamelFolder *folder, const cha
g_object_set_data ((GObject *)mfv->priv->from_to, "data", GINT_TO_POINTER (EMTS_COL_TO));
}
gtk_tree_view_set_model (GTK_TREE_VIEW (mfv->tree), mfv->model);
+ g_signal_connect (mfv->model, "row-deleted", G_CALLBACK(mfv_row_del), mfv);
mfv->priv->folder = folder;
gtk_widget_hide ((GtkWidget *)mfv->mail);
gtk_widget_hide (mfv->priv->info_spinner);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]