[fractal/fractal-next] room-history: Replace show to invite members in menu
- From: Julian Sparber <jsparber src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal/fractal-next] room-history: Replace show to invite members in menu
- Date: Thu, 9 Dec 2021 11:59:54 +0000 (UTC)
commit 7325740485665d2c5c3634645b9125ef87cbbac7
Author: Julian Sparber <julian sparber net>
Date: Thu Dec 9 01:19:00 2021 +0100
room-history: Replace show to invite members in menu
data/resources/ui/content-room-history.ui | 4 ++--
src/session/content/room_history/mod.rs | 13 +++++++++++--
2 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/data/resources/ui/content-room-history.ui b/data/resources/ui/content-room-history.ui
index b4d9cd09..e2b2ff64 100644
--- a/data/resources/ui/content-room-history.ui
+++ b/data/resources/ui/content-room-history.ui
@@ -8,8 +8,8 @@
<attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
- <attribute name="label" translatable="yes">Room _Members</attribute>
- <attribute name="action">room-history.members</attribute>
+ <attribute name="label" translatable="yes">_Invite New Member</attribute>
+ <attribute name="action">room-history.invite-members</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
</section>
diff --git a/src/session/content/room_history/mod.rs b/src/session/content/room_history/mod.rs
index 176346a1..9dc7dbd9 100644
--- a/src/session/content/room_history/mod.rs
+++ b/src/session/content/room_history/mod.rs
@@ -87,8 +87,8 @@ mod imp {
klass.install_action("room-history.details", None, move |widget, _, _| {
widget.open_room_details("general");
});
- klass.install_action("room-history.members", None, move |widget, _, _| {
- widget.open_room_details("members");
+ klass.install_action("room-history.invite-members", None, move |widget, _, _| {
+ widget.open_invite_members();
});
klass.install_action("room-history.scroll-down", None, move |widget, _, _| {
@@ -399,6 +399,15 @@ impl RoomHistory {
}
}
+ pub fn open_invite_members(&self) {
+ if let Some(room) = self.room() {
+ let window = RoomDetails::new(&self.parent_window(), &room);
+ window.set_property("visible-page-name", "members").unwrap();
+ window.present_invite_subpage();
+ window.show();
+ }
+ }
+
fn update_room_state(&self) {
let priv_ = imp::RoomHistory::from_instance(self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]