Tue, 15 Sep 2020 21:54:10 -0500
Separate the AccountChooser from its model and move options to filters
Create a store for accounts and a filter to only show connected accounts
Update everything to use the new PidginAccountStore and PidginAccountFilterConnected filter
Add a GtkTreeModelFilter for protocols by id
Testing Done:
Compiled and opened most of the dialogs to make sure they're still working the same. Was unable to test gevolution.
Reviewed at https://reviews.imfreedom.org/r/95/
|
40379
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * pidgin |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * Pidgin is the legal property of its developers, whose names are too numerous |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * source distribution. |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * This program is free software; you can redistribute it and/or modify |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * it under the terms of the GNU General Public License as published by |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * the Free Software Foundation; either version 2 of the License, or |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * (at your option) any later version. |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * This program is distributed in the hope that it will be useful, |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * GNU General Public License for more details. |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | * |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * You should have received a copy of the GNU General Public License |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | * along with this program; if not, write to the Free Software |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
40502
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
40388
diff
changeset
|
22 | |
|
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
40388
diff
changeset
|
23 | #if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION) |
|
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
40388
diff
changeset
|
24 | # error "only <pidgin.h> may be included directly" |
|
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
40388
diff
changeset
|
25 | #endif |
|
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
40388
diff
changeset
|
26 | |
|
40379
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | #ifndef PIDGIN_ACCOUNTS_MENU_H |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | #define PIDGIN_ACCOUNTS_MENU_H |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | /** |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | * SECTION:pidginaccountsmenu |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | * @section_id: pidgin-accounts-menu |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | * @short_description: A menu for managing accounts and their actions |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | * @title: Accounts Menu |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | * |
|
40388
3f2e9e346f6f
Fix a bunch of stuff that was found in review.
Gary Kramlich <grim@reaperworld.com>
parents:
40379
diff
changeset
|
36 | * #PidginAccountsMenu is a #GtkMenu that provides an interface to users to open |
|
40379
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | * the account manager as well as activate account actions. |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | * |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | * It manages itself as accounts are created/deleted and enabled/disabled and |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | * can be added as a submenu to any #GtkMenuItem. |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | */ |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | #include <gtk/gtk.h> |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | G_BEGIN_DECLS |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | #define PIDGIN_TYPE_ACCOUNTS_MENU (pidgin_accounts_menu_get_type()) |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | G_DECLARE_FINAL_TYPE(PidginAccountsMenu, pidgin_accounts_menu, PIDGIN, |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | ACCOUNTS_MENU, GtkMenu) |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | /** |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | * pidgin_accounts_menu_new: |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | * |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | * Creates a new #PidginAccountsMenu instance that keeps itself up to date. |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | * |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | * Returns: (transfer full): The new #PidginAccountsMenu instance. |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | */ |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | GtkWidget *pidgin_accounts_menu_new(void); |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | G_END_DECLS |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | |
|
c50c509dd028
Migrate the accounts menu to its own set of widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | #endif /* PIDGIN_ACCOUNTS_MENU_H */ |