comparison pidgin/gtkaccount.c @ 21938:94dad52b61b4

Double clicking the column header/divider, or in the 'enabled' column shouldn't bring up the account-modify window. Fixes #3733.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 25 Dec 2007 08:49:35 +0000
parents 2a591a5b3322
children 1690d040addd
comparison
equal deleted inserted replaced
21934:cebfc2263199 21938:94dad52b61b4
1757 purple_accounts_reorder(a, dest_index); 1757 purple_accounts_reorder(a, dest_index);
1758 } 1758 }
1759 } 1759 }
1760 } 1760 }
1761 1761
1762 static gint 1762 static gboolean
1763 accedit_win_destroy_cb(GtkWidget *w, GdkEvent *event, AccountsWindow *dialog) 1763 accedit_win_destroy_cb(GtkWidget *w, GdkEvent *event, AccountsWindow *dialog)
1764 { 1764 {
1765 /* Since this is called as the window is closing, we don't need
1766 * pidgin_accounts_window_hide() to also dispose of the window */
1767 dialog->window = NULL; 1765 dialog->window = NULL;
1768 1766
1769 pidgin_accounts_window_hide(); 1767 pidgin_accounts_window_hide();
1770 1768
1771 return 0; 1769 return FALSE;
1772 } 1770 }
1773 1771
1774 static gboolean 1772 static gboolean
1775 configure_cb(GtkWidget *w, GdkEventConfigure *event, AccountsWindow *dialog) 1773 configure_cb(GtkWidget *w, GdkEventConfigure *event, AccountsWindow *dialog)
1776 { 1774 {
2100 AccountsWindow *dialog; 2098 AccountsWindow *dialog;
2101 GtkTreePath *path; 2099 GtkTreePath *path;
2102 GtkTreeViewColumn *column; 2100 GtkTreeViewColumn *column;
2103 GtkTreeIter iter; 2101 GtkTreeIter iter;
2104 PurpleAccount *account; 2102 PurpleAccount *account;
2105 const gchar *title;
2106 2103
2107 dialog = (AccountsWindow *)user_data; 2104 dialog = (AccountsWindow *)user_data;
2105
2106 if (event->window != gtk_tree_view_get_bin_window(treeview))
2107 return FALSE;
2108 2108
2109 /* Figure out which node was clicked */ 2109 /* Figure out which node was clicked */
2110 if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(dialog->treeview), event->x, event->y, &path, &column, NULL, NULL)) 2110 if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(dialog->treeview), event->x, event->y, &path, &column, NULL, NULL))
2111 return FALSE; 2111 return FALSE;
2112 title = gtk_tree_view_column_get_title(column); 2112 if (column == gtk_tree_view_get_column(treeview, 0))
2113 /* The -1 is required because the first two columns of the list 2113 return FALSE;
2114 * store are displayed as only one column in the tree view. */ 2114
2115 column = gtk_tree_view_get_column(treeview, COLUMN_ENABLED-1);
2116 gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, path); 2115 gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, path);
2117 gtk_tree_path_free(path); 2116 gtk_tree_path_free(path);
2118 gtk_tree_model_get(GTK_TREE_MODEL(dialog->model), &iter, COLUMN_DATA, &account, -1); 2117 gtk_tree_model_get(GTK_TREE_MODEL(dialog->model), &iter, COLUMN_DATA, &account, -1);
2119 2118
2120 if ((account != NULL) && (event->button == 1) && 2119 if ((account != NULL) && (event->button == 1) &&
2121 (event->type == GDK_2BUTTON_PRESS) && 2120 (event->type == GDK_2BUTTON_PRESS))
2122 (strcmp(gtk_tree_view_column_get_title(column), title)))
2123 { 2121 {
2124 pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, account); 2122 pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, account);
2125 return TRUE; 2123 return TRUE;
2126 } 2124 }
2127 2125