generated from cosmic-utils/cosmic-app-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from ahoneybun/fix-config-issue
Fix config issue
- Loading branch information
Showing
7 changed files
with
147 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
res/com.example.CosmicAppTemplate.desktop → ...om.github.ahoneybun.CosmicBackups.desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<component type="desktop-application"> | ||
<id>com.example.CosmicAppTemplate</id> | ||
<id>com.github.ahoneybun.CosmicBackups</id> | ||
<metadata_license>CC0-1.0</metadata_license> | ||
<project_license>GPL-3.0-only</project_license> | ||
<project_group>COSMIC</project_group> | ||
<developer_name>YourName</developer_name> | ||
<update_contact>[email protected]</update_contact> | ||
<developer_name>Aaron Honeycutt</developer_name> | ||
<update_contact>[email protected]</update_contact> | ||
<url type="homepage"></url> | ||
<url type="bugtracker"></url> | ||
<name>COSMIC App Template</name> | ||
<summary>A template for COSMIC applications</summary> | ||
<name>COSMIC Backups</name> | ||
<summary>A simple backup application for the COSMIC desktop.</summary> | ||
<description> | ||
<p>A template for COSMIC applications</p> | ||
<p>A simple backup application using Rustic for the COSMIC desktop.</p> | ||
</description> | ||
<launchable type="desktop-id">com.example.CosmicAppTemplate.desktop</launchable> | ||
<icon type="remote" height="256" width="256">https://raw.githubusercontent.com/edfloreshz/cosmic-app-template/master/res/icons/hicolor/256x256/apps/com.example.CosmicAppTemplate.svg</icon> | ||
|
@@ -22,7 +22,7 @@ | |
<mimetype>text/plain</mimetype> | ||
</mimetypes> | ||
<binaries> | ||
<binary>cosmic-app-template</binary> | ||
<binary>cosmic-backups</binary> | ||
</binaries> | ||
</provides> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use super::config::CosmicBackupsConfig; | ||
use crate::app::Flags; | ||
use cosmic::app::Settings; | ||
use cosmic::iced::{Limits, Size}; | ||
|
||
pub fn init() -> (Settings, Flags) { | ||
set_logger(); | ||
let settings = get_app_settings(); | ||
let flags = get_flags(); | ||
(settings, flags) | ||
} | ||
|
||
pub fn get_app_settings() -> Settings { | ||
let config = CosmicBackupsConfig::config(); | ||
|
||
let mut settings = Settings::default(); | ||
settings = settings.theme(config.app_theme.theme()); | ||
settings = settings.size_limits(Limits::NONE.min_width(400.0).min_height(180.0)); | ||
settings = settings.size(Size::new(800.0, 800.0)); | ||
settings = settings.debug(false); | ||
settings | ||
} | ||
|
||
pub fn set_logger() { | ||
tracing_subscriber::fmt().json().init(); | ||
} | ||
|
||
pub fn get_flags() -> Flags { | ||
let (config_handler, config) = ( | ||
CosmicBackupsConfig::config_handler(), | ||
CosmicBackupsConfig::config(), | ||
); | ||
|
||
let flags = Flags { | ||
config_handler, | ||
config, | ||
}; | ||
flags | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters