Render and be able to edit bike rides (and sorta other time distance workouts) #169
|
@ -201,7 +201,7 @@ mod test {
|
|||
|
||||
impl Recordable for WeightRecord {
|
||||
fn timestamp(&self) -> Timestamp {
|
||||
Timestamp::Date(self.date.clone())
|
||||
Timestamp::Date(self.date)
|
||||
}
|
||||
|
||||
fn tags(&self) -> Vec<String> {
|
||||
|
|
|
@ -20,7 +20,7 @@ extern crate emseries;
|
|||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use chrono::{format::Fixed, prelude::*};
|
||||
use chrono::{prelude::*};
|
||||
use chrono_tz::Etc::UTC;
|
||||
use dimensioned::si::{Kilogram, Meter, Second, M, S};
|
||||
|
||||
|
@ -42,7 +42,7 @@ mod test {
|
|||
|
||||
impl Recordable for BikeTrip {
|
||||
fn timestamp(&self) -> Timestamp {
|
||||
Timestamp::DateTime(self.datetime.clone())
|
||||
Timestamp::DateTime(self.datetime)
|
||||
}
|
||||
fn tags(&self) -> Vec<String> {
|
||||
Vec::new()
|
||||
|
@ -99,7 +99,7 @@ mod test {
|
|||
]
|
||||
}
|
||||
|
||||
fn run_test<T>(test: T) -> ()
|
||||
fn run_test<T>(test: T)
|
||||
where
|
||||
T: FnOnce(tempfile::TempPath),
|
||||
{
|
||||
|
@ -108,7 +108,7 @@ mod test {
|
|||
test(tmp_path);
|
||||
}
|
||||
|
||||
fn run<T>(test: T) -> ()
|
||||
fn run<T>(test: T)
|
||||
where
|
||||
T: FnOnce(Series<BikeTrip>),
|
||||
{
|
||||
|
@ -280,8 +280,7 @@ mod test {
|
|||
UTC.with_ymd_and_hms(2011, 11, 04, 0, 0, 0)
|
||||
.unwrap()
|
||||
.with_timezone(&FixedOffset::east_opt(0).unwrap()),
|
||||
)
|
||||
.into(),
|
||||
),
|
||||
true,
|
||||
),
|
||||
|l, r| l.timestamp().cmp(&r.timestamp()),
|
||||
|
|
|
@ -99,10 +99,6 @@ impl AppWindow {
|
|||
window.set_content(Some(&navigation));
|
||||
window.present();
|
||||
|
||||
let gesture = gtk::GestureClick::new();
|
||||
gesture.connect_released(|_, _, _, _| println!("detected gesture"));
|
||||
layout.add_controller(gesture);
|
||||
|
||||
let s = Self {
|
||||
app: ft_app,
|
||||
layout,
|
||||
|
|
|
@ -264,7 +264,6 @@ impl DayEdit {
|
|||
}
|
||||
|
||||
fn add_row(&self, workout: Record<TraxRecord>) {
|
||||
println!("adding a row for {:?}", workout);
|
||||
let workout_rows = self.imp().workout_rows.borrow();
|
||||
|
||||
#[allow(clippy::single_match)]
|
||||
|
|
|
@ -11,7 +11,8 @@ FitnessTrax is distributed in the hope that it will be useful, but WITHOUT ANY W
|
|||
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with FitnessTrax. If not, see <https://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License along with FitnessTrax. If not,
|
||||
see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
mod action_group;
|
||||
|
|
|
@ -25,7 +25,7 @@ use dimensioned::si;
|
|||
use ft_core::{TimeDistance, TimeDistanceActivity};
|
||||
use glib::Object;
|
||||
use gtk::{prelude::*, subclass::prelude::*};
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
use std::{rc::Rc, cell::RefCell};
|
||||
|
||||
pub fn time_distance_summary(
|
||||
distance: DistanceFormatter,
|
||||
|
|
|
@ -256,14 +256,6 @@ impl From<si::Second<f64>> for DurationFormatter {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
fn take_digits(s: String) -> String {
|
||||
s.chars()
|
||||
.take_while(|t| t.is_ascii_digit())
|
||||
.collect::<String>()
|
||||
}
|
||||
*/
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
|
|
@ -230,12 +230,10 @@ impl DayDetailViewModel {
|
|||
}
|
||||
|
||||
pub fn update_record(&self, update: Record<TraxRecord>) {
|
||||
println!("updating a record: {:?}", update);
|
||||
let mut records = self.records.write().unwrap();
|
||||
records
|
||||
.entry(update.id)
|
||||
.and_modify(|record| record.set_value(update.data));
|
||||
println!("record updated: {:?}", records.get(&update.id));
|
||||
}
|
||||
|
||||
pub fn records(&self) -> Vec<Record<TraxRecord>> {
|
||||
|
|
Loading…
Reference in New Issue