pidgin/prefs/pidginawayprefs.h

Mon, 29 Aug 2022 22:06:07 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Mon, 29 Aug 2022 22:06:07 -0500
changeset 41623
78cf94d0f8c8
parent 41548
3353c766c6cf
child 42465
b7d530551c1b
permissions
-rw-r--r--

Move network preferences to Adwaita preference widgets

This does make the TURN server settings longer vertically, but that seems more consistent with everything.

Also fix the `leave` event on the TURN server setting.

Testing Done:
Toggled all the options and checked that stuff happened in the Debug Window.

Also, I'm not sure why the `GtkSpinButton` and `GtkEntry` expand to different sizes; they both have `hexpand=1`, and the spin button is next to text that's _shorter_ than the entry, but somehow ends up farther right. Seems like a bug in GTK.

PS, be careful of this page; it tries to get your public IP address and displays it when it succeeds.

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

41368
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
1 /*
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
2 * Pidgin - Internet Messenger
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
4 *
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
5 * Pidgin is the legal property of its developers, whose names are too numerous
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
7 * source distribution.
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
8 *
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
12 * (at your option) any later version.
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
13 *
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
17 * GNU General Public License for more details.
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
18 *
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
21 */
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
22
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
23 #if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION)
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
24 # error "only <pidgin.h> may be included directly"
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
25 #endif
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
26
41374
ea87294eff71 Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41368
diff changeset
27 #ifndef PIDGIN_AWAY_PREFS_H
ea87294eff71 Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41368
diff changeset
28 #define PIDGIN_AWAY_PREFS_H
41368
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
29
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
30 #include <glib.h>
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
31
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
32 #include <gtk/gtk.h>
41548
3353c766c6cf Convert away prefs page to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41374
diff changeset
33 #include <adwaita.h>
41368
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
34
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
35 G_BEGIN_DECLS
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
36
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
37 /**
41374
ea87294eff71 Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41368
diff changeset
38 * PidginAwayPrefs:
41368
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
39 *
41374
ea87294eff71 Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41368
diff changeset
40 * #PidginAwayPrefs is a widget for the preferences window to let users
41368
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
41 * choose and configure their away and idle settings.
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
42 *
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
43 * Since: 3.0.0
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
44 */
41374
ea87294eff71 Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41368
diff changeset
45 #define PIDGIN_TYPE_AWAY_PREFS (pidgin_away_prefs_get_type())
ea87294eff71 Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41368
diff changeset
46 G_DECLARE_FINAL_TYPE(PidginAwayPrefs, pidgin_away_prefs,
41548
3353c766c6cf Convert away prefs page to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41374
diff changeset
47 PIDGIN, AWAY_PREFS, AdwPreferencesPage)
41368
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
48
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
49 /**
41374
ea87294eff71 Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41368
diff changeset
50 * pidgin_away_prefs_new:
41368
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
51 *
41374
ea87294eff71 Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41368
diff changeset
52 * Creates a new #PidginAwayPrefs instance.
41368
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
53 *
41374
ea87294eff71 Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41368
diff changeset
54 * Returns: (transfer full): The new #PidginAwayPrefs instance.
41368
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
55 *
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
56 * Since: 3.0.0
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
57 */
41374
ea87294eff71 Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41368
diff changeset
58 GtkWidget *pidgin_away_prefs_new(void);
41368
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
59
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
60 G_END_DECLS
54d7cfc990eb Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
61
41374
ea87294eff71 Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41368
diff changeset
62 #endif /* PIDGIN_AWAY_PREFS_H */

mercurial