pidgin/pidginaccountmanager.h

Thu, 16 Mar 2023 22:36:19 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Thu, 16 Mar 2023 22:36:19 -0500
changeset 42151
41b9c5be8965
parent 41310
53e4815ef254
child 42465
b7d530551c1b
permissions
-rw-r--r--

Embed PidginAccountEditor into PidginAccountManager

The account manager now uses a stack to switch between a single editor instance
and the list of accounts. The save button from the editor got moved next to the
new back button, but we should probably prompt or throw up an info box when the
user starts making changes or prompt before moving back.

Also, the app.edit-account action now will lose any changes to an account that
is currently being edited, which we should disallow from happening in the future
as well.

Testing Done:
Opened the account manager and selected accounts and moved backed and saved accounts and made sure everything there worked.
Opened the account editor from a connection error notification and verified that opened properly as well.

Reviewed at https://reviews.imfreedom.org/r/2333/

41310
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Pidgin - Internet Messenger
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Pidgin is the legal property of its developers, whose names are too numerous
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * (at your option) any later version.
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * GNU General Public License for more details.
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION)
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 # error "only <pidgin.h> may be included directly"
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 #endif
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #ifndef PIDGIN_ACCOUNT_MANAGER_H
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 #define PIDGIN_ACCOUNT_MANAGER_H
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 #include <gtk/gtk.h>
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 G_BEGIN_DECLS
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 /**
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 * PidginAccountManager:
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 *
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 * A singleton dialog for managing accounts.
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 *
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 * Since: 3.0.0
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 */
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 #define PIDGIN_TYPE_ACCOUNT_MANAGER (pidgin_account_manager_get_type())
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 G_DECLARE_FINAL_TYPE(PidginAccountManager, pidgin_account_manager, PIDGIN,
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 ACCOUNT_MANAGER, GtkDialog)
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 /**
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 * pidgin_account_manager_new:
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 *
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 * Creates a new account manager dialog.
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 *
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 * Returns: (transfer full): The dialog.
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 *
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 * Since: 3.0.0
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 */
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 GtkWidget *pidgin_account_manager_new(void);
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56
42151
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
57 /**
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
58 * pidgin_account_managet_show_overview:
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
59 * @manager: The instance.
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
60 *
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
61 * Switches @manager to the overview page. This is useful as @manager might
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
62 * already be visible but editing an account.
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
63 *
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
64 * Since: 3.0.0
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
65 */
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
66 void pidgin_account_manager_show_overview(PidginAccountManager *manager);
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
67
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
68 /**
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
69 * pidgin_account_manager_edit_account:
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
70 * @manager: The instance.
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
71 * @account: The account to edit.
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
72 *
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
73 * Opens the account editor in @manager for the given account.
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
74 *
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
75 * Since: 3.0.0
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
76 */
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
77 void pidgin_account_manager_edit_account(PidginAccountManager *manager, PurpleAccount *account);
41b9c5be8965 Embed PidginAccountEditor into PidginAccountManager
Gary Kramlich <grim@reaperworld.com>
parents: 41310
diff changeset
78
41310
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 G_END_DECLS
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80
53e4815ef254 Create a new PidginAccountManager that replaces the manually built one.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 #endif /* PIDGIN_ACCOUNT_MANAGER_H */

mercurial