Thu, 15 May 2025 23:56:42 -0500
Add Purple.Protocol:tags and add unit tests for protocol properties
Testing Done:
Ran the tests under valgrind and called in the turtles.
Reviewed at https://reviews.imfreedom.org/r/4006/
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Pidgin - Internet Messenger |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * Pidgin is the legal property of its developers, whose names are too numerous |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * source distribution. |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * This program is free software; you can redistribute it and/or modify |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * it under the terms of the GNU General Public License as published by |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * the Free Software Foundation; either version 2 of the License, or |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * (at your option) any later version. |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * This program is distributed in the hope that it will be useful, |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | * GNU General Public License for more details. |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | * along with this program; if not, see <https://www.gnu.org/licenses/>. |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #include <glib/gi18n.h> |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
25 | #include "pidginaccountsdisabledmenu.h" |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
27 | struct _PidginAccountsDisabledMenu { |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
28 | GMenuModel parent; |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | |
|
43220
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
30 | GListModel *accounts; |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
31 | }; |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | |
|
42575
580339aa47cc
Make sure all of the final types in pidgin are defined as such
Gary Kramlich <grim@reaperworld.com>
parents:
42565
diff
changeset
|
33 | G_DEFINE_FINAL_TYPE(PidginAccountsDisabledMenu, pidgin_accounts_disabled_menu, |
|
580339aa47cc
Make sure all of the final types in pidgin are defined as such
Gary Kramlich <grim@reaperworld.com>
parents:
42565
diff
changeset
|
34 | G_TYPE_MENU_MODEL) |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | /****************************************************************************** |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | * Callbacks |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | *****************************************************************************/ |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | static void |
|
43220
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
40 | pidgin_accounts_disabled_menu_items_changed_cb(GListModel *model, |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
41 | guint position, |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
42 | guint removed, |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
43 | guint added, |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
44 | gpointer data) |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | { |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
46 | PidginAccountsDisabledMenu *menu = data; |
|
43220
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
47 | guint n_items = g_list_model_get_n_items(model); |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
48 | |
|
43220
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
49 | if(n_items == 0) { |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
50 | /* If every account is enabled, this model will be empty, but we add an |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
51 | * item saying "no disabled accounts". |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
52 | */ |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
53 | added = 1; |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
54 | } else if(n_items == (added - removed) && position == 0) { |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
55 | /* In this case, there were no accounts in the model *before*. This |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
56 | * means we need to remove the "no disabled accounts" item that we put |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
57 | * in place when all accounts are enabled. |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
58 | */ |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
59 | removed = 1; |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
60 | } |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
61 | |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
62 | g_menu_model_items_changed(G_MENU_MODEL(menu), position, removed, added); |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
63 | } |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
64 | |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
65 | /****************************************************************************** |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
66 | * GMenuModel Implementation |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
67 | *****************************************************************************/ |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
68 | static gboolean |
|
41947
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41946
diff
changeset
|
69 | pidgin_accounts_disabled_menu_is_mutable(G_GNUC_UNUSED GMenuModel *model) { |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
70 | return TRUE; |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
71 | } |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
72 | |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
73 | static gboolean |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
74 | pidgin_accounts_disabled_menu_get_n_items(GMenuModel *model) { |
|
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
75 | PidginAccountsDisabledMenu *menu = NULL; |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
76 | |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
77 | menu = PIDGIN_ACCOUNTS_DISABLED_MENU(model); |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
78 | |
|
43220
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
79 | /* If every account is enabled, we add an item saying "no disabled |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
80 | * accounts", so there's always at least 1. |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
81 | */ |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
82 | return MAX(1, g_list_model_get_n_items(menu->accounts)); |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | } |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | static void |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
86 | pidgin_accounts_disabled_menu_get_item_attributes(GMenuModel *model, |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
87 | gint index, |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
88 | GHashTable **attributes) |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
89 | { |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
90 | PidginAccountsDisabledMenu *menu = NULL; |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
91 | PurpleAccount *account = NULL; |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
92 | PurpleProtocol *protocol = NULL; |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
93 | GVariant *value = NULL; |
|
43062
9d134b69b834
Update Pidgin for the Purple.Account.get_protocol_name deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42804
diff
changeset
|
94 | const char *account_name = NULL; |
|
9d134b69b834
Update Pidgin for the Purple.Account.get_protocol_name deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42804
diff
changeset
|
95 | const char *protocol_name = N_("Unknown"); |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
96 | |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
97 | menu = PIDGIN_ACCOUNTS_DISABLED_MENU(model); |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
98 | |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
99 | /* Create our hash table of attributes to return. */ |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
100 | *attributes = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
101 | (GDestroyNotify)g_variant_unref); |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
102 | |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
103 | /* If we don't have any disabled accounts, just return a single item, |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
104 | * stating as much. |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
105 | */ |
|
43220
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
106 | if(g_list_model_get_n_items(menu->accounts) == 0) { |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
107 | value = g_variant_new_string(_("No disabled accounts")); |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
108 | g_hash_table_insert(*attributes, G_MENU_ATTRIBUTE_LABEL, |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
109 | g_variant_ref_sink(value)); |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
110 | |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
111 | value = g_variant_new_string("disabled"); |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
112 | g_hash_table_insert(*attributes, G_MENU_ATTRIBUTE_ACTION, |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
113 | g_variant_ref_sink(value)); |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
114 | |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
115 | return; |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
116 | } |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
117 | |
|
43220
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
118 | account = g_list_model_get_item(menu->accounts, index); |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
119 | if(account == NULL) { |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
120 | return; |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
121 | } |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
122 | |
|
42804
be8c8b5471ca
Update pidgin to use get id and username directly on PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
42575
diff
changeset
|
123 | account_name = purple_account_get_username(account); |
|
43062
9d134b69b834
Update Pidgin for the Purple.Account.get_protocol_name deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42804
diff
changeset
|
124 | protocol = purple_account_get_protocol(account); |
|
9d134b69b834
Update Pidgin for the Purple.Account.get_protocol_name deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42804
diff
changeset
|
125 | if(PURPLE_IS_PROTOCOL(protocol)) { |
|
9d134b69b834
Update Pidgin for the Purple.Account.get_protocol_name deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42804
diff
changeset
|
126 | protocol_name = purple_protocol_get_name(protocol); |
|
9d134b69b834
Update Pidgin for the Purple.Account.get_protocol_name deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42804
diff
changeset
|
127 | |
|
9d134b69b834
Update Pidgin for the Purple.Account.get_protocol_name deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42804
diff
changeset
|
128 | value = g_variant_new_printf("%s", purple_protocol_get_icon_name(protocol)); |
|
9d134b69b834
Update Pidgin for the Purple.Account.get_protocol_name deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42804
diff
changeset
|
129 | g_hash_table_insert(*attributes, G_MENU_ATTRIBUTE_ICON, |
|
9d134b69b834
Update Pidgin for the Purple.Account.get_protocol_name deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42804
diff
changeset
|
130 | g_variant_ref_sink(value)); |
|
9d134b69b834
Update Pidgin for the Purple.Account.get_protocol_name deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42804
diff
changeset
|
131 | } |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
132 | |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
133 | /* translators: This format string is intended to contain the account |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
134 | * name followed by the protocol name to uniquely identify a specific |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
135 | * account. |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
136 | */ |
|
43062
9d134b69b834
Update Pidgin for the Purple.Account.get_protocol_name deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42804
diff
changeset
|
137 | value = g_variant_new_printf(_("%s (%s)"), account_name, _(protocol_name)); |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
138 | g_hash_table_insert(*attributes, G_MENU_ATTRIBUTE_LABEL, |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
139 | g_variant_ref_sink(value)); |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
140 | |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
141 | value = g_variant_new_string("app.enable-account"); |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
142 | g_hash_table_insert(*attributes, G_MENU_ATTRIBUTE_ACTION, |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
143 | g_variant_ref_sink(value)); |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
144 | |
|
42804
be8c8b5471ca
Update pidgin to use get id and username directly on PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents:
42575
diff
changeset
|
145 | value = g_variant_new_printf("%s", purple_account_get_id(account)); |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
146 | g_hash_table_insert(*attributes, G_MENU_ATTRIBUTE_TARGET, |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
147 | g_variant_ref_sink(value)); |
|
43220
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
148 | |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
149 | g_clear_object(&account); |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
150 | } |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
151 | |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
152 | static void |
|
41947
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41946
diff
changeset
|
153 | pidgin_accounts_disabled_menu_get_item_links(G_GNUC_UNUSED GMenuModel *model, |
|
7b3312d0760c
Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41946
diff
changeset
|
154 | G_GNUC_UNUSED gint index, |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
155 | GHashTable **links) |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
156 | { |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
157 | *links = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
158 | g_object_unref); |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
159 | } |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
160 | |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
161 | /****************************************************************************** |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
162 | * GObject Implementation |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
163 | *****************************************************************************/ |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
164 | static void |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
165 | pidgin_accounts_disabled_menu_constructed(GObject *obj) { |
|
43220
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
166 | PidginAccountsDisabledMenu *menu = PIDGIN_ACCOUNTS_DISABLED_MENU(obj); |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
167 | guint count = 0; |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
168 | |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
169 | G_OBJECT_CLASS(pidgin_accounts_disabled_menu_parent_class)->constructed(obj); |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
170 | |
|
43220
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
171 | count = g_list_model_get_n_items(menu->accounts); |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
172 | g_menu_model_items_changed(G_MENU_MODEL(obj), 0, 0, count); |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
173 | } |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
174 | |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
175 | static void |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
176 | pidgin_accounts_disabled_menu_init(PidginAccountsDisabledMenu *menu) { |
|
41891
a45d6db4f857
Propagate the PurpleAccount::notify signal via PurpleAccountManager::account-changed
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
177 | PurpleAccountManager *manager = purple_account_manager_get_default(); |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
178 | |
|
43222
e0cc9323ffed
Remove GList versions of purple_account_manager_get_{disabled,enabled}
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43220
diff
changeset
|
179 | menu->accounts = purple_account_manager_get_disabled(manager); |
|
43220
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
180 | g_signal_connect_object(menu->accounts, "items-changed", |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
181 | G_CALLBACK(pidgin_accounts_disabled_menu_items_changed_cb), |
|
583158d1e6c2
Convert PidginAccountsDisabledMenu to the list model
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
43062
diff
changeset
|
182 | menu, G_CONNECT_DEFAULT); |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
183 | } |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
184 | |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
185 | static void |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
186 | pidgin_accounts_disabled_menu_class_init(PidginAccountsDisabledMenuClass *klass) { |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
187 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
188 | GMenuModelClass *model_class = G_MENU_MODEL_CLASS(klass); |
|
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
189 | |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
190 | obj_class->constructed = pidgin_accounts_disabled_menu_constructed; |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
191 | |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
192 | model_class->is_mutable = pidgin_accounts_disabled_menu_is_mutable; |
|
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
193 | model_class->get_n_items = pidgin_accounts_disabled_menu_get_n_items; |
|
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
194 | model_class->get_item_attributes = pidgin_accounts_disabled_menu_get_item_attributes; |
|
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
195 | model_class->get_item_links = pidgin_accounts_disabled_menu_get_item_links; |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
196 | } |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
197 | |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
198 | /****************************************************************************** |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
199 | * Public API |
|
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
200 | *****************************************************************************/ |
|
41315
1c9f47bbc031
Replace PidginAccountsDisabledMenu with PidginInactiveAccountsMenu which is a GMenuModel subclass.
Gary Kramlich <grim@reaperworld.com>
parents:
41298
diff
changeset
|
201 | GMenuModel * |
|
41450
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
202 | pidgin_accounts_disabled_menu_new(void) { |
|
ce81f2bc04ca
Rename PidginInactiveAccountsMenu to PidginAccountsDisabledMenu to match PidginAccountsEnabledMenu
Gary Kramlich <grim@reaperworld.com>
parents:
41315
diff
changeset
|
203 | return g_object_new(PIDGIN_TYPE_ACCOUNTS_DISABLED_MENU, NULL); |
|
41298
6d816e02fd76
Create a menu controller that will keep a GMenu in sync with the disabled accounts in libpurple
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
204 | } |