Mon, 21 Mar 2022 20:25:43 -0500
Create a new status manager that's built in glade
Behavorial Changes:
* Confirmation dialog for remove has been removed.
* Remove button is disabled if the currently selected status is the active
status. Previously this scenario was silently ignored after confirmation.
Errata:
It is possible to open multiple modify windows for a status. Previously the
editor was reaching into the manager and controlling this pointer. I was going
to fix this, but the editor isn't a widget yet and I don't like doing duplicate
work.
Testing Done:
Basically tried everything I could think of with editing and selecting and so on.
Bugs closed: PIDGIN-17590
Reviewed at https://reviews.imfreedom.org/r/1322/
|
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 | |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | #include "pidginclosebutton.h" |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | struct _PidginCloseButton { |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | GtkButton parent; |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | }; |
|
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 | /****************************************************************************** |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | * GObject Implementation |
|
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 | G_DEFINE_TYPE(PidginCloseButton, pidgin_close_button, GTK_TYPE_BUTTON) |
|
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 | static void |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | pidgin_close_button_init(PidginCloseButton *button) { |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | gtk_widget_init_template(GTK_WIDGET(button)); |
|
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 | |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | static void |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | pidgin_close_button_class_init(PidginCloseButtonClass *klass) { |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | gtk_widget_class_set_template_from_resource( |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | widget_class, |
|
41030
ec8b76f3bf0a
Fix the resource path so we can use the automatic stuff that GtkApplication supports
Gary Kramlich <grim@reaperworld.com>
parents:
40539
diff
changeset
|
44 | "/im/pidgin/Pidgin3/closebutton.ui" |
|
40533
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 | } |
|
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 | /****************************************************************************** |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | * Public API |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | *****************************************************************************/ |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | GtkWidget * |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | pidgin_close_button_new(void) { |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | return GTK_WIDGET(g_object_new(PIDGIN_TYPE_CLOSE_BUTTON, NULL)); |
|
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | } |