Commit 46592f1f authored by Sophie Herold's avatar Sophie Herold
Browse files

fix some todos

parent c099be1a
Pipeline #329945 failed with stage
in 17 minutes and 3 seconds
......@@ -83,7 +83,6 @@ impl Global {
}
if config.repo.is_network() && gio::NetworkMonitor::default().is_network_metered() {
// TODO: Does not seem to work inside Flatpak
vec.push(Self::MeteredConnection)
}
......@@ -115,35 +114,6 @@ pub enum Due {
Running,
}
/*
impl std::fmt::Display for Due {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::NotDue { next } => write!(
f,
"{}",
// TODO: gettext string
format!(
"Next Scheduled Backup: {}",
glib::DateTime::from_unix_local(next.timestamp())
.unwrap()
.format("%c")
.unwrap()
.to_string()
)
),
Self::NotDueDate { next } => write!(
f,
"{}",
// TODO: gettext string
format!("Next Scheduled Backup: {:?}", next)
),
Self::Running => write!(f, "{}", gettext("Backup running")),
}
}
}
*/
impl Due {
pub fn next_due(&self) -> Option<chrono::Duration> {
match self {
......
......@@ -60,7 +60,6 @@ impl Status {
let mut main_level = StatusLevel::Ok;
if let Err(due) = due_requirements {
// TODO: say daily/monthly/...
main_title = match config.schedule.frequency {
config::Frequency::Hourly => gettext("Hourly backups enabled"),
config::Frequency::Daily { .. } => gettext("Daily backups enabled"),
......@@ -70,11 +69,19 @@ impl Status {
if let Some(scheduled_in) = &due.next_due() {
main_subtitle = next_backup_in(scheduled_in);
}
if !global_requirements.is_empty() || !hints.is_empty() {
// TODO proper format
main_subtitle += " – Will not start until requirements are met";
if !global_requirements.is_empty() || !hints.is_empty() {
// TODO proper format
main_subtitle += &format!(
" – {}",
gettext("Will not start until requirements are met.")
);
}
} else {
if BACKUP_COMMUNICATION.load().get(&config.id).is_none() {
main_subtitle = gettext("Iconsitent backup information");
main_level = StatusLevel::Error;
}
}
problem_level = StatusLevel::Warning;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment