From d2d2554eb04f9a0d9ff9f64b1d74a7e0fb364361 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Mon, 3 Jun 2024 17:16:29 -0600 Subject: [PATCH 1/2] rename to align with COSMIC trademark policy --- Cargo.toml | 2 +- src/app.rs | 12 ++++++------ src/app/config.rs | 10 +++++----- src/app/settings.rs | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c6335a8..86b5617 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "cosmic-backups" +name = "stellarshot" version = "0.1.0" edition = "2021" license = "GPL-3.0" diff --git a/src/app.rs b/src/app.rs index 2f6c924..80dc6a3 100644 --- a/src/app.rs +++ b/src/app.rs @@ -43,7 +43,7 @@ pub struct App { selected_repository: Option, app_themes: Vec, config_handler: Option, - config: config::CosmicBackupsConfig, + config: config::StellarshotConfig, context_page: ContextPage, dialog_pages: VecDeque, dialog_text_input: widget::Id, @@ -106,7 +106,7 @@ pub enum DialogPage { #[derive(Clone, Debug)] pub struct Flags { pub config_handler: Option, - pub config: config::CosmicBackupsConfig, + pub config: config::Stellarshot, } #[derive(Clone, Copy, Debug, Eq, PartialEq)] @@ -144,7 +144,7 @@ impl App { fn about(&self) -> Element { let cosmic_theme::Spacing { space_xxs, .. } = cosmic::theme::active().cosmic().spacing; - let repository = "https://github.com/ahoneybun/cosmic-backups"; + let repository = "https://github.com/ahoneybun/Stellarshot"; let hash = env!("VERGEN_GIT_SHA"); let short_hash: String = hash.chars().take(7).collect(); let date = env!("VERGEN_GIT_COMMIT_DATE"); @@ -155,7 +155,7 @@ impl App { )[..], )) .into(), - widget::text::title3(fl!("cosmic-backups")).into(), + widget::text::title3(fl!("stellarshot")).into(), widget::button::link(repository) .on_press(Message::LaunchUrl(repository.to_string())) .padding(0) @@ -216,7 +216,7 @@ impl Application for App { type Message = Message; - const APP_ID: &'static str = "com.github.ahoneybun.CosmicExtBackups"; + const APP_ID: &'static str = "com.github.ahoneybun.Stellarshot"; fn core(&self) -> &Core { &self.core @@ -319,7 +319,7 @@ impl Application for App { if let Some(repository) = self.nav_model.data::(entity) { self.selected_repository = Some(repository.clone()); - let window_title = format!("{} - {}", repository.name, fl!("cosmic-backups")); + let window_title = format!("{} - {}", repository.name, fl!("stellarshot")); commands.push(self.set_window_title(window_title, self.main_window_id())); } diff --git a/src/app/config.rs b/src/app/config.rs index caae278..a8b1c28 100644 --- a/src/app/config.rs +++ b/src/app/config.rs @@ -10,25 +10,25 @@ use serde::{Deserialize, Serialize}; pub const CONFIG_VERSION: u64 = 1; #[derive(Clone, Default, Debug, Eq, PartialEq, Deserialize, Serialize, CosmicConfigEntry)] -pub struct CosmicBackupsConfig { +pub struct StellarshotConfig { pub app_theme: AppTheme, pub repositories: Vec, } -impl CosmicBackupsConfig { +impl StellarshotConfig { pub fn config_handler() -> Option { Config::new(App::APP_ID, CONFIG_VERSION).ok() } - pub fn config() -> CosmicBackupsConfig { + pub fn config() -> StellarshotConfig { match Self::config_handler() { Some(config_handler) => { - CosmicBackupsConfig::get_entry(&config_handler).unwrap_or_else(|(errs, config)| { + StellarshotConfig::get_entry(&config_handler).unwrap_or_else(|(errs, config)| { log::info!("errors loading config: {:?}", errs); config }) } - None => CosmicBackupsConfig::default(), + None => StellarshotConfig::default(), } } } diff --git a/src/app/settings.rs b/src/app/settings.rs index bd24c87..007f4c1 100644 --- a/src/app/settings.rs +++ b/src/app/settings.rs @@ -1,6 +1,6 @@ use std::sync::Mutex; -use super::config::CosmicBackupsConfig; +use super::config::StellarshotConfig; use super::icon_cache::{IconCache, ICON_CACHE}; use crate::app::Flags; use cosmic::app::Settings; @@ -15,7 +15,7 @@ pub fn init() -> (Settings, Flags) { } pub fn get_app_settings() -> Settings { - let config = CosmicBackupsConfig::config(); + let config = StellarshotConfig::config(); let mut settings = Settings::default(); settings = settings.theme(config.app_theme.theme()); @@ -35,8 +35,8 @@ pub fn set_icon_cache() { pub fn get_flags() -> Flags { let (config_handler, config) = ( - CosmicBackupsConfig::config_handler(), - CosmicBackupsConfig::config(), + StellarshotConfig::config_handler(), + StellarshotConfig::config(), ); let flags = Flags { From 35cafa3bef1aab0062309dccdc0b1cd63099ace6 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Mon, 3 Jun 2024 17:24:41 -0600 Subject: [PATCH 2/2] Fix build issues --- i18n/en/{cosmic_backups.ftl => stellarshot.ftl} | 4 ++-- src/app.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename i18n/en/{cosmic_backups.ftl => stellarshot.ftl} (93%) diff --git a/i18n/en/cosmic_backups.ftl b/i18n/en/stellarshot.ftl similarity index 93% rename from i18n/en/cosmic_backups.ftl rename to i18n/en/stellarshot.ftl index 9d35d2b..38b3fdc 100644 --- a/i18n/en/cosmic_backups.ftl +++ b/i18n/en/stellarshot.ftl @@ -1,5 +1,5 @@ -cosmic-backups = COSMIC Backups -app-title = COSMIC Backups +stellarshot = Stellarshot +app-title = stellarshot welcome = Backup often! ✨ # Dialogs diff --git a/src/app.rs b/src/app.rs index 80dc6a3..33a521b 100644 --- a/src/app.rs +++ b/src/app.rs @@ -106,7 +106,7 @@ pub enum DialogPage { #[derive(Clone, Debug)] pub struct Flags { pub config_handler: Option, - pub config: config::Stellarshot, + pub config: config::StellarshotConfig, } #[derive(Clone, Copy, Debug, Eq, PartialEq)]