gobjectification: 31a07cc5: Update pidgin for GObjectified accounts.
sadrul at pidgin.im
sadrul at pidgin.im
Sun Jun 22 14:41:37 EDT 2008
-----------------------------------------------------------------
Revision: 31a07cc53ba9397f832e19caeba0b8e391c747ed
Ancestor: fb55ef16a54e874acc44b76c764fbf6d181143e8
Author: sadrul at pidgin.im
Date: 2008-06-22T18:09:50
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/31a07cc53ba9397f832e19caeba0b8e391c747ed
Modified files:
pidgin/gtkaccount.c pidgin/gtkblist.c pidgin/gtkconn.c
pidgin/gtkdocklet.c pidgin/gtkmain.c
ChangeLog:
Update pidgin for GObjectified accounts.
-------------- next part --------------
============================================================
--- pidgin/gtkaccount.c 91f40fa2469e89dbe815e67ed70ac8dd2b3ef926
+++ pidgin/gtkaccount.c f7d3106c4cab50c542c4c2b6df7e805390b6c23c
@@ -1189,7 +1189,10 @@ ok_account_prefs_cb(GtkWidget *w, Accoun
account = dialog->account;
/* Protocol */
+#warning We need to destroy the existing account and create a new one with the changed prpl
+#if 0
purple_account_set_protocol_id(account, dialog->protocol_id);
+#endif
}
/* Alias */
@@ -1387,7 +1390,7 @@ ok_account_prefs_cb(GtkWidget *w, Accoun
saved_status = purple_savedstatus_get_current();
if (saved_status != NULL) {
purple_savedstatus_activate_for_account(saved_status, account);
- purple_account_set_enabled(account, PIDGIN_UI, TRUE);
+ purple_account_set_enabled(account, TRUE);
}
}
@@ -1605,7 +1608,7 @@ static void
}
static void
-account_abled_cb(PurpleAccount *account, gpointer user_data)
+account_abled_cb(PurpleAccount *account, GParamSpec *spec, gpointer user_data)
{
GtkTreeIter iter;
@@ -1615,8 +1618,8 @@ account_abled_cb(PurpleAccount *account,
/* update the account in the GtkListStore */
if (accounts_window_find_account_in_treemodel(&iter, account))
gtk_list_store_set(accounts_window->model, &iter,
- COLUMN_ENABLED, GPOINTER_TO_INT(user_data),
- -1);
+ COLUMN_ENABLED, purple_account_get_enabled(account),
+ -1);
}
static void
@@ -1891,7 +1894,7 @@ enabled_cb(GtkCellRendererToggle *render
purple_savedstatus_activate_for_account(saved_status, account);
}
- purple_account_set_enabled(account, PIDGIN_UI, !enabled);
+ purple_account_set_enabled(account, !enabled);
}
static void
@@ -1999,7 +2002,7 @@ set_account(GtkListStore *store, GtkTree
COLUMN_ICON, pixbuf,
COLUMN_BUDDYICON, buddyicon,
COLUMN_SCREENNAME, purple_account_get_username(account),
- COLUMN_ENABLED, purple_account_get_enabled(account, PIDGIN_UI),
+ COLUMN_ENABLED, purple_account_get_enabled(account),
COLUMN_PROTOCOL, purple_account_get_protocol_name(account),
COLUMN_DATA, account,
-1);
@@ -2023,6 +2026,8 @@ add_account_to_liststore(PurpleAccountMa
gtk_notebook_set_current_page(GTK_NOTEBOOK(accounts_window->notebook),1);
set_account(accounts_window->model, &iter, account, global_buddyicon);
+ g_signal_connect_object(G_OBJECT(account), "notify::enabled",
+ G_CALLBACK(account_abled_cb), accounts_window->treeview, (GConnectFlags)0);
}
static gboolean
@@ -2586,13 +2591,6 @@ pidgin_account_init(void)
G_CALLBACK(account_removed_cb), NULL);
#endif
- purple_signal_connect(purple_accounts_get_handle(), "account-disabled",
- pidgin_account_get_handle(),
- PURPLE_CALLBACK(account_abled_cb), GINT_TO_POINTER(FALSE));
- purple_signal_connect(purple_accounts_get_handle(), "account-enabled",
- pidgin_account_get_handle(),
- PURPLE_CALLBACK(account_abled_cb), GINT_TO_POINTER(TRUE));
-
account_pref_wins =
g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, NULL);
}
============================================================
--- pidgin/gtkblist.c 02941991a8f80a93f1f569ab98580aa74d9c0a68
+++ pidgin/gtkblist.c 4da39fdfda000dff69480cd6c1dfa774e503eeb5
@@ -4623,7 +4623,7 @@ generic_error_enable_cb(PurpleAccount *a
generic_error_enable_cb(PurpleAccount *account)
{
purple_account_clear_current_error(account);
- purple_account_set_enabled(account, purple_core_get_ui(), TRUE);
+ purple_account_set_enabled(account, TRUE);
}
static void
@@ -4655,7 +4655,7 @@ add_generic_error_dialog(PurpleAccount *
GtkWidget *mini_dialog;
const char *username = purple_account_get_username(account);
gboolean enabled =
- purple_account_get_enabled(account, purple_core_get_ui());
+ purple_account_get_enabled(account);
char *primary;
if (enabled)
@@ -4754,7 +4754,7 @@ enable_account(PurpleAccount *account)
static void
enable_account(PurpleAccount *account)
{
- purple_account_set_enabled(account, purple_core_get_ui(), TRUE);
+ purple_account_set_enabled(account, TRUE);
}
static void
@@ -7485,7 +7485,7 @@ enable_account_cb(GtkCheckMenuItem *widg
saved_status = purple_savedstatus_get_current();
purple_savedstatus_activate_for_account(saved_status, account);
- purple_account_set_enabled(account, PIDGIN_UI, TRUE);
+ purple_account_set_enabled(account, TRUE);
}
static void
@@ -7493,7 +7493,7 @@ disable_account_cb(GtkCheckMenuItem *wid
{
PurpleAccount *account = data;
- purple_account_set_enabled(account, PIDGIN_UI, FALSE);
+ purple_account_set_enabled(account, FALSE);
}
void
@@ -7527,7 +7527,7 @@ pidgin_blist_update_accounts_menu(void)
account = accounts->data;
accel_group = gtk_menu_get_accel_group(GTK_MENU(accountmenu));
- if(purple_account_get_enabled(account, PIDGIN_UI)) {
+ if(purple_account_get_enabled(account)) {
buf = g_strconcat(purple_account_get_username(account), " (",
purple_account_get_protocol_name(account), ")", NULL);
menuitem = gtk_image_menu_item_new_with_label(buf);
@@ -7606,7 +7606,7 @@ pidgin_blist_update_accounts_menu(void)
account = accounts->data;
- if(!purple_account_get_enabled(account, PIDGIN_UI)) {
+ if(!purple_account_get_enabled(account)) {
disabled_accounts = TRUE;
============================================================
--- pidgin/gtkconn.c 3994de125aa49d4bcd195cd60925f7db3ac1ad77
+++ pidgin/gtkconn.c 02b44a0f5bbd83af15083bdfa4c76c9859ae03af
@@ -171,7 +171,7 @@ pidgin_connection_report_disconnect_reas
if (info != NULL)
g_hash_table_remove(auto_reconns, account);
- purple_account_set_enabled(account, PIDGIN_UI, FALSE);
+ purple_account_set_enabled(account, FALSE);
}
/* If we have any open chats, we probably want to rejoin when we get back online. */
============================================================
--- pidgin/gtkdocklet.c a4aef94a2a248a3e9fe796ea4e4a720b8a0c25c6
+++ pidgin/gtkdocklet.c d99d6baccb7847b8bad887e0cd45e66b47f04941
@@ -187,7 +187,7 @@ docklet_update_status(void)
PurpleAccount *account = (PurpleAccount*)l->data;
PurpleStatus *account_status;
- if (!purple_account_get_enabled(account, PIDGIN_UI))
+ if (!purple_account_get_enabled(account))
continue;
if (purple_account_is_disconnected(account))
============================================================
--- pidgin/gtkmain.c a98e450ab4fedfe413e1ffa42c7b6b789851e71b
+++ pidgin/gtkmain.c 8185730c2e5696c78b945fdf9f9364d26feaee59
@@ -124,7 +124,7 @@ dologin_named(const char *name)
for (i = 0; names[i] != NULL; i++) {
account = purple_accounts_find(names[i], NULL);
if (account != NULL) { /* found a user */
- purple_account_set_enabled(account, PIDGIN_UI, TRUE);
+ purple_account_set_enabled(account, TRUE);
}
}
g_strfreev(names);
@@ -135,7 +135,7 @@ dologin_named(const char *name)
if (accounts != NULL)
{
account = (PurpleAccount *)accounts->data;
- purple_account_set_enabled(account, PIDGIN_UI, TRUE);
+ purple_account_set_enabled(account, TRUE);
}
}
}
@@ -846,7 +846,7 @@ int main(int argc, char *argv[])
/* disable all accounts */
for (accounts = purple_accounts_get_all(); accounts != NULL; accounts = accounts->next) {
PurpleAccount *account = accounts->data;
- purple_account_set_enabled(account, PIDGIN_UI, FALSE);
+ purple_account_set_enabled(account, FALSE);
}
/* honor the startup status preference */
if (!purple_prefs_get_bool("/purple/savedstatus/startup_current_status"))
More information about the Commits
mailing list