[fractal/ui-refactor: 12/15] Move connect_gtk to ui module




commit 0f743fda4e7d2c2e95f897ddc3991e17e1b17938
Author: Alejandro Domínguez <adomu net-c com>
Date:   Tue Nov 17 19:22:27 2020 +0100

    Move connect_gtk to ui module

 fractal-gtk/src/app/mod.rs                         |  2 +-
 fractal-gtk/src/appop/connect/mod.rs               | 39 ----------------------
 fractal-gtk/src/appop/mod.rs                       |  1 -
 fractal-gtk/src/meson.build                        | 32 +++++++++---------
 fractal-gtk/src/{appop => ui}/connect/account.rs   |  0
 .../src/{appop => ui}/connect/autocomplete.rs      |  0
 fractal-gtk/src/{appop => ui}/connect/direct.rs    |  0
 fractal-gtk/src/{appop => ui}/connect/directory.rs |  0
 fractal-gtk/src/{appop => ui}/connect/headerbar.rs |  0
 fractal-gtk/src/{appop => ui}/connect/invite.rs    |  0
 fractal-gtk/src/{appop => ui}/connect/join_room.rs |  0
 fractal-gtk/src/{appop => ui}/connect/language.rs  |  0
 .../src/{appop => ui}/connect/leave_room.rs        |  0
 fractal-gtk/src/{appop => ui}/connect/markdown.rs  |  0
 fractal-gtk/src/ui/connect/mod.rs                  | 37 ++++++++++++++++++++
 fractal-gtk/src/{appop => ui}/connect/new_room.rs  |  0
 .../src/{appop => ui}/connect/roomlist_search.rs   |  0
 fractal-gtk/src/{appop => ui}/connect/send.rs      |  0
 .../src/{appop => ui}/connect/swipeable_widgets.rs |  0
 fractal-gtk/src/ui/mod.rs                          |  2 ++
 20 files changed, 56 insertions(+), 57 deletions(-)
---
diff --git a/fractal-gtk/src/app/mod.rs b/fractal-gtk/src/app/mod.rs
index 4f3bb651..b981fbe5 100644
--- a/fractal-gtk/src/app/mod.rs
+++ b/fractal-gtk/src/app/mod.rs
@@ -159,7 +159,7 @@ fn new(gtk_app: gtk::Application) -> (AppRuntime, ui::UI) {
             .gtk_app
             .set_accels_for_action("login.back", &["Escape"]);
         actions::Global::new(state);
-        state.connect_gtk();
+        state.ui.connect_gtk(state.app_runtime.clone());
     });
 
     (app_runtime, ui)
diff --git a/fractal-gtk/src/appop/mod.rs b/fractal-gtk/src/appop/mod.rs
index 60382d2f..30897817 100644
--- a/fractal-gtk/src/appop/mod.rs
+++ b/fractal-gtk/src/appop/mod.rs
@@ -30,7 +30,6 @@ use crate::widgets;
 mod about;
 mod account;
 pub mod attach;
-mod connect;
 mod directory;
 mod invite;
 mod login;
diff --git a/fractal-gtk/src/meson.build b/fractal-gtk/src/meson.build
index f8a201c3..1a69a165 100644
--- a/fractal-gtk/src/meson.build
+++ b/fractal-gtk/src/meson.build
@@ -54,21 +54,6 @@ app_sources = files(
   'api/r0.rs',
   'app/mod.rs',
   'app/windowstate.rs',
-  'appop/connect/account.rs',
-  'appop/connect/autocomplete.rs',
-  'appop/connect/directory.rs',
-  'appop/connect/direct.rs',
-  'appop/connect/headerbar.rs',
-  'appop/connect/invite.rs',
-  'appop/connect/join_room.rs',
-  'appop/connect/language.rs',
-  'appop/connect/leave_room.rs',
-  'appop/connect/markdown.rs',
-  'appop/connect/mod.rs',
-  'appop/connect/new_room.rs',
-  'appop/connect/roomlist_search.rs',
-  'appop/connect/send.rs',
-  'appop/connect/swipeable_widgets.rs',
   'appop/about.rs',
   'appop/account.rs',
   'appop/attach.rs',
@@ -101,9 +86,24 @@ app_sources = files(
   'model/message.rs',
   'model/mod.rs',
   'model/room.rs',
+  'ui/connect/account.rs',
+  'ui/connect/autocomplete.rs',
+  'ui/connect/directory.rs',
+  'ui/connect/direct.rs',
+  'ui/connect/headerbar.rs',
+  'ui/connect/invite.rs',
+  'ui/connect/join_room.rs',
+  'ui/connect/language.rs',
+  'ui/connect/leave_room.rs',
+  'ui/connect/markdown.rs',
+  'ui/connect/mod.rs',
+  'ui/connect/new_room.rs',
+  'ui/connect/roomlist_search.rs',
+  'ui/connect/send.rs',
+  'ui/connect/swipeable_widgets.rs',
+  'ui/mod.rs',
   'util/i18n.rs',
   'util/mod.rs',
-  'ui/mod.rs',
   'widgets/address.rs',
   'widgets/autocomplete.rs',
   'widgets/avatar.rs',
diff --git a/fractal-gtk/src/appop/connect/account.rs b/fractal-gtk/src/ui/connect/account.rs
similarity index 100%
rename from fractal-gtk/src/appop/connect/account.rs
rename to fractal-gtk/src/ui/connect/account.rs
diff --git a/fractal-gtk/src/appop/connect/autocomplete.rs b/fractal-gtk/src/ui/connect/autocomplete.rs
similarity index 100%
rename from fractal-gtk/src/appop/connect/autocomplete.rs
rename to fractal-gtk/src/ui/connect/autocomplete.rs
diff --git a/fractal-gtk/src/appop/connect/direct.rs b/fractal-gtk/src/ui/connect/direct.rs
similarity index 100%
rename from fractal-gtk/src/appop/connect/direct.rs
rename to fractal-gtk/src/ui/connect/direct.rs
diff --git a/fractal-gtk/src/appop/connect/directory.rs b/fractal-gtk/src/ui/connect/directory.rs
similarity index 100%
rename from fractal-gtk/src/appop/connect/directory.rs
rename to fractal-gtk/src/ui/connect/directory.rs
diff --git a/fractal-gtk/src/appop/connect/headerbar.rs b/fractal-gtk/src/ui/connect/headerbar.rs
similarity index 100%
rename from fractal-gtk/src/appop/connect/headerbar.rs
rename to fractal-gtk/src/ui/connect/headerbar.rs
diff --git a/fractal-gtk/src/appop/connect/invite.rs b/fractal-gtk/src/ui/connect/invite.rs
similarity index 100%
rename from fractal-gtk/src/appop/connect/invite.rs
rename to fractal-gtk/src/ui/connect/invite.rs
diff --git a/fractal-gtk/src/appop/connect/join_room.rs b/fractal-gtk/src/ui/connect/join_room.rs
similarity index 100%
rename from fractal-gtk/src/appop/connect/join_room.rs
rename to fractal-gtk/src/ui/connect/join_room.rs
diff --git a/fractal-gtk/src/appop/connect/language.rs b/fractal-gtk/src/ui/connect/language.rs
similarity index 100%
rename from fractal-gtk/src/appop/connect/language.rs
rename to fractal-gtk/src/ui/connect/language.rs
diff --git a/fractal-gtk/src/appop/connect/leave_room.rs b/fractal-gtk/src/ui/connect/leave_room.rs
similarity index 100%
rename from fractal-gtk/src/appop/connect/leave_room.rs
rename to fractal-gtk/src/ui/connect/leave_room.rs
diff --git a/fractal-gtk/src/appop/connect/markdown.rs b/fractal-gtk/src/ui/connect/markdown.rs
similarity index 100%
rename from fractal-gtk/src/appop/connect/markdown.rs
rename to fractal-gtk/src/ui/connect/markdown.rs
diff --git a/fractal-gtk/src/ui/connect/mod.rs b/fractal-gtk/src/ui/connect/mod.rs
new file mode 100644
index 00000000..0249dabc
--- /dev/null
+++ b/fractal-gtk/src/ui/connect/mod.rs
@@ -0,0 +1,37 @@
+mod account;
+mod autocomplete;
+mod direct;
+mod directory;
+mod headerbar;
+mod invite;
+mod join_room;
+mod language;
+mod leave_room;
+mod markdown;
+mod new_room;
+mod roomlist_search;
+mod send;
+mod swipeable_widgets;
+
+use crate::app::AppRuntime;
+use crate::ui::UI;
+
+impl UI {
+    pub fn connect_gtk(&self, app_runtime: AppRuntime) {
+        headerbar::connect(self);
+        send::connect(self, app_runtime.clone());
+        markdown::connect(self, app_runtime.clone());
+        autocomplete::connect(self, app_runtime.clone());
+        language::connect(self, app_runtime.clone());
+        directory::connect(self, app_runtime.clone());
+        leave_room::connect(self, app_runtime.clone());
+        new_room::connect(self, app_runtime.clone());
+        join_room::connect(self, app_runtime.clone());
+        account::connect(self, app_runtime.clone());
+        invite::connect_dialog(self, app_runtime.clone());
+        invite::connect_user(self, app_runtime.clone());
+        direct::connect(self, app_runtime.clone());
+        roomlist_search::connect(self, app_runtime);
+        swipeable_widgets::connect(self);
+    }
+}
diff --git a/fractal-gtk/src/appop/connect/new_room.rs b/fractal-gtk/src/ui/connect/new_room.rs
similarity index 100%
rename from fractal-gtk/src/appop/connect/new_room.rs
rename to fractal-gtk/src/ui/connect/new_room.rs
diff --git a/fractal-gtk/src/appop/connect/roomlist_search.rs b/fractal-gtk/src/ui/connect/roomlist_search.rs
similarity index 100%
rename from fractal-gtk/src/appop/connect/roomlist_search.rs
rename to fractal-gtk/src/ui/connect/roomlist_search.rs
diff --git a/fractal-gtk/src/appop/connect/send.rs b/fractal-gtk/src/ui/connect/send.rs
similarity index 100%
rename from fractal-gtk/src/appop/connect/send.rs
rename to fractal-gtk/src/ui/connect/send.rs
diff --git a/fractal-gtk/src/appop/connect/swipeable_widgets.rs 
b/fractal-gtk/src/ui/connect/swipeable_widgets.rs
similarity index 100%
rename from fractal-gtk/src/appop/connect/swipeable_widgets.rs
rename to fractal-gtk/src/ui/connect/swipeable_widgets.rs
diff --git a/fractal-gtk/src/ui/mod.rs b/fractal-gtk/src/ui/mod.rs
index d80bad13..0dd506b0 100644
--- a/fractal-gtk/src/ui/mod.rs
+++ b/fractal-gtk/src/ui/mod.rs
@@ -7,6 +7,8 @@ use matrix_sdk::identifiers::{EventId, UserId};
 use std::path::PathBuf;
 use url::Url;
 
+pub mod connect;
+
 #[derive(Clone, Debug)]
 pub struct UI {
     pub builder: gtk::Builder,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]