Add table of network schemes
This commit is contained in:
parent
0d8fd00dd3
commit
7451ecf111
2 changed files with 32 additions and 1 deletions
|
|
@ -87,6 +87,15 @@ enter-server-address = Enter server address
|
||||||
network-drive-description =
|
network-drive-description =
|
||||||
Server addresses include a protocol prefix and address.
|
Server addresses include a protocol prefix and address.
|
||||||
Examples: ssh://192.168.0.1, ftp://[2001:db8::1]
|
Examples: ssh://192.168.0.1, ftp://[2001:db8::1]
|
||||||
|
### Make sure to keep the comma which separates the columns
|
||||||
|
network-drive-schemes =
|
||||||
|
Available protocols,Prefix
|
||||||
|
AppleTalk,afp://
|
||||||
|
File Transfer Protocol,ftp:// or ftps://
|
||||||
|
Network File System,nfs://
|
||||||
|
Server Message Block,smb://
|
||||||
|
SSH File Transfer Protocol,sftp:// or ssh://
|
||||||
|
WebDav,dav:// or davs://
|
||||||
network-drive-error = Unable to access network drive
|
network-drive-error = Unable to access network drive
|
||||||
password = Password
|
password = Password
|
||||||
remember-password = Remember password
|
remember-password = Remember password
|
||||||
|
|
|
||||||
24
src/app.rs
24
src/app.rs
|
|
@ -829,7 +829,9 @@ impl App {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn network_drive(&self) -> Element<Message> {
|
fn network_drive(&self) -> Element<Message> {
|
||||||
let cosmic_theme::Spacing { space_m, .. } = theme::active().cosmic().spacing;
|
let cosmic_theme::Spacing {
|
||||||
|
space_xxs, space_m, ..
|
||||||
|
} = theme::active().cosmic().spacing;
|
||||||
let mut text_input =
|
let mut text_input =
|
||||||
widget::text_input(fl!("enter-server-address"), &self.network_drive_input);
|
widget::text_input(fl!("enter-server-address"), &self.network_drive_input);
|
||||||
let button = if self.network_drive_connecting.is_some() {
|
let button = if self.network_drive_connecting.is_some() {
|
||||||
|
|
@ -840,9 +842,29 @@ impl App {
|
||||||
.on_submit(Message::NetworkDriveSubmit);
|
.on_submit(Message::NetworkDriveSubmit);
|
||||||
widget::button::standard(fl!("connect")).on_press(Message::NetworkDriveSubmit)
|
widget::button::standard(fl!("connect")).on_press(Message::NetworkDriveSubmit)
|
||||||
};
|
};
|
||||||
|
let mut table = widget::column::with_capacity(8);
|
||||||
|
for (i, line) in fl!("network-drive-schemes").lines().enumerate() {
|
||||||
|
let mut row = widget::row::with_capacity(2);
|
||||||
|
for part in line.split(',') {
|
||||||
|
row = row.push(
|
||||||
|
widget::container(if i == 0 {
|
||||||
|
widget::text::heading(part.to_string())
|
||||||
|
} else {
|
||||||
|
widget::text::body(part.to_string())
|
||||||
|
})
|
||||||
|
.width(Length::Fill)
|
||||||
|
.padding(space_xxs),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
table = table.push(row);
|
||||||
|
if i == 0 {
|
||||||
|
table = table.push(widget::divider::horizontal::light());
|
||||||
|
}
|
||||||
|
}
|
||||||
widget::column::with_children(vec![
|
widget::column::with_children(vec![
|
||||||
text_input.into(),
|
text_input.into(),
|
||||||
widget::text(fl!("network-drive-description")).into(),
|
widget::text(fl!("network-drive-description")).into(),
|
||||||
|
table.into(),
|
||||||
widget::row::with_children(vec![
|
widget::row::with_children(vec![
|
||||||
widget::horizontal_space(Length::Fill).into(),
|
widget::horizontal_space(Length::Fill).into(),
|
||||||
button.into(),
|
button.into(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue