diff options
Diffstat (limited to 'src/Window.cpp')
-rw-r--r-- | src/Window.cpp | 16 |
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); |