Commit f715d696 authored by Daniel García Moreno's avatar Daniel García Moreno

Fix uibuilder ui files loading

There's depenedencies between ui files, so we need to load in the
correct way.
parent 2191bef1
......@@ -9,23 +9,47 @@ pub struct UI {
impl UI {
pub fn new() -> UI {
// The orther here is important because some ui file depends on others
let builder = gtk::Builder::new();
builder.add_from_resource("/org/gnome/Fractal/ui/user_menu.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/main_window.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/add_room_menu.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/autocomplete.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/direct_chat.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/filechooser.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/invite.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/invite_user.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/join_room.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/leave_room.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/members.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/new_room.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/room_config.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/room_menu.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/autocomplete.ui")
.expect("Can't load ui file: autocomplete.ui");
// needed from main_window
// These are popup menus showed from main_window interface
builder.add_from_resource("/org/gnome/Fractal/ui/user_menu.ui")
.expect("Can't load ui file: user_menu.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/add_room_menu.ui")
.expect("Can't load ui file: add_room_menu.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/room_menu.ui")
.expect("Can't load ui file: room_menu.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/members.ui")
.expect("Can't load ui file: members.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/main_window.ui")
.expect("Can't load ui file: main_window.ui");
// Depends on main_window
// These are all dialogs transient for main_window
builder.add_from_resource("/org/gnome/Fractal/ui/direct_chat.ui")
.expect("Can't load ui file: direct_chat.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/invite.ui")
.expect("Can't load ui file: invite.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/invite_user.ui")
.expect("Can't load ui file: invite_user.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/join_room.ui")
.expect("Can't load ui file: join_room.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/leave_room.ui")
.expect("Can't load ui file: leave_room.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/new_room.ui")
.expect("Can't load ui file: new_room.ui");
builder.add_from_resource("/org/gnome/Fractal/ui/room_config.ui")
.expect("Can't load ui file: room_config.ui");
// Depends on room config
builder.add_from_resource("/org/gnome/Fractal/ui/filechooser.ui")
.expect("Can't load ui file: filechooser.ui");
UI { builder }
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment