1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use crate::{
    core::i18n,
    plugins::{
        steps::{DataProvider, PluginStepsDetails},
        Plugin, PluginDetails, PluginName,
    },
};
use gtk::prelude::*;

#[derive(Clone, Debug)]
pub struct StepsPlugin;

impl StepsPlugin {
    pub fn new() -> Self {
        Self {}
    }
}

impl Plugin for StepsPlugin {
    fn details(&self, mocked: bool) -> PluginDetails {
        let data_provider = if mocked {
            DataProvider::mocked()
        } else {
            DataProvider::actual()
        };

        PluginStepsDetails::new(data_provider).upcast()
    }

    fn name(&self) -> PluginName {
        PluginName::Steps
    }

    fn icon_name(&self) -> &'static str {
        "steps-thin-symbolic"
    }

    fn localised_name(&self) -> String {
        i18n("Steps")
    }
}