pidgin/pidgindialog.c

Sat, 29 Oct 2022 01:14:13 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Sat, 29 Oct 2022 01:14:13 -0500
changeset 41859
ed82ab63d15a
parent 41576
f8771a229df1
permissions
-rw-r--r--

Convert PidginProxyPrefs to Adwaita 1.2

Testing Done:
Set all the values via the ui and the config file and tested bad values in the port in both as well. Bad values in the ui will store whatever atoi returned, but bad values in the config file will fallback to the default.

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

40533
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * pidgin
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 *
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 * Pidgin is the legal property of its developers, whose names are too numerous
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * source distribution.
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 *
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * (at your option) any later version.
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 *
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * GNU General Public License for more details.
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 *
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
40539
2941deda6d8d Use an https link to gnu.org in the license file headers
Gary Kramlich <grim@reaperworld.com>
parents: 40533
diff changeset
19 * along with this program; if not, see <https://www.gnu.org/licenses/>.
40533
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 */
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21
40608
defc6aec1761 Add missing i18n headers.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40539
diff changeset
22 #include <glib/gi18n-lib.h>
defc6aec1761 Add missing i18n headers.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40539
diff changeset
23
40533
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 #include "pidgindialog.h"
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 #include "pidgincore.h"
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 struct _PidginDialog {
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 GtkDialog parent;
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 };
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 /******************************************************************************
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 * GObject Implementation
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 *****************************************************************************/
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 G_DEFINE_TYPE(PidginDialog, pidgin_dialog, GTK_TYPE_DIALOG)
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 static void
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 pidgin_dialog_init(PidginDialog *button) {
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 }
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 static void
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 pidgin_dialog_class_init(PidginDialogClass *klass) {
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 }
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 /******************************************************************************
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 * Public API
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 *****************************************************************************/
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 GtkWidget *
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 pidgin_dialog_new(const gchar *title, guint border_width, const gchar *role,
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 gboolean resizable)
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 {
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 if(title == NULL) {
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 title = PIDGIN_ALERT_TITLE;
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 }
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 return GTK_WIDGET(g_object_new(
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 PIDGIN_TYPE_DIALOG,
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 "title", title,
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 "resizable", resizable,
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 NULL));
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 }

mercurial