added link to wiki in general settings

This commit is contained in:
Giuliano Bellini s294739 2024-03-28 23:56:53 +01:00
parent 1bb1330cc3
commit 6d08d33ea7
6 changed files with 72 additions and 13 deletions

View File

@ -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). <br>
> [!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). <br>
Alternative installation methods are reported in the following:
**Alternative installation methods** are reported in the following:
<details>
@ -185,9 +186,10 @@ ## Features
## User manual
If you want to learn more, its 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. <br>
The wiki includes step-by-step guides, examples of usage, tips, and answers to frequently asked questions.
Do you want to **learn more**? <br>
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. <br>
The wiki includes step-by-step guides, examples of usage, tips, and answers to frequent questions.
<p align="center">
<a href="https://github.com/GyulyVGC/sniffnet/wiki" title="Sniffnet Wiki">

Binary file not shown.

View File

@ -4,7 +4,7 @@
use iced::widget::text::LineHeight;
use iced::widget::tooltip::Position;
use iced::widget::{
button, horizontal_space, Column, Container, PickList, Row, Rule, Slider, Space, Text, Tooltip,
button, vertical_space, Column, Container, PickList, Row, Rule, Slider, Space, Text, Tooltip,
};
use iced::{Alignment, Font, Length};
@ -20,10 +20,12 @@
use crate::translations::translations::language_translation;
use crate::translations::translations_2::country_translation;
use crate::translations::translations_3::{
mmdb_files_translation, params_not_editable_translation, zoom_translation,
mmdb_files_translation, need_help_translation, params_not_editable_translation,
zoom_translation,
};
use crate::utils::formatted_strings::get_path_termination_string;
use crate::utils::types::file_info::FileInfo;
use crate::utils::types::icon::Icon;
use crate::utils::types::web_page::WebPage;
use crate::{ConfigSettings, Language, RunningPage, Sniffer, StyleType};
@ -106,12 +108,12 @@ fn row_language_scale_factor(
) -> 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,

View File

@ -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?",
}
}

View File

@ -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',
}
}

View File

@ -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",
}
}
}