-
-
It might be a lot easier if we just add a helper function to get the selected room. That should avoid all the
g_object_[gs]et_data
stuff. -
pidgin/gtkroomlist.c (Diff revision 1) These should be named spaced, but we also try to avoid prototypes by just defining functions before they are needed.
-
-
-
pidgin/gtkroomlist.c (Diff revision 1) according to your
g_action_group_add_entries
call, this data should be set ondialog
-
pidgin/gtkroomlist.c (Diff revision 1) according to the gtk4-demo menu progran, you just bind the child menu to the parent, and then call popup on it when you need it. Therefore avoiding needing to get an object from gtk builder and so on.
-
pidgin/resources/Roomlist/menu.ui (Diff revision 1) The
menu
element can and should be put directly in roomlist.ui at the same level as thetemplate
element. This will allow you to use thegtk_widget_class_bind_template_child
. -
pidgin/resources/Roomlist/roomlist.ui (Diff revision 1) delete-event
was replaced withclose-request
. Which also meansdelete_win_cb
should be renamed and have it's properties adjusted. -
-
pidgin/resources/Roomlist/roomlist.ui (Diff revision 1) the box itself wasn't set to fill or expand.
-
pidgin/resources/Roomlist/roomlist.ui (Diff revision 1) needs
halign
=fill
orGTK_ALIGN_FILL
as well. -
-
pidgin/resources/Roomlist/roomlist.ui (Diff revision 1) the old progress bar didn't have align or expand set.
-
pidgin/resources/Roomlist/roomlist.ui (Diff revision 1) action area got reworked see https://docs.gtk.org/gtk4/class.Dialog.html#gtkdialog-as-gtkbuildable for an example. And we should be using response ids instead of direct callbacks.
Port PidginRoomlistDialog to GTK4
Review Request #1423 — Created May 7, 2022 and submitted
Port PidginRoomlistDialog to GTK4
Compiled.
Summary | ID |
---|---|
61337b8f8147c0c7f3b19c1cdaf7479bb7921618 |
Description | From | Last Updated |
---|---|---|
It might be a lot easier if we just add a helper function to get the selected room. That should … |
grim | |
These should be named spaced, but we also try to avoid prototypes by just defining functions before they are needed. |
grim | |
you probably want gtk_widget_get_toplevel instead. |
grim | |
likewise on gtk_widget_get_toplevel |
grim | |
according to your g_action_group_add_entries call, this data should be set on dialog |
grim | |
according to the gtk4-demo menu progran, you just bind the child menu to the parent, and then call popup on … |
grim | |
The menu element can and should be put directly in roomlist.ui at the same level as the template element. This … |
grim | |
delete-event was replaced with close-request. Which also means delete_win_cb should be renamed and have it's properties adjusted. |
grim | |
This should probably be visible. |
grim | |
the box itself wasn't set to fill or expand. |
grim | |
needs halign = fill or GTK_ALIGN_FILL as well. |
grim | |
seeds valign set to GTK_ALIGN_FILL |
grim | |
the old progress bar didn't have align or expand set. |
grim | |
action area got reworked see https://docs.gtk.org/gtk4/class.Dialog.html#gtkdialog-as-gtkbuildable for an example. And we should be using response ids instead of direct callbacks. |
grim | |
You can bind the selection via the ui file and gtk_widget_class_bind_template_child in pidgin_roomlist_class_init to avoid having to do this lookup. … |
grim | |
alignment is off, should be using spaces to align it with the first parameter after the (. |
grim | |
unused parameters should be marked with G_GNUC_UNUSED like G_GNUC_UNUSED GSimpleActions *action, G_GNUC_UNUSED GVariant *parameter |
grim | |
alignment again |
grim | |
d is unused and should be marked as so. |
grim | |
w is unused and should be marked as so. |
grim | |
There should probably be a if(PURPLE_IS_ROOMLIST_ROOM(room)) before this. |
grim | |
You don't need to typecast a gpointer, it'll be implicitly cast. |
grim | |
gdouble for consistency |
grim | |
no need for the cast |
grim | |
Typically we validate parameters before acting on them. So this should use g_return_if_fail(PURPLE_IS_ACCOUNT(account)); before creating the dialog, which that that … |
grim | |
this should probably be start i think? |
grim | |
Action area has been removed in GTK4. The child buttons are just normal children with an additional attribute of type="action" … |
grim | |
We should probably make sure that a room was selected before attempting to join it. |
grim |
Change Summary:
Resolved the issues.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+584 -608) |
-
-
pidgin/gtkroomlist.c (Diff revision 2) You can bind the selection via the ui file and
gtk_widget_class_bind_template_child
inpidgin_roomlist_class_init
to avoid having to do this lookup. See https://docs.gtk.org/gtk4/class.TreeView.html#gtktreeview-as-gtkbuildable for the ui file syntax. -
pidgin/gtkroomlist.c (Diff revision 2) alignment is off, should be using spaces to align it with the first parameter after the
(
. -
pidgin/gtkroomlist.c (Diff revision 2) unused parameters should be marked with
G_GNUC_UNUSED
likeG_GNUC_UNUSED GSimpleActions *action, G_GNUC_UNUSED GVariant *parameter
-
-
-
-
pidgin/gtkroomlist.c (Diff revision 2) There should probably be a
if(PURPLE_IS_ROOMLIST_ROOM(room))
before this. -
pidgin/gtkroomlist.c (Diff revision 2) You don't need to typecast a gpointer, it'll be implicitly cast.
-
-
-
pidgin/gtkroomlist.c (Diff revision 2) Typically we validate parameters before acting on them.
So this should use
g_return_if_fail(PURPLE_IS_ACCOUNT(account));
before creating the dialog, which that that point should be valid and not need ag_return_if_*
macro. -
-
pidgin/resources/Roomlist/roomlist.ui (Diff revision 2) Action area has been removed in GTK4. The child buttons are just normal children with an additional attribute of
type="action"
on them.https://docs.gtk.org/gtk4/class.Dialog.html#gtkdialog-as-gtkbuildable
Change Summary:
Resolved issues.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+584 -610) |
-
-
pidgin/gtkroomlist.c (Diff revision 3) We should probably make sure that a room was selected before attempting to join it.
Change Summary:
Address issues.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+588 -610) |