aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-11-09 09:46:43 +0100
committerdec05eba <dec05eba@protonmail.com>2018-11-09 09:46:47 +0100
commit5fab9a3a2cf048330f687dda48c76c95a3a67d98 (patch)
tree1be0385ef62f5fbf0794d98a697e0ff11fe7a510 /src/Window.cpp
parent118277121c8b1767a78f76d19c44aea496121b34 (diff)
Add room joining
Diffstat (limited to 'src/Window.cpp')
-rw-r--r--src/Window.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/Window.cpp b/src/Window.cpp
index 22e5501..adad21e 100644
--- a/src/Window.cpp
+++ b/src/Window.cpp
@@ -20,6 +20,7 @@ namespace dchat
overlay.add(stack);
add(overlay);
+ stack.set_homogeneous(false);
stack.set_transition_type(Gtk::StackTransitionType::STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT);
stack.set_transition_duration(250);
stack.add(loginWindow, "login");
@@ -27,6 +28,7 @@ namespace dchat
overlay.show();
windowNotification->show_all();
+ stack.set_visible_child("login");
stack.show();
//chatWindow.show_all();
//loginWindow.show();
@@ -45,7 +47,7 @@ namespace dchat
rooms->loginUser(username.raw(), password.raw());
//windowNotification->show(Glib::ustring("Successfully logged in as ") + username);
drawBackgroundConnection.disconnect();
- chatWindow.show_all();
+ chatWindow.show();
stack.set_visible_child(chatWindow);
chatWindow.scrollToBottom();
}
@@ -71,7 +73,7 @@ namespace dchat
rooms->registerUser(username.raw(), password.raw());
windowNotification->show(Glib::ustring("Successfully registered user ") + username);
drawBackgroundConnection.disconnect();
- chatWindow.show_all();
+ chatWindow.show();
stack.set_visible_child(chatWindow);
}
catch(std::exception &e)
@@ -109,11 +111,11 @@ namespace dchat
};
roomCallbackFuncs.createRoomCallbackFunc = [this](std::shared_ptr<Room> room)
{
- chatWindow.addRoom(room);
+ chatWindow.addRoom(room);
};
- roomCallbackFuncs.addUserCallbackFunc = [this](std::shared_ptr<Room> room, std::shared_ptr<User> user)
+ roomCallbackFuncs.addUserCallbackFunc = [this](const RoomAddUserRequest &request)
{
- chatWindow.addUser(room, user);
+ chatWindow.addUser(request);
};
roomCallbackFuncs.addMessageCallbackFunc = [this](const RoomAddMessageRequest &request)
{
@@ -127,6 +129,10 @@ namespace dchat
{
chatWindow.changeRoomName(request);
};
+ roomCallbackFuncs.receiveInviteUserCallbackFunc = [this](const InviteUserRequest &request)
+ {
+ chatWindow.addInviteRequest(request);
+ };
windowNotification->show("Connecting to 83.252.53.188:27130");
Rooms::connect("83.252.53.188", 27130, roomCallbackFuncs);