Fri, 13 May 2022 04:43:04 -0500
Split proxy prefs page into a separate widget
Again no re-designing, but did switch `GtkFrame` to `HdyPreferencesGroup` to work in a `HdyPreferencesPage`.
Testing Done:
Open Preferences, saw no errors, changed options and checked debug window to see saving of prefs.
Reviewed at https://reviews.imfreedom.org/r/1443/
|
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 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
25 | #include <handy.h> |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
26 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
27 | #include "pidginawaypage.h" |
|
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 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
32 | struct _PidginAwayPage { |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
33 | HdyPreferencesPage parent; |
|
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; |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
37 | GtkWidget *idle_hbox; |
|
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; |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
41 | GtkWidget *startup_hbox; |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
42 | GtkWidget *startup_label; |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
43 | }; |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
44 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
45 | G_DEFINE_TYPE(PidginAwayPage, pidgin_away_page, HDY_TYPE_PREFERENCES_PAGE) |
|
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 | /****************************************************************************** |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
48 | * Helpers |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
49 | *****************************************************************************/ |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
50 | static void |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
51 | 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
|
52 | { |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
53 | 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
|
54 | 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
|
55 | } |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
56 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
57 | static void |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
58 | set_startupstatus(PurpleSavedStatus *status) |
|
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 | 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
|
61 | 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
|
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 | /****************************************************************************** |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
65 | * GObject Implementation |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
66 | *****************************************************************************/ |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
67 | static void |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
68 | pidgin_away_page_class_init(PidginAwayPageClass *klass) |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
69 | { |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
70 | 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
|
71 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
72 | 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
|
73 | widget_class, |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
74 | "/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
|
75 | ); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
76 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
77 | gtk_widget_class_bind_template_child( |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
78 | widget_class, PidginAwayPage, idle_reporting.combo); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
79 | gtk_widget_class_bind_template_child( |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
80 | widget_class, PidginAwayPage, mins_before_away); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
81 | gtk_widget_class_bind_template_child( |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
82 | widget_class, PidginAwayPage, away_when_idle); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
83 | gtk_widget_class_bind_template_child( |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
84 | widget_class, PidginAwayPage, idle_hbox); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
85 | gtk_widget_class_bind_template_child( |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
86 | widget_class, PidginAwayPage, auto_reply.combo); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
87 | gtk_widget_class_bind_template_child( |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
88 | widget_class, PidginAwayPage, startup_current_status); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
89 | gtk_widget_class_bind_template_child( |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
90 | widget_class, PidginAwayPage, startup_hbox); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
91 | gtk_widget_class_bind_template_child( |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
92 | widget_class, PidginAwayPage, startup_label); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
93 | } |
|
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 | static void |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
96 | pidgin_away_page_init(PidginAwayPage *page) |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
97 | { |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
98 | GtkWidget *menu; |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
99 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
100 | gtk_widget_init_template(GTK_WIDGET(page)); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
101 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
102 | page->idle_reporting.type = PURPLE_PREF_STRING; |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
103 | page->idle_reporting.key = "/purple/away/idle_reporting"; |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
104 | pidgin_prefs_bind_dropdown(&page->idle_reporting); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
105 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
106 | pidgin_prefs_bind_spin_button("/purple/away/mins_before_away", |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
107 | page->mins_before_away); |
|
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 | pidgin_prefs_bind_checkbox("/purple/away/away_when_idle", |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
110 | page->away_when_idle); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
111 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
112 | /* 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
|
113 | 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
|
114 | G_CALLBACK(set_idle_away)); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
115 | gtk_widget_show_all(menu); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
116 | gtk_box_pack_start(GTK_BOX(page->idle_hbox), menu, FALSE, FALSE, 0); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
117 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
118 | g_object_bind_property(page->away_when_idle, "active", |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
119 | menu, "sensitive", |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
120 | G_BINDING_SYNC_CREATE); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
121 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
122 | /* Away stuff */ |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
123 | page->auto_reply.type = PURPLE_PREF_STRING; |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
124 | page->auto_reply.key = "/purple/away/auto_reply"; |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
125 | pidgin_prefs_bind_dropdown(&page->auto_reply); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
126 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
127 | /* Signon status stuff */ |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
128 | pidgin_prefs_bind_checkbox("/purple/savedstatus/startup_current_status", |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
129 | page->startup_current_status); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
130 | |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
131 | /* 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
|
132 | 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
|
133 | G_CALLBACK(set_startupstatus)); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
134 | gtk_widget_show_all(menu); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
135 | gtk_box_pack_start(GTK_BOX(page->startup_hbox), menu, FALSE, FALSE, 0); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
136 | gtk_label_set_mnemonic_widget(GTK_LABEL(page->startup_label), menu); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
137 | pidgin_set_accessible_label(menu, GTK_LABEL(page->startup_label)); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
138 | g_object_bind_property(page->startup_current_status, "active", |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
139 | page->startup_hbox, "sensitive", |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
140 | G_BINDING_SYNC_CREATE|G_BINDING_INVERT_BOOLEAN); |
|
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 | /****************************************************************************** |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
144 | * API |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
145 | *****************************************************************************/ |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
146 | GtkWidget * |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
147 | pidgin_away_page_new(void) { |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
148 | return GTK_WIDGET(g_object_new(PIDGIN_TYPE_AWAY_PAGE, NULL)); |
|
54d7cfc990eb
Split away/idle prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff
changeset
|
149 | } |