|
Link Here
|
| 93 |
static GtkWidget *prefs_display_header_list_view_create (const gchar *name); |
93 |
static GtkWidget *prefs_display_header_list_view_create (const gchar *name); |
| 94 |
static void prefs_filtering_create_list_view_columns (GtkWidget *list_view, |
94 |
static void prefs_filtering_create_list_view_columns (GtkWidget *list_view, |
| 95 |
const gchar *name); |
95 |
const gchar *name); |
| 96 |
static void headers_list_model_row_changed (GtkTreeModel *model, |
|
|
| 97 |
GtkTreePath *path, |
| 98 |
GtkTreeIter *iter, |
| 99 |
GtkTreeView *list_view); |
| 100 |
static void headers_list_model_rows_reordered (GtkTreeModel *model, |
96 |
static void headers_list_model_rows_reordered (GtkTreeModel *model, |
| 101 |
GtkTreePath *path, |
97 |
GtkTreePath *path, |
| 102 |
GtkTreeIter *iter, |
98 |
GtkTreeIter *iter, |
| 103 |
gpointer arg, |
99 |
gpointer arg, |
| 104 |
GtkTreeView *list_view); |
100 |
GtkTreeView *list_view); |
| 105 |
|
101 |
|
| 106 |
static void drag_begin (GtkTreeView *list_view, |
|
|
| 107 |
GdkDragContext *context, |
| 108 |
gpointer data); |
| 109 |
|
| 110 |
static void drag_end (GtkTreeView *list_view, |
102 |
static void drag_end (GtkTreeView *list_view, |
| 111 |
GdkDragContext *context, |
103 |
GdkDragContext *context, |
| 112 |
gpointer data); |
104 |
gpointer data); |
|
Link Here
|
| 318 |
gtk_container_add(GTK_CONTAINER(list_view_scrolledwin), headers_list_view); |
310 |
gtk_container_add(GTK_CONTAINER(list_view_scrolledwin), headers_list_view); |
| 319 |
gtk_tree_view_set_reorderable(GTK_TREE_VIEW(headers_list_view), TRUE); |
311 |
gtk_tree_view_set_reorderable(GTK_TREE_VIEW(headers_list_view), TRUE); |
| 320 |
|
312 |
|
| 321 |
g_signal_connect(G_OBJECT(headers_list_view), "drag_begin", |
|
|
| 322 |
G_CALLBACK(drag_begin), |
| 323 |
headers_list_view); |
| 324 |
|
| 325 |
g_signal_connect(G_OBJECT(headers_list_view), "drag_end", |
313 |
g_signal_connect(G_OBJECT(headers_list_view), "drag_end", |
| 326 |
G_CALLBACK(drag_end), |
314 |
G_CALLBACK(drag_end), |
| 327 |
headers_list_view); |
315 |
headers_list_view); |
|
Link Here
|
| 799 |
} |
787 |
} |
| 800 |
|
788 |
|
| 801 |
/*! |
789 |
/*! |
| 802 |
*\brief Called as a result of a drag & drop |
|
|
| 803 |
*/ |
| 804 |
static void headers_list_model_row_changed(GtkTreeModel *model, |
| 805 |
GtkTreePath *path, |
| 806 |
GtkTreeIter *iter, |
| 807 |
GtkTreeView *list_view) |
| 808 |
{ |
| 809 |
prefs_display_header_set_list(); |
| 810 |
} |
| 811 |
|
| 812 |
/*! |
| 813 |
*\brief Called as a result of a gtk_list_store_swap() |
790 |
*\brief Called as a result of a gtk_list_store_swap() |
| 814 |
*/ |
791 |
*/ |
| 815 |
static void headers_list_model_rows_reordered(GtkTreeModel *model, |
792 |
static void headers_list_model_rows_reordered(GtkTreeModel *model, |
|
Link Here
|
| 821 |
prefs_display_header_set_list(); |
798 |
prefs_display_header_set_list(); |
| 822 |
} |
799 |
} |
| 823 |
|
800 |
|
| 824 |
static void drag_begin(GtkTreeView *list_view, |
801 |
/*! |
| 825 |
GdkDragContext *context, |
802 |
*\brief Called as a result of a drag & drop |
| 826 |
gpointer data) |
803 |
*/ |
| 827 |
{ |
|
|
| 828 |
/* XXX unfortunately a completed drag & drop does not emit |
| 829 |
* a "rows_reordered" signal, but a "row_changed" signal. |
| 830 |
* So during drag and drop, listen to "row_changed", and |
| 831 |
* update the account list accordingly */ |
| 832 |
|
| 833 |
GtkTreeModel *model = gtk_tree_view_get_model(list_view); |
| 834 |
g_signal_connect(G_OBJECT(model), "row_changed", |
| 835 |
G_CALLBACK(headers_list_model_row_changed), |
| 836 |
list_view); |
| 837 |
} |
| 838 |
|
| 839 |
static void drag_end(GtkTreeView *list_view, |
804 |
static void drag_end(GtkTreeView *list_view, |
| 840 |
GdkDragContext *context, |
805 |
GdkDragContext *context, |
| 841 |
gpointer data) |
806 |
gpointer data) |
| 842 |
{ |
807 |
{ |
| 843 |
GtkTreeModel *model = gtk_tree_view_get_model(list_view); |
808 |
prefs_display_header_set_list(); |
| 844 |
g_signal_handlers_disconnect_by_func(G_OBJECT(model), |
|
|
| 845 |
G_CALLBACK(headers_list_model_row_changed), |
| 846 |
list_view); |
| 847 |
} |
809 |
} |
| 848 |
|
810 |
|