Mon, 29 Aug 2022 22:06:07 -0500
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 | #include <purple.h> |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
24 | |
|
41548
3353c766c6cf
Convert away prefs page to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41374
diff
changeset
|
25 | #include <adwaita.h> |
|
41368
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 | #include "pidginawayprefs.h" |
|
41368
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
28 | #include "gtksavedstatuses.h" |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
29 | #include "gtkutils.h" |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
30 | #include "pidginprefsinternal.h" |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
31 | |
|
41374
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
32 | struct _PidginAwayPrefs { |
|
41548
3353c766c6cf
Convert away prefs page to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41374
diff
changeset
|
33 | AdwPreferencesPage parent; |
|
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 | PidginPrefCombo idle_reporting; |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
36 | GtkWidget *mins_before_away; |
|
41622
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
37 | GtkWidget *idle_row; |
|
41368
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
38 | GtkWidget *away_when_idle; |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
39 | PidginPrefCombo auto_reply; |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
40 | GtkWidget *startup_current_status; |
|
41622
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
41 | GtkWidget *startup_row; |
|
41368
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 | |
|
41548
3353c766c6cf
Convert away prefs page to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41374
diff
changeset
|
44 | G_DEFINE_TYPE(PidginAwayPrefs, pidgin_away_prefs, ADW_TYPE_PREFERENCES_PAGE) |
|
41368
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
45 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
46 | /****************************************************************************** |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
47 | * Helpers |
|
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 | static void |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
50 | set_idle_away(PurpleSavedStatus *status) |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
51 | { |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
52 | purple_prefs_set_int("/purple/savedstatus/idleaway", |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
53 | purple_savedstatus_get_creation_time(status)); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
54 | } |
|
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 | static void |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
57 | set_startupstatus(PurpleSavedStatus *status) |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
58 | { |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
59 | purple_prefs_set_int("/purple/savedstatus/startup", |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
60 | purple_savedstatus_get_creation_time(status)); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
61 | } |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
62 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
63 | /****************************************************************************** |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
64 | * GObject Implementation |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
65 | *****************************************************************************/ |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
66 | static void |
|
41374
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
67 | pidgin_away_prefs_class_init(PidginAwayPrefsClass *klass) |
|
41368
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
68 | { |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
69 | GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
70 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
71 | gtk_widget_class_set_template_from_resource( |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
72 | widget_class, |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
73 | "/im/pidgin/Pidgin3/Prefs/away.ui" |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
74 | ); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
75 | |
|
41374
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
76 | gtk_widget_class_bind_template_child(widget_class, PidginAwayPrefs, |
|
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
77 | idle_reporting.combo); |
|
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
78 | gtk_widget_class_bind_template_child(widget_class, PidginAwayPrefs, |
|
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
79 | mins_before_away); |
|
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
80 | gtk_widget_class_bind_template_child(widget_class, PidginAwayPrefs, |
|
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
81 | away_when_idle); |
|
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
82 | gtk_widget_class_bind_template_child(widget_class, PidginAwayPrefs, |
|
41622
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
83 | idle_row); |
|
41374
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
84 | gtk_widget_class_bind_template_child(widget_class, PidginAwayPrefs, |
|
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
85 | auto_reply.combo); |
|
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
86 | gtk_widget_class_bind_template_child(widget_class, PidginAwayPrefs, |
|
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
87 | startup_current_status); |
|
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
88 | gtk_widget_class_bind_template_child(widget_class, PidginAwayPrefs, |
|
41622
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
89 | startup_row); |
|
41368
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
90 | } |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
91 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
92 | static void |
|
41374
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
93 | pidgin_away_prefs_init(PidginAwayPrefs *prefs) |
|
41368
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
94 | { |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
95 | GtkWidget *menu; |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
96 | |
|
41374
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
97 | gtk_widget_init_template(GTK_WIDGET(prefs)); |
|
41368
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
98 | |
|
41374
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
99 | prefs->idle_reporting.type = PURPLE_PREF_STRING; |
|
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
100 | prefs->idle_reporting.key = "/purple/away/idle_reporting"; |
|
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
101 | pidgin_prefs_bind_dropdown(&prefs->idle_reporting); |
|
41368
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
102 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
103 | pidgin_prefs_bind_spin_button("/purple/away/mins_before_away", |
|
41374
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
104 | prefs->mins_before_away); |
|
41368
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
105 | |
|
41622
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
106 | pidgin_prefs_bind_switch("/purple/away/away_when_idle", |
|
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
107 | prefs->away_when_idle); |
|
41368
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
108 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
109 | /* TODO: Show something useful if we don't have any saved statuses. */ |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
110 | menu = pidgin_status_menu(purple_savedstatus_get_idleaway(), |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
111 | G_CALLBACK(set_idle_away)); |
|
41622
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
112 | gtk_widget_set_valign(menu, GTK_ALIGN_CENTER); |
|
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
113 | adw_action_row_add_suffix(ADW_ACTION_ROW(prefs->idle_row), menu); |
|
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
114 | adw_action_row_set_activatable_widget(ADW_ACTION_ROW(prefs->idle_row), |
|
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
115 | menu); |
|
41368
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
116 | |
|
41374
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
117 | g_object_bind_property(prefs->away_when_idle, "active", |
|
41368
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
118 | menu, "sensitive", |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
119 | G_BINDING_SYNC_CREATE); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
120 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
121 | /* Away stuff */ |
|
41374
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
122 | prefs->auto_reply.type = PURPLE_PREF_STRING; |
|
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
123 | prefs->auto_reply.key = "/purple/away/auto_reply"; |
|
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
124 | pidgin_prefs_bind_dropdown(&prefs->auto_reply); |
|
41368
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
125 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
126 | /* Signon status stuff */ |
|
41622
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
127 | pidgin_prefs_bind_switch("/purple/savedstatus/startup_current_status", |
|
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
128 | prefs->startup_current_status); |
|
41368
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
129 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
130 | /* TODO: Show something useful if we don't have any saved statuses. */ |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
131 | menu = pidgin_status_menu(purple_savedstatus_get_startup(), |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
132 | G_CALLBACK(set_startupstatus)); |
|
41622
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
133 | gtk_widget_set_valign(menu, GTK_ALIGN_CENTER); |
|
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
134 | adw_action_row_add_suffix(ADW_ACTION_ROW(prefs->startup_row), menu); |
|
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
135 | adw_action_row_set_activatable_widget(ADW_ACTION_ROW(prefs->startup_row), |
|
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
136 | menu); |
|
41374
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
137 | g_object_bind_property(prefs->startup_current_status, "active", |
|
41622
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
138 | prefs->startup_row, "sensitive", |
|
4e81efb6f325
Move away preferences to Adwaita preference widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41548
diff
changeset
|
139 | G_BINDING_SYNC_CREATE|G_BINDING_INVERT_BOOLEAN); |
|
41368
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
140 | } |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
141 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
142 | /****************************************************************************** |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
143 | * API |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
144 | *****************************************************************************/ |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
145 | GtkWidget * |
|
41374
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
146 | pidgin_away_prefs_new(void) { |
|
ea87294eff71
Rename PidginAwayPage to PidginAwayPrefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41368
diff
changeset
|
147 | return GTK_WIDGET(g_object_new(PIDGIN_TYPE_AWAY_PREFS, NULL)); |
|
41368
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
148 | } |