Mercurial > pidgin
comparison src/gtkaccount.c @ 11113:a5efa067eaca
[gaim-migrate @ 13166]
Patch #1239122, from Levi Bard
"When you disable/reenable an account in HEAD by
clicking off/on the checkbox, it triggers the
treeview's double-click event and pulls up the modify
account dialog.
This patch suppresses that for disabling/reenabling an
account, but leaves it intact for the other parts of
the treeview."
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Mon, 18 Jul 2005 00:13:06 +0000 |
parents | 57e36a4ff107 |
children | 096020ae09a9 |
comparison
equal
deleted
inserted
replaced
11112:92f7b92e866b | 11113:a5efa067eaca |
---|---|
2208 static gboolean | 2208 static gboolean |
2209 account_treeview_double_click_cb(GtkTreeView *treeview, GdkEventButton *event, gpointer user_data) | 2209 account_treeview_double_click_cb(GtkTreeView *treeview, GdkEventButton *event, gpointer user_data) |
2210 { | 2210 { |
2211 AccountsWindow *dialog; | 2211 AccountsWindow *dialog; |
2212 GtkTreePath *path; | 2212 GtkTreePath *path; |
2213 GtkTreeViewColumn *column; | |
2213 GtkTreeIter iter; | 2214 GtkTreeIter iter; |
2214 GaimAccount *account; | 2215 GaimAccount *account; |
2216 const gchar *title; | |
2215 | 2217 |
2216 dialog = (AccountsWindow *)user_data; | 2218 dialog = (AccountsWindow *)user_data; |
2217 | 2219 |
2218 /* Figure out which node was clicked */ | 2220 /* Figure out which node was clicked */ |
2219 if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(dialog->treeview), event->x, event->y, &path, NULL, NULL, NULL)) | 2221 if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(dialog->treeview), event->x, event->y, &path, &column, NULL, NULL)) |
2220 return FALSE; | 2222 return FALSE; |
2223 title = gtk_tree_view_column_get_title(column); | |
2224 column = gtk_tree_view_get_column(treeview, COLUMN_ENABLED-1); /* -1 required by weirdness in GtkTreeView */ | |
2221 gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, path); | 2225 gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, path); |
2222 gtk_tree_path_free(path); | 2226 gtk_tree_path_free(path); |
2223 gtk_tree_model_get(GTK_TREE_MODEL(dialog->model), &iter, COLUMN_DATA, &account, -1); | 2227 gtk_tree_model_get(GTK_TREE_MODEL(dialog->model), &iter, COLUMN_DATA, &account, -1); |
2224 | 2228 |
2225 if ((account != NULL) && (event->button == 1) && | 2229 if ((account != NULL) && (event->button == 1) && |
2226 (event->type == GDK_2BUTTON_PRESS)) | 2230 (event->type == GDK_2BUTTON_PRESS) && |
2231 (strcmp(gtk_tree_view_column_get_title(column), title))) | |
2227 { | 2232 { |
2228 gaim_gtk_account_dialog_show(GAIM_GTK_MODIFY_ACCOUNT_DIALOG, account); | 2233 gaim_gtk_account_dialog_show(GAIM_GTK_MODIFY_ACCOUNT_DIALOG, account); |
2229 return TRUE; | 2234 return TRUE; |
2230 } | 2235 } |
2231 | 2236 |