Only display 'Connect anonymously' when available
Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
parent
9f819454ae
commit
2ca51132d5
1 changed files with 22 additions and 14 deletions
36
src/app.rs
36
src/app.rs
|
|
@ -899,7 +899,7 @@ impl App {
|
||||||
self.search_set(entity, term_opt)
|
self.search_set(entity, term_opt)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn search_set(&mut self,tab: Entity, term_opt: Option<String>) -> Task<Message> {
|
fn search_set(&mut self, tab: Entity, term_opt: Option<String>) -> Task<Message> {
|
||||||
let mut title_location_opt = None;
|
let mut title_location_opt = None;
|
||||||
if let Some(tab) = self.tab_model.data_mut::<Tab>(tab) {
|
if let Some(tab) = self.tab_model.data_mut::<Tab>(tab) {
|
||||||
let location_opt = match term_opt {
|
let location_opt = match term_opt {
|
||||||
|
|
@ -3744,7 +3744,8 @@ impl Application for App {
|
||||||
let mut parts = auth.message.splitn(2, '\n');
|
let mut parts = auth.message.splitn(2, '\n');
|
||||||
let title = parts.next().unwrap_or_default();
|
let title = parts.next().unwrap_or_default();
|
||||||
let body = parts.next().unwrap_or_default();
|
let body = parts.next().unwrap_or_default();
|
||||||
widget::dialog()
|
|
||||||
|
let mut widget = widget::dialog()
|
||||||
.title(title)
|
.title(title)
|
||||||
.body(body)
|
.body(body)
|
||||||
.control(widget::column::with_children(controls).spacing(space_s))
|
.control(widget::column::with_children(controls).spacing(space_s))
|
||||||
|
|
@ -3753,18 +3754,25 @@ impl Application for App {
|
||||||
)
|
)
|
||||||
.secondary_action(
|
.secondary_action(
|
||||||
widget::button::standard(fl!("cancel")).on_press(Message::DialogCancel),
|
widget::button::standard(fl!("cancel")).on_press(Message::DialogCancel),
|
||||||
)
|
);
|
||||||
.tertiary_action(widget::button::text(fl!("connect-anonymously")).on_press(
|
|
||||||
Message::DialogUpdateComplete(DialogPage::NetworkAuth {
|
if let Some(_anonymous) = &auth.anonymous_opt {
|
||||||
mounter_key: *mounter_key,
|
widget = widget.tertiary_action(
|
||||||
uri: uri.clone(),
|
widget::button::text(fl!("connect-anonymously")).on_press(
|
||||||
auth: MounterAuth {
|
Message::DialogUpdateComplete(DialogPage::NetworkAuth {
|
||||||
anonymous_opt: Some(true),
|
mounter_key: *mounter_key,
|
||||||
..auth.clone()
|
uri: uri.clone(),
|
||||||
},
|
auth: MounterAuth {
|
||||||
auth_tx: auth_tx.clone(),
|
anonymous_opt: Some(true),
|
||||||
}),
|
..auth.clone()
|
||||||
))
|
},
|
||||||
|
auth_tx: auth_tx.clone(),
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
widget
|
||||||
}
|
}
|
||||||
DialogPage::NetworkError {
|
DialogPage::NetworkError {
|
||||||
mounter_key: _,
|
mounter_key: _,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue