comparison src/gtkaccount.c @ 12125:3c1bac709234

[gaim-migrate @ 14425] Change /core/savedstatus/current and /core/savedstatus/idleaway to ints (they used to be strings, where the value was the title of a GaimSavedStatus). The value is now equal to the "creation" timestamp of a saved_status. The creation timestamp is used as the unique key. The primary reason for this is to allow for saved statuses to have NULL titles. NULL titles are needed for transient statuses. I also added a "last_used" timestamp. This all paves the way for keeping track of recently used statuses committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 18 Nov 2005 07:23:29 +0000
parents 355c7acbb61d
children cda86ce5b026
comparison
equal deleted inserted replaced
12124:9c123e27e2f6 12125:3c1bac709234
1620 else 1620 else
1621 gaim_signal_emit(gaim_gtk_account_get_handle(), "account-modified", account); 1621 gaim_signal_emit(gaim_gtk_account_get_handle(), "account-modified", account);
1622 1622
1623 /* If this is a new account, then sign on! */ 1623 /* If this is a new account, then sign on! */
1624 if (new) { 1624 if (new) {
1625 const char *current_savedstatus_name; 1625 const GaimSavedStatus *saved_status;
1626 const GaimSavedStatus *saved_status = NULL; 1626
1627 1627 saved_status = gaim_savedstatus_get_current();
1628 current_savedstatus_name = gaim_prefs_get_string("/core/savedstatus/current"); 1628 if (saved_status != NULL) {
1629 if (current_savedstatus_name)
1630 saved_status = gaim_savedstatus_find(current_savedstatus_name);
1631
1632 if (saved_status) {
1633 gaim_savedstatus_activate_for_account(saved_status, account); 1629 gaim_savedstatus_activate_for_account(saved_status, account);
1634 gaim_account_set_enabled(account, GAIM_GTK_UI, TRUE); 1630 gaim_account_set_enabled(account, GAIM_GTK_UI, TRUE);
1635 } 1631 }
1636 } 1632 }
1637 1633
2175 AccountsWindow *dialog = (AccountsWindow *)data; 2171 AccountsWindow *dialog = (AccountsWindow *)data;
2176 GaimAccount *account; 2172 GaimAccount *account;
2177 GtkTreeModel *model = GTK_TREE_MODEL(dialog->model); 2173 GtkTreeModel *model = GTK_TREE_MODEL(dialog->model);
2178 GtkTreeIter iter; 2174 GtkTreeIter iter;
2179 gboolean enabled; 2175 gboolean enabled;
2180 const char *current_savedstatus_name;
2181 const GaimSavedStatus *saved_status; 2176 const GaimSavedStatus *saved_status;
2182 2177
2183 gtk_tree_model_get_iter_from_string(model, &iter, path_str); 2178 gtk_tree_model_get_iter_from_string(model, &iter, path_str);
2184 gtk_tree_model_get(model, &iter, 2179 gtk_tree_model_get(model, &iter,
2185 COLUMN_DATA, &account, 2180 COLUMN_DATA, &account,
2186 COLUMN_ENABLED, &enabled, 2181 COLUMN_ENABLED, &enabled,
2187 -1); 2182 -1);
2188 2183
2189 /* Set the statuses for this account to the current status */ 2184 /* Set the statuses for this account to the current status */
2190 current_savedstatus_name = gaim_prefs_get_string("/core/savedstatus/current"); 2185 saved_status = gaim_savedstatus_get_current();
2191 saved_status = gaim_savedstatus_find(current_savedstatus_name);
2192 gaim_savedstatus_activate_for_account(saved_status, account); 2186 gaim_savedstatus_activate_for_account(saved_status, account);
2193 2187
2194 gaim_account_set_enabled(account, GAIM_GTK_UI, !enabled); 2188 gaim_account_set_enabled(account, GAIM_GTK_UI, !enabled);
2195 } 2189 }
2196 2190