Tue, 15 Oct 2024 00:47:42 -0500
Port prefs to AdwSwitchRow
Now that we depend on Adwaita 1.4, we can flip the switch on using these (pun intended).
This also simplifies some extra tracking we needed to do for activations and focus, since the Adwaita widgets do that for us.
Testing Done:
Opened prefs, confirmed all the switches were there, and toggled them all without any warnings.
Also used the mnemonics to toggle the switches from the keyboard.
Reviewed at https://reviews.imfreedom.org/r/3582/
|
41237
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42497
diff
changeset
|
5 | * Purple is the legal property of its developers, whose names are too numerous |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42497
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42497
diff
changeset
|
7 | * source distribution. |
|
41237
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42497
diff
changeset
|
9 | * This library is free software; you can redistribute it and/or modify it |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42497
diff
changeset
|
10 | * under the terms of the GNU General Public License as published by the Free |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42497
diff
changeset
|
11 | * Software Foundation; either version 2 of the License, or (at your option) |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42497
diff
changeset
|
12 | * any later version. |
|
41237
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42497
diff
changeset
|
14 | * This library is distributed in the hope that it will be useful, but WITHOUT |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42497
diff
changeset
|
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42497
diff
changeset
|
16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42497
diff
changeset
|
17 | * more details. |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42497
diff
changeset
|
18 | * |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42497
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License along with |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42497
diff
changeset
|
20 | * this library; if not, see <https://www.gnu.org/licenses/>. |
|
41237
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | # error "only <purple.h> may be included directly" |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | #endif |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | #ifndef PURPLE_PATH_H |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | #define PURPLE_PATH_H |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | #include <glib.h> |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | |
|
42391
090b03385984
Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41680
diff
changeset
|
32 | #include "purpleversion.h" |
|
090b03385984
Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41680
diff
changeset
|
33 | |
|
41237
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | G_BEGIN_DECLS |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | /** |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | * purple_cache_dir: |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | * |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | * Returns the purple cache directory according to XDG Base Directory Specification. |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | * This is usually $HOME/.cache/purple. |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | * If custom user dir was specified then this is cache |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | * sub-directory of DIR argument passed to -c option. |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | * |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | * Returns: The purple cache directory. |
|
42391
090b03385984
Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41680
diff
changeset
|
45 | * |
|
42615
2f3308794a8f
Remove the micro version from since tags for libpurple part 4
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
46 | * Since: 3.0 |
|
41237
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | */ |
|
42391
090b03385984
Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41680
diff
changeset
|
48 | PURPLE_AVAILABLE_IN_3_0 |
|
41237
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | const gchar *purple_cache_dir(void); |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | /** |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | * purple_config_dir: |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | * |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | * Returns the purple configuration directory according to XDG Base Directory Specification. |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | * This is usually $HOME/.config/purple. |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | * If custom user dir was specified then this is config |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | * sub-directory of DIR argument passed to -c option. |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | * |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | * Returns: The purple configuration directory. |
|
42391
090b03385984
Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41680
diff
changeset
|
60 | * |
|
42615
2f3308794a8f
Remove the micro version from since tags for libpurple part 4
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
61 | * Since: 3.0 |
|
41237
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | */ |
|
42391
090b03385984
Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41680
diff
changeset
|
63 | PURPLE_AVAILABLE_IN_3_0 |
|
41237
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | const gchar *purple_config_dir(void); |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | /** |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | * purple_data_dir: |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | * |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | * Returns the purple data directory according to XDG Base Directory Specification. |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | * This is usually $HOME/.local/share/purple. |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | * If custom user dir was specified then this is data |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | * sub-directory of DIR argument passed to -c option. |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | * |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | * Returns: The purple data directory. |
|
42391
090b03385984
Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41680
diff
changeset
|
75 | * |
|
42615
2f3308794a8f
Remove the micro version from since tags for libpurple part 4
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
76 | * Since: 3.0 |
|
41237
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 | */ |
|
42391
090b03385984
Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41680
diff
changeset
|
78 | PURPLE_AVAILABLE_IN_3_0 |
|
41237
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | const gchar *purple_data_dir(void); |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
81 | /** |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
82 | * purple_util_set_user_dir: |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | * @dir: The custom settings directory |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | * |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | * Define a custom purple settings directory, overriding the default (user's home directory/.purple) |
|
42408
94151c4d26b5
Add Since tags/visibility exports to utility functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42391
diff
changeset
|
86 | * |
|
42615
2f3308794a8f
Remove the micro version from since tags for libpurple part 4
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
87 | * Since: 2.0 |
|
41237
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | */ |
|
42408
94151c4d26b5
Add Since tags/visibility exports to utility functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42391
diff
changeset
|
89 | PURPLE_AVAILABLE_IN_ALL |
|
41237
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
90 | void purple_util_set_user_dir(const gchar *dir); |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 | |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
92 | G_END_DECLS |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
93 | |
|
5098e0dd3a09
Move the path based functions from util.c to their own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
94 | #endif /* PURPLE_PATH_H */ |