From f3e04d57dc1716417567dd3b05b55b40321ddb9d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sep 11 2020 23:48:30 +0000 Subject: Update to --- diff --git a/.gitignore b/.gitignore index c945b77..d5e50e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /news_flash_gtk-1.0-rc1.tar.gz +/news_flash_gtk-1.0.5.tar.bz2 diff --git a/0001-dont-call-show_all-in-app-constructor.patch b/0001-dont-call-show_all-in-app-constructor.patch deleted file mode 100644 index 49cddf1..0000000 --- a/0001-dont-call-show_all-in-app-constructor.patch +++ /dev/null @@ -1,2801 +0,0 @@ -From 2a9405ea8148329fa8973b7d7098a8b6ba6495a8 Mon Sep 17 00:00:00 2001 -From: Jan Lukas Gernert -Date: Fri, 12 Jun 2020 10:07:54 +0200 -Subject: [PATCH] dont call show_all in app constructor - ---- - data/resources/ui/main_window.ui | 2336 +++++++++++++++--------------- - src/app.rs | 1 - - 2 files changed, 1169 insertions(+), 1168 deletions(-) - -diff --git a/data/resources/ui/main_window.ui b/data/resources/ui/main_window.ui -index 700a91e..a2d7aef 100644 ---- a/data/resources/ui/main_window.ui -+++ b/data/resources/ui/main_window.ui -@@ -1,5 +1,5 @@ - -- -+ - - - -@@ -9,749 +9,830 @@ - center - 1200 - 600 -- -- -+ -+ - True - False -+ slide-left - -- -+ - True - False -- 50 -- crossfade -+ center -+ 20 -+ 20 -+ 50 -+ 50 -+ vertical - -- -+ - True - False -- left_headerbar -- over -+ Where are your feeds? -+ center -+ -+ -+ -+ False -+ True -+ 0 -+ -+ -+ -+ -+ True -+ False -+ Please select the RSS service you are using and log in to get going. -+ center -+ True -+ end -+ 3 -+ -+ -+ -+ False -+ True -+ 2 -+ 1 -+ -+ -+ -+ -+ 350 -+ True -+ False -+ center -+ in - -- -+ - True - False -- False -- 5 -- True - -- -+ -+ True -+ False -+ none -+ -+ -+ -+ -+ -+ -+ -+ -+ True -+ True -+ 20 -+ 2 -+ -+ -+ -+ -+ welcome -+ -+ -+ -+ -+ True -+ False -+ vertical -+ -+ -+ False -+ True -+ True -+ error -+ True -+ -+ -+ False -+ 6 -+ end -+ -+ -+ Ignore - True - True -- True -- -- -- True -- False -- go-previous-symbolic -- -- - -+ -+ True -+ True -+ 0 -+ - - -- -+ -+ Details -+ True - True - True -- True -- -- -- True -- False -- 5 -- -- -- True -- False -- 50 -- crossfade -- -- -- True -- False -- All -- 0 -- -- -- all -- all -- -- -- -- -- True -- False -- Unread -- 0 -- -- -- unread -- unread -- 1 -- -- -- -- -- True -- False -- Starred -- 0 -- -- -- marked -- marked -- 2 -- -- -- -- -- False -- True -- 0 -- -- -- -- -- True -- False -- go-down-symbolic -- -- -- False -- True -- 1 -- -- -- -- - - -+ True -+ True - 1 - - -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ False -+ 16 - -- -+ - True - False -- True -- -- -- True -- False -- False -- True -- True -- -- -- True -- False -- All -- -- -- -- -- False -- True -- 0 -- -- -- -- -- True -- False -- False -- True -- -- -- True -- False -- Unread -- -- -- -- -- False -- True -- 1 -- -- -- -- -- True -- False -- False -- True -- -- -- True -- False -- Starred -- -- -- -- -- False -- True -- 2 -- -- -- -+ 20 -+ 20 -+ True -+ label -+ 0 - - -- 2 -+ False -+ True -+ 0 - - -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ False -+ True -+ 0 -+ -+ -+ -+ -+ 350 -+ True -+ False -+ center -+ center -+ True -+ True -+ vertical -+ -+ -+ True -+ False -+ Headline -+ end -+ -+ -+ -+ False -+ True -+ 0 -+ -+ -+ -+ -+ -+ False -+ True -+ 1 -+ -+ -+ -+ -+ True -+ False - -- -+ - True -- True -- True -- Refresh Content -- -- -- True -- False -- crossfade -- -- -- True -- False -- view-refresh-symbolic -- -- -- icon -- icon -- -- -- -- -- True -- False -- True -- -- -- spinner -- spinner -- 1 -- -- -- -- -+ False -+ 40 -+ Url: -+ 1 - - -- 3 -+ 0 -+ 0 - - - -- -+ -+ True -+ False -+ 40 -+ Username: -+ 1 -+ -+ -+ 0 -+ 1 -+ -+ -+ -+ -+ True -+ False -+ 42 -+ Password: -+ 1 -+ -+ -+ 0 -+ 2 -+ -+ -+ -+ -+ True - True -- True -- True -- Go back to online mode -- -- -- True -- False -- network-offline-symbolic -- -- -+ 15 -+ 15 -+ 2 -+ 2 -+ True -+ url - - -- 5 -+ 1 -+ 0 - - - -- -+ - True - True -- True -- Search Articles -- -- -- True -- False -- system-search-symbolic -- -- -+ 15 -+ 15 -+ 2 -+ 2 -+ True - - -- 5 -+ 1 -+ 1 - - - -- -+ - True - True -- True -- Set All/Feed/Category as read -+ 15 -+ 15 -+ 2 -+ 2 -+ False -+ password -+ -+ -+ 1 -+ 2 -+ -+ -+ -+ -+ False -+ True -+ 2 -+ -+ -+ -+ -+ True -+ False -+ slide-up -+ -+ -+ True -+ False -+ vertical -+ -+ -+ True -+ False -+ 20 -+ 10 -+ HTTP Basic Auth -+ -+ -+ -+ False -+ True -+ 0 -+ -+ - -- -+ - True - False - -- -+ - True - False -- emblem-ok-symbolic -+ 40 -+ Username: -+ 1 - - -- image -- image -+ 0 -+ 0 - - - -- -+ - True - False -- True -+ 40 -+ Password: -+ 1 - - -- spinner -- spinner -- 1 -+ 0 -+ 1 -+ -+ -+ -+ -+ True -+ True -+ 15 -+ 15 -+ 2 -+ 2 -+ True -+ -+ -+ 1 -+ 0 -+ -+ -+ -+ -+ True -+ True -+ 15 -+ 15 -+ 2 -+ 2 -+ True -+ False -+ password -+ -+ -+ 1 -+ 1 - - - -+ -+ False -+ True -+ 1 -+ - - -- -- 7 -- - -+ -+ -+ False -+ True -+ 3 -+ -+ -+ -+ -+ Login -+ True -+ False -+ True -+ True -+ end -+ 15 -+ 2 -+ 2 -+ -+ -+ -+ False -+ True -+ 4 -+ -+ -+ -+ -+ False -+ True -+ 1 -+ -+ -+ -+ -+ password_login -+ 1 -+ -+ -+ -+ -+ True -+ False -+ vertical -+ -+ -+ False -+ True -+ warning -+ True -+ -+ -+ False -+ 6 -+ end - -- -+ -+ Details - True - True - True -- -- -- True -- False -- open-menu-symbolic -- -- - - -- end -- 3 -+ True -+ True -+ 0 - - - -+ -+ False -+ False -+ 0 -+ - -- -- -- True -+ -+ - False -- True -- vertical -+ 16 -+ -+ -+ True -+ False -+ label -+ -+ -+ False -+ True -+ 0 -+ -+ - -+ -+ False -+ False -+ 0 -+ - -- -- -- 300 -- True -+ -+ -+ False -+ True -+ 0 -+ -+ -+ -+ -+ -+ -+ -+ oauth_login -+ 2 -+ -+ -+ -+ -+ True -+ False -+ vertical -+ -+ -+ False -+ True -+ warning -+ True -+ False -+ -+ - False -- True -- False -- 5 -- True -+ 6 -+ end - -- -+ -+ Undo -+ True - True - True -- True -- -- -- True -- False -- go-previous-symbolic -- -- - - -- 1 -+ True -+ True -+ 0 -+ -+ -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ False -+ 16 -+ -+ -+ True -+ False -+ Delte Feed/Category -+ -+ -+ False -+ True -+ 0 - - -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ False -+ True -+ 0 -+ -+ -+ -+ -+ False -+ True -+ error -+ True -+ -+ -+ False -+ 6 -+ end - - - True - False -+ 6 - -- -+ -+ Login - True -- False - True - True -- Toggle Starred -- -- -- True -- False -- 50 -- crossfade -- -- -- True -- False -- unmarked-symbolic -- -- -- unmarked -- unmarked -- -- -- -- -- True -- False -- marked-symbolic -- -- -- marked -- marked -- 1 -- -- -- -- -+ - - -- False -+ True - True - 0 - - - -- -+ -+ Go Offline - True -- False - True - True -- Toggle Read -- -- -- True -- False -- 50 -- crossfade -- -- -- True -- False -- read-symbolic -- -- -- read -- read -- -- -- -- -- True -- False -- unread-symbolic -- -- -- unread -- unread -- 1 -- -- -- -- -+ True - - -- False -+ True - True - 1 - - -- -- -- -- 2 -- -- -- -- -- True -- False -- True -- True - -- -+ - True -- False -+ True -+ True - - - True - False -- view-more-symbolic -- -- -- image -- image -- -- -- -- -- True -- False -- True -+ dialog-question-symbolic - -- -- spinner -- spinner -- 1 -- - - -+ -+ False -+ False -+ end -+ 2 -+ - - - -- end -- 1 -- -- -- -- -- True -- False -- True -- True -- -- -- True -- False -- tag-symbolic -- -- -- -- -- end -+ True -+ True - 3 - - -- -- -- True -- False -- True -- True -- Try to show full content -- -- -- True -- False -- 50 -- crossfade -- -- -- True -- False -- accessories-dictionary-symbolic -- -- -- image -- image -- -- -- -- -- True -- False -- True -- -- -- spinner -- spinner -- 1 -- -- -- -- -- -- -- end -- 4 -- -- - -+ -+ False -+ False -+ 0 -+ - -- -- -- content -- -- -- -- -- True -- False -- NewsFlash -- False -- True -- -- -- -- -- -- welcome -- 1 -- -- -- -- -- True -- False -- NewsFlash -- True -- -- -- True -- True -- True -- True -+ -+ -+ False -+ 16 - -- -+ - True - False -- go-previous-symbolic -+ label - -+ -+ False -+ True -+ 0 -+ - - -+ -+ False -+ False -+ 0 -+ - - -- -- login -- 2 -- -- -- -- -- -- -- -- -- True -- False -- slide-left -- -- -- True -- False -- center -- 20 -- 20 -- 50 -- 50 -- vertical -- -- -- True -- False -- Where are your feeds? -- center -- -- - - False - True -- 0 -- -- -- -- -- True -- False -- Please select the RSS service you are using and log in to get going. -- center -- True -- end -- 3 -- -- -- -- False -- True -- 2 - 1 - - - -- -- 350 -+ - True - False -- center -- in -+ True -+ True -+ minor_leaflet -+ over - -- -+ - True - False -+ feedlist_box -+ over - -- -+ -+ 220 - True - False -- none -+ True -+ vertical -+ -+ -+ -+ -+ -+ -+ -+ True -+ False -+ vertical - - - -+ -+ -+ 380 -+ True -+ False -+ True -+ vertical -+ -+ -+ True -+ False -+ -+ -+ True -+ True -+ edit-find-symbolic -+ False -+ False -+ -+ -+ -+ -+ False -+ True -+ 0 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ True -+ False -+ vertical -+ -+ -+ -+ -+ 300 -+ True -+ False -+ True -+ vertical -+ -+ -+ - - -- - - -- True -+ False - True -- 20 - 2 - - - - -- welcome -+ content -+ 3 - - - -- -+ - True - False - vertical - -- -+ -+ True - False -- True -- True -- error -+ True - True -+ False - - - False - 6 - end - -- -- Ignore -- True -- True -- -- -- True -- True -- 0 -- -- -- -- -+ - Details - True - True -@@ -760,7 +841,7 @@ - - True - True -- 1 -+ 0 - - - -@@ -775,14 +856,10 @@ - False - 16 - -- -+ - True - False -- 20 -- 20 -- True -- label -- 0 -+ Resetting Account failed - - - False -@@ -806,20 +883,19 @@ - - - -- 350 -- True - False - center -- center -- True -- True -+ 20 -+ 20 -+ 50 -+ 50 - vertical - -- -+ - True - False -- Headline -- end -+ True -+ Resetting leads to all local data being lost - -@@ -831,784 +907,710 @@ - - - -- -- -- False -- True -- 1 -- -- -- -- -+ - True - False - -- -- True -- False -- 40 -- Url: -- 1 -- -- -- 0 -- 0 -- -- -- -- -- True -- False -- 40 -- Username: -- 1 -- -- -- 0 -- 1 -- -- -- -- -- True -- False -- 42 -- Password: -- 1 -- -- -- 0 -- 2 -- -- -- -- -- True -- True -- 15 -- 15 -- 2 -- 2 -- True -- url -- -- -- 1 -- 0 -- -- -- -- -+ -+ I changed my mind - True - True -- 15 -- 15 -- 2 -- 2 -- True -+ True - - -- 1 -- 1 -+ False -+ True -+ 0 - - - -- -+ - True - True -- 15 -- 15 -- 2 -- 2 -- False -- password -+ True -+ -+ -+ True -+ False -+ 50 -+ crossfade -+ -+ -+ True -+ False -+ Reset -+ -+ -+ reset_label -+ page0 -+ -+ -+ -+ -+ True -+ False -+ True -+ -+ -+ reset_spinner -+ page1 -+ 1 -+ -+ -+ -+ -+ - - -- 1 -- 2 -+ False -+ True -+ end -+ 1 - - - - - False - True -- 2 -+ 1 - - -+ -+ -+ True -+ True -+ 1 -+ -+ -+ -+ -+ reset_page -+ 4 -+ -+ -+ -+ -+ -+ -+ True -+ False -+ -+ -+ True -+ False -+ 50 -+ crossfade -+ -+ -+ True -+ False -+ left_headerbar -+ over - -- -+ - True - False -- slide-up -+ False -+ 5 -+ True - -- -- True -- False -- vertical -+ -+ True -+ True -+ True - -- -+ - True - False -- 20 -- 10 -- HTTP Basic Auth -- -+ go-previous-symbolic - -- -- False -- True -- 0 -- - -+ -+ -+ -+ -+ True -+ True -+ True - -- -+ - True - False -+ 5 - -- -+ - True - False -- 40 -- Username: -- 1 -+ 50 -+ crossfade -+ -+ -+ True -+ False -+ All -+ 0 -+ -+ -+ all -+ all -+ -+ -+ -+ -+ True -+ False -+ Unread -+ 0 -+ -+ -+ unread -+ unread -+ 1 -+ -+ -+ -+ -+ True -+ False -+ Starred -+ 0 -+ -+ -+ marked -+ marked -+ 2 -+ -+ - - -- 0 -- 0 -+ False -+ True -+ 0 - - - -- -+ - True - False -- 40 -- Password: -- 1 -+ go-down-symbolic - - -- 0 -- 1 -+ False -+ True -+ 1 - - -+ -+ -+ -+ -+ 1 -+ -+ -+ -+ -+ True -+ False -+ True -+ -+ -+ True -+ False -+ False -+ True -+ True - -- -+ - True -- True -- 15 -- 15 -- 2 -- 2 -- True -+ False -+ All - -- -- 1 -- 0 -- - -+ -+ -+ False -+ True -+ 0 -+ -+ -+ -+ -+ True -+ False -+ False -+ True - -- -+ - True -- True -- 15 -- 15 -- 2 -- 2 -- True -- False -- password -+ False -+ Unread -+ -+ -+ -+ -+ False -+ True -+ 1 -+ -+ -+ -+ -+ True -+ False -+ False -+ True -+ -+ -+ True -+ False -+ Starred - -- -- 1 -- 1 -- - - - - False - True -- 1 -+ 2 - - -- -- -- -- -- False -- True -- 3 -- -- -- -- -- Login -- True -- False -- True -- True -- end -- 15 -- 2 -- 2 -- -- -- -- False -- True -- 4 -- -- -- -- -- False -- True -- 1 -- -- -- -- -- password_login -- 1 -- -- -- -- -- True -- False -- vertical -- -- -- False -- True -- warning -- True -- -- -- False -- 6 -- end -- -- -- Details -- True -- True -- True -- -- -- True -- True -- 0 -- -- -- -- -- False -- False -- 0 -- -- -- -- -- False -- 16 -- -- -- True -- False -- label -+ - - -- False -- True -- 0 -+ 2 - - -- -- -- False -- False -- 0 -- -- -- -- -- False -- True -- 0 -- -- -- -- -- -- -- -- oauth_login -- 2 -- -- -- -- -- True -- False -- vertical -- -- -- False -- True -- warning -- True -- False -- -- -- False -- 6 -- end - -- -- Undo -+ - True - True - True -+ -+ -+ True -+ False -+ open-menu-symbolic -+ -+ - - -- True -- True -- 0 -+ end -+ 3 - - -- -- -- False -- False -- 0 -- -- -- -- -- False -- 16 - -- -+ - True -- False -- Delte Feed/Category -+ True -+ True -+ Refresh Content -+ -+ -+ True -+ False -+ crossfade -+ -+ -+ True -+ False -+ view-refresh-symbolic -+ -+ -+ icon -+ icon -+ -+ -+ -+ -+ True -+ False -+ True -+ -+ -+ spinner -+ spinner -+ 1 -+ -+ -+ -+ - - -- False -- True -- 0 -+ 3 - - -- -- -- False -- False -- 0 -- -- -- -- -- False -- True -- 0 -- -- -- -- -- False -- True -- error -- True -- -- -- False -- 6 -- end - -- -- True -- False -- 6 -+ -+ True -+ True -+ True -+ Go back to online mode - -- -- Login -- True -- True -- True -- -+ -+ True -+ False -+ network-offline-symbolic - -- -- True -- True -- 0 -- - -+ -+ -+ 5 -+ -+ -+ -+ -+ True -+ True -+ True -+ Search Articles - -- -- Go Offline -+ - True -- True -- True -- True -+ False -+ system-search-symbolic - -- -- True -- True -- 1 -- - -+ -+ -+ 5 -+ -+ -+ -+ -+ True -+ True -+ True -+ Set All/Feed/Category as read - -- -+ - True -- True -- True -+ False - - - True - False -- dialog-question-symbolic -+ emblem-ok-symbolic -+ -+ -+ image -+ image -+ -+ -+ -+ -+ True -+ False -+ True - -+ -+ spinner -+ spinner -+ 1 -+ - - -- -- False -- False -- end -- 2 -- - - - -- True -- True -- 3 -+ 7 - - - -- -- False -- False -- 0 -- - -- -- -+ -+ -+ True - False -- 16 -- -- -- True -- False -- label -- -- -- False -- True -- 0 -- -- -+ True -+ vertical - -- -- False -- False -- 0 -- - -- -- -- False -- True -- 1 -- -- -- -- -- True -- False -- True -- True -- minor_leaflet -- over - -- -+ -+ 300 - True - False -- feedlist_box -- over -+ True -+ False -+ 5 -+ True - -- -- 220 -+ - True -- False -- True -- vertical -+ False -+ True -+ True - -- -+ -+ True -+ False -+ -+ -+ True -+ False -+ view-more-symbolic -+ -+ -+ image -+ image -+ -+ -+ -+ -+ True -+ False -+ True -+ -+ -+ spinner -+ spinner -+ 1 -+ -+ -+ - - -+ -+ end -+ 1 -+ - - -- -- False -- vertical -- -+ -+ True -+ True -+ True -+ -+ -+ True -+ False -+ go-previous-symbolic -+ -+ - -+ -+ 1 -+ - - -- -- 380 -+ - True - False -- True -- vertical - -- -+ - True -- False -+ False -+ True -+ True -+ Toggle Starred - -- -+ - True -- True -- edit-find-symbolic -- False -- False -+ False -+ 50 -+ crossfade -+ -+ -+ True -+ False -+ unmarked-symbolic -+ -+ -+ unmarked -+ unmarked -+ -+ -+ -+ -+ True -+ False -+ marked-symbolic -+ -+ -+ marked -+ marked -+ 1 -+ -+ -+ -+ -+ -+ -+ False -+ True -+ 0 -+ -+ -+ -+ -+ True -+ False -+ True -+ True -+ Toggle Read -+ -+ -+ True -+ False -+ 50 -+ crossfade -+ -+ -+ True -+ False -+ read-symbolic -+ -+ -+ read -+ read -+ -+ -+ -+ -+ True -+ False -+ unread-symbolic -+ -+ -+ unread -+ unread -+ 1 -+ -+ - - - - - False - True -- 0 -+ 1 - - -- -- -- -- -- -- -- -- -- -- False -- vertical -- -- -- -- -- 300 -- True -- False -- True -- vertical -- -- -- -- -- -- -- -- False -- True -- 2 -- -- -- -- -- content -- 3 -- -- -- -- -- True -- False -- vertical -- -- -- True -- False -- True -- True -- False -- -- -- False -- 6 -- end -- -- -- Details -- True -- True -- True -- -- -- True -- True -- 0 -- -- -- -- -- False -- False -- 0 -- -- -- -- -- False -- 16 -- -- -- True -- False -- Resetting Account failed -+ - - -- False -- True -- 0 -+ 2 - - -- -- -- False -- False -- 0 -- -- -- -- -- False -- True -- 0 -- -- -- -- -- False -- center -- 20 -- 20 -- 50 -- 50 -- vertical -- -- -- True -- False -- True -- Resetting leads to all local data being lost -- -- -- -- False -- True -- 0 -- -- -- -- -- True -- False - -- -- I changed my mind -+ - True -+ False - True - True -+ -+ -+ True -+ False -+ tag-symbolic -+ -+ - - -- False -- True -- 0 -+ end -+ 3 - - - -- -+ - True -+ False - True - True -+ Try to show full content - -- -+ - True - False - 50 - crossfade - -- -+ - True - False -- Reset -+ accessories-dictionary-symbolic - - -- reset_label -- page0 -+ image -+ image - - - -- -+ - True - False - True - - -- reset_spinner -- page1 -+ spinner -+ spinner - 1 - - - - -- - - -- False -- True - end -- 1 -+ 4 - - - -- -- False -- True -- 1 -- - - - -- True -- True -+ content -+ -+ -+ -+ -+ True -+ False -+ NewsFlash -+ False -+ True -+ -+ -+ -+ -+ -+ welcome - 1 - - -+ -+ -+ True -+ False -+ NewsFlash -+ True -+ -+ -+ True -+ True -+ True -+ True -+ -+ -+ True -+ False -+ go-previous-symbolic -+ -+ -+ -+ -+ -+ -+ login -+ 2 -+ -+ - -- -- reset_page -- 4 -- - - - -@@ -1633,8 +1635,8 @@ - - True - False -- 10 -- 10 -+ 10 -+ 10 - 10 - 10 - You are now offline. -@@ -1650,8 +1652,8 @@ Click here to go back online. - - True - False -- 10 -- 10 -+ 10 -+ 10 - 10 - 10 - You are back online. -diff --git a/src/app.rs b/src/app.rs -index 7dfb76e..88bfc37 100644 ---- a/src/app.rs -+++ b/src/app.rs -@@ -202,7 +202,6 @@ impl App { - } - - app.window.init(&app.news_flash, app.threadpool.clone(), &app.features); -- app.window.widget.show_all(); - app - } - --- -2.27.0 - diff --git a/0001-dont-inhibit-all-key-press-signals-in-webview.patch b/0001-dont-inhibit-all-key-press-signals-in-webview.patch deleted file mode 100644 index 8f5c1fc..0000000 --- a/0001-dont-inhibit-all-key-press-signals-in-webview.patch +++ /dev/null @@ -1,30 +0,0 @@ -From dfea2df583a9995796bc7ac01f6048d47f35393a Mon Sep 17 00:00:00 2001 -From: Jan Lukas Gernert -Date: Thu, 11 Jun 2020 07:04:50 +0200 -Subject: [PATCH] dont inhibit all key press signals in webview - ---- - src/article_view/mod.rs | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/article_view/mod.rs b/src/article_view/mod.rs -index f43c487..6b7444f 100644 ---- a/src/article_view/mod.rs -+++ b/src/article_view/mod.rs -@@ -504,10 +504,11 @@ impl ArticleView { - KP_0 => closure_webivew.set_zoom_level(1.0), - KP_ADD => closure_webivew.set_zoom_level(zoom + 0.25), - KP_SUBTRACT => closure_webivew.set_zoom_level(zoom - 0.25), -- _ => {} -+ _ => return Inhibit(false), - } -+ return Inhibit(true); - } -- Inhibit(true) -+ Inhibit(false) - }) - .to_glib() as usize, - ); --- -2.27.0 - diff --git a/0001-update-gtk-rs.patch b/0001-update-gtk-rs.patch deleted file mode 100644 index 8268dea..0000000 --- a/0001-update-gtk-rs.patch +++ /dev/null @@ -1,976 +0,0 @@ -From cec20bb478bfbfc32622ec81b8e1b4393edb0867 Mon Sep 17 00:00:00 2001 -From: Jan Lukas Gernert -Date: Sat, 18 Jul 2020 07:22:30 +0200 -Subject: [PATCH] update gtk-rs - -(cherry picked from commit 3d3d24f6e57097cb99073c084178c35fc268f8f4) ---- - Cargo.toml | 18 +-- - src/add_dialog.rs | 223 ++++++++++++----------------- - src/app.rs | 40 +++--- - src/article_view/mod.rs | 6 +- - src/content_page/content_header.rs | 4 +- - src/login_screen/password_login.rs | 21 ++- - src/main_window.rs | 7 +- - src/settings/dialog.rs | 100 ++++++------- - src/settings/keybinding_editor.rs | 10 +- - src/settings/keybindings.rs | 105 +++++++------- - src/settings/theme_chooser.rs | 41 +++--- - src/util/builder_helper.rs | 2 +- - src/util/gtk_util.rs | 6 +- - 13 files changed, 270 insertions(+), 313 deletions(-) - -diff --git a/Cargo.toml b/Cargo.toml -index 100a84ae0df4..6b7bb31bc7e3 100644 ---- a/Cargo.toml -+++ b/Cargo.toml -@@ -12,15 +12,15 @@ rust-embed = { version = "5.5", features = ["debug-embed"] } - failure = "0.1" - serde = { version = "1.0", features = ["serde_derive"] } - serde_json = "1.0" --cairo-rs = { version = "0.8", features = ["v1_16"] } --pango = "0.8" --glib = { version = "0.9" } --gdk-pixbuf = { version = "0.8", features = ["v2_36"] } --gtk = { version = "0.8", features = ["v3_24"] } --gio = { version = "0.8", features = ["v2_58"] } --gdk = { version = "0.12", features = ["v3_24"] } --libhandy = { version = "0.5", features = ["v0_0_10"] } --webkit2gtk = { version = "0.9", features = ["v2_16"] } -+cairo-rs = { version = "0.9", features = ["v1_16"] } -+pango = "0.9" -+glib = { version = "0.10" } -+gdk-pixbuf = { version = "0.9", features = ["v2_36"] } -+gtk = { version = "0.9", features = ["v3_24"] } -+gio = { version = "0.9", features = ["v2_58"] } -+gdk = { version = "0.13", features = ["v3_24"] } -+libhandy = { version = "0.6", features = ["v0_0_10"] } -+webkit2gtk = { version = "0.10", features = ["v2_16"] } - gettext-rs = { version = "0.4", features = ["gettext-system"] } - log4rs = "0.12" - dirs = "2.0" -diff --git a/src/add_dialog.rs b/src/add_dialog.rs -index 73f9d4dbe906..6c87e5f7ecfb 100644 ---- a/src/add_dialog.rs -+++ b/src/add_dialog.rs -@@ -130,14 +130,10 @@ impl AddPopover { - - // make parse button sensitive if entry contains text and vice versa - url_entry.connect_changed(clone!(@weak parse_button => @default-panic, move |entry| { -- if let Some(text) = entry.get_text() { -- if text.as_str().is_empty() { -- parse_button.set_sensitive(false); -- } else { -- parse_button.set_sensitive(true); -- } -- } else { -+ if entry.get_text().as_str().is_empty() { - parse_button.set_sensitive(false); -+ } else { -+ parse_button.set_sensitive(true); - } - - entry.set_property_secondary_icon_name(None); -@@ -153,14 +149,10 @@ impl AddPopover { - - // make parse button sensitive if entry contains text and vice versa - category_entry.connect_changed(clone!(@weak category_add_button => @default-panic, move |entry| { -- if let Some(text) = entry.get_text() { -- if text.as_str().is_empty() { -- category_add_button.set_sensitive(false); -- } else { -- category_add_button.set_sensitive(true); -- } -- } else { -+ if entry.get_text().as_str().is_empty() { - category_add_button.set_sensitive(false); -+ } else { -+ category_add_button.set_sensitive(true); - } - - entry.set_property_secondary_icon_name(None); -@@ -176,14 +168,10 @@ impl AddPopover { - - // make parse button sensitive if entry contains text and vice versa - tag_entry.connect_changed(clone!(@weak tag_add_button => @default-panic, move |entry| { -- if let Some(text) = entry.get_text() { -- if text.as_str().is_empty() { -- tag_add_button.set_sensitive(false); -- } else { -- tag_add_button.set_sensitive(true); -- } -- } else { -+ if entry.get_text().as_str().is_empty() { - tag_add_button.set_sensitive(false); -+ } else { -+ tag_add_button.set_sensitive(true); - } - - entry.set_property_secondary_icon_name(None); -@@ -216,39 +204,33 @@ impl AddPopover { - @strong feed_url, - @strong settings => @default-panic, move |button| - { -- if let Some(url_text) = url_entry.get_text() { -- let mut url_text = url_text.as_str().to_owned(); -- if !url_text.starts_with("http://") && !url_text.starts_with("https://") { -- url_text.insert_str(0, "https://"); -- } -- if let Ok(url) = Url::parse(&url_text) { -- // set 'next' button insensitive and show spinner -- parse_button_stack.set_visible_child_name("spinner"); -- button.set_sensitive(false); -- -- Self::parse_feed_url( -- &url, -- &settings, -- &threadpool, -- &main_stack, -- &feed_list, -- &feed_title_entry, -- &select_button, -- &select_button_stack, -- &favicon_image, -- &feed_url, -- &parse_button_stack, -- button, -- &url_entry); -- } else { -- error!("No valid url: '{}'", url_text); -- url_entry.set_property_secondary_icon_name(Some(WARN_ICON)); -- url_entry.set_property_secondary_icon_tooltip_text(Some(&i18n("No valid URL."))); -- } -+ let mut url_text = url_entry.get_text().as_str().to_owned(); -+ if !url_text.starts_with("http://") && !url_text.starts_with("https://") { -+ url_text.insert_str(0, "https://"); -+ } -+ if let Ok(url) = Url::parse(&url_text) { -+ // set 'next' button insensitive and show spinner -+ parse_button_stack.set_visible_child_name("spinner"); -+ button.set_sensitive(false); -+ -+ Self::parse_feed_url( -+ &url, -+ &settings, -+ &threadpool, -+ &main_stack, -+ &feed_list, -+ &feed_title_entry, -+ &select_button, -+ &select_button_stack, -+ &favicon_image, -+ &feed_url, -+ &parse_button_stack, -+ button, -+ &url_entry); - } else { -- error!("Empty url"); -+ error!("No valid url: '{}'", url_text); - url_entry.set_property_secondary_icon_name(Some(WARN_ICON)); -- url_entry.set_property_secondary_icon_tooltip_text(Some(&i18n("Empty URL"))); -+ url_entry.set_property_secondary_icon_tooltip_text(Some(&i18n("No valid URL."))); - } - })); - -@@ -262,8 +244,6 @@ impl AddPopover { - let sensitive = Self::calc_add_button_sensitive(&feed_title_entry, &entry); - feed_add_button.set_sensitive(sensitive); - -- let entry_text = entry.get_text().map(|t| t.as_str().to_owned()); -- - let folder_icon = if category_combo.get_active_id().is_some() { - if let Some(id) = category_combo.get_active_id() { - let category_id = CategoryID::new(id.as_str()); -@@ -272,13 +252,10 @@ impl AddPopover { - .replace(AddCategory::Existing(category_id)); - } - None -- } else if entry_text.is_none() { -- feed_category.write().take(); -- None -- } else if categories.iter().any(|c| Some(c.label.clone()) == entry_text) { -+ } else if categories.iter().any(|c| c.label == entry.get_text().as_str()) { - let category_id = categories - .iter() -- .find(|c| Some(c.label.clone()) == entry_text) -+ .find(|c| c.label == entry.get_text().as_str()) - .map(|c| c.category_id.clone()); - - if let Some(category_id) = category_id { -@@ -288,9 +265,7 @@ impl AddPopover { - } - None - } else { -- feed_category.write().replace(AddCategory::New( -- entry_text.expect("entry_text already checked for None"), -- )); -+ feed_category.write().replace(AddCategory::New(entry.get_text().as_str().into())); - Some(NEW_CATEGORY_ICON) - }; - -@@ -333,7 +308,7 @@ impl AddPopover { - return; - } - }; -- let feed_title = feed_title_entry.get_text().map(|title| title.as_str().to_owned()); -+ let feed_title = if feed_title_entry.get_text().as_str().is_empty() { None } else { Some(feed_title_entry.get_text().as_str().into()) }; - let feed_category = feed_category.read().clone(); - - Util::send(&sender, Action::AddFeed((feed_url, feed_title, feed_category))); -@@ -344,9 +319,8 @@ impl AddPopover { - @weak category_entry, - @strong sender => @default-panic, move |_button| - { -- let category_title = category_entry.get_text().map(|text| text.as_str().to_owned()); -- if let Some(category_title) = category_title { -- Util::send(&sender, Action::AddCategory(category_title)); -+ if !category_entry.get_text().as_str().is_empty() { -+ Util::send(&sender, Action::AddCategory(category_entry.get_text().as_str().into())); - popover.popdown() - } - })); -@@ -356,12 +330,11 @@ impl AddPopover { - @weak color_button, - @strong sender => @default-panic, move |_button| - { -- let tag_title = tag_entry.get_text().map(|text| text.as_str().to_owned()); - let rgba = color_button.get_rgba(); - let rgba = ColorRGBA::from_normalized(rgba.red, rgba.green, rgba.blue, rgba.alpha); - let color = rgba.to_string_no_alpha(); -- if let Some(tag_title) = tag_title { -- Util::send(&sender, Action::AddTag(color, tag_title)); -+ if !tag_entry.get_text().as_str().is_empty() { -+ Util::send(&sender, Action::AddTag(color, tag_entry.get_text().as_str().into())); - popover.popdown() - } - })); -@@ -496,61 +469,59 @@ impl AddPopover { - @weak select_button_stack => @default-panic, move |button| - { - if let Some(row) = list.get_selected_row() { -- if let Some(name) = row.get_widget_name() { -- select_button_stack.set_visible_child_name("spinner"); -- button.set_sensitive(false); -- -- let url = Url::parse(name.as_str()).expect("should never fail since it comes from 'url.as_str()'"); -- let feed_id = FeedID::new(url.get().as_str()); -- -- let (sender, receiver) = oneshot::channel::>(); -- -- let settings_clone = settings.clone(); -- let thread_future = async move { -- let result = Runtime::new() -- .expect(RUNTIME_ERROR) -- .block_on(news_flash::feed_parser::download_and_parse_feed( -- &url, &feed_id, None, None, &App::build_client(&settings_clone), -- )) -- .ok(); -- sender.send(result).expect(CHANNEL_ERROR); -- }; -+ select_button_stack.set_visible_child_name("spinner"); -+ button.set_sensitive(false); -+ -+ let url = Url::parse(row.get_widget_name().as_str()).expect("should never fail since it comes from 'url.as_str()'"); -+ let feed_id = FeedID::new(url.get().as_str()); - -- let glib_future = receiver.map(clone!( -- @strong threadpool, -- @weak button as select_button, -- @weak select_button_stack, -- @strong feed_url, -- @strong settings, -- @weak favicon, -- @weak title_entry, -- @weak stack as main_stack => @default-panic, move |res| -- { -- if let Some(ParsedUrl::SingleFeed(feed)) = res.expect(CHANNEL_ERROR) { -- Self::fill_feed_page( -- feed, -- &title_entry, -- &favicon, -- &feed_url, -- threadpool, -- &settings, -- ); -- main_stack.set_visible_child_name("feed_page"); -- } else if let Some(child) = row.get_child() { -- if let Ok(_box) = child.downcast::() { -- if let Some(icon) = _box.get_children().get(1) { -- icon.set_visible(true); -- } -+ let (sender, receiver) = oneshot::channel::>(); -+ -+ let settings_clone = settings.clone(); -+ let thread_future = async move { -+ let result = Runtime::new() -+ .expect(RUNTIME_ERROR) -+ .block_on(news_flash::feed_parser::download_and_parse_feed( -+ &url, &feed_id, None, None, &App::build_client(&settings_clone), -+ )) -+ .ok(); -+ sender.send(result).expect(CHANNEL_ERROR); -+ }; -+ -+ let glib_future = receiver.map(clone!( -+ @strong threadpool, -+ @weak button as select_button, -+ @weak select_button_stack, -+ @strong feed_url, -+ @strong settings, -+ @weak favicon, -+ @weak title_entry, -+ @weak stack as main_stack => @default-panic, move |res| -+ { -+ if let Some(ParsedUrl::SingleFeed(feed)) = res.expect(CHANNEL_ERROR) { -+ Self::fill_feed_page( -+ feed, -+ &title_entry, -+ &favicon, -+ &feed_url, -+ threadpool, -+ &settings, -+ ); -+ main_stack.set_visible_child_name("feed_page"); -+ } else if let Some(child) = row.get_child() { -+ if let Ok(_box) = child.downcast::() { -+ if let Some(icon) = _box.get_children().get(1) { -+ icon.set_visible(true); - } - } -+ } - -- select_button_stack.set_visible_child_name("text"); -- select_button.set_sensitive(true); -- })); -+ select_button_stack.set_visible_child_name("text"); -+ select_button.set_sensitive(true); -+ })); - -- threadpool.spawn_ok(thread_future); -- Util::glib_spawn_future(glib_future); -- } -+ threadpool.spawn_ok(thread_future); -+ Util::glib_spawn_future(glib_future); - } - })); - for (title, url) in feed_vec { -@@ -559,7 +530,7 @@ impl AddPopover { - label.set_ellipsize(EllipsizeMode::End); - label.set_xalign(0.0); - -- let warn_icon = Image::new_from_icon_name(Some(WARN_ICON), IconSize::Button); -+ let warn_icon = Image::from_icon_name(Some(WARN_ICON), IconSize::Button); - warn_icon.set_tooltip_text(Some(&i18n("Failed to get Feed."))); - warn_icon.set_no_show_all(true); - -@@ -597,16 +568,12 @@ impl AddPopover { - } - - fn calc_add_button_sensitive(title_entry: &Entry, feed_category_entry: &Entry) -> bool { -- if let Some(text) = title_entry.get_text() { -- if text.as_str().is_empty() { -- return false; -- } -+ if title_entry.get_text().as_str().is_empty() { -+ return false; - } - -- if let Some(text) = feed_category_entry.get_text() { -- if text.as_str().is_empty() { -- return false; -- } -+ if feed_category_entry.get_text().as_str().is_empty() { -+ return false; - } - - true -diff --git a/src/app.rs b/src/app.rs -index c57bf2fbf82b..cdc130270e9d 100644 ---- a/src/app.rs -+++ b/src/app.rs -@@ -994,17 +994,15 @@ impl App { - @weak dialog.dialog as rename_dialog, - @strong self.sender as sender => @default-panic, move |_button| - { -- let new_label = match rename_entry.get_text().map(|label| label.to_owned()) { -- Some(label) => label, -- None => { -- Util::send( -- &sender, -- Action::ErrorSimpleMessage("No valid title to rename feed.".to_owned()), -- ); -- rename_dialog.emit_close(); -- return; -- } -- }; -+ let new_label = rename_entry.get_text().to_owned(); -+ if new_label.is_empty() { -+ Util::send( -+ &sender, -+ Action::ErrorSimpleMessage("No valid title to rename feed.".to_owned()), -+ ); -+ rename_dialog.emit_close(); -+ return; -+ } - - let feed = feed.clone(); - Util::send(&sender, Action::RenameFeed((feed, new_label))); -@@ -1065,17 +1063,15 @@ impl App { - @weak dialog.rename_entry as rename_entry, - @strong self.sender as sender => @default-panic, move |_button| - { -- let new_label = match rename_entry.get_text().map(|label| label.to_owned()) { -- Some(label) => label, -- None => { -- Util::send( -- &sender, -- Action::ErrorSimpleMessage("No valid title to rename feed.".to_owned()), -- ); -- rename_dialog.emit_close(); -- return; -- } -- }; -+ let new_label = rename_entry.get_text().to_owned(); -+ if new_label.is_empty() { -+ Util::send( -+ &sender, -+ Action::ErrorSimpleMessage("No valid title to rename category.".to_owned()), -+ ); -+ rename_dialog.emit_close(); -+ return; -+ } - - let category = category.clone(); - Util::send(&sender, Action::RenameCategory((category, new_label))); -diff --git a/src/article_view/mod.rs b/src/article_view/mod.rs -index ae40cc8b398f..227521935b5a 100644 ---- a/src/article_view/mod.rs -+++ b/src/article_view/mod.rs -@@ -14,8 +14,8 @@ use crate::settings::Settings; - use crate::util::{BuilderHelper, DateUtil, FileUtil, GtkUtil, Util, GTK_RESOURCE_FILE_ERROR}; - use crate::Resources; - use gdk::{ -- enums::key::KP_Add as KP_ADD, enums::key::KP_Subtract as KP_SUBTRACT, enums::key::KP_0, Cursor, CursorType, -- Display, EventMask, ModifierType, ScrollDirection, -+ keys::constants::KP_Add as KP_ADD, keys::constants::KP_Subtract as KP_SUBTRACT, keys::constants::KP_0, Cursor, -+ CursorType, Display, EventMask, ModifierType, ScrollDirection, - }; - use gio::{Cancellable, Settings as GSettings, SettingsExt as GSettingsExt}; - use glib::{clone, object::Cast, source::Continue, translate::ToGlib, MainLoop, Sender}; -@@ -356,7 +356,7 @@ impl ArticleView { - settings.set_media_playback_requires_user_gesture(true); - settings.set_user_agent_with_application_details(Some("NewsFlash"), None); - -- let webview = WebView::new_with_context(ctx); -+ let webview = WebView::with_context(ctx); - webview.set_settings(&settings); - webview.set_events(EventMask::POINTER_MOTION_MASK); - webview.set_events(EventMask::SCROLL_MASK); -diff --git a/src/content_page/content_header.rs b/src/content_page/content_header.rs -index e3bd5e371a7c..ad273ab55684 100644 ---- a/src/content_page/content_header.rs -+++ b/src/content_page/content_header.rs -@@ -326,9 +326,7 @@ impl ContentHeader { - - fn setup_search_entry(search_entry: &SearchEntry, sender: &Sender) { - search_entry.connect_search_changed(clone!(@strong sender => @default-panic, move |search_entry| { -- if let Some(text) = search_entry.get_text() { -- Util::send(&sender, Action::SearchTerm(text.as_str().to_owned())); -- } -+ Util::send(&sender, Action::SearchTerm(search_entry.get_text().as_str().into())); - })); - } - -diff --git a/src/login_screen/password_login.rs b/src/login_screen/password_login.rs -index be1e1fd1cf1f..ec00dfd0289e 100644 ---- a/src/login_screen/password_login.rs -+++ b/src/login_screen/password_login.rs -@@ -186,35 +186,32 @@ impl PasswordLogin { - @strong self.sender as sender => @default-panic, move |_button| - { - let url: Option = if pw_gui_desc.url { -- match url_entry.get_text() { -- Some(url) => Some(url.as_str().to_owned()), -- None => None, -- } -+ Some(url_entry.get_text().as_str().to_owned()) - } else { - None - }; - let user = user_entry - .get_text() -- .expect("Login button should be insensitive if user entry is empty.") - .as_str() - .to_owned(); - let password = pass_entry - .get_text() -- .expect("Login button should be insensitive if password entry is empty.") - .as_str() - .to_owned(); - let http_user: Option = if http_revealer.get_child_revealed() { -- match http_user_entry.get_text() { -- Some(user) => Some(user.as_str().to_owned()), -- None => None, -+ if http_user_entry.get_text().is_empty() { -+ None -+ } else { -+ Some(http_user_entry.get_text().as_str().to_owned()) - } - } else { - None - }; - let http_password: Option = if http_revealer.get_child_revealed() { -- match http_pass_entry.get_text() { -- Some(pass) => Some(pass.as_str().to_owned()), -- None => None, -+ if http_pass_entry.get_text().is_empty() { -+ None -+ } else { -+ Some(http_pass_entry.get_text().as_str().to_owned()) - } - } else { - None -diff --git a/src/main_window.rs b/src/main_window.rs -index cb2958748491..6690be3b8346 100644 ---- a/src/main_window.rs -+++ b/src/main_window.rs -@@ -20,8 +20,9 @@ use futures::FutureExt; - use gdk::EventKey; - use glib::{self, clone, Sender}; - use gtk::{ -- self, ApplicationWindow, CssProvider, CssProviderExt, GtkWindowExt, Inhibit, Settings as GtkSettings, SettingsExt, -- Stack, StackExt, StackTransitionType, StyleContext, StyleContextExt, WidgetExt, -+ self, prelude::WidgetExtManual, ApplicationWindow, CssProvider, CssProviderExt, GtkWindowExt, Inhibit, -+ Settings as GtkSettings, SettingsExt, Stack, StackExt, StackTransitionType, StyleContext, StyleContextExt, -+ WidgetExt, - }; - use log::{error, warn}; - use news_flash::models::{ -@@ -326,7 +327,7 @@ impl MainWindow { - if let Some(keybinding) = keybinding { - let (keyval, modifier) = gtk::accelerator_parse(&keybinding); - -- if gdk::keyval_to_lower(keyval) == gdk::keyval_to_lower(event.get_keyval()) { -+ if gdk::keyval_to_lower(keyval) == gdk::keyval_to_lower(*event.get_keyval()) { - if modifier.is_empty() { - if Keybindings::clean_modifier(event.get_state()).is_empty() { - return true; -diff --git a/src/settings/dialog.rs b/src/settings/dialog.rs -index e7e731916bec..947ee5f7da09 100644 ---- a/src/settings/dialog.rs -+++ b/src/settings/dialog.rs -@@ -207,10 +207,8 @@ impl SettingsDialog { - if let Ok(listbox) = listbox.downcast::() { - listbox.connect_row_activated( - clone!(@weak self.sync_pop as sync_pop => @default-panic, move |_list, row| { -- if let Some(name) = row.get_widget_name() { -- if name == "sync_row" { -- sync_pop.popup(); -- } -+ if row.get_widget_name() == "sync_row" { -+ sync_pop.popup(); - } - }), - ); -@@ -259,10 +257,8 @@ impl SettingsDialog { - if let Ok(listbox) = listbox.downcast::() { - listbox.connect_row_activated( - clone!(@weak self.article_order_pop as article_order_pop => @default-panic, move |_list, row| { -- if let Some(name) = row.get_widget_name() { -- if name == "article_order_row" { -- article_order_pop.popup(); -- } -+ if row.get_widget_name() == "article_order_row" { -+ article_order_pop.popup(); - } - }), - ); -@@ -306,18 +302,16 @@ impl SettingsDialog { - @weak self.settings as settings, - @strong sender => @default-panic, move |_list, row| - { -- if let Some(name) = row.get_widget_name() { -- if name == "article_theme_row" { -- let theme_chooser = ThemeChooser::new(&article_theme_event, &sender, &settings); -- theme_chooser.widget().connect_closed(clone!( -- @strong sender, -- @weak settings => @default-panic, move |_pop| -- { -- article_theme_label.set_label(settings.read().get_article_view_theme().name()); -- Util::send(&sender, Action::RedrawArticle); -- })); -- theme_chooser.widget().popup(); -- } -+ if row.get_widget_name() == "article_theme_row" { -+ let theme_chooser = ThemeChooser::new(&article_theme_event, &sender, &settings); -+ theme_chooser.widget().connect_closed(clone!( -+ @strong sender, -+ @weak settings => @default-panic, move |_pop| -+ { -+ article_theme_label.set_label(settings.read().get_article_view_theme().name()); -+ Util::send(&sender, Action::RedrawArticle); -+ })); -+ theme_chooser.widget().popup(); - } - })); - } -@@ -464,43 +458,41 @@ impl SettingsDialog { - @strong sender, - @strong id => @default-panic, move |_list, row| - { -- if let Some(name) = row.get_widget_name() { -- if name.as_str() == row_name { -- let editor = KeybindingEditor::new(&dialog, &info_text); -- editor.widget().present(); -- editor.widget().connect_close(clone!( -- @weak label, -- @weak settings, -- @strong sender, -- @strong id => @default-panic, move |_dialog| -- { -- let _settings = settings.clone(); -- match &*editor.keybinding.read() { -- KeybindState::Canceled | KeybindState::Illegal => {} -- KeybindState::Disabled => { -- if Keybindings::write_keybinding(&id, None, &settings).is_ok() { -- Self::keybind_label_text(None, &label); -- } else { -- Util::send( -- &sender, -- Action::ErrorSimpleMessage("Failed to write keybinding.".to_owned()), -- ); -- } -+ if row.get_widget_name().as_str() == row_name { -+ let editor = KeybindingEditor::new(&dialog, &info_text); -+ editor.widget().present(); -+ editor.widget().connect_close(clone!( -+ @weak label, -+ @weak settings, -+ @strong sender, -+ @strong id => @default-panic, move |_dialog| -+ { -+ let _settings = settings.clone(); -+ match &*editor.keybinding.read() { -+ KeybindState::Canceled | KeybindState::Illegal => {} -+ KeybindState::Disabled => { -+ if Keybindings::write_keybinding(&id, None, &settings).is_ok() { -+ Self::keybind_label_text(None, &label); -+ } else { -+ Util::send( -+ &sender, -+ Action::ErrorSimpleMessage("Failed to write keybinding.".to_owned()), -+ ); - } -- KeybindState::Enabled(keybind) => { -- if Keybindings::write_keybinding(&id, Some(keybind.clone()), &settings).is_ok() -- { -- Self::keybind_label_text(Some(keybind.clone()), &label); -- } else { -- Util::send( -- &sender, -- Action::ErrorSimpleMessage("Failed to write keybinding.".to_owned()), -- ); -- } -+ } -+ KeybindState::Enabled(keybind) => { -+ if Keybindings::write_keybinding(&id, Some(keybind.clone()), &settings).is_ok() -+ { -+ Self::keybind_label_text(Some(keybind.clone()), &label); -+ } else { -+ Util::send( -+ &sender, -+ Action::ErrorSimpleMessage("Failed to write keybinding.".to_owned()), -+ ); - } - } -- })); -- } -+ } -+ })); - } - })); - } -diff --git a/src/settings/keybinding_editor.rs b/src/settings/keybinding_editor.rs -index 530facde1d0c..f8deb9c11654 100644 ---- a/src/settings/keybinding_editor.rs -+++ b/src/settings/keybinding_editor.rs -@@ -1,7 +1,7 @@ - use super::keybindings::Keybindings; - use crate::i18n::i18n; - use crate::util::BuilderHelper; --use gdk::enums::key; -+use gdk::keys::constants; - use glib::{clone, object::IsA}; - use gtk::{ - Align, Button, ButtonExt, Dialog, DialogExt, GtkWindowExt, Inhibit, Label, LabelExt, ShortcutLabel, Stack, -@@ -51,13 +51,13 @@ impl KeybindingEditor { - let keyval = event.get_keyval(); - let modifier = Keybindings::clean_modifier(event.get_state()); - -- if keyval == key::Escape { -+ if keyval == constants::Escape { - *keybinding_public.write() = KeybindState::Canceled; - widget.emit_close(); - return Inhibit(true); - } - -- if keyval == key::BackSpace { -+ if keyval == constants::BackSpace { - shortcut_meta.set_label(&i18n("Disable Keybinding")); - set_button.set_visible(true); - cancel_button.set_visible(true); -@@ -66,11 +66,11 @@ impl KeybindingEditor { - return Inhibit(false); - } - -- let internal_shortcut = gtk::accelerator_name(keyval, modifier) -+ let internal_shortcut = gtk::accelerator_name(*keyval, modifier) - .expect("Shortcut not convertable. This should never happen!") - .to_string(); - -- if Keybindings::parse_keyval(keyval).is_some() { -+ if Keybindings::parse_keyval(*keyval).is_some() { - set_button.set_visible(true); - cancel_button.set_visible(true); - shortcut_label.set_accelerator(&internal_shortcut); -diff --git a/src/settings/keybindings.rs b/src/settings/keybindings.rs -index d6bb59962280..a04c7c250a7d 100644 ---- a/src/settings/keybindings.rs -+++ b/src/settings/keybindings.rs -@@ -2,8 +2,9 @@ use super::error::{SettingsError, SettingsErrorKind}; - use crate::settings::Settings; - use crate::util::{BuilderHelper, GTK_RESOURCE_FILE_ERROR}; - use crate::Resources; --use gdk::{enums::key, ModifierType}; -+use gdk::{keys::constants, keys::Key, ModifierType}; - use glib::object::{Cast, IsA}; -+use glib::translate::FromGlib; - use gtk::{BinExt, Box, ContainerExt, GtkWindowExt, ShortcutsWindow, Stack, StackExt, WidgetExt, Window}; - use log::warn; - use parking_lot::RwLock; -@@ -54,42 +55,42 @@ impl Keybindings { - - pub fn parse_keyval(keyval: u32) -> Option { - let keyval = gdk::keyval_to_upper(keyval); -- -+ let keyval = Key::from_glib(keyval); - let manual_parsed = match keyval { -- key::Shift_L -- | key::Control_L -- | key::Alt_L -- | key::Meta_L -- | key::Super_L -- | key::Hyper_L -- | key::Shift_R -- | key::Control_R -- | key::Alt_R -- | key::Meta_R -- | key::Super_R -- | key::Hyper_R => Self::get_modifier_label(keyval), -- key::Left => Some("←".to_owned()), -- key::Right => Some("→".to_owned()), -- key::Down => Some("↓".to_owned()), -- key::Up => Some("↑".to_owned()), -- key::space => Some("␣".to_owned()), -- key::Return => Some("⏎".to_owned()), -- key::Delete => Some("Del".to_owned()), -- key::Page_Up => Some("⇑".to_owned()), -- key::Page_Down => Some("⇓".to_owned()), -- key::BackSpace => Some("Backspace".to_owned()), -- key::F1 => Some("F1".to_owned()), -- key::F2 => Some("F2".to_owned()), -- key::F3 => Some("F3".to_owned()), -- key::F4 => Some("F4".to_owned()), -- key::F5 => Some("F5".to_owned()), -- key::F6 => Some("F6".to_owned()), -- key::F7 => Some("F7".to_owned()), -- key::F8 => Some("F8".to_owned()), -- key::F9 => Some("F9".to_owned()), -- key::F10 => Some("F10".to_owned()), -- key::F11 => Some("F11".to_owned()), -- key::F12 => Some("F12".to_owned()), -+ constants::Shift_L -+ | constants::Control_L -+ | constants::Alt_L -+ | constants::Meta_L -+ | constants::Super_L -+ | constants::Hyper_L -+ | constants::Shift_R -+ | constants::Control_R -+ | constants::Alt_R -+ | constants::Meta_R -+ | constants::Super_R -+ | constants::Hyper_R => Self::get_modifier_label(&keyval), -+ constants::Left => Some("←".to_owned()), -+ constants::Right => Some("→".to_owned()), -+ constants::Down => Some("↓".to_owned()), -+ constants::Up => Some("↑".to_owned()), -+ constants::space => Some("␣".to_owned()), -+ constants::Return => Some("⏎".to_owned()), -+ constants::Delete => Some("Del".to_owned()), -+ constants::Page_Up => Some("⇑".to_owned()), -+ constants::Page_Down => Some("⇓".to_owned()), -+ constants::BackSpace => Some("Backspace".to_owned()), -+ constants::F1 => Some("F1".to_owned()), -+ constants::F2 => Some("F2".to_owned()), -+ constants::F3 => Some("F3".to_owned()), -+ constants::F4 => Some("F4".to_owned()), -+ constants::F5 => Some("F5".to_owned()), -+ constants::F6 => Some("F6".to_owned()), -+ constants::F7 => Some("F7".to_owned()), -+ constants::F8 => Some("F8".to_owned()), -+ constants::F9 => Some("F9".to_owned()), -+ constants::F10 => Some("F10".to_owned()), -+ constants::F11 => Some("F11".to_owned()), -+ constants::F12 => Some("F12".to_owned()), - _ => None, - }; - -@@ -97,7 +98,7 @@ impl Keybindings { - return manual_parsed; - } - -- match gdk::keyval_to_unicode(keyval) { -+ match keyval.to_unicode() { - Some(keyval) => { - let mut buffer: [u8; 4] = [0; 4]; - Some(keyval.encode_utf8(&mut buffer).to_owned()) -@@ -106,24 +107,30 @@ impl Keybindings { - } - } - -- fn get_modifier_label(keyval: u32) -> Option { -+ fn get_modifier_label(keyval: &Key) -> Option { - let mut mod_string = String::new(); - match keyval { -- key::Shift_L | key::Control_L | key::Alt_L | key::Meta_L | key::Super_L | key::Hyper_L => { -- mod_string.push('L') -- } -- key::Shift_R | key::Control_R | key::Alt_R | key::Meta_R | key::Super_R | key::Hyper_R => { -- mod_string.push('R') -- } -+ &constants::Shift_L -+ | &constants::Control_L -+ | &constants::Alt_L -+ | &constants::Meta_L -+ | &constants::Super_L -+ | &constants::Hyper_L => mod_string.push('L'), -+ &constants::Shift_R -+ | &constants::Control_R -+ | &constants::Alt_R -+ | &constants::Meta_R -+ | &constants::Super_R -+ | &constants::Hyper_R => mod_string.push('R'), - _ => return None, - } - - match keyval { -- key::Shift_L | key::Shift_R => mod_string.push_str("Shift"), -- key::Control_L | key::Control_R => mod_string.push_str("Ctrl"), -- key::Meta_L | key::Meta_R => mod_string.push_str("Meta"), -- key::Super_L | key::Super_R => mod_string.push_str("Super"), -- key::Hyper_L | key::Hyper_R => mod_string.push_str("Hyper"), -+ &constants::Shift_L | &constants::Shift_R => mod_string.push_str("Shift"), -+ &constants::Control_L | &constants::Control_R => mod_string.push_str("Ctrl"), -+ &constants::Meta_L | &constants::Meta_R => mod_string.push_str("Meta"), -+ &constants::Super_L | &constants::Super_R => mod_string.push_str("Super"), -+ &constants::Hyper_L | &constants::Hyper_R => mod_string.push_str("Hyper"), - _ => return None, - } - -diff --git a/src/settings/theme_chooser.rs b/src/settings/theme_chooser.rs -index a02d2ca8e940..e747e91e3de3 100644 ---- a/src/settings/theme_chooser.rs -+++ b/src/settings/theme_chooser.rs -@@ -82,29 +82,28 @@ impl ThemeChooser { - let theme_list = builder.get::("theme_list"); - theme_list.connect_row_activated( - clone!(@strong sender, @weak settings, @weak pop => @default-panic, move |_list, row| { -- if let Some(row_name) = row.get_widget_name() { -- let result = if "default" == row_name { -- settings.write().set_article_view_theme(ArticleTheme::Default) -- } else if "spring" == row_name { -- settings.write().set_article_view_theme(ArticleTheme::Spring) -- } else if "midnight" == row_name { -- settings.write().set_article_view_theme(ArticleTheme::Midnight) -- } else if "parchment" == row_name { -- settings.write().set_article_view_theme(ArticleTheme::Parchment) -- } else if "gruvbox" == row_name { -- settings.write().set_article_view_theme(ArticleTheme::Gruvbox) -- } else { -- Ok(()) -- }; -+ let row_name = row.get_widget_name(); -+ let result = if "default" == row_name { -+ settings.write().set_article_view_theme(ArticleTheme::Default) -+ } else if "spring" == row_name { -+ settings.write().set_article_view_theme(ArticleTheme::Spring) -+ } else if "midnight" == row_name { -+ settings.write().set_article_view_theme(ArticleTheme::Midnight) -+ } else if "parchment" == row_name { -+ settings.write().set_article_view_theme(ArticleTheme::Parchment) -+ } else if "gruvbox" == row_name { -+ settings.write().set_article_view_theme(ArticleTheme::Gruvbox) -+ } else { -+ Ok(()) -+ }; - -- if result.is_err() { -- Util::send( -- &sender, -- Action::ErrorSimpleMessage("Failed to set theme setting.".to_owned()), -- ); -- } -- pop.popdown(); -+ if result.is_err() { -+ Util::send( -+ &sender, -+ Action::ErrorSimpleMessage("Failed to set theme setting.".to_owned()), -+ ); - } -+ pop.popdown(); - }), - ); - -diff --git a/src/util/builder_helper.rs b/src/util/builder_helper.rs -index c890bf510e93..408581fcd4d2 100644 ---- a/src/util/builder_helper.rs -+++ b/src/util/builder_helper.rs -@@ -17,7 +17,7 @@ impl BuilderHelper { - } - - pub fn new_from_xml(ui_xml: &str) -> Self { -- let builder = Builder::new_from_string(ui_xml); -+ let builder = Builder::from_string(ui_xml); - BuilderHelper { builder } - } - -diff --git a/src/util/gtk_util.rs b/src/util/gtk_util.rs -index d8ec0f0666d8..0ae774930db8 100644 ---- a/src/util/gtk_util.rs -+++ b/src/util/gtk_util.rs -@@ -30,7 +30,7 @@ impl GtkUtil { - pub fn register_symbolic_icons() { - let data = Resources::get("gresource_bundles/symbolic_icons.gresource").expect(GTK_RESOURCE_FILE_ERROR); - let bytes = Bytes::from(&data); -- let icon_resource = Resource::new_from_data(&bytes).expect("Error creating gio resource."); -+ let icon_resource = Resource::from_data(&bytes).expect("Error creating gio resource."); - gio::resources_register(&icon_resource); - IconTheme::get_default() - .unwrap_or_else(|| panic!("Failed to register symbolic icons.")) -@@ -74,10 +74,10 @@ impl GtkUtil { - scale_factor: i32, - ) -> Result { - let bytes = Bytes::from(data); -- let stream = MemoryInputStream::new_from_bytes(&bytes); -+ let stream = MemoryInputStream::from_bytes(&bytes); - let cancellable: Option<&Cancellable> = None; - let pixbuf = -- Pixbuf::new_from_stream_at_scale(&stream, width * scale_factor, height * scale_factor, true, cancellable) -+ Pixbuf::from_stream_at_scale(&stream, width * scale_factor, height * scale_factor, true, cancellable) - .context(UtilErrorKind::CairoSurface)?; - Ok(pixbuf) - } --- -2.26.2 - diff --git a/0001-use-usize-where-possible.patch b/0001-use-usize-where-possible.patch deleted file mode 100644 index d39d206..0000000 --- a/0001-use-usize-where-possible.patch +++ /dev/null @@ -1,791 +0,0 @@ -From 38361e7c8d644b10d9b6747c26eeec2b50d42845 Mon Sep 17 00:00:00 2001 -From: Jan Lukas Gernert -Date: Sun, 7 Jun 2020 18:55:59 +0200 -Subject: [PATCH] use usize where possible - ---- - src/article_list/article_row.rs | 24 ++++++------ - src/article_list/mod.rs | 4 +- - src/article_view/mod.rs | 56 +++++++++++++-------------- - src/content_page/content_header.rs | 12 +++--- - src/error_bar.rs | 18 ++++----- - src/login_screen/password_login.rs | 38 +++++++++--------- - src/login_screen/web_login.rs | 30 +++++--------- - src/reset_page.rs | 4 +- - src/sidebar/feed_list/category_row.rs | 12 +++--- - src/sidebar/feed_list/feed_row.rs | 10 ++--- - src/tag_popover/mod.rs | 20 +++++----- - src/util/gtk_util.rs | 7 +++- - 12 files changed, 114 insertions(+), 121 deletions(-) - -diff --git a/src/article_list/article_row.rs b/src/article_list/article_row.rs -index 255665b..ca3ebf6 100644 ---- a/src/article_list/article_row.rs -+++ b/src/article_list/article_row.rs -@@ -24,7 +24,7 @@ pub struct ArticleRow { - unread_stack: Stack, - title_label: Label, - row_hovered: Arc>, -- connected_signals: Vec<(u64, Widget)>, -+ connected_signals: Vec<(usize, Widget)>, - } - - impl ArticleRow { -@@ -175,7 +175,7 @@ impl ArticleRow { - title_label: &Label, - article_id: &ArticleID, - list_model: &Arc>, -- ) -> Vec<(u64, Widget)> { -+ ) -> Vec<(usize, Widget)> { - let mut vec = Vec::new(); - vec.push(( - eventbox -@@ -192,7 +192,7 @@ impl ArticleRow { - } - Inhibit(false) - })) -- .to_glib(), -+ .to_glib() as usize, - eventbox.clone().upcast::(), - )); - -@@ -211,7 +211,7 @@ impl ArticleRow { - } - Inhibit(false) - })) -- .to_glib(), -+ .to_glib() as usize, - eventbox.clone().upcast::(), - )); - -@@ -249,7 +249,7 @@ impl ArticleRow { - Util::send(&sender, Action::MarkArticleRead(update)); - Inhibit(true) - })) -- .to_glib(), -+ .to_glib() as usize, - eventbox.clone().upcast::(), - )); - -@@ -264,7 +264,7 @@ impl ArticleRow { - marked_stack: &Stack, - article_id: &ArticleID, - list_model: &Arc>, -- ) -> Vec<(u64, Widget)> { -+ ) -> Vec<(usize, Widget)> { - let mut vec = Vec::new(); - - vec.push(( -@@ -282,7 +282,7 @@ impl ArticleRow { - } - Inhibit(false) - })) -- .to_glib(), -+ .to_glib() as usize, - eventbox.clone().upcast::(), - )); - -@@ -301,7 +301,7 @@ impl ArticleRow { - } - Inhibit(false) - })) -- .to_glib(), -+ .to_glib() as usize, - eventbox.clone().upcast::(), - )); - -@@ -337,7 +337,7 @@ impl ArticleRow { - Util::send(&sender, Action::MarkArticle(update)); - Inhibit(true) - })) -- .to_glib(), -+ .to_glib() as usize, - eventbox.clone().upcast::(), - )); - -@@ -352,7 +352,7 @@ impl ArticleRow { - marked_stack: &Stack, - title_label: &Label, - row_hovered: &Arc>, -- ) -> Vec<(u64, Widget)> { -+ ) -> Vec<(usize, Widget)> { - Self::update_title_label(&title_label, *read.read()); - Self::update_unread_stack(&unread_stack, *read.read(), *row_hovered.read()); - Self::update_marked_stack(&marked_stack, *marked.read()); -@@ -382,7 +382,7 @@ impl ArticleRow { - } - Inhibit(true) - })) -- .to_glib(), -+ .to_glib() as usize, - eventbox.clone().upcast::(), - )); - -@@ -409,7 +409,7 @@ impl ArticleRow { - } - Inhibit(true) - })) -- .to_glib(), -+ .to_glib() as usize, - eventbox.clone().upcast::(), - )); - -diff --git a/src/article_list/mod.rs b/src/article_list/mod.rs -index 86cbbd6..1122367 100644 ---- a/src/article_list/mod.rs -+++ b/src/article_list/mod.rs -@@ -33,7 +33,7 @@ pub struct ArticleList { - list_1: Arc>, - list_2: Arc>, - list_model: Arc>, -- list_activate_signal: Option, -+ list_activate_signal: Option, - local_state: MainWindowState, - global_state: Arc>, - current_list: Arc>, -@@ -263,7 +263,7 @@ impl ArticleList { - } - })) - .to_glib(); -- self.list_activate_signal = Some(activate_signal_id); -+ self.list_activate_signal = Some(activate_signal_id as usize); - } - - fn require_new_list(&self, new_state: &RwLock) -> bool { -diff --git a/src/article_view/mod.rs b/src/article_view/mod.rs -index b29edb2..f43c487 100644 ---- a/src/article_view/mod.rs -+++ b/src/article_view/mod.rs -@@ -59,16 +59,16 @@ pub struct ArticleView { - visible_feed_name: Arc>>, - widnow_state: Arc>, - internal_state: Arc>, -- load_changed_signal: Arc>>, -- decide_policy_signal: Arc>>, -- mouse_over_signal: Arc>>, -- scroll_signal: Arc>>, -- key_press_signal: Arc>>, -- ctx_menu_signal: Arc>>, -- load_signal: Arc>>, -- click_signal: Arc>>, -- click_release_signal: Arc>>, -- drag_motion_notify_signal: Arc>>, -+ load_changed_signal: Arc>>, -+ decide_policy_signal: Arc>>, -+ mouse_over_signal: Arc>>, -+ scroll_signal: Arc>>, -+ key_press_signal: Arc>>, -+ ctx_menu_signal: Arc>>, -+ load_signal: Arc>>, -+ click_signal: Arc>>, -+ click_release_signal: Arc>>, -+ drag_motion_notify_signal: Arc>>, - drag_released_motion_signal: Arc>>, - drag_buffer_update_signal: Arc>>, - progress_overlay_delay_signal: Arc>>, -@@ -303,15 +303,15 @@ impl ArticleView { - progress_overlay_label: &Arc>, - old_state: &Arc>, - stack: >k::Stack, -- load_changed_signal: &Arc>>, -- decide_policy_signal: &Arc>>, -- mouse_over_signal: &Arc>>, -- scroll_signal: &Arc>>, -- key_press_signal: &Arc>>, -- ctx_menu_signal: &Arc>>, -- load_signal: &Arc>>, -- click_signal: &Arc>>, -- click_release_signal: &Arc>>, -+ load_changed_signal: &Arc>>, -+ decide_policy_signal: &Arc>>, -+ mouse_over_signal: &Arc>>, -+ scroll_signal: &Arc>>, -+ key_press_signal: &Arc>>, -+ ctx_menu_signal: &Arc>>, -+ load_signal: &Arc>>, -+ click_signal: &Arc>>, -+ click_release_signal: &Arc>>, - drag_released_motion_signal: &Arc>>, - drag_buffer_update_signal: &Arc>>, - progress_overlay_delay_signal: &Arc>>, -@@ -431,7 +431,7 @@ impl ArticleView { - } - false - }) -- .to_glib(), -+ .to_glib() as usize, - ); - - //---------------------------------- -@@ -463,7 +463,7 @@ impl ArticleView { - url_overlay_label.read().reveal(false); - } - })) -- .to_glib(), -+ .to_glib() as usize, - ); - - //---------------------------------- -@@ -489,7 +489,7 @@ impl ArticleView { - } - Inhibit(false) - }) -- .to_glib(), -+ .to_glib() as usize, - ); - - //------------------------------------------------ -@@ -509,7 +509,7 @@ impl ArticleView { - } - Inhibit(true) - }) -- .to_glib(), -+ .to_glib() as usize, - ); - - //---------------------------------- -@@ -542,7 +542,7 @@ impl ArticleView { - - false - }) -- .to_glib(), -+ .to_glib() as usize, - ); - - //---------------------------------- -@@ -571,7 +571,7 @@ impl ArticleView { - progress_handle.read().reveal(true); - progress_handle.read().set_percentage(progress); - })) -- .to_glib(), -+ .to_glib() as usize, - ); - Continue(false) - })) -@@ -652,7 +652,7 @@ impl ArticleView { - Self::set_scroll_pos_static(view, scroll_pos + scroll); - Inhibit(false) - })) -- .to_glib(), -+ .to_glib() as usize, - ); - } - } -@@ -662,7 +662,7 @@ impl ArticleView { - } - Inhibit(false) - })) -- .to_glib(), -+ .to_glib() as usize, - ); - - self.click_release_signal.write().replace( -@@ -724,7 +724,7 @@ impl ArticleView { - } - Inhibit(false) - })) -- .to_glib(), -+ .to_glib() as usize, - ); - - //---------------------------------- -diff --git a/src/content_page/content_header.rs b/src/content_page/content_header.rs -index e3bd5e3..8d828c9 100644 ---- a/src/content_page/content_header.rs -+++ b/src/content_page/content_header.rs -@@ -33,7 +33,7 @@ pub struct ContentHeader { - marked_button: ToggleButton, - scrap_content_button: ToggleButton, - scrap_content_stack: Stack, -- scrap_content_event: RwLock>, -+ scrap_content_event: RwLock>, - tag_button: MenuButton, - tag_popover: RwLock>, - more_actions_button: MenuButton, -@@ -43,8 +43,8 @@ pub struct ContentHeader { - mark_article_read_button: ToggleButton, - mark_article_stack: Stack, - mark_article_read_stack: Stack, -- mark_article_event: RwLock>, -- mark_article_read_event: RwLock>, -+ mark_article_event: RwLock>, -+ mark_article_read_event: RwLock>, - } - - impl ContentHeader { -@@ -557,7 +557,7 @@ impl ContentHeader { - } - Util::send(&sender, Action::ToggleArticleMarked); - })) -- .to_glib(), -+ .to_glib() as usize, - ); - - self.mark_article_read_event.write().replace( -@@ -573,7 +573,7 @@ impl ContentHeader { - } - Util::send(&sender, Action::ToggleArticleRead); - })) -- .to_glib(), -+ .to_glib() as usize, - ); - - self.scrap_content_event.write().replace( -@@ -590,7 +590,7 @@ impl ContentHeader { - Util::send(&sender, Action::RedrawArticle); - } - })) -- .to_glib(), -+ .to_glib() as usize, - ); - - self.more_actions_button.set_sensitive(sensitive); -diff --git a/src/error_bar.rs b/src/error_bar.rs -index cf24d98..48761c9 100644 ---- a/src/error_bar.rs -+++ b/src/error_bar.rs -@@ -15,9 +15,9 @@ pub struct ErrorBar { - detail_button: Button, - login_button: Button, - offline_button: Button, -- detail_signal: Arc>>, -- relogin_signal: Arc>>, -- offline_signal: Arc>>, -+ detail_signal: Arc>>, -+ relogin_signal: Arc>>, -+ offline_signal: Arc>>, - sender: Sender, - } - -@@ -71,9 +71,9 @@ impl ErrorBar { - detail_button: &Button, - login_button: &Button, - offline_button: &Button, -- detail_signal: &Arc>>, -- relogin_signal: &Arc>>, -- offline_signal: &Arc>>, -+ detail_signal: &Arc>>, -+ relogin_signal: &Arc>>, -+ offline_signal: &Arc>>, - ) { - info_bar.set_revealed(false); - GtkUtil::disconnect_signal(*detail_signal.read(), detail_button); -@@ -114,7 +114,7 @@ impl ErrorBar { - log::info!("retry login"); - Util::send(&sender, Action::RetryLogin); - })) -- .to_glib(), -+ .to_glib() as usize, - ); - - *self.offline_signal.write() = Some( -@@ -141,7 +141,7 @@ impl ErrorBar { - ); - Util::send(&sender, Action::SetOfflineMode(true)); - })) -- .to_glib(), -+ .to_glib() as usize, - ); - } - -@@ -155,7 +155,7 @@ impl ErrorBar { - error!("Failed to spawn ErrorDialog. Parent window not found."); - } - }) -- .to_glib(), -+ .to_glib() as usize, - ); - } - } -diff --git a/src/login_screen/password_login.rs b/src/login_screen/password_login.rs -index be1e1fd..683d3e9 100644 ---- a/src/login_screen/password_login.rs -+++ b/src/login_screen/password_login.rs -@@ -34,16 +34,16 @@ pub struct PasswordLogin { - login_button: gtk::Button, - ignore_tls_button: gtk::Button, - error_details_button: gtk::Button, -- info_bar_close_signal: RwLock>, -- info_bar_response_signal: RwLock>, -- url_entry_signal: RwLock>, -- user_entry_signal: RwLock>, -- pass_entry_signal: RwLock>, -- http_user_entry_signal: RwLock>, -- http_pass_entry_signal: RwLock>, -- login_button_signal: RwLock>, -- ignore_tls_signal: RwLock>, -- error_details_signal: RwLock>, -+ info_bar_close_signal: RwLock>, -+ info_bar_response_signal: RwLock>, -+ url_entry_signal: RwLock>, -+ user_entry_signal: RwLock>, -+ pass_entry_signal: RwLock>, -+ http_user_entry_signal: RwLock>, -+ http_pass_entry_signal: RwLock>, -+ login_button_signal: RwLock>, -+ ignore_tls_signal: RwLock>, -+ error_details_signal: RwLock>, - } - - impl PasswordLogin { -@@ -129,7 +129,7 @@ impl PasswordLogin { - .connect_close(|info_bar| { - PasswordLogin::hide_info_bar(info_bar); - }) -- .to_glib(), -+ .to_glib() as usize, - ); - self.info_bar_response_signal.write().replace( - self.info_bar -@@ -138,7 +138,7 @@ impl PasswordLogin { - PasswordLogin::hide_info_bar(info_bar); - } - }) -- .to_glib(), -+ .to_glib() as usize, - ); - - if let LoginGUI::Password(pw_gui_desc) = &info.login_gui { -@@ -157,19 +157,19 @@ impl PasswordLogin { - // check if 'login' should be clickable - self.url_entry_signal - .write() -- .replace(self.setup_entry(&self.url_entry, &pw_gui_desc).to_glib()); -+ .replace(self.setup_entry(&self.url_entry, &pw_gui_desc).to_glib() as usize); - self.user_entry_signal - .write() -- .replace(self.setup_entry(&self.user_entry, &pw_gui_desc).to_glib()); -+ .replace(self.setup_entry(&self.user_entry, &pw_gui_desc).to_glib() as usize); - self.pass_entry_signal - .write() -- .replace(self.setup_entry(&self.pass_entry, &pw_gui_desc).to_glib()); -+ .replace(self.setup_entry(&self.pass_entry, &pw_gui_desc).to_glib() as usize); - self.http_user_entry_signal - .write() -- .replace(self.setup_entry(&self.http_user_entry, &pw_gui_desc).to_glib()); -+ .replace(self.setup_entry(&self.http_user_entry, &pw_gui_desc).to_glib() as usize); - self.http_pass_entry_signal - .write() -- .replace(self.setup_entry(&self.http_pass_entry, &pw_gui_desc).to_glib()); -+ .replace(self.setup_entry(&self.http_pass_entry, &pw_gui_desc).to_glib() as usize); - - // harvest login data - self.login_button_signal.write().replace( -@@ -231,7 +231,7 @@ impl PasswordLogin { - let login_data = LoginData::Password(login_data); - Util::send(&sender, Action::Login(login_data)); - })) -- .to_glib(), -+ .to_glib() as usize, - ); - - return Ok(()); -@@ -324,7 +324,7 @@ impl PasswordLogin { - .expect("MainWindow is not a parent of password login error details button."); - let _dialog = ErrorDialog::new(&error, &parent); - }) -- .to_glib(), -+ .to_glib() as usize, - ); - self.info_bar.set_visible(true); - self.info_bar.set_revealed(true); -diff --git a/src/login_screen/web_login.rs b/src/login_screen/web_login.rs -index 641415e..274c4fc 100644 ---- a/src/login_screen/web_login.rs -+++ b/src/login_screen/web_login.rs -@@ -3,14 +3,7 @@ use crate::app::Action; - use crate::error_dialog::ErrorDialog; - use crate::i18n::i18n; - use crate::util::{BuilderHelper, GtkUtil, Util, GTK_BUILDER_ERROR}; --use glib::{ -- clone, -- object::ObjectExt, -- signal::SignalHandlerId, -- source::Continue, -- translate::{FromGlib, ToGlib}, -- Sender, --}; -+use glib::{clone, source::Continue, translate::ToGlib, Sender}; - use gtk::{Box, BoxExt, Button, ButtonExt, InfoBar, InfoBarExt, Label, LabelExt, ResponseType, WidgetExt}; - use news_flash::models::{LoginData, LoginGUI, OAuthData, PluginInfo}; - use news_flash::{NewsFlashError, NewsFlashErrorKind}; -@@ -26,10 +19,10 @@ pub struct WebLogin { - info_bar: gtk::InfoBar, - info_bar_label: gtk::Label, - error_details_button: gtk::Button, -- redirect_signal_id: Rc>>, -- info_bar_close_signal: RwLock>, -- info_bar_response_signal: RwLock>, -- error_details_signal: RwLock>, -+ redirect_signal_id: Rc>>, -+ info_bar_close_signal: RwLock>, -+ info_bar_response_signal: RwLock>, -+ error_details_signal: RwLock>, - } - - impl WebLogin { -@@ -86,7 +79,7 @@ impl WebLogin { - let parent = GtkUtil::get_main_window(button).expect("MainWindow is not parent of details button."); - let _dialog = ErrorDialog::new(&error, &parent); - }) -- .to_glib(), -+ .to_glib() as usize, - ); - - self.info_bar.set_visible(true); -@@ -100,7 +93,7 @@ impl WebLogin { - .connect_close(|info_bar| { - WebLogin::hide_info_bar(info_bar); - }) -- .to_glib(), -+ .to_glib() as usize, - ); - self.info_bar_response_signal.write().replace( - self.info_bar -@@ -109,7 +102,7 @@ impl WebLogin { - WebLogin::hide_info_bar(info_bar); - } - }) -- .to_glib(), -+ .to_glib() as usize, - ); - - if let LoginGUI::OAuth(web_login_desc) = info.login_gui.clone() { -@@ -129,10 +122,7 @@ impl WebLogin { - url: uri.as_str().to_owned(), - }; - let oauth_data = LoginData::OAuth(oauth_data); -- if let Some(signal_id) = *redirect_signal_id.read() { -- let signal_id = SignalHandlerId::from_glib(signal_id); -- webview.disconnect(signal_id); -- } -+ GtkUtil::disconnect_signal(*redirect_signal_id.read(), webview); - webview.stop_loading(); - Util::send(&sender, Action::Login(oauth_data)); - } -@@ -145,7 +135,7 @@ impl WebLogin { - } - })); - -- self.redirect_signal_id.write().replace(signal_id.to_glib()); -+ self.redirect_signal_id.write().replace(signal_id.to_glib() as usize); - return Ok(()); - } - -diff --git a/src/reset_page.rs b/src/reset_page.rs -index 6382cac..f088ff2 100644 ---- a/src/reset_page.rs -+++ b/src/reset_page.rs -@@ -12,7 +12,7 @@ pub struct ResetPage { - reset_button: Button, - info_bar: InfoBar, - error_details_button: Button, -- error_details_signal: RwLock>, -+ error_details_signal: RwLock>, - } - - impl ResetPage { -@@ -72,7 +72,7 @@ impl ResetPage { - .expect("MainWindow is not a parent of password login error details button."); - let _dialog = ErrorDialog::new(&error, &parent); - }) -- .to_glib(), -+ .to_glib() as usize, - ); - - self.info_bar.set_revealed(true); -diff --git a/src/sidebar/feed_list/category_row.rs b/src/sidebar/feed_list/category_row.rs -index b33e694..0b6f580 100644 ---- a/src/sidebar/feed_list/category_row.rs -+++ b/src/sidebar/feed_list/category_row.rs -@@ -32,7 +32,7 @@ pub struct CategoryRow { - item_count_event: EventBox, - title: Label, - expanded: bool, -- connected_signals: Vec<(u64, Widget)>, -+ connected_signals: Vec<(usize, Widget)>, - } - - impl CategoryRow { -@@ -96,7 +96,7 @@ impl CategoryRow { - arrow_image.set_opacity(1.0); - Inhibit(false) - })) -- .to_glib(), -+ .to_glib() as usize, - arrow_event.clone().upcast::(), - )); - -@@ -106,7 +106,7 @@ impl CategoryRow { - arrow_image.set_opacity(0.8); - Inhibit(false) - })) -- .to_glib(), -+ .to_glib() as usize, - arrow_event.clone().upcast::(), - )); - -@@ -127,7 +127,7 @@ impl CategoryRow { - Inhibit(false) - }), - ) -- .to_glib(), -+ .to_glib() as usize, - arrow_event.clone().upcast::(), - )); - -@@ -155,7 +155,7 @@ impl CategoryRow { - features: &Arc>>, - label: String, - sender: Sender, -- ) -> Option<(u64, Widget)> { -+ ) -> Option<(usize, Widget)> { - row.set_activatable(true); - row.set_can_focus(false); - row.get_style_context().remove_class("activatable"); -@@ -240,7 +240,7 @@ impl CategoryRow { - row.set_state_flags(StateFlags::PRELIGHT, false); - - Inhibit(true) -- })).to_glib(), eventbox.clone().upcast::())) -+ })).to_glib() as usize, eventbox.clone().upcast::())) - } else { - None - } -diff --git a/src/sidebar/feed_list/feed_row.rs b/src/sidebar/feed_list/feed_row.rs -index 86529ad..248332b 100644 ---- a/src/sidebar/feed_list/feed_row.rs -+++ b/src/sidebar/feed_list/feed_row.rs -@@ -39,7 +39,7 @@ pub struct FeedRow { - revealer: Revealer, - hide_timeout: Arc>>, - favicon: Image, -- connected_signals: Vec<(u64, Widget)>, -+ connected_signals: Vec<(usize, Widget)>, - } - - impl FeedRow { -@@ -100,7 +100,7 @@ impl FeedRow { - id: &FeedID, - parent_id: &CategoryID, - label: String, -- ) -> Vec<(u64, Widget)> { -+ ) -> Vec<(usize, Widget)> { - let mut vec = Vec::new(); - - row.set_activatable(true); -@@ -135,7 +135,7 @@ impl FeedRow { - } - } - })) -- .to_glib(), -+ .to_glib() as usize, - revealer.clone().upcast::(), - )); - -@@ -152,7 +152,7 @@ impl FeedRow { - style_context.remove_class("drag-icon"); - drag_context.drag_set_icon_surface(&surface); - })) -- .to_glib(), -+ .to_glib() as usize, - revealer.clone().upcast::(), - )); - -@@ -231,7 +231,7 @@ impl FeedRow { - row.set_state_flags(StateFlags::PRELIGHT, false); - - Inhibit(true) -- })).to_glib(), row.clone().upcast::())); -+ })).to_glib() as usize, row.clone().upcast::())); - } - - vec -diff --git a/src/tag_popover/mod.rs b/src/tag_popover/mod.rs -index af0905e..9b6a38e 100644 ---- a/src/tag_popover/mod.rs -+++ b/src/tag_popover/mod.rs -@@ -28,11 +28,11 @@ pub struct TagPopover { - unassigned_tags_list_stack: Stack, - assigned_tags: Arc>>, - unassigned_tags: Arc>>, -- add_button_signal: Option, -- back_button_signal: Option, -- popover_close_signal: Option, -- assigned_click_signal: Option, -- unassigned_click_signal: Option, -+ add_button_signal: Option, -+ back_button_signal: Option, -+ popover_close_signal: Option, -+ assigned_click_signal: Option, -+ unassigned_click_signal: Option, - } - - impl TagPopover { -@@ -55,7 +55,7 @@ impl TagPopover { - .connect_clicked(clone!(@weak main_stack => @default-panic, move |_button| { - main_stack.set_visible_child_full("possible_tags", StackTransitionType::SlideLeft); - })) -- .to_glib(), -+ .to_glib() as usize, - ); - - let back_button_signal = Some( -@@ -63,7 +63,7 @@ impl TagPopover { - .connect_clicked(clone!(@weak main_stack => @default-panic, move |_button| { - main_stack.set_visible_child_full("assigned_tags", StackTransitionType::SlideRight); - })) -- .to_glib(), -+ .to_glib() as usize, - ); - - let popover_close_signal = Some( -@@ -71,7 +71,7 @@ impl TagPopover { - .connect_closed(clone!(@weak main_stack => @default-panic, move |_button| { - main_stack.set_visible_child_full("assigned_tags", StackTransitionType::None); - })) -- .to_glib(), -+ .to_glib() as usize, - ); - - let assigned_click_signal = Some( -@@ -79,7 +79,7 @@ impl TagPopover { - .connect_row_activated(|_list, _row| { - info!("click"); - }) -- .to_glib(), -+ .to_glib() as usize, - ); - - let unassigned_click_signal = Some( -@@ -130,7 +130,7 @@ impl TagPopover { - main_stack.set_visible_child_full("assigned_tags", StackTransitionType::SlideRight); - list.remove(row); - })) -- .to_glib(), -+ .to_glib() as usize, - ); - - let popover = TagPopover { -diff --git a/src/util/gtk_util.rs b/src/util/gtk_util.rs -index d8ec0f0..7189533 100644 ---- a/src/util/gtk_util.rs -+++ b/src/util/gtk_util.rs -@@ -155,9 +155,12 @@ impl GtkUtil { - None - } - -- pub fn disconnect_signal(signal_id: Option, widget: &T) { -+ pub fn disconnect_signal(signal_id: Option, widget: &T) { - if let Some(signal_id) = signal_id { -- let signal_id = SignalHandlerId::from_glib(signal_id); -+ #[cfg(target_pointer_width = "64")] -+ let signal_id = SignalHandlerId::from_glib(signal_id as u64); -+ #[cfg(target_pointer_width = "32")] -+ let signal_id = SignalHandlerId::from_glib(signal_id as u32); - widget.disconnect(signal_id); - } - //warn!("Signal ID to disconnect is NONE"); --- -2.27.0 - diff --git a/newsflash.spec b/newsflash.spec index cd57f7f..d46a7e6 100644 --- a/newsflash.spec +++ b/newsflash.spec @@ -1,8 +1,8 @@ %global __cargo_skip_build 0 Name: newsflash -Version: 1.0~rc1 -Release: 8%{?dist} +Version: 1.0.5 +Release: 2%{?dist} Summary: Modern feed reader # (MIT or ASL 2.0) and BSD @@ -18,18 +18,7 @@ Summary: Modern feed reader # zlib License: GPLv3+ and BSD and ASL 2.0 and MIT and Unlicense and zlib URL: https://gitlab.com/news-flash/news_flash_gtk -Source0: https://gitlab.com/news-flash/news_flash_gtk/-/archive/%{version_no_tilde}/news_flash_gtk-%{version_no_tilde}.tar.gz -# https://gitlab.com/news-flash/news_flash_gtk/-/issues/66 -# https://gitlab.com/news-flash/news_flash_gtk/-/commit/38361e7c8d644b10d9b6747c26eeec2b50d42845 -Patch0001: 0001-use-usize-where-possible.patch -# https://gitlab.com/news-flash/news_flash_gtk/-/issues/74 -# https://gitlab.com/news-flash/news_flash_gtk/-/commit/dfea2df583a9995796bc7ac01f6048d47f35393a -Patch0002: 0001-dont-inhibit-all-key-press-signals-in-webview.patch -# https://gitlab.com/news-flash/news_flash_gtk/-/issues/77 -# https://gitlab.com/news-flash/news_flash_gtk/-/commit/2a9405ea8148329fa8973b7d7098a8b6ba6495a8 -Patch0003: 0001-dont-call-show_all-in-app-constructor.patch -# https://gitlab.com/news-flash/news_flash_gtk/-/commit/3d3d24f6e57097cb99073c084178c35fc268f8f4 -Patch0004: 0001-update-gtk-rs.patch +Source0: https://gitlab.com/news-flash/news_flash_gtk/-/archive/%{version_no_tilde}/news_flash_gtk-%{version_no_tilde}.tar.bz2 ExclusiveArch: %{rust_arches} @@ -52,7 +41,6 @@ shortcuts and having access to all your articles as long as you like. # Use packaged crates with proper versions sed -i \ -e '/tokio/s/=0.2/0.2/' \ - -e 's/news-flash = .*/news-flash = "1"/' \ Cargo.toml # We will build by cargo ourselves sed -i -e '/\(build_by_default\|install\)/s/true/false/' src/meson.build @@ -91,6 +79,9 @@ appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/com.gitla %{_datadir}/metainfo/com.gitlab.newsflash.appdata.xml %changelog +* Fri Sep 11 2020 Josh Stone - 1.0.5-2 +- Update to + * Sat Aug 01 2020 Fedora Release Engineering - 1.0~rc1-8 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/sources b/sources index 4676106..56b5d8c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (news_flash_gtk-1.0-rc1.tar.gz) = ad039ebe2856a348bff4a9ce02a4ab48eb4ffb5543acf213e504d977a4ca96156af0d7db58167626813c7626be34c2b27aab9f86f9114ef49fc168ab60a1f55e +SHA512 (news_flash_gtk-1.0.5.tar.bz2) = d6a334a8b9265f6f75fcdc69941209cb47367a71a0a07a4e0bc4855ee69b45d52b3dae77b2d426d260f9de1205dd9d738068b26ff0308d82c9021fdd0f7d1025