[fractal] Replace legacy gtk functions



commit 5db67ad68efd38b2f1c30e571b175c739c304ff6
Author: Alejandro Domínguez <adomu net-c com>
Date:   Mon Nov 30 10:55:29 2020 +0100

    Replace legacy gtk functions

 fractal-gtk/src/actions/message.rs       | 4 ++--
 fractal-gtk/src/appop/notify.rs          | 2 +-
 fractal-gtk/src/cache/mod.rs             | 6 +++---
 fractal-gtk/src/widgets/image.rs         | 2 +-
 fractal-gtk/src/widgets/inline_player.rs | 2 +-
 fractal-gtk/src/widgets/media_viewer.rs  | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/fractal-gtk/src/actions/message.rs b/fractal-gtk/src/actions/message.rs
index 7d202aa2..a4de118b 100644
--- a/fractal-gtk/src/actions/message.rs
+++ b/fractal-gtk/src/actions/message.rs
@@ -148,7 +148,7 @@ pub fn new(
 
                 media::get_media_async(thread_pool.clone(), server_url.clone(), url, tx);
 
-                gtk::timeout_add(
+                glib::timeout_add_local(
                     50,
                     clone!(
                         @strong name,
@@ -191,7 +191,7 @@ pub fn new(
 
                 media::get_media_async(thread_pool.clone(), server_url.clone(), url, tx);
 
-                gtk::timeout_add(50, move || match rx.try_recv() {
+                glib::timeout_add_local(50, move || match rx.try_recv() {
                     Err(TryRecvError::Empty) => Continue(true),
                     Err(TryRecvError::Disconnected) => {
                         let msg = i18n("Could not download the file");
diff --git a/fractal-gtk/src/appop/notify.rs b/fractal-gtk/src/appop/notify.rs
index 959965e1..5055e80a 100644
--- a/fractal-gtk/src/appop/notify.rs
+++ b/fractal-gtk/src/appop/notify.rs
@@ -76,7 +76,7 @@ impl AppOp {
 
         let room_id = room_id.to_string();
         let id = id.to_string();
-        gtk::timeout_add(
+        glib::timeout_add_local(
             50,
             clone!(@weak app => @default-return Continue(false), move || match rx.try_recv() {
                 Err(TryRecvError::Empty) => Continue(true),
diff --git a/fractal-gtk/src/cache/mod.rs b/fractal-gtk/src/cache/mod.rs
index 913f99eb..c16500ca 100644
--- a/fractal-gtk/src/cache/mod.rs
+++ b/fractal-gtk/src/cache/mod.rs
@@ -173,7 +173,7 @@ pub fn download_to_cache(
         tx,
     );
 
-    gtk::timeout_add(50, move || match rx.try_recv() {
+    glib::timeout_add_local(50, move || match rx.try_recv() {
         Err(TryRecvError::Empty) => Continue(true),
         Err(TryRecvError::Disconnected) => Continue(false),
         Ok(_resp) => {
@@ -196,7 +196,7 @@ pub fn download_to_cache_username(
         let query = user::get_username_async(server_url, access_token, uid);
         ctx.send(query).expect_log("Connection closed");
     });
-    gtk::timeout_add(50, move || match rx.try_recv() {
+    glib::timeout_add_local(50, move || match rx.try_recv() {
         Err(TryRecvError::Empty) => Continue(true),
         Err(TryRecvError::Disconnected) => Continue(false),
         Ok(username) => {
@@ -227,7 +227,7 @@ pub fn download_to_cache_username_emote(
         ctx.send(query).expect_log("Connection closed");
     });
     let text = text.to_string();
-    gtk::timeout_add(50, move || match rx.try_recv() {
+    glib::timeout_add_local(50, move || match rx.try_recv() {
         Err(TryRecvError::Empty) => Continue(true),
         Err(TryRecvError::Disconnected) => Continue(false),
         Ok(username) => {
diff --git a/fractal-gtk/src/widgets/image.rs b/fractal-gtk/src/widgets/image.rs
index 06aa70a2..b28289c0 100644
--- a/fractal-gtk/src/widgets/image.rs
+++ b/fractal-gtk/src/widgets/image.rs
@@ -286,7 +286,7 @@ impl Image {
                 let da = self.widget.clone();
 
                 da.get_style_context().add_class("image-spinner");
-                gtk::timeout_add(50, move || match rx.try_recv() {
+                glib::timeout_add_local(50, move || match rx.try_recv() {
                     Err(TryRecvError::Empty) => Continue(true),
                     Err(TryRecvError::Disconnected) => Continue(false),
                     Ok(Ok(fname)) => {
diff --git a/fractal-gtk/src/widgets/inline_player.rs b/fractal-gtk/src/widgets/inline_player.rs
index d361c452..b10cead8 100644
--- a/fractal-gtk/src/widgets/inline_player.rs
+++ b/fractal-gtk/src/widgets/inline_player.rs
@@ -512,7 +512,7 @@ impl<T: MediaPlayer + 'static> PlayerExt for T {
         let (tx, rx): (Sender<media::MediaResult>, Receiver<media::MediaResult>) = channel();
         media::get_media_async(thread_pool, server_url, media_url, tx);
         let local_path = player.get_local_path_access();
-        gtk::timeout_add(
+        glib::timeout_add_local(
             50,
             clone!(@strong player, @strong bx => move || {
                 match rx.try_recv() {
diff --git a/fractal-gtk/src/widgets/media_viewer.rs b/fractal-gtk/src/widgets/media_viewer.rs
index 6ef0d563..3f848dfc 100644
--- a/fractal-gtk/src/widgets/media_viewer.rs
+++ b/fractal-gtk/src/widgets/media_viewer.rs
@@ -1036,7 +1036,7 @@ fn load_more_media(thread_pool: ThreadPool, data: Rc<RefCell<Data>>, builder: gt
     );
 
     let ui = builder.clone();
-    gtk::timeout_add(
+    glib::timeout_add_local(
         50,
         clone!(
         @weak data


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