Fri, 03 Nov 2023 00:50:51 -0500
Integrate PurplePresenceManager with the core and uis
The original implemenation was just the API and wasn't yet tied into the core
or ui. This fixes that.
Testing Done:
Temporarily added code to add a saved status in the `PurpleUi->get_presence_manager` implementation and verified it was saved to the correct file.
Reviewed at https://reviews.imfreedom.org/r/2771/
|
41483
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Pidgin - Internet Messenger |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * Pidgin is the legal property of its developers, whose names are too numerous |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * source distribution. |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * This program is free software; you can redistribute it and/or modify |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * it under the terms of the GNU General Public License as published by |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * the Free Software Foundation; either version 2 of the License, or |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * (at your option) any later version. |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * This program is distributed in the hope that it will be useful, |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | * GNU General Public License for more details. |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | * along with this program; if not, see <https://www.gnu.org/licenses/>. |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION) |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | # error "only <pidgin.h> may be included directly" |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | #endif |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | #ifndef PIDGIN_ACCOUNT_EDITOR_H |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | #define PIDGIN_ACCOUNT_EDITOR_H |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | #include <gtk/gtk.h> |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | |
|
42151
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
32 | #include <adwaita.h> |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
33 | |
|
41483
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | #include <purple.h> |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | |
|
42465
b7d530551c1b
Tag declared Pidgin types with symbol visibility
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42151
diff
changeset
|
36 | #include "pidginversion.h" |
|
b7d530551c1b
Tag declared Pidgin types with symbol visibility
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42151
diff
changeset
|
37 | |
|
41483
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | /** |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | * PidginAccountEditor: |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | * |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | * #PidginAccountEditor is a dialog that allows you to edit an account. |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | * |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | * Since: 3.0.0 |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | */ |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | G_BEGIN_DECLS |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | #define PIDGIN_TYPE_ACCOUNT_EDITOR pidgin_account_editor_get_type() |
|
42465
b7d530551c1b
Tag declared Pidgin types with symbol visibility
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42151
diff
changeset
|
49 | |
|
b7d530551c1b
Tag declared Pidgin types with symbol visibility
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42151
diff
changeset
|
50 | PIDGIN_AVAILABLE_IN_3_0 |
|
41483
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | G_DECLARE_FINAL_TYPE(PidginAccountEditor, pidgin_account_editor, PIDGIN, |
|
42151
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
52 | ACCOUNT_EDITOR, AdwPreferencesPage) |
|
41483
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | /** |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | * pidgin_account_editor_new: |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | * @account: (nullable): The [class@Purple.Account] to edit. |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | * |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | * Creates a new #PidginAccountEditor for @account. If @account is %NULL, the |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | * editor will create a new account. |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | * |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | * Returns: (transfer full): The new instance. |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | * |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | * Since: 3.0.0 |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | */ |
|
42466
ca3374c1cdba
Add visibility to all Pidgin symbols tagged with Since 3.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42465
diff
changeset
|
65 | PIDGIN_AVAILABLE_IN_3_0 |
|
41483
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | GtkWidget *pidgin_account_editor_new(PurpleAccount *account); |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | /** |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | * pidgin_account_editor_get_account: |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | * @editor: The instance. |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | * |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | * Gets the [class@Purple.Account] that @editor is modifying. |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | * |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | * Returns: (transfer none): The [class@Purple.Account] or %NULL. |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | * |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | * Since: 3.0.0 |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 | */ |
|
42466
ca3374c1cdba
Add visibility to all Pidgin symbols tagged with Since 3.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42465
diff
changeset
|
78 | PIDGIN_AVAILABLE_IN_3_0 |
|
41483
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | PurpleAccount *pidgin_account_editor_get_account(PidginAccountEditor *editor); |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | |
|
42151
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
81 | /** |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
82 | * pidgin_account_editor_set_account: |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
83 | * @editor: The instance. |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
84 | * @account: (nullable): The new account to edit. |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
85 | * |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
86 | * Sets the account that @editor is editing to @account. You can pass %NULL |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
87 | * to remove the current account or edit a new account. |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
88 | * |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
89 | * Since: 3.0.0 |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
90 | */ |
|
42466
ca3374c1cdba
Add visibility to all Pidgin symbols tagged with Since 3.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42465
diff
changeset
|
91 | PIDGIN_AVAILABLE_IN_3_0 |
|
42151
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
92 | void pidgin_account_editor_set_account(PidginAccountEditor *editor, PurpleAccount *account); |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
93 | |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
94 | /** |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
95 | * pidgin_account_editor_get_is_valid: |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
96 | * @editor: The instance. |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
97 | * |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
98 | * Gets whether or not the settings for the account is valid and can be saved. |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
99 | * |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
100 | * Returns: %TRUE if the account being edited has valid values, otherwise |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
101 | * %FALSE. |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
102 | * |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
103 | * Since: 3.0.0 |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
104 | */ |
|
42466
ca3374c1cdba
Add visibility to all Pidgin symbols tagged with Since 3.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42465
diff
changeset
|
105 | PIDGIN_AVAILABLE_IN_3_0 |
|
42151
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
106 | gboolean pidgin_account_editor_get_is_valid(PidginAccountEditor *editor); |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
107 | |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
108 | /** |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
109 | * pidgin_account_editor_save: |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
110 | * @editor: The instance. |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
111 | * |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
112 | * Save the account to disk. If this is a new account, it will be set to match |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
113 | * the current global status which is "online" in most cases. |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
114 | * |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
115 | * Since: 3.0.0 |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
116 | */ |
|
42466
ca3374c1cdba
Add visibility to all Pidgin symbols tagged with Since 3.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42465
diff
changeset
|
117 | PIDGIN_AVAILABLE_IN_3_0 |
|
42151
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
118 | void pidgin_account_editor_save(PidginAccountEditor *editor); |
|
41b9c5be8965
Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents:
41483
diff
changeset
|
119 | |
|
41483
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
120 | G_END_DECLS |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
121 | |
|
e3bd18c1769d
The start of the new account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
122 | #endif /* PIDGIN_ACCOUNT_EDITOR_H */ |