aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-11-24 19:17:47 +0100
committerdec05eba <dec05eba@protonmail.com>2018-11-24 19:17:50 +0100
commitb5659bf9ade976353d771d9fcd1a3f1f3c3fb663 (patch)
treeec83c67f7aa705f46b0aca32554dc8b94b7b1025 /include
parent6da0c0ab26e726e4ea35457246ef06970ce5975a (diff)
Add change user nickname/avatar menu
Diffstat (limited to 'include')
-rw-r--r--include/ChatWindow.hpp5
-rw-r--r--include/UserSettingsWindow.hpp33
2 files changed, 37 insertions, 1 deletions
diff --git a/include/ChatWindow.hpp b/include/ChatWindow.hpp
index b0f4001..764ca32 100644
--- a/include/ChatWindow.hpp
+++ b/include/ChatWindow.hpp
@@ -3,6 +3,7 @@
#include "ImageButton.hpp"
#include "RoomSettingsWindow.hpp"
#include "RoomNotificationsWindow.hpp"
+#include "UserSettingsWindow.hpp"
#include <dchat/Room.hpp>
#include <gtkmm/label.h>
#include <gtkmm/radiobutton.h>
@@ -30,6 +31,7 @@ namespace dchat
void addMessage(const RoomAddMessageRequest &request);
void addUser(const RoomAddUserRequest &request);
void setUserNickname(const UserChangeNicknameRequest &request);
+ void setUserAvatar(const UserChangeAvatarRequest &request);
void changeRoomName(const RoomChangeNameRequest &request);
void addInviteRequest(const InviteUserRequest &request);
void scrollToBottom();
@@ -39,7 +41,9 @@ namespace dchat
Gtk::Grid chatPage;
RoomSettingsWindow roomSettingsWindow;
RoomNotificationsWindow roomNotificationsWindow;
+ UserSettingsWindow userSettingsWindow;
Window *window;
+ std::shared_ptr<Room> currentRoom;
private:
void setupTopbar();
void setupLeftPanel(Gtk::ResponsivePaned *sidePanels);
@@ -69,7 +73,6 @@ namespace dchat
int chatPrevNumLines;
int roomCount;
RoomData *currentRoomData;
- std::shared_ptr<Room> currentRoom;
bool chatInputShowPlaceholder;
bool chatInputChangeByPlaceholder;
};
diff --git a/include/UserSettingsWindow.hpp b/include/UserSettingsWindow.hpp
new file mode 100644
index 0000000..e7062e1
--- /dev/null
+++ b/include/UserSettingsWindow.hpp
@@ -0,0 +1,33 @@
+#pragma once
+
+#include <gtkmm/grid.h>
+#include <gtkmm/entry.h>
+#include <gtkmm/label.h>
+#include <string>
+
+namespace Gtk
+{
+ class Paned;
+}
+
+namespace dchat
+{
+ class ChatWindow;
+
+ class UserSettingsWindow : public Gtk::Grid
+ {
+ public:
+ UserSettingsWindow(ChatWindow *chatWindow);
+ void setAvatarUrl(const std::string &url);
+ void setNickname(const std::string &nickname);
+
+ void setupLeftPanel(Gtk::Paned *sidePanels);
+ void setupRightPanel(Gtk::Paned *sidePanels);
+ private:
+ ChatWindow *chatWindow;
+ Gtk::Entry nicknameEntry;
+ Gtk::Entry avatarUrlEntry;
+ Glib::ustring prevNickname;
+ Glib::ustring prevAvatarUrl;
+ };
+} \ No newline at end of file