comparison src/gtkaccount.c @ 12070:e4666705944b

[gaim-migrate @ 14365] patches [ 1353462 ] account-disabled/enabled signals, use them in account dialog and [ 1355690 ] Add/remove statusbox when accounts are enabled/disabled some parts of the first one didn't apply, but they were doc changes, so i figured charkins could diff them. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Sun, 13 Nov 2005 03:45:16 +0000
parents 831e52ceddf3
children c59115994f67
comparison
equal deleted inserted replaced
12069:1019f1d510d6 12070:e4666705944b
1902 if (accounts_window_find_account_in_treemodel(&iter, account)) 1902 if (accounts_window_find_account_in_treemodel(&iter, account))
1903 gtk_list_store_remove(accounts_window->model, &iter); 1903 gtk_list_store_remove(accounts_window->model, &iter);
1904 } 1904 }
1905 1905
1906 static void 1906 static void
1907 account_abled_cb(GaimAccount *account, gpointer user_data)
1908 {
1909 GtkTreeIter iter;
1910
1911 if (accounts_window == NULL)
1912 return;
1913
1914 /* update the account in the GtkListStore */
1915 if (accounts_window_find_account_in_treemodel(&iter, account))
1916 gtk_list_store_set(accounts_window->model, &iter,
1917 COLUMN_ENABLED, GPOINTER_TO_INT(user_data),
1918 -1);
1919 }
1920
1921 static void
1907 drag_data_get_cb(GtkWidget *widget, GdkDragContext *ctx, 1922 drag_data_get_cb(GtkWidget *widget, GdkDragContext *ctx,
1908 GtkSelectionData *data, guint info, guint time, 1923 GtkSelectionData *data, guint info, guint time,
1909 AccountsWindow *dialog) 1924 AccountsWindow *dialog)
1910 { 1925 {
1911 if (data->target == gdk_atom_intern("GAIM_ACCOUNT", FALSE)) { 1926 if (data->target == gdk_atom_intern("GAIM_ACCOUNT", FALSE)) {
2165 current_savedstatus_name = gaim_prefs_get_string("/core/status/current"); 2180 current_savedstatus_name = gaim_prefs_get_string("/core/status/current");
2166 saved_status = gaim_savedstatus_find(current_savedstatus_name); 2181 saved_status = gaim_savedstatus_find(current_savedstatus_name);
2167 gaim_savedstatus_activate_for_account(saved_status, account); 2182 gaim_savedstatus_activate_for_account(saved_status, account);
2168 2183
2169 gaim_account_set_enabled(account, GAIM_GTK_UI, !enabled); 2184 gaim_account_set_enabled(account, GAIM_GTK_UI, !enabled);
2170
2171 gtk_list_store_set(dialog->model, &iter,
2172 COLUMN_ENABLED, !enabled,
2173 -1);
2174 } 2185 }
2175 2186
2176 static void 2187 static void
2177 add_columns(GtkWidget *treeview, AccountsWindow *dialog) 2188 add_columns(GtkWidget *treeview, AccountsWindow *dialog)
2178 { 2189 {
2618 gaim_gtk_account_get_handle(), 2629 gaim_gtk_account_get_handle(),
2619 GAIM_CALLBACK(add_account_to_liststore), NULL); 2630 GAIM_CALLBACK(add_account_to_liststore), NULL);
2620 gaim_signal_connect(gaim_accounts_get_handle(), "account-removed", 2631 gaim_signal_connect(gaim_accounts_get_handle(), "account-removed",
2621 gaim_gtk_account_get_handle(), 2632 gaim_gtk_account_get_handle(),
2622 GAIM_CALLBACK(account_removed_cb), NULL); 2633 GAIM_CALLBACK(account_removed_cb), NULL);
2634 gaim_signal_connect(gaim_accounts_get_handle(), "account-disabled",
2635 gaim_gtk_account_get_handle(),
2636 GAIM_CALLBACK(account_abled_cb), GINT_TO_POINTER(FALSE));
2637 gaim_signal_connect(gaim_accounts_get_handle(), "account-enabled",
2638 gaim_gtk_account_get_handle(),
2639 GAIM_CALLBACK(account_abled_cb), GINT_TO_POINTER(TRUE));
2623 2640
2624 account_pref_wins = 2641 account_pref_wins =
2625 g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, NULL); 2642 g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, NULL);
2626 } 2643 }
2627 2644