Skip to content

Commit

Permalink
fix: few typos in UI and internal messages (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
soifou authored Nov 4, 2024
1 parent 55ab089 commit 76e9050
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ All notable changes to this project will be documented in this file.

- Songs not being sorted below directories in the Directories pane
- Scrolloff issues in Playlists pane after rename/move
- Few typos in UI and internal messages

## [0.6.0] - 2024-10-28

Expand Down
12 changes: 6 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ fn main() -> Result<()> {

let mut client = try_ret!(
Client::init(config.address, config.password, "command", true),
"Failed to connect to mpd"
"Failed to connect to MPD"
);

let terminal = try_ret!(ui::setup_terminal(config.enable_mouse), "Failed to setup terminal");
Expand Down Expand Up @@ -263,7 +263,7 @@ fn main() -> Result<()> {

let mut idle_client = try_ret!(
Client::init(context.config.address, context.config.password, "idle", true),
"Failed to connect to mpd with idle client"
"Failed to connect to MPD with idle client"
);

let main_task = std::thread::Builder::new().name("main task".to_owned()).spawn(|| {
Expand Down Expand Up @@ -380,7 +380,7 @@ fn main_task<B: Backend + std::io::Write>(
Ok(ui::KeyHandleResult::None) => continue,
Ok(ui::KeyHandleResult::Quit) => {
if let Err(err) = ui.on_event(UiEvent::Exit, &mut context, &mut client) {
error!(error:? = err, event:?; "Ui failed to handle quit event");
error!(error:? = err, event:?; "UI failed to handle quit event");
}
break;
}
Expand All @@ -402,7 +402,7 @@ fn main_task<B: Backend + std::io::Write>(
}
AppEvent::Log(msg) => {
if let Err(err) = ui.on_event(UiEvent::LogAdded(msg), &mut context, &mut client) {
error!(error:? = err; "Ui failed to handle log event");
error!(error:? = err; "UI failed to handle log event");
}
}
AppEvent::IdleEvent(event) => {
Expand All @@ -411,7 +411,7 @@ fn main_task<B: Backend + std::io::Write>(
}
if let Ok(ev) = event.try_into() {
if let Err(err) = ui.on_event(ev, &mut context, &mut client) {
status_error!(error:? = err, event:?; "Ui failed to handle idle event, event: '{:?}', error: '{}'", event, err.to_status());
status_error!(error:? = err, event:?; "UI failed to handle idle event, event: '{:?}', error: '{}'", event, err.to_status());
}
}
render_wanted = true;
Expand Down Expand Up @@ -446,7 +446,7 @@ fn main_task<B: Backend + std::io::Write>(
}
AppEvent::Resized { columns, rows } => {
if let Err(err) = ui.on_event(UiEvent::Resized { columns, rows }, &mut context, &mut client) {
error!(error:? = err, event:?; "Ui failed to resize event");
error!(error:? = err, event:?; "UI failed to resize event");
}
full_rerender_wanted = true;
render_wanted = true;
Expand Down
6 changes: 3 additions & 3 deletions src/mpd/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ impl<'name> Client<'name> {
)));
};

debug!(name, addr:?, version = version.to_string().as_str(), handshake = buf.trim(); "MPD client initiazed");
debug!(name, addr:?, version = version.to_string().as_str(), handshake = buf.trim(); "MPD client initialized");

if version < MIN_SUPPORTED_VERSION {
status_warn!(
"MPD version '{version}' is lower than supported. Minimum supported protocol version is '{MIN_SUPPORTED_VERSION }'. Some features may work incorrectly."
"MPD version '{version}' is lower than supported. Minimum supported protocol version is '{MIN_SUPPORTED_VERSION}'. Some features may work incorrectly."
);
}

Expand Down Expand Up @@ -189,7 +189,7 @@ impl<'name> Client<'name> {
self.stream = stream;
self.version = version;

debug!(name = self.name, addr:? = self.addr, handshake = buf.trim(), version = version.to_string().as_str(); "MPD client initiazed");
debug!(name = self.name, addr:? = self.addr, handshake = buf.trim(), version = version.to_string().as_str(); "MPD client initialized");

if let Some(MpdPassword(password)) = self.password {
debug!("Used password auth to MPD");
Expand Down
4 changes: 2 additions & 2 deletions src/mpd/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ impl Display for MpdError {
MpdError::Generic(msg) => write!(f, "GenericError: '{msg}'"),
MpdError::ClientClosed => write!(f, "Client has been already closed."),
MpdError::Mpd(err) => write!(f, "MpdError: '{err}'"),
MpdError::ValueExpected(val) => write!(f, "Expected value from mpd but got '{val}'"),
MpdError::UnsupportedMpdVersion(val) => write!(f, "Unsupported mpd version: '{val}'"),
MpdError::ValueExpected(val) => write!(f, "Expected value from MPD but got '{val}'"),
MpdError::UnsupportedMpdVersion(val) => write!(f, "Unsupported MPD version: '{val}'"),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub fn is_youtube_supported(mpd_address: MpdAddress) -> Result<(), Vec<String>>
unsupported.push("python-mutagen".to_string());
}
if matches!(mpd_address, MpdAddress::IpAndPort(_)) {
unsupported.push("socket connection to mpd".to_string());
unsupported.push("socket connection to MPD".to_string());
}

if unsupported.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ impl<'ui> Ui<'ui> {
}

pub fn before_show(&mut self, context: &mut AppContext, client: &mut impl MpdClient) -> Result<()> {
self.current_song = try_ret!(client.get_current_song(), "Failed get current song");
self.current_song = try_ret!(client.get_current_song(), "Failed to get current song");
screen_call!(self, before_show(client, &context))
}

Expand Down
2 changes: 1 addition & 1 deletion src/ui/modals/outputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl Modal for OutputsModal {
.border_set(border::ROUNDED)
.border_style(app.config.as_border_style())
.title_alignment(ratatui::prelude::Alignment::Center)
.title("Keybinds");
.title("Outputs");

let table_area = popup_area.inner(Margin {
horizontal: 1,
Expand Down
4 changes: 2 additions & 2 deletions src/ui/panes/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl SearchPane {
},
},
FilterInput {
label: " Case Sensistive :",
label: " Case sensitive :",
variant: FilterInputVariant::SelectFilterCaseSensitive {
value: config.search.case_sensitive,
},
Expand All @@ -83,7 +83,7 @@ impl SearchPane {
let item = &self.songs_dir.items[*idx];
client.add(&item.file)?;
}
status_info!("Added {} songs queue", self.songs_dir.marked().len());
status_info!("Added {} songs to queue", self.songs_dir.marked().len());

context.render()?;
} else if let Some(item) = self.songs_dir.selected() {
Expand Down

0 comments on commit 76e9050

Please # to comment.