Adapt to newest gtk-rs

This commit is contained in:
Elias Projahn 2021-02-15 17:29:39 +01:00
parent be6e7fd93a
commit 0898bf63c9
12 changed files with 18 additions and 18 deletions

View file

@ -188,7 +188,7 @@ impl RecordingEditor {
.borrow()
.clone()
.expect("Tried to create recording without work!"),
comment: self.comment_entry.get_text().unwrap().to_string(),
comment: self.comment_entry.get_text().to_string(),
performances: self.performances.borrow().clone(),
};

View file

@ -322,7 +322,7 @@ impl WorkEditor {
let work = Work {
id: self.id.clone(),
title: self.title_entry.get_text().unwrap().to_string(),
title: self.title_entry.get_text().to_string(),
composer: self
.composer
.borrow()

View file

@ -43,7 +43,7 @@ impl Screen<Option<WorkPart>, WorkPart> for WorkPartEditor {
save_button.connect_clicked(clone!(@weak this => move |_| {
let section = WorkPart {
title: this.title_entry.get_text().unwrap().to_string(),
title: this.title_entry.get_text().to_string(),
};
this.handle.pop(Some(section));

View file

@ -44,7 +44,7 @@ impl Screen<Option<WorkSection>, WorkSection> for WorkSectionEditor {
save_button.connect_clicked(clone!(@weak this => move |_| {
let section = WorkSection {
before_index: 0,
title: this.title_entry.get_text().unwrap().to_string(),
title: this.title_entry.get_text().to_string(),
};
this.handle.pop(Some(section));

View file

@ -154,7 +154,7 @@ impl Screen<Rc<Box<dyn Source>>, ()> for MediumEditor {
impl MediumEditor {
/// Save the medium and possibly upload it to the server.
async fn save(&self) -> Result<()> {
let name = self.name_entry.get_text().unwrap().to_string();
let name = self.name_entry.get_text().to_string();
// Create a new directory in the music library path for the imported medium.
@ -200,7 +200,7 @@ impl MediumEditor {
let medium = Medium {
id: generate_id(),
name: self.name_entry.get_text().unwrap().to_string(),
name: self.name_entry.get_text().to_string(),
discid: self.source.discid(),
tracks: track_sets,
};

View file

@ -57,8 +57,8 @@ impl Screen<Option<LoginData>, Option<LoginData>> for LoginDialog {
this.widget.set_visible_child_name("loading");
let data = LoginData {
username: this.username_entry.get_text().unwrap().to_string(),
password: this.password_entry.get_text().unwrap().to_string(),
username: this.username_entry.get_text().to_string(),
password: this.password_entry.get_text().to_string(),
};
spawn!(@clone this, async move {

View file

@ -56,8 +56,8 @@ impl Screen<(), LoginData> for RegisterDialog {
}));
register_button.connect_clicked(clone!(@weak this => move |_| {
let password = this.password_entry.get_text().unwrap().to_string();
let repeat = this.repeat_password_entry.get_text().unwrap().to_string();
let password = this.password_entry.get_text().to_string();
let repeat = this.repeat_password_entry.get_text().to_string();
if password != repeat {
// TODO: Show error and validate other input.
@ -65,10 +65,10 @@ impl Screen<(), LoginData> for RegisterDialog {
this.widget.set_visible_child_name("loading");
spawn!(@clone this, async move {
let username = this.username_entry.get_text().unwrap().to_string();
let email = this.email_entry.get_text().unwrap().to_string();
let username = this.username_entry.get_text().to_string();
let email = this.email_entry.get_text().to_string();
let captcha_id = this.captcha_id.borrow().clone().unwrap();
let answer = this.captcha_entry.get_text().unwrap().to_string();
let answer = this.captcha_entry.get_text().to_string();
let email = if email.len() == 0 {
None

View file

@ -40,7 +40,7 @@ impl ServerDialog {
}));
set_button.connect_clicked(clone!(@strong this => move |_| {
let url = this.url_entry.get_text().unwrap().to_string();
let url = this.url_entry.get_text().to_string();
this.backend.set_server_url(&url);
if let Some(cb) = &*this.selected_cb.borrow() {

View file

@ -135,7 +135,7 @@ impl Screen<(), ()> for MainScreen {
this.poe_list.set_filter_cb(clone!(@weak this => move |index| {
let poe = &this.poes.borrow()[index];
let search = this.search_entry.get_text().unwrap().to_string().to_lowercase();
let search = this.search_entry.get_text().to_string().to_lowercase();
let title = poe.get_title().to_lowercase();
search.is_empty() || title.contains(&search)
}));

View file

@ -105,7 +105,7 @@ impl<T> Selector<T> {
match &*this.filter.borrow() {
Some(filter) => {
let item = &this.items.borrow()[index];
let search = this.search_entry.get_text().unwrap().to_string().to_lowercase();
let search = this.search_entry.get_text().to_string().to_lowercase();
search.is_empty() || filter(&search, item)
}
None => true,

View file

@ -39,6 +39,6 @@ impl EntryRow {
/// Get the text that was entered by the user.
pub fn get_text(&self) -> String {
self.entry.get_text().unwrap().to_string()
self.entry.get_text().to_string()
}
}

View file

@ -98,7 +98,7 @@ impl Screen {
/// Get the current search string.
pub fn get_search(&self) -> String {
self.search_entry.get_text().unwrap().to_string().to_lowercase()
self.search_entry.get_text().to_string().to_lowercase()
}
/// Hide the loading page and switch to the content.