From 6d08d33ea798bb1f5ea3acede9a3eadc4a6cc1bc Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Thu, 28 Mar 2024 23:56:53 +0100 Subject: [PATCH] added link to wiki in general settings --- README.md | 12 ++--- resources/fonts/subset/icons.ttf | Bin 15284 -> 15940 bytes src/gui/pages/settings_general_page.rs | 60 +++++++++++++++++++++---- src/translations/translations_3.rs | 8 ++++ src/utils/types/icon.rs | 2 + src/utils/types/web_page.rs | 3 ++ 6 files changed, 72 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 1736e5be..93233793 100644 --- a/README.md +++ b/README.md @@ -58,12 +58,13 @@ ## Download |:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| |         [64‑bit](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_Windows_64-bit.msi) \| [32‑bit](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_Windows_32-bit.msi)         | [Intel](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_macOS_Intel.dmg) \| [Apple silicon](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_macOS_AppleSilicon.dmg) | [amd64](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxDEB_amd64.deb) \| [arm64](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxDEB_arm64.deb) \| [i386](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxDEB_i386.deb) \| [armhf](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxDEB_armhf.deb) |         [x86_64](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxRPM_x86_64.rpm) \| [aarch64](https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxRPM_aarch64.rpm)         | +Links in the table above will download the latest version of Sniffnet directly from [GitHub releases](https://github.com/GyulyVGC/sniffnet/releases).
+ > [!NOTE] > > Remember to also install the [required dependencies](https://github.com/GyulyVGC/sniffnet/wiki/Required-dependencies) for your operating system. -Links in the table above will download the latest version of Sniffnet directly from [GitHub releases](https://github.com/GyulyVGC/sniffnet/releases).
-Alternative installation methods are reported in the following: +**Alternative installation methods** are reported in the following:
@@ -185,9 +186,10 @@ ## Features ## User manual -If you want to learn more, it’s recommended to check out the [Sniffnet Wiki](https://github.com/GyulyVGC/sniffnet/wiki), -a **comprehensive manual** to help you thoroughly master the application, from basic setup to the most advanced functionalities.
-The wiki includes step-by-step guides, examples of usage, tips, and answers to frequently asked questions. +Do you want to **learn more**?
+Check out the [**Sniffnet Wiki**](https://github.com/GyulyVGC/sniffnet/wiki), a comprehensive manual to help you +thoroughly master the application from a basic setup to the most advanced functionalities.
+The wiki includes step-by-step guides, examples of usage, tips, and answers to frequent questions.

diff --git a/resources/fonts/subset/icons.ttf b/resources/fonts/subset/icons.ttf index dbe3cb95909f70b4ab777e3dd15208afca12accb..4a725cfc64b3298ea02b265c872744ad717c7ef7 100644 GIT binary patch delta 1357 zcmZ8hU2GIp6h7z9>`dopcXoE?XMeg&_kT-myWO_C(A{mTfeN<7f~7GgYPY3Ogwh5G zf@$1J2tgxiSbuoXghXRvB&G&pi1J`aMPtAa<;f6fe8KQy1JMVPc0Jo@AfB6GJFw^MP*wSQlX@_LL9J)@tMlN`DaFuxJ0V-8-|wP5_?x+{n~qc~|`7 z%o*Zt(UY5+nyi!?nt7f!8wA9srVk(0?%;jW7f3(8e`cb5`Of!^0Nf?g=cda?XK{|- zKs-Irbf7#v**N~L3ea@lLIdoV!E$pEHhKT=gEjdc?>f!K-7q#MFpwLkyw@(kA ztk1uym*y z^ur*O;b0x9{Zjk6cD;73c9pogkB3q}J4e=3N!Up59w- z^*hddK`zQ?<@53tc}cmfEUCll5$BNeP3KRpmt0@C?rI0Li|!uxDfbokuX>aIj{dd& zz;ncN-rMC}Fm_u*)(v~eK5k#KSAAh$ukWbup1Ax1p1P%t4gX=GJ@t=7r4yxRK zUgO?_Cg^}CU@v??Iaz`zSgB;rw(Ky=t~Y* zxyt8~6hs~GqJ@~jKUuIXontQBD~pP*>53?;K~-GGu}ukqF)y}qEq3@RB@*X6dylRB z@Ti8@Ja60ji0J=P=JV?K;#k11hbzS`A+MsiIJbv zlB9mFa?OL|4-~%7@V=hRZj*Gkyib=K@T}vt{+^I1NwO$NB1#fP&nbdibL#%l=XVR3 zHd9$abnxa8iDT^lYUOX%p-Nk#;r^|`txhI*9g^Zpn4*JWf)_0SHn@had)VNK{#2-(Z@$mr;*5 n&>s*%qk)uel-_Yl8Hu58T=Vo_i>`I_Z$tO*5&Fn);Cwqu+&`37TteH+mEpdgW9 zU}4At(n1UZKoKS&%ap;2!I8m}A&McNp$h0t5HMgc2Z}i}crzq26oJJ4U;cmT|C#@% z|DXB~askLBWB{_>1ZWb_^FW;-XIlbIWng53DV@BJ$;uiSAAI}*fj^&H~Ap5XcT7# zXC3Dpt_rR>+&tVyJRCe8JYBqMyji@<__X*6_`dPG@YnHA Row<'static, Message, StyleType> { Row::new() .align_items(Alignment::Start) - .height(90) + .height(100) .push(language_picklist(language, font)) .push(Rule::vertical(25)) .push(scale_factor_slider(language, font, scale_factor)) .push(Rule::vertical(25)) - .push(horizontal_space()) + .push(need_help(language, font)) } fn language_picklist(language: Language, font: Font) -> Container<'static, Message, StyleType> { @@ -145,7 +147,6 @@ fn language_picklist(language: Language, font: Font) -> Container<'static, Messa } let content = Column::new() - .spacing(5) .align_items(Alignment::Center) .push( Text::new(language_translation(language)) @@ -153,7 +154,9 @@ fn language_picklist(language: Language, font: Font) -> Container<'static, Messa .size(FONT_SIZE_SUBTITLE) .font(font), ) + .push(vertical_space()) .push(flag_row) + .push(Space::with_height(10)) .push( PickList::new( &Language::ALL[..], @@ -162,7 +165,8 @@ fn language_picklist(language: Language, font: Font) -> Container<'static, Messa ) .padding([2, 7]) .font(font), - ); + ) + .push(vertical_space()); Container::new(content) .width(Length::Fill) @@ -179,7 +183,6 @@ fn scale_factor_slider( let slider_width = 150.0 / scale_factor as f32; Container::new( Column::new() - .spacing(5) .align_items(Alignment::Center) .push( Text::new(zoom_translation(language)) @@ -187,18 +190,59 @@ fn scale_factor_slider( .size(FONT_SIZE_SUBTITLE) .font(font), ) + .push(vertical_space()) .push(Text::new(format!("x{scale_factor:.2}")).font(font)) + .push(Space::with_height(5)) .push( Slider::new(0.5..=1.5, scale_factor, Message::ChangeScaleFactor) .step(0.05) .width(slider_width), - ), + ) + .push(vertical_space()), ) .width(Length::Fill) .align_x(Horizontal::Center) .align_y(Vertical::Center) } +fn need_help(language: Language, font: Font) -> Container<'static, Message, StyleType> { + let content = Column::new() + .align_items(Alignment::Center) + .push( + Text::new(need_help_translation(language)) + .style(TextType::Subtitle) + .size(FONT_SIZE_SUBTITLE) + .font(font), + ) + .push(vertical_space()) + .push( + Tooltip::new( + button( + Icon::Book + .to_text() + .vertical_alignment(Vertical::Center) + .horizontal_alignment(Horizontal::Center) + .size(22) + .line_height(LineHeight::Relative(1.0)), + ) + .on_press(Message::OpenWebPage(WebPage::Wiki)) + .padding(2) + .height(40) + .width(60), + row_open_link_tooltip("Sniffnet Wiki", font), + Position::Right, + ) + .gap(5) + .style(ContainerType::Tooltip), + ) + .push(vertical_space()); + + Container::new(content) + .width(Length::Fill) + .align_x(Horizontal::Center) + .align_y(Vertical::Center) +} + fn mmdb_settings( is_editable: bool, language: Language, diff --git a/src/translations/translations_3.rs b/src/translations/translations_3.rs index 2d63b0c5..034c10a4 100644 --- a/src/translations/translations_3.rs +++ b/src/translations/translations_3.rs @@ -193,3 +193,11 @@ pub fn thumbnail_mode_translation(language: Language) -> &'static str { _ => "Thumbnail mode", } } + +pub fn need_help_translation(language: Language) -> &'static str { + match language { + Language::EN => "Do you need help?", + Language::IT => "Hai bisogno di aiuto?", + _ => "Do you need help?", + } +} diff --git a/src/utils/types/icon.rs b/src/utils/types/icon.rs index da6fe1fa..eb15010d 100644 --- a/src/utils/types/icon.rs +++ b/src/utils/types/icon.rs @@ -11,6 +11,7 @@ pub enum Icon { AudioHigh, AudioMute, Bin, + Book, BytesThreshold, Clock, Copy, @@ -87,6 +88,7 @@ pub fn codepoint(&self) -> char { Icon::OpenLink => 'o', Icon::ThumbnailOpen => 's', Icon::ThumbnailClose => 'r', + Icon::Book => 'B', } } diff --git a/src/utils/types/web_page.rs b/src/utils/types/web_page.rs index c98e728a..de3b04ae 100644 --- a/src/utils/types/web_page.rs +++ b/src/utils/types/web_page.rs @@ -11,6 +11,8 @@ pub enum WebPage { Sponsor, /// Sniffnet issue #60 on GitHub IssueLanguages, + /// Sniffnet Wiki + Wiki, } impl WebPage { @@ -21,6 +23,7 @@ pub fn get_url(&self) -> &str { WebPage::Sponsor => "https://github.com/sponsors/GyulyVGC", WebPage::WebsiteDownload => "https://www.sniffnet.net/download/", WebPage::IssueLanguages => "https://github.com/GyulyVGC/sniffnet/issues/60", + WebPage::Wiki => "https://github.com/GyulyVGC/sniffnet/wiki", } } }