summary refs log tree commit diff
path: root/src/ui
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2021-10-11 19:53:17 +0000
committerGitHub <noreply@github.com>2021-10-11 19:53:17 +0000
commit088765b427146eda759e0bff6ba28595bb86077c (patch)
treeac16516ff6a5a8648df9c647727fee24d2576757 /src/ui
parentMerge pull request #755 from Nheko-Reborn/bootstrapping (diff)
parentUse better close-on-Enter logic (diff)
downloadnheko-088765b427146eda759e0bff6ba28595bb86077c.tar.xz
Merge pull request #741 from LorenDB/qmlJoinRoomDlg
QML the join room dialog
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/NhekoGlobalObject.cpp8
-rw-r--r--src/ui/NhekoGlobalObject.h3
2 files changed, 3 insertions, 8 deletions
diff --git a/src/ui/NhekoGlobalObject.cpp b/src/ui/NhekoGlobalObject.cpp
index d687a308..11fc5681 100644
--- a/src/ui/NhekoGlobalObject.cpp
+++ b/src/ui/NhekoGlobalObject.cpp
@@ -21,6 +21,7 @@ Nheko::Nheko()
     connect(
       UserSettings::instance().get(), &UserSettings::themeChanged, this, &Nheko::colorsChanged);
     connect(ChatPage::instance(), &ChatPage::contentLoaded, this, &Nheko::updateUserProfile);
+    connect(this, &Nheko::joinRoom, ChatPage::instance(), &ChatPage::joinRoom);
 }
 
 void
@@ -97,13 +98,6 @@ Nheko::openCreateRoomDialog() const
 }
 
 void
-Nheko::openJoinRoomDialog() const
-{
-    MainWindow::instance()->openJoinRoomDialog(
-      [](const QString &room_id) { ChatPage::instance()->joinRoom(room_id); });
-}
-
-void
 Nheko::reparent(QWindow *win) const
 {
     win->setTransientParent(MainWindow::instance()->windowHandle());
diff --git a/src/ui/NhekoGlobalObject.h b/src/ui/NhekoGlobalObject.h
index 64aad941..c70813c5 100644
--- a/src/ui/NhekoGlobalObject.h
+++ b/src/ui/NhekoGlobalObject.h
@@ -50,7 +50,6 @@ public:
     Q_INVOKABLE void showUserSettingsPage() const;
     Q_INVOKABLE void logout() const;
     Q_INVOKABLE void openCreateRoomDialog() const;
-    Q_INVOKABLE void openJoinRoomDialog() const;
     Q_INVOKABLE void reparent(QWindow *win) const;
 
 public slots:
@@ -61,6 +60,8 @@ signals:
     void profileChanged();
 
     void openLogoutDialog();
+    void openJoinRoomDialog();
+    void joinRoom(QString roomId);
 
 private:
     QScopedPointer<UserProfile> currentUser_;