mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 19:57:25 +01:00
Adapt to newest gtk-rs
This commit is contained in:
parent
be6e7fd93a
commit
0898bf63c9
12 changed files with 18 additions and 18 deletions
|
|
@ -188,7 +188,7 @@ impl RecordingEditor {
|
||||||
.borrow()
|
.borrow()
|
||||||
.clone()
|
.clone()
|
||||||
.expect("Tried to create recording without work!"),
|
.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(),
|
performances: self.performances.borrow().clone(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -322,7 +322,7 @@ impl WorkEditor {
|
||||||
|
|
||||||
let work = Work {
|
let work = Work {
|
||||||
id: self.id.clone(),
|
id: self.id.clone(),
|
||||||
title: self.title_entry.get_text().unwrap().to_string(),
|
title: self.title_entry.get_text().to_string(),
|
||||||
composer: self
|
composer: self
|
||||||
.composer
|
.composer
|
||||||
.borrow()
|
.borrow()
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ impl Screen<Option<WorkPart>, WorkPart> for WorkPartEditor {
|
||||||
|
|
||||||
save_button.connect_clicked(clone!(@weak this => move |_| {
|
save_button.connect_clicked(clone!(@weak this => move |_| {
|
||||||
let section = WorkPart {
|
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));
|
this.handle.pop(Some(section));
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ impl Screen<Option<WorkSection>, WorkSection> for WorkSectionEditor {
|
||||||
save_button.connect_clicked(clone!(@weak this => move |_| {
|
save_button.connect_clicked(clone!(@weak this => move |_| {
|
||||||
let section = WorkSection {
|
let section = WorkSection {
|
||||||
before_index: 0,
|
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));
|
this.handle.pop(Some(section));
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ impl Screen<Rc<Box<dyn Source>>, ()> for MediumEditor {
|
||||||
impl MediumEditor {
|
impl MediumEditor {
|
||||||
/// Save the medium and possibly upload it to the server.
|
/// Save the medium and possibly upload it to the server.
|
||||||
async fn save(&self) -> Result<()> {
|
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.
|
// Create a new directory in the music library path for the imported medium.
|
||||||
|
|
||||||
|
|
@ -200,7 +200,7 @@ impl MediumEditor {
|
||||||
|
|
||||||
let medium = Medium {
|
let medium = Medium {
|
||||||
id: generate_id(),
|
id: generate_id(),
|
||||||
name: self.name_entry.get_text().unwrap().to_string(),
|
name: self.name_entry.get_text().to_string(),
|
||||||
discid: self.source.discid(),
|
discid: self.source.discid(),
|
||||||
tracks: track_sets,
|
tracks: track_sets,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,8 @@ impl Screen<Option<LoginData>, Option<LoginData>> for LoginDialog {
|
||||||
this.widget.set_visible_child_name("loading");
|
this.widget.set_visible_child_name("loading");
|
||||||
|
|
||||||
let data = LoginData {
|
let data = LoginData {
|
||||||
username: this.username_entry.get_text().unwrap().to_string(),
|
username: this.username_entry.get_text().to_string(),
|
||||||
password: this.password_entry.get_text().unwrap().to_string(),
|
password: this.password_entry.get_text().to_string(),
|
||||||
};
|
};
|
||||||
|
|
||||||
spawn!(@clone this, async move {
|
spawn!(@clone this, async move {
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,8 @@ impl Screen<(), LoginData> for RegisterDialog {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
register_button.connect_clicked(clone!(@weak this => move |_| {
|
register_button.connect_clicked(clone!(@weak this => move |_| {
|
||||||
let password = this.password_entry.get_text().unwrap().to_string();
|
let password = this.password_entry.get_text().to_string();
|
||||||
let repeat = this.repeat_password_entry.get_text().unwrap().to_string();
|
let repeat = this.repeat_password_entry.get_text().to_string();
|
||||||
|
|
||||||
if password != repeat {
|
if password != repeat {
|
||||||
// TODO: Show error and validate other input.
|
// TODO: Show error and validate other input.
|
||||||
|
|
@ -65,10 +65,10 @@ impl Screen<(), LoginData> for RegisterDialog {
|
||||||
this.widget.set_visible_child_name("loading");
|
this.widget.set_visible_child_name("loading");
|
||||||
|
|
||||||
spawn!(@clone this, async move {
|
spawn!(@clone this, async move {
|
||||||
let username = this.username_entry.get_text().unwrap().to_string();
|
let username = this.username_entry.get_text().to_string();
|
||||||
let email = this.email_entry.get_text().unwrap().to_string();
|
let email = this.email_entry.get_text().to_string();
|
||||||
let captcha_id = this.captcha_id.borrow().clone().unwrap();
|
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 {
|
let email = if email.len() == 0 {
|
||||||
None
|
None
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ impl ServerDialog {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
set_button.connect_clicked(clone!(@strong this => move |_| {
|
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);
|
this.backend.set_server_url(&url);
|
||||||
|
|
||||||
if let Some(cb) = &*this.selected_cb.borrow() {
|
if let Some(cb) = &*this.selected_cb.borrow() {
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ impl Screen<(), ()> for MainScreen {
|
||||||
|
|
||||||
this.poe_list.set_filter_cb(clone!(@weak this => move |index| {
|
this.poe_list.set_filter_cb(clone!(@weak this => move |index| {
|
||||||
let poe = &this.poes.borrow()[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();
|
let title = poe.get_title().to_lowercase();
|
||||||
search.is_empty() || title.contains(&search)
|
search.is_empty() || title.contains(&search)
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ impl<T> Selector<T> {
|
||||||
match &*this.filter.borrow() {
|
match &*this.filter.borrow() {
|
||||||
Some(filter) => {
|
Some(filter) => {
|
||||||
let item = &this.items.borrow()[index];
|
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)
|
search.is_empty() || filter(&search, item)
|
||||||
}
|
}
|
||||||
None => true,
|
None => true,
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,6 @@ impl EntryRow {
|
||||||
|
|
||||||
/// Get the text that was entered by the user.
|
/// Get the text that was entered by the user.
|
||||||
pub fn get_text(&self) -> String {
|
pub fn get_text(&self) -> String {
|
||||||
self.entry.get_text().unwrap().to_string()
|
self.entry.get_text().to_string()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ impl Screen {
|
||||||
|
|
||||||
/// Get the current search string.
|
/// Get the current search string.
|
||||||
pub fn get_search(&self) -> 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.
|
/// Hide the loading page and switch to the content.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue